1 6 7 package com.hp.hpl.jena.vocabulary.test; 8 9 import com.hp.hpl.jena.rdf.model.test.ModelTestBase; 10 import com.hp.hpl.jena.vocabulary.*; 11 import junit.framework.*; 12 13 16 public class TestVocabRDF extends ModelTestBase 17 { 18 public TestVocabRDF(String name) 19 { super(name); } 20 21 public static TestSuite suite() 22 { return new TestSuite( TestVocabRDF.class ); } 23 24 29 static final String RDFns = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"; 30 31 35 public void testRDFVocabulary() 36 { 37 String ns = RDFns; 38 assertEquals( ns, RDF.getURI() ); 39 assertEquals( ns + "Alt", RDF.Alt.getURI() ); 40 assertEquals( ns + "Bag", RDF.Bag.getURI() ); 41 assertEquals( ns + "Property", RDF.Property.getURI() ); 42 assertEquals( ns + "Seq", RDF. Seq.getURI() ); 43 assertEquals( ns + "Statement", RDF. Statement.getURI() ); 44 assertEquals( ns + "List", RDF. List.getURI() ); 45 assertEquals( ns + "nil", RDF. nil.getURI() ); 46 assertEquals( ns + "type", RDF. type.getURI() ); 47 assertEquals( ns + "rest", RDF. rest.getURI() ); 48 assertEquals( ns + "first", RDF. first.getURI() ); 49 assertEquals( ns + "subject", RDF. subject.getURI() ); 50 assertEquals( ns + "predicate", RDF. predicate.getURI() ); 51 assertEquals( ns + "object", RDF. object.getURI() ); 52 assertEquals( ns + "value", RDF. value.getURI() ); 53 } 54 55 59 public void testLI() 60 { 61 String ns = RDFns; 62 assertEquals( ns + "_1", RDF.li(1).getURI() ); 63 assertEquals( ns + "_1", RDF.li(1).getURI() ); 64 assertEquals( ns + "_10", RDF.li(10).getURI() ); 65 assertEquals( ns + "_11", RDF.li(11).getURI() ); 66 assertEquals( ns + "_100", RDF.li(100).getURI() ); 67 assertEquals( ns + "_123", RDF.li(123).getURI() ); 68 assertEquals( ns + "_32768", RDF.li(32768).getURI() ); 69 } 70 71 public void testNodes() 72 { 73 assertEquals( RDF.Alt.getNode(), RDF.Nodes.Alt ); 74 assertEquals( RDF.Bag.getNode(), RDF.Nodes.Bag ); 75 assertEquals( RDF.Property.getNode(), RDF.Nodes.Property ); 76 assertEquals( RDF.Seq.getNode(), RDF.Nodes. Seq ); 77 assertEquals( RDF.Statement.getNode(), RDF.Nodes. Statement ); 78 assertEquals( RDF.List.getNode(), RDF.Nodes. List ); 79 assertEquals( RDF.nil.getNode(), RDF.Nodes. nil ); 80 assertEquals( RDF.type.getNode(), RDF.Nodes. type ); 81 assertEquals( RDF.rest.getNode(), RDF.Nodes. rest ); 82 assertEquals( RDF.first.getNode(), RDF.Nodes. first ); 83 assertEquals( RDF.subject.getNode(), RDF.Nodes. subject ); 84 assertEquals( RDF.predicate.getNode(), RDF.Nodes. predicate ); 85 assertEquals( RDF.object.getNode(), RDF.Nodes. object ); 86 assertEquals( RDF.value.getNode(), RDF.Nodes. value ); 87 } 88 } 89 90 91 120 | Popular Tags |