View Javadoc

1   /*
2    * FullFitter_Test.java
3    *
4    * Created on July 24, 2007, 4:59 PM
5    *
6    * $Id: FullFitter_Test.java,v 1.1.1.1 2010/04/08 20:38:00 jeremy Exp $
7    */
8   
9   package org.lcsim.recon.tracking.trffit;
10  
11  import junit.framework.TestCase;
12  import org.lcsim.recon.tracking.trfbase.ETrack;
13  import org.lcsim.recon.tracking.trfbase.SurfTest;
14  import org.lcsim.recon.tracking.trfutil.Assert;
15  
16  /**
17   *
18   * @author Norman Graf
19   */
20  public class FullFitter_Test extends TestCase
21  {
22      private boolean debug;
23      /** Creates a new instance of FullFitter_Test */
24      public void testFullFitter()
25      {
26           String component = "FullFitter";
27          String ok_prefix = component + " (I): ";
28          String error_prefix = component + " test (E): ";
29          
30          if(debug) System.out.println( ok_prefix
31                  + "-------- Testing component " + component  );
32          
33          //********************************************************************
34          
35          if(debug) System.out.println( ok_prefix + "Define track."  );
36          SurfTest srf = new SurfTest(10);
37          ETrack tre = new ETrack( srf.newPureSurface() );
38          HTrack trh = new HTrack(tre);
39          
40          //********************************************************************
41          
42          if(debug) System.out.println(  ok_prefix + "Test constructor." );
43          int ival = 123;
44          FullFitterTest fit = new FullFitterTest(ival);
45          if(debug) System.out.println( fit );
46          Assert.assertTrue( fit.fit(trh) == ival );
47          
48          //********************************************************************
49          
50          if(debug) System.out.println( ok_prefix
51                  + "------------- All tests passed. -------------" );
52          
53          
54          //********************************************************************       
55      }
56      
57  }