1 6 package com.hp.hpl.jena.rdf.model.test; 7 8 import com.hp.hpl.jena.rdf.model.*; 9 10 import junit.framework.TestSuite; 11 12 16 public class TestModelRead extends ModelTestBase 17 { 18 public TestModelRead( String name ) 19 { super( name ); } 20 21 public static TestSuite suite() 22 { return new TestSuite( TestModelRead.class ); } 23 24 public void testReturnsSelf() 25 { 26 Model m = ModelFactory.createDefaultModel(); 27 assertSame( m, m.read( "file:testing/modelReading/empty.n3", "base", "N3" ) ); 28 assertTrue( m.isEmpty() ); 29 } 30 31 public void testLoadsSimpleModel() 32 { 33 Model expected = ModelFactory.createDefaultModel(); 34 Model m = ModelFactory.createDefaultModel(); 35 expected.read( "file:testing/modelReading/simple.n3", "N3" ); 36 assertSame( m, m.read( "file:testing/modelReading/simple.n3", "base", "N3" ) ); 37 assertIsoModels( expected, m ); 38 } 39 40 45 public void testLoadsSimpleModelWithoutProtocol() 46 { 47 } 53 54 public void testSimpleLoadImplictBase() 55 { 56 Model mBasedImplicit = ModelFactory.createDefaultModel(); 57 mBasedImplicit.read( "file:testing/modelReading/based.n3", "N3" ); 58 assertIsoModels( modelWithStatements( "file:testing/modelReading/based.n3 jms:predicate jms:object" ), mBasedImplicit ); 59 } 60 61 public void testSimpleLoadExplicitBase() 62 { 63 Model mBasedExplicit = ModelFactory.createDefaultModel(); 64 mBasedExplicit.read( "file:testing/modelReading/based.n3", "base:", "N3" ); 65 assertIsoModels( modelWithStatements( "base: jms:predicate jms:object" ), mBasedExplicit ); 66 } 67 68 public void testDefaultLangXML() 69 { 70 Model m = ModelFactory.createDefaultModel(); 71 m.read( "file:testing/modelReading/plain.rdf", null, null ); 72 } 73 } 74 75 76 | Popular Tags |