1 6 7 package com.hp.hpl.jena.rdf.model.test; 8 9 import com.hp.hpl.jena.rdf.model.*; 10 import junit.framework.*; 11 12 15 public class TestSelectors extends ModelTestBase 16 { 17 public TestSelectors( String name ) 18 { super( name ); } 19 20 public static TestSuite suite() 21 { return new TestSuite( TestSelectors.class ); } 22 23 public void testSelectors() 24 { 25 Model m = ModelFactory.createDefaultModel(); 26 check( null, null, null ); 27 check( resource( m, "A" ), null, null ); 28 check( null, property( m, "B" ), null ); 29 check( null, null, literal( m, "10" ) ); 30 check( resource( m, "C" ), property( m, "D" ), resource( m, "_E" ) ); 31 } 32 33 public void check( Resource S, Property P, RDFNode O ) 34 { 35 Selector s = new SimpleSelector( S, P, O ); 36 assertTrue( s.isSimple() ); 37 assertEquals( S, s.getSubject() ); 38 assertEquals( P, s.getPredicate() ); 39 assertEquals( O, s.getObject() ); 40 } 41 } 42 43 44 | Popular Tags |