Commit in GeomConverter/test/org/lcsim/detector on MAIN
SimpleDetectorTest.java+42added 1.1
JM: Dev Snapshot.  Includes simple working example of LV and PV creation and data access.

GeomConverter/test/org/lcsim/detector
SimpleDetectorTest.java added at 1.1
diff -N SimpleDetectorTest.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ SimpleDetectorTest.java	3 Mar 2007 01:19:43 -0000	1.1
@@ -0,0 +1,42 @@
+package org.lcsim.detector;
+
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.lcsim.detector.material.IMaterial;
+import org.lcsim.detector.solids.Box;
+
+public class SimpleDetectorTest extends TestCase
+{		
+	private IPhysicalVolume world=null;
+	
+    public SimpleDetectorTest(String name)
+    {
+        super(name);
+    }
+    
+    public static junit.framework.Test suite()
+    {
+        return new TestSuite(SimpleDetectorTest.class);
+    }
+    
+    protected void setUp() throws Exception
+    {
+    	world = DetectorTestUtil.createTestSetup();
+    }
+    
+    public void testBasicAccess()
+    {
+    	System.out.println("pv world = " + world.getName());
+    	ILogicalVolume lvWorld = world.getLogicalVolume();
+    	System.out.println("lv world = " + lvWorld.getName());
+    	IPhysicalVolume pvDau = lvWorld.getDaughter(0);
+    	System.out.println("pv dau = " + pvDau.getName());
+    	ILogicalVolume lvDau = pvDau.getLogicalVolume();
+    	System.out.println("lv dau = " + lvDau.getName());
+    	Box boxDau = (Box)lvDau.getSolid();
+    	System.out.println("box dau = " + boxDau.getName() + "; halfx halfy halfz = " + boxDau.getXHalfLength() + " " + boxDau.getYHalfLength() + " " + boxDau.getZHalfLength());
+    	IMaterial material = lvDau.getMaterial();
+    	System.out.println("mat dau = " + material.getName());
+    }
+}
\ No newline at end of file
CVSspam 0.2.8