Package org.hivedb

Examples of org.hivedb.Hive.directory()


    assertFalse(hive.directory().doesResourceIdExist("WeatherReport", report.getReportId()));
    // Referenced entity does not get deleted
    assertTrue(hive.directory().doesResourceIdExist("Temperature", report.getTemperature()));

    assertFalse(hive.directory().doesPrimaryIndexKeyExist(asia.getName()));
    assertFalse(hive.directory().doesSecondaryIndexKeyExist("Continent", "population", asia.getPopulation(), asia.getName()));

  }

  @Test
  public void testOnSaveUpdate() throws Exception {
View Full Code Here


    Hive hive = getHive();
    EntityHiveConfig config = getEntityHiveConfig();
    HiveInterceptorDecorator interceptor = new HiveInterceptorDecorator(config, hive);

    WeatherReport report = generateInstance();
    hive.directory().insertPrimaryIndexKey(report.getContinent());
    interceptor.postFlush(Arrays.asList(new WeatherReport[]{report}).iterator());

    assertTrue(hive.directory().doesPrimaryIndexKeyExist(report.getContinent()));
    assertTrue(hive.directory().doesResourceIdExist("WeatherReport", report.getReportId()));
    assertTrue(hive.directory().doesResourceIdExist("Temperature", report.getTemperature()));
View Full Code Here

    WeatherReport report = generateInstance();
    hive.directory().insertPrimaryIndexKey(report.getContinent());
    interceptor.postFlush(Arrays.asList(new WeatherReport[]{report}).iterator());

    assertTrue(hive.directory().doesPrimaryIndexKeyExist(report.getContinent()));
    assertTrue(hive.directory().doesResourceIdExist("WeatherReport", report.getReportId()));
    assertTrue(hive.directory().doesResourceIdExist("Temperature", report.getTemperature()));

    int oldTemperature = report.getTemperature();
    GeneratedInstanceInterceptor.setProperty(report, "temperature", 72);
View Full Code Here

    WeatherReport report = generateInstance();
    hive.directory().insertPrimaryIndexKey(report.getContinent());
    interceptor.postFlush(Arrays.asList(new WeatherReport[]{report}).iterator());

    assertTrue(hive.directory().doesPrimaryIndexKeyExist(report.getContinent()));
    assertTrue(hive.directory().doesResourceIdExist("WeatherReport", report.getReportId()));
    assertTrue(hive.directory().doesResourceIdExist("Temperature", report.getTemperature()));

    int oldTemperature = report.getTemperature();
    GeneratedInstanceInterceptor.setProperty(report, "temperature", 72);
    assertFalse(oldTemperature == 72);
View Full Code Here

    hive.directory().insertPrimaryIndexKey(report.getContinent());
    interceptor.postFlush(Arrays.asList(new WeatherReport[]{report}).iterator());

    assertTrue(hive.directory().doesPrimaryIndexKeyExist(report.getContinent()));
    assertTrue(hive.directory().doesResourceIdExist("WeatherReport", report.getReportId()));
    assertTrue(hive.directory().doesResourceIdExist("Temperature", report.getTemperature()));

    int oldTemperature = report.getTemperature();
    GeneratedInstanceInterceptor.setProperty(report, "temperature", 72);
    assertFalse(oldTemperature == 72);
    interceptor.postFlush(Arrays.asList(new WeatherReport[]{report}).iterator());
View Full Code Here

    int oldTemperature = report.getTemperature();
    GeneratedInstanceInterceptor.setProperty(report, "temperature", 72);
    assertFalse(oldTemperature == 72);
    interceptor.postFlush(Arrays.asList(new WeatherReport[]{report}).iterator());
    assertTrue(hive.directory().doesResourceIdExist("Temperature", 72));
  }
}

View Full Code Here

  public void insertTest() throws Exception {
    Hive hive = getHive();
    HiveIndexer indexer = new HiveIndexer(hive);
    WeatherReport report = generateInstance();
    indexer.insert(getWeatherReportConfig(report), report);
    assertTrue(hive.directory().doesResourceIdExist("WeatherReport", report.getReportId()));
    assertTrue(hive.directory().doesResourceIdExist("Temperature", report.getTemperature()));
    for (WeatherEvent weatherEvent : report.getWeatherEvents())
      assertTrue(hive.directory().doesSecondaryIndexKeyExist("WeatherReport", "weatherEventEventId", weatherEvent.getEventId(), report.getReportId()));
  }
View Full Code Here

    Hive hive = getHive();
    HiveIndexer indexer = new HiveIndexer(hive);
    WeatherReport report = generateInstance();
    indexer.insert(getWeatherReportConfig(report), report);
    assertTrue(hive.directory().doesResourceIdExist("WeatherReport", report.getReportId()));
    assertTrue(hive.directory().doesResourceIdExist("Temperature", report.getTemperature()));
    for (WeatherEvent weatherEvent : report.getWeatherEvents())
      assertTrue(hive.directory().doesSecondaryIndexKeyExist("WeatherReport", "weatherEventEventId", weatherEvent.getEventId(), report.getReportId()));
  }

  // Test for HiveIndexer.update(EntityIndexConfiguration config, Object entity)
View Full Code Here

    WeatherReport report = generateInstance();
    indexer.insert(getWeatherReportConfig(report), report);
    assertTrue(hive.directory().doesResourceIdExist("WeatherReport", report.getReportId()));
    assertTrue(hive.directory().doesResourceIdExist("Temperature", report.getTemperature()));
    for (WeatherEvent weatherEvent : report.getWeatherEvents())
      assertTrue(hive.directory().doesSecondaryIndexKeyExist("WeatherReport", "weatherEventEventId", weatherEvent.getEventId(), report.getReportId()));
  }

  // Test for HiveIndexer.update(EntityIndexConfiguration config, Object entity)
  @Test
  public void updateTest() throws Exception {
View Full Code Here

    HiveIndexer indexer = new HiveIndexer(hive);
    WeatherReport report = generateInstance();
    Integer oldTemp = report.getTemperature();
    indexer.insert(getWeatherReportConfig(report), report);
    assertWeatherReportResourceIdsOfPrimaryIndexKey("WeatherReport", report);
    assertTrue(hive.directory().doesResourceIdExist("Temperature", report.getTemperature()));
    GeneratedInstanceInterceptor.setProperty(report, "temperature", 32);
    indexer.update(getWeatherReportConfig(report), report);
    assertEquals(report.getContinent(), hive.directory().getPrimaryIndexKeyOfResourceId("Temperature", 32));
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.