1 /* 2 * RootFinder_Test.java 3 * 4 * Created on July 24, 2007, 11:33 AM 5 * 6 * $Id: RootFinder_Test.java,v 1.1.1.1 2010/04/08 20:38:00 jeremy Exp $ 7 */ 8 9 package org.lcsim.recon.tracking.trfutil; 10 11 import junit.framework.TestCase; 12 13 /** 14 * 15 * @author Norman Graf 16 */ 17 public class RootFinder_Test extends TestCase 18 { 19 private boolean debug; 20 /** Creates a new instance of RootFinder_Test */ 21 public void testRootFinder() 22 { 23 String component = "RootFinder"; 24 String ok_prefix = component+ " (I): "; 25 String error_prefix = component+ " test (E): "; 26 27 if(debug) System.out.println( ok_prefix 28 + "--------------- testing component" + component 29 + ". -------------"); 30 //******************************************* 31 if(debug) System.out.println( ok_prefix+" Test constructor"); 32 33 RootFinderTest rfind = new RootFinderTest(); 34 35 StatusDouble eval = rfind.evaluate(3.2); 36 StatusDouble soln = rfind.solve(2.34,5.67); 37 Assert.assertTrue( eval.status() == 1 ); 38 Assert.assertTrue( eval.value() == 3.2 ); 39 Assert.assertTrue( soln.status() == 2 ); 40 Assert.assertTrue( soln.value() == 2.34*5.67 ); 41 42 43 //******************************************* 44 if(debug) System.out.println( ok_prefix 45 + "-------------------- All tests passed. -------------------"); 46 //******************************************* 47 } 48 49 }