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