View Javadoc

1   /*
2    * LayerSimulator_Test.java
3    *
4    * Created on July 24, 2007, 4:26 PM
5    *
6    * $Id: LayerSimulator_Test.java,v 1.1.1.1 2010/04/08 20:38:00 jeremy Exp $
7    */
8   
9   package org.lcsim.recon.tracking.trflayer;
10  
11  import junit.framework.TestCase;
12  import org.lcsim.recon.tracking.trfbase.SurfTest;
13  import org.lcsim.recon.tracking.trfbase.VTrack;
14  import org.lcsim.recon.tracking.trfutil.Assert;
15  
16  /**
17   *
18   * @author Norman Graf
19   */
20  public class LayerSimulator_Test extends TestCase
21  {
22      private boolean debug;
23      /** Creates a new instance of LayerSimulator_Test */
24      public void testLayerSimulator()
25      {
26           String component = "LayerSimulator";
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          
36          
37          if(debug) System.out.println( ok_prefix + "Check constructor." );
38          Layer  lyr = new LayerTest(5.0);
39          LayerSimulatorTest lsim = new LayerSimulatorTest(lyr);
40          if(debug) System.out.println( lsim );
41          Assert.assertTrue( lyr.equals(lsim.layer()) );
42          Assert.assertTrue( lsim.generators().size() == 1 );
43          VTrack trv = new VTrack( (new SurfTest(5.0)) );
44          int mcid = 137;
45          lsim.addClusters(trv, 137);
46          lsim.dropClusters();
47          
48          //********************************************************************
49          
50          if(debug) System.out.println( ok_prefix
51                  + "------------- All tests passed. -------------" );
52          
53          
54          //********************************************************************       
55      }
56      
57  }