Examples of WeatherReport


Examples of org.hivedb.util.database.test.WeatherReport

  }

  @Test
  public void configureResourceTest() throws Exception {
    EntityConfig config = new ConfigurationReader().configure(WeatherReport.class);
    WeatherReport report = generateInstance();
    assertEquals(WeatherReport.CONTINENT, config.getPrimaryIndexKeyPropertyName());
    assertEquals(WeatherReport.CONTINENT, config.getPartitionDimensionName());
    assertEquals(report.getContinent(), config.getPrimaryIndexKey(report));
    assertEquals(report.getReportId(), config.getId(report));
    assertEquals("WeatherReport", config.getResourceName());
    assertFalse(config.isPartitioningResource());
    assertEquals(WeatherReport.class, config.getRepresentedInterface());
    assertEquals(Integer.class, config.getIdClass());

    Collection<EntityIndexConfig> indexes = (Collection<EntityIndexConfig>) config.getEntityIndexConfigs();

    EntityIndexConfig temperature = null;
    for (EntityIndexConfig icfg : indexes)
      if ("temperature".equals(icfg.getIndexName())) {
        temperature = icfg;
        break;
      }
    assertNotNull(temperature);
    assertEquals(int.class, temperature.getIndexClass());
    assertEquals(report.getTemperature(), Atom.getFirst(temperature.getIndexValues(report)));

    Filter.grepSingleOrNull(new Predicate<EntityIndexConfig>() {
      public boolean f(EntityIndexConfig entityIndexConfig) {
        return "weatherEventEventId".equals(entityIndexConfig.getIndexName());
      }
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.