1 package org.lcsim.detector.converter.compact;
2
3 import java.io.InputStream;
4
5 import junit.framework.TestCase;
6
7 import org.lcsim.detector.converter.heprep.DetectorElementToHepRepConverter;
8 import org.lcsim.geometry.Detector;
9 import org.lcsim.geometry.GeometryReader;
10 import org.lcsim.util.test.TestUtil.TestOutputFile;
11
12
13
14
15
16
17
18
19
20 public class PolyhedraBarrelCalorimeter2HepRepTest extends TestCase
21 {
22 Detector detector;
23
24 private static final String resource =
25 "/org/lcsim/geometry/subdetector/PolyhedraBarrelCalorimeter2Test.xml";
26
27 public void setUp()
28 {
29 InputStream in =
30 this.getClass().
31 getResourceAsStream(resource);
32
33 GeometryReader reader = new GeometryReader();
34
35 try
36 {
37 detector = reader.read(in);
38 }
39 catch (Throwable x)
40 {
41 throw new RuntimeException(x);
42 }
43 }
44
45 public void testWriteHepRep()
46 {
47 try
48 {
49 DetectorElementToHepRepConverter.writeHepRep((new TestOutputFile("PolyhedraBarrelCalorimeter2Test.heprep")).getPath());
50 }
51 catch (Exception x)
52 {
53 throw new RuntimeException(x);
54 }
55 }
56 }