1 6 package com.hp.hpl.jena.util.iterator.test; 7 8 import java.util.NoSuchElementException ; 9 10 import junit.framework.*; 11 12 import com.hp.hpl.jena.rdf.model.test.ModelTestBase; 13 import com.hp.hpl.jena.util.iterator.*; 14 15 19 public class TestNullIterator extends ModelTestBase 20 { 21 public TestNullIterator( String name ) { super( name ); } 22 23 public static TestSuite suite() 24 { return new TestSuite( TestNullIterator.class ); } 25 26 public void testHasntNext() 27 { assertFalse( NullIterator.instance.hasNext() ); } 28 29 public void testNextFails() 30 { try 31 { NullIterator.instance.next(); fail( "should throw NoSuchElementException" ); } 32 catch (NoSuchElementException e) { pass(); } 33 } 34 35 public void testAndThenReturnsArgument() 36 { 37 ExtendedIterator it = new NiceIterator(); 38 assertSame( it, NullIterator.instance.andThen( it ) ); 39 } 40 } 41 42 43 | Popular Tags |