コード例 #1
0
  @Test
  public void testGetSeriesWithData21() throws Exception {
    DbAccessor<?> accessor = new DotStatAccessor(ecbBean(), supplier);

    DbSetId single = ecbRoot().child("A", "DEU", "1", "0", "319", "0", "UBLGE");

    DbSeries series = accessor.getSeriesWithData("A", "DEU", "1", "0", "319", "0", "UBLGE");
    assertEquals(single, series.getId());

    TsData data = series.getData().get();
    assertEquals(new TsPeriod(TsFrequency.Yearly, 1991, 0), data.getStart());
    assertEquals(new TsPeriod(TsFrequency.Yearly, 2015, 0), data.getLastPeriod());
    assertEquals(25, data.getLength());
    assertEquals(25, data.getObsCount());
    assertEquals(-2.8574221, data.getValues().get(0), 0d);
    assertEquals(-0.1420473, data.getValues().get(24), 0d);
  }
コード例 #2
0
  @Test
  public void testGetSeriesWithData20() throws Exception {
    DbAccessor<?> accessor = new DotStatAccessor(nbbBean(), supplier);

    DbSetId single = nbbRoot().child("LOCSTL04", "AUS", "M");

    DbSeries series = accessor.getSeriesWithData("LOCSTL04", "AUS", "M");
    assertEquals(single, series.getId());

    TsData data = series.getData().get();
    assertEquals(new TsPeriod(TsFrequency.Monthly, 1966, 1), data.getStart());
    assertEquals(new TsPeriod(TsFrequency.Monthly, 1970, 7), data.getLastPeriod());
    assertEquals(55, data.getLength());
    assertEquals(54, data.getObsCount());
    assertTrue(data.isMissing(50)); // 1970-04
    assertEquals(98.68823, data.getValues().get(0), 0d);
    assertEquals(101.1945, data.getValues().get(54), 0d);
  }