1 /* 2 * Interactor_Test.java 3 * 4 * Created on July 24, 2007, 12:15 PM 5 * 6 * $Id: Interactor_Test.java,v 1.1.1.1 2010/04/08 20:38:00 jeremy Exp $ 7 */ 8 9 package org.lcsim.recon.tracking.trfbase; 10 11 import junit.framework.TestCase; 12 import org.lcsim.recon.tracking.trfutil.Assert; 13 14 /** 15 * 16 * @author Norman Graf 17 */ 18 public class Interactor_Test extends TestCase 19 { 20 private boolean debug; 21 /** Creates a new instance of Interactor_Test */ 22 public void testInteractor() 23 { 24 String component = "Interactor"; 25 String ok_prefix = component + " (I): "; 26 String error_prefix = component + " test (E): "; 27 28 if(debug) System.out.println( ok_prefix 29 + "---------- Testing component " + component 30 + ". ----------" ); 31 32 //******************************************************************** 33 34 if(debug) System.out.println( ok_prefix + "Construct interactor." ); 35 double errfac = 3.0; 36 InteractorTest inter = new InteractorTest(errfac); 37 Assert.assertTrue( inter.get_errfac() == errfac ); 38 39 //******************************************************************** 40 41 if(debug) System.out.println( ok_prefix + "Interact track." ); 42 ETrack tre = new ETrack(); 43 TrackError cleanError = tre.error(); 44 TrackError err = new TrackError(); 45 err.set(0,0, 4.0); 46 tre.setError(err); 47 Assert.assertTrue( tre.error().get(0,0) == 4.0 ); 48 inter.interact(tre); 49 Assert.assertTrue( tre.error().get(0,0) == errfac*4.0 ); 50 51 //******************************************************************** 52 53 if(debug) System.out.println( ok_prefix 54 + "------------- All tests passed. -------------" ); 55 56 //******************************************************************** 57 } 58 59 }