lcsim/test/org/lcsim/conditions
diff -N ConditionsManagerTest.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ConditionsManagerTest.java 6 Jul 2005 00:43:13 -0000 1.1
@@ -0,0 +1,64 @@
+/*
+ * ConditionsReaderTest.java
+ *
+ * Created on July 5, 2005, 4:06 PM
+ */
+
+package org.lcsim.conditions;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import org.lcsim.conditions.ConditionsManager.ConditionsNotFoundException;
+
+/**
+ *
+ * @author jeremym
+ */
+public class ConditionsManagerTest extends TestCase
+{
+ ConditionsManager _mgr;
+ public final static String testDet = "sdjan03";
+ public final static String[] condNames = {"TrackParameters","ClusterParameters","HitSmearing","SamplingFractions"};
+
+ /** Creates a new instance of ConditionsReaderTest */
+ public ConditionsManagerTest(String testName)
+ {
+ super(testName);
+ }
+
+ public static Test suite()
+ {
+ return new TestSuite(ConditionsManagerTest.class);
+ }
+
+ protected void setUp() throws Exception
+ {
+ _mgr = ConditionsManager.defaultInstance();
+ _mgr.setDetector(testDet, 0);
+ }
+
+ public void test_files()
+ {
+ for ( String s : condNames )
+ {
+ System.out.println("Looking up ConditionSet: " + s);
+ ConditionsSet cs = _mgr.getConditions(s);
+
+ if ( cs == null )
+ {
+ throw new RuntimeException("ConditionSet not found: " + s);
+ }
+ else
+ {
+ System.out.println("Found ConditionSet: " + s);
+
+ System.out.println("key=val pairs");
+ for ( Object o : cs.keySet() )
+ {
+ System.out.println(o.toString() + "=" + cs.getString(o.toString()) );
+ }
+ }
+ }
+ }
+}