1 package org.apache.poi.util; 2 3 import junit.framework.TestCase; 4 5 8 public class TestList2d 9 extends TestCase 10 { 11 public void testAccess() 12 throws Exception 13 { 14 Object objectA = new Object (); 15 Object objectB = new Object (); 16 17 List2d array = new List2d(); 18 assertNull( array.get( 0, 0 ) ); 19 assertNull( array.get( 1, 1 ) ); 20 assertNull( array.get( 100, 100 ) ); 21 array.set( 100, 100, objectA ); 22 assertSame( objectA, array.get( 100, 100 ) ); 23 assertNull( array.get( 0, 0 ) ); 24 array.set( 0, 0, objectB ); 25 assertSame( objectB, array.get( 0, 0 ) ); 26 27 try 28 { 29 array.get( -1, -1 ); 30 fail(); 31 } 32 catch ( ArrayIndexOutOfBoundsException e ) 33 { 34 } 36 } 37 } 38 | Popular Tags |