1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package test.wsmo4j.parser.owl;
17
18 import java.io.InputStreamReader;
19 import java.util.HashMap;
20
21 import org.wsmo.common.TopEntity;
22 import org.wsmo.factory.Factory;
23 import org.wsmo.wsml.Parser;
24 import org.wsmo.wsml.ParserException;
25 import org.wsmo.wsml.Serializer;
26
27 import test.wsmo4j.Wsmo4jTestCase;
28
29 import static test.wsmo4j.Utils.*;
30
31
32
33
34
35 public class OWLParserTest extends Wsmo4jTestCase {
36
37 protected Parser parser;
38
39 protected Serializer serializer;
40
41 protected void setUp() throws Exception {
42 super.setUp();
43 HashMap <String, Object> properties = new HashMap <String, Object> ();
44 properties.put(Factory.PROVIDER_CLASS, "com.ontotext.wsmo4j.parser.owl.OWLParser");
45 properties.put(Factory.WSMO_FACTORY, factory);
46 properties.put(Factory.LE_FACTORY, leFactory);
47 parser = Factory.createParser(properties);
48
49 properties = new HashMap <String, Object> ();
50 properties.put(Factory.PROVIDER_CLASS,
51 "com.ontotext.wsmo4j.serializer.wsml.WSMLSerializerImpl");
52 serializer = Factory.createSerializer(properties);
53 }
54
55 protected void tearDown() throws Exception {
56 super.tearDown();
57 parser = null;
58 System.gc();
59 }
60
61 public void testFileParsing() throws Exception {
62 InputStreamReader reader = new InputStreamReader(getStream("test/wsmo4j/parser/owl/Pizza.owl"));
63
64 try {
65 parser.parse(reader);
66 fail();
67 } catch (ParserException e) {
68 assertEquals("Nested http://www.w3.org/2002/07/owl#intersectionOf Not supported", e.getCause().getMessage());
69 }
70 }
71
72 }