示例#1
0
 @BeforeClass
 public void init() {
   rdfXmlParserTest = new RdfXmlParserTest();
   rdfXmlParserTest.init();
   model = new LinkedHashModel();
   streamProcessor =
       new StreamProcessor(
           RdfXmlParser.connect(SesameSink.connect(new StatementCollector(model))));
 }
示例#2
0
  @Test(dataProvider = "getTestSuite")
  public void runW3CWithSesameSink(RdfXmlParserTest.TestCase testCase) {
    rdfXmlParserTest.runTest(
        testCase,
        new RdfXmlParserTest.SaveToFileCallback() {
          @Override
          public void run(Reader input, String inputUri, Writer output) throws ParseException {
            try {
              streamProcessor.process(input, inputUri);
            } finally {
              try {
                Rio.write(model, output, RDFFormat.TURTLE);
              } catch (RDFHandlerException e) {
                // do nothing
              }
            }
          }

          @Override
          public String getOutputFileExt() {
            return "ttl";
          }
        });
  }
示例#3
0
 @DataProvider
 public Object[][] getTestSuite() throws IOException {
   return rdfXmlParserTest.getTestSuite();
 }