View Javadoc

1   package org.lcsim.material;
2   
3   import junit.framework.TestCase;
4   
5   /**
6    * This is a very basic integration test of the XMLMaterialManager, making
7    * sure that it loads a few expected materials and elements into the MaterialManager.
8    * @author jeremym
9    */
10  public class XMLMaterialManagerTest extends TestCase
11  {
12      static XMLMaterialManager xmgr;
13          
14      public void setUp()
15      {
16          if (xmgr == null)
17          {
18              XMLMaterialManager.setup();
19              xmgr = XMLMaterialManager.getDefaultMaterialManager();
20          }
21      }
22         
23      public void testElements()
24      {
25          assertTrue(MaterialManager.instance().getElement("N") != null);
26          assertTrue(MaterialManager.instance().getMaterial("Nitrogen") != null);
27      }
28      
29      public void testMaterials()
30      {
31          assertTrue(MaterialManager.instance().getMaterial("Polystyrene") != null);
32      }         
33  }