@Test public void testCreate() throws Exception { SdmxSource source = new GenericDocFactory().create(load("/sdmx-generic-sample.xml")); assertEquals(1, source.items.size()); SdmxGroup group; SdmxSeries series; group = (SdmxGroup) source.items.get(0); assertEquals("JD_TYPE=P, JD_CATEGORY=A, VIS_CTY=MX", group.id); assertEquals(2, group.series.size()); series = group.series.get(0); assertEquals(TimeFormat.P1M, series.timeFormat); assertEquals("FREQ=M", series.id); assertEquals(new TsDomain(TsFrequency.Monthly, 2000, 0, 12), series.data.get().getDomain()); assertArrayEquals(new double[]{3.14, 3.14, 4.29, 6.04, 5.18, 5.07, 3.13, 1.17, 1.14, 3.04, 1.14, 3.24}, series.data.get().internalStorage(), 0); series = group.series.get(1); assertEquals(TimeFormat.P1Y, series.timeFormat); assertEquals("FREQ=A", series.id); assertEquals(new TsDomain(TsFrequency.Yearly, 2000, 0, 1), series.data.get().getDomain()); assertArrayEquals(new double[]{3.14}, series.data.get().internalStorage(), 0); }
@Override public SdmxSource create(Document doc) { Optional<Node> dataSetNode = lookupDataSetNode(doc); return new SdmxSource(SdmxSource.Type.GENERIC, getSdmxItems(dataSetNode.get(), new GregorianCalendar())); }
GenericDocFactory extends AbstractDocumentFactory { @Override public SdmxSource create(Document doc) { Optional<Node> dataSetNode = lookupDataSetNode(doc); return new SdmxSource(SdmxSource.Type.GENERIC, getSdmxItems(dataSetNode.get(), new GregorianCalendar())); } }
GenericDocFactory extends AbstractDocumentFactory { @Override public SdmxSource create(Document doc) { Optional<Node> dataSetNode = lookupDataSetNode(doc); return new SdmxSource(SdmxSource.Type.GENERIC, getSdmxItems(dataSetNode.get(), new GregorianCalendar())); }  }
GenericDocFactory extends AbstractDocumentFactory { @Override public SdmxSource create(Document doc) { Optional<Node> dataSetNode = lookupDataSetNode(doc); return new SdmxSource(SdmxSource.Type.GENERIC, getSdmxItems(dataSetNode.get(), new GregorianCalendar())); }  @Override String getName(); @Override boolean isValid(Document doc); @Override SdmxSource create(Document doc); }
GenericDocFactory extends AbstractDocumentFactory { @Override public SdmxSource create(Document doc) { Optional<Node> dataSetNode = lookupDataSetNode(doc); return new SdmxSource(SdmxSource.Type.GENERIC, getSdmxItems(dataSetNode.get(), new GregorianCalendar())); }  @Override String getName(); @Override boolean isValid(Document doc); @Override SdmxSource create(Document doc);  }