01: package org.ontoware.rdfreactor.generator;
02:
03: import org.junit.Test;
04: import org.ontoware.rdf2go.Reasoning;
05:
06: public class TestReportedBugs {
07:
08: public static final String outdir = "./target/test-gen";
09:
10: @Test
11: public void testRangeXsdAnyUri() throws Exception {
12: CodeGenerator.generate("./src/test/resources/test001.n3",
13: outdir, "gen.rangexsdanyuri", Reasoning.rdfs, true);
14: }
15:
16: @Test
17: public void testRangeXsdInt() throws Exception {
18: CodeGenerator.generate("./src/test/resources/test002.n3",
19: outdir, "gen.rangexsdint", Reasoning.rdfs, true);
20: }
21:
22: /** handling of props without domain */
23: @Test
24: public void testTagGeneration() throws Exception {
25: CodeGenerator.generate("./src/test/resources/TagFilter.n3",
26: outdir, "org.ontoware.tag", Reasoning.rdfs, true);
27: }
28:
29: @Test
30: public void testReac15() throws Exception {
31:
32: CodeGenerator.generate("./src/test/resources/reac15.rdfs",
33: outdir, "org.ontoware.rdfreactor.test.reac15", "RDFS",
34: true, true, "");
35:
36: }
37:
38: // This test needs too much heap space when running in maven, but is OK when
39: // running from Eclipse (and setting -Xmx1024M
40:
41: // @Test
42: // public void testReac11() throws Exception {
43: // CodeGenerator.generate("./src/test/resources/ncal_data.xml", outdir,
44: // "org.ontoware.rdfreactor.test.reac11", "RDFS", true, true, "NCal");
45: // }
46:
47: // @Test
48: // // http://www.semanticdesktop.org/ontologies/2007/01/19/nie/nie_data.rdfs
49: // public void testReac11() throws Exception {
50: // URL url =new URL("http://www.semanticdesktop.org/ontologies/2007/01/19/nie/nie_data.rdfs");
51: // URLConnection conn = url.openConnection();
52: // conn.connect();
53: // InputStream in = conn.getInputStream();
54: // Model m = RDF2Go.getModelFactory().createModel();
55: // m.open();
56: // m.readFrom(in);
57: //
58: // CodeGenerator.generate(m, new File(outdir),
59: // "org.ontoware.rdfreactor.test.reac15", Reasoning.rdfs, true, "");
60: // }
61:
62: // @Test
63: // // FIXME broken with rdfs+owl
64: // public void testReac18() throws Exception {
65: // String schemafile = "./src/test/resources/reac18.n3";
66: // String packagename = "org.ontoware.rdfreactor.test.reac18";
67: //
68: // CodeGenerator.generate("./src/test/resources/reac18.n3", outdir,
69: // "org.ontoware.rdfreactor.test.reac18", Reasoning.rdfsAndOwl,
70: // true, "");
71: //
72: // Model schemaDataModel = CodeGenerator.loadSchemaDataModel(schemafile);
73: // JModel jm = ModelGenerator.createFromRDFS_AND_OWL(schemaDataModel, packagename, true);
74: // jm.addInverseProperties();
75: //
76: // System.out.println( jm.toReport() );
77: //
78: //
79: // }
80: }
|