View Javadoc

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