1 6 7 package com.hp.hpl.jena.rdf.model.test; 8 9 import com.hp.hpl.jena.rdf.model.*; 10 import com.hp.hpl.jena.rdf.model.ModelSource; 11 12 import junit.framework.TestSuite; 13 14 18 public class TestModelSource extends ModelTestBase 19 { 20 21 22 public TestModelSource( String name ) 23 { super( name ); } 24 25 public static TestSuite suite() 26 { return new TestSuite( TestModelSource.class ); } 27 28 public ModelSource getModelSource() 29 { return new ModelSourceImpl(); } 30 31 public void testMethodsExist() 32 { 33 ModelSource s = getModelSource(); 34 s.getModel(); 35 s.createModel(); 36 s.openModel( "spoo" ); 37 s.openModelIfPresent( "flarn" ); 38 } 39 40 46 public static class ModelSourceImpl implements ModelSource 47 { 48 public Model openModel( String name ) 49 { return ModelFactory.createDefaultModel(); } 50 51 public Model openModelIfPresent(String name) 52 { return null; } 53 54 Model theDefaultModel = ModelFactory.createDefaultModel(); 55 56 public Model getModel() 57 { return theDefaultModel; } 58 59 public Model createModel() 60 { return getModel(); } 61 } 62 } 63 64 65 | Popular Tags |