@@ -0,0 +1,2699 @@
+/*%0A *    Copyright (c) 2013, University of Toronto.%0A *%0A *    Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A *    not use this file except in compliance with the License. You may obtain%0A *    a copy of the License at%0A *%0A *         http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *    Unless required by applicable law or agreed to in writing, software%0A *    distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A *    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A *    License for the specific language governing permissions and limitations%0A *    under the License.%0A */%0Apackage edu.toronto.cs.xcurator.rdf;%0A%0Aimport com.hp.hpl.jena.rdf.model.Model;%0Aimport com.hp.hpl.jena.tdb.TDBFactory;%0Aimport edu.toronto.cs.xcurator.mapping.Mapping;%0Aimport edu.toronto.cs.xcurator.mapping.XmlBasedMapping;%0Aimport edu.toronto.cs.xcurator.xml.ElementIdGenerator;%0Aimport edu.toronto.cs.xcurator.xml.XPathFinder;%0Aimport edu.toronto.cs.xcurator.xml.XmlParser;%0Aimport java.io.File;%0Aimport org.junit.Assert;%0Aimport org.junit.Before;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.rules.TemporaryFolder;%0A%0A/**%0A *%0A * @author zhuerkan%0A */%0Apublic class RdfGeneratorTest %7B%0A  %0A  private RdfGenerator rdfGenerator;%0A  private RdfGeneration rdfGeneration;%0A  private XmlBasedMappingDeserialization mappingDeserialization;%0A  private Mapping mapping;%0A  private String testTdbDir;%0A%0A  @Rule%0A  public TemporaryFolder testTdbFolder = new TemporaryFolder();%0A%0A  @Before%0A  public void setup() %7B%0A    // Setup deserializer%0A    mappingDeserialization = new XmlBasedMappingDeserialization(%0A            RdfGeneratorTest.class.getResourceAsStream(%0A                    %22/secxbrls/mapping/fb-20121231-mapping.xml%22),%0A            new XmlParser());%0A    %0A    // Use temporary directory for setting up testing TDB%0A    File testTdb = testTdbFolder.newFolder(%22testTdb%22);%0A    testTdbDir = testTdb.getAbsolutePath();%0A    rdfGeneration = new RdfGeneration(testTdbDir,%0A            RdfGeneratorTest.class.getResourceAsStream(%0A                    %22/secxbrls/data/fb-20121231.xml%22), new XmlParser(), %0A            new XPathFinder(), new ElementIdGenerator());%0A    %0A    // Initialize the class to be tested%0A    mapping = new XmlBasedMapping();%0A    rdfGenerator = new RdfGenerator(mapping);%0A  %7D%0A  %0A  @Test%0A  public void test_generateRdfs() %7B%0A    // Add steps%0A    rdfGenerator.addStep(mappingDeserialization);%0A    rdfGenerator.addStep(rdfGeneration);%0A    %0A    // Generate%0A    rdfGenerator.generateRdfs();%0A    %0A    // Verify%0A    Model model = TDBFactory.createModel(testTdbDir);%0A    Assert.assertFalse(%22No RDF was generated. TDB directory: %22 + testTdbDir, model.isEmpty());%0A  %7D%0A%7D%0A

Add generator test