KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > poi > util > TestDoubleList2d


1 package org.apache.poi.util;
2
3 import junit.framework.TestCase;
4
5 /**
6  * @version $Id: TestDoubleList2d.java,v 1.1 2004/04/18 13:02:48 glens Exp $
7  */

8 public class TestDoubleList2d
9         extends TestCase
10 {
11     public void testAccess()
12             throws Exception JavaDoc
13     {
14         DoubleList2d array = new DoubleList2d();
15         assertEquals( 0, array.get( 0, 0 ), 0.00001 );
16         assertEquals( 0, array.get( 1, 1 ), 0.00001 );
17         assertEquals( 0, array.get( 100, 100 ), 0.00001 );
18         array.set( 100, 100, 999 );
19         assertEquals( 999, array.get( 100, 100 ), 0.00001 );
20         assertEquals( 0, array.get( 0, 0 ), 0.00001 );
21         array.set( 0, 0, 999 );
22         assertEquals( 999, array.get( 0, 0 ), 0.00001 );
23
24         try
25         {
26             array.get( -1, -1 );
27             fail();
28         }
29         catch ( ArrayIndexOutOfBoundsException JavaDoc e )
30         {
31             // pass
32
}
33     }
34 }
35
Popular Tags