KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > JSci > tests > NumberTest


1 package JSci.tests;
2
3 import JSci.maths.*;
4 import JSci.maths.fields.*;
5
6 /**
7  * Testcase for Number subclasses.
8  */

9 public class NumberTest extends junit.framework.TestCase {
10     public static void main(String JavaDoc[] args) {
11         junit.textui.TestRunner.run(NumberTest.class);
12     }
13     public NumberTest(String JavaDoc name) {
14         super(name);
15     }
16     protected void setUp() throws Exception JavaDoc {
17         JSci.GlobalSettings.ZERO_TOL=1.0e-9;
18         super.setUp();
19     }
20     public void testOne() {
21         // integers are a subset of reals
22
assertTrue(RealField.ONE.equals(IntegerRing.ONE));
23         assertFalse(IntegerRing.ONE.equals(RealField.ONE));
24     }
25 }
26
Popular Tags