1 19 20 package org.netbeans.modules.java.source.util; 21 import java.util.ArrayList ; 22 import java.util.List ; 23 import junit.framework.*; 24 import org.netbeans.modules.java.source.util.IteratorTest.IteratorDescription; 25 26 30 public class UnmodifiableIteratorTest extends IteratorTest { 31 32 public UnmodifiableIteratorTest(String testName) { 33 super(testName); 34 } 35 36 protected void setUp() throws Exception { 37 } 38 39 protected void tearDown() throws Exception { 40 } 41 42 public static Test suite() { 43 TestSuite suite = new TestSuite(UnmodifiableIteratorTest.class); 44 return suite; 45 } 46 47 49 protected Iterable <IteratorDescription> createDescriptions() { 50 51 List <IteratorDescription> descs = new ArrayList <IteratorDescription>(); 52 53 List <Integer > gl = IteratorTest.createSequentialList( 100 ); 54 55 descs.add( new IteratorDescription( "PlainUnmodifiableListIterator", 56 Iterators.unmodifiable( gl.iterator() ), 57 gl.iterator(), 58 gl.size(), 59 false ) ); 60 61 return descs; 62 } 63 64 66 public void testInvalidParameters() { 67 68 try { 69 Iterators.unmodifiable( null ); 70 fail( "IllegalArgumentException should have been thrown, but was not."); 71 } 72 catch( IllegalArgumentException e ) { 73 } 75 76 } 77 78 } 79 | Popular Tags |