Пример #1
0
  @Test
  public void sdmx2Codelist() throws Exception {

    InputStream stream = getClass().getClassLoader().getResourceAsStream("samplesdmx.xml");

    CodelistBean bean = parser.parse(stream, Stream2SdmxDirectives.DEFAULT);

    Outcome<Codelist> outcome = service.map(bean, new Sdmx2CodelistDirectives().name("test"));

    System.out.println(outcome.result());
    System.out.println(outcome.report());
  }
Пример #2
0
  @Test
  public void csv2codelist() {

    String[][] data = {{"c1"}, {"1"}};

    Csv2TableDirectives parseDirectives = new Csv2TableDirectives();

    parseDirectives.options().hasHeader(true);

    InputStream stream = asCsv(data, parseDirectives);

    Table table = parser.parse(stream, parseDirectives);

    Table2CodelistDirectives directives = new Table2CodelistDirectives("c1");

    Outcome<Codelist> outcome = service.map(table, directives);

    System.out.println(outcome.result());
    System.out.println(outcome.report());
  }