View Javadoc

1   /*
2    * NullSimInteractor_Test.java
3    *
4    * Created on July 24, 2007, 12:07 PM
5    *
6    * $Id: NullSimInteractor_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 NullSimInteractor_Test extends TestCase
19  {
20      private boolean debug;
21      /** Creates a new instance of NullSimInteractor_Test */
22      public void testNullSimInteractor()
23      {
24         String component = "NullSimInteractor";
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          
35          if(debug) System.out.println( ok_prefix + "Create interactor." );
36          NullSimInteractor inter = new NullSimInteractor();
37          
38          //********************************************************************
39          
40          if(debug) System.out.println( ok_prefix + "Interact a track." );
41          Surface srf = new SurfTest(10);
42          VTrack trv = new VTrack(srf);
43          VTrack trv0 = new VTrack(trv);
44          Assert.assertTrue( trv.equals(trv0) );
45          inter.interact(trv);
46          Assert.assertTrue( trv.equals(trv0) );
47          
48          //********************************************************************
49          
50          if(debug) System.out.println( ok_prefix + "Clone." );
51          {
52              SimInteractor inter2 = inter.newCopy();
53              Assert.assertTrue(inter2!=inter);
54              Assert.assertTrue( trv.equals(trv0) );
55              inter2.interact(trv);
56              Assert.assertTrue( trv.equals(trv0) );
57          }
58          
59          //********************************************************************
60          
61          if(debug) System.out.println( ok_prefix
62                  + "------------- All tests passed. -------------" );
63          
64          
65          //********************************************************************        
66      }
67      
68  }