View Javadoc

1   /*
2    * MaterialCnvTest.java
3    *
4    * Created on June 29, 2005, 2:27 PM
5    */
6   
7   package org.lcsim.material;
8   
9   import java.io.IOException;
10  import java.net.URL;
11  import junit.framework.Test;
12  import junit.framework.TestCase;
13  import junit.framework.TestSuite;
14  import org.jdom.JDOMException;
15  
16  /**
17   *
18   * @author jeremym
19   */
20  public class MaterialFromGDMLCnvTest extends TestCase
21  {
22      public static URL defURL = MaterialFromGDMLCnvTest.class.getResource("MaterialFromGDMLCnvTest.xml");
23      
24      /** Creates a new instance of MaterialCnvTest */
25      public MaterialFromGDMLCnvTest()
26      {}
27      
28      public MaterialFromGDMLCnvTest(String testName)
29      {
30          super(testName);
31      }
32      
33      public static Test suite()
34      {
35          return new TestSuite(MaterialFromGDMLCnvTest.class);
36      }
37      
38      public void test_cnvNoLCDD() throws IOException, JDOMException
39      {
40          System.out.println("Test removed for now!");
41          /*
42          //MaterialElementData med = new MaterialElementData();
43          MaterialManager.instance();
44          //XMLMaterialManager f = XMLMaterialManager.create(MaterialFromGDMLCnvTest.class.getResourceAsStream("MaterialFromGDMLCnvTest.xml"));
45          XMLMaterialManager xmat = new XMLMaterialManager(MaterialFromGDMLCnvTest.class.getResourceAsStream("MaterialFromGDMLCnvTest.xml"));
46          
47          //for ( MaterialElement me : MaterialManager.elements().values() )
48          //{
49          //    System.out.println("defined elem: " + me.name());
50          //}
51          
52          xmat.makeMaterials(null);
53          
54          Material testFractionMat = MaterialManager.instance().getMaterial("TestFraction");
55          
56          //assertTrue(testFractionMat != null);
57          
58          //System.out.println("testFractionMat ncomp, ncompmax, nelem: " + testFractionMat.getNComponents() + " " + testFractionMat.getNComponentsMax() + " " + testFractionMat.getNElements() );        
59          //assertEquals( testFractionMat.getMassFractions().get(0), 0.25);
60          //assertEquals( testFractionMat.getMassFractions().get(1), 0.25);
61          //assertEquals( testFractionMat.getMassFractions().get(2), 0.5);         
62           */
63      }
64  }