1 6 7 package com.hp.hpl.jena.rdf.model.test; 8 9 import com.hp.hpl.jena.rdf.model.*; 10 11 import junit.framework.*; 12 13 19 public class TestLiteralImpl extends ModelTestBase 20 { 21 public TestLiteralImpl( String name ) 22 { super( name ); } 23 24 public static TestSuite suite() 25 { return new TestSuite( TestLiteralImpl.class ); } 26 27 30 public void testCannotAsNonLiteral() 31 { Model m = ModelFactory.createDefaultModel(); 32 try 33 { resource( m, "plumPie" ).as( Literal.class ); 34 fail( "non-literal cannot be converted to literal" ); } 35 catch (LiteralRequiredException l) 36 { pass(); } } 37 38 41 public void testAsLiteral() 42 { Model m = ModelFactory.createDefaultModel(); 43 literal( m, "17" ).as( Literal.class ); } 44 } 45 46 | Popular Tags |