Commit in java/trunk/integration-tests on MAIN
pom.xml+6-131082 -> 1083
src/test/java/org/hps/EcalReadoutSimTest.java+12-91082 -> 1083
                     /EtSystemTest.java+12-71082 -> 1083
                     /MCReconTest.java+7-11082 -> 1083
                     /MockDataReconTest.java+5-51082 -> 1083
                     /TestRunEvioToLcioTest.java+12-21082 -> 1083
+54-37
6 modified files
Rework integration tests configuration and test file locations.

java/trunk/integration-tests
pom.xml 1082 -> 1083
--- java/trunk/integration-tests/pom.xml	2014-09-24 22:41:30 UTC (rev 1082)
+++ java/trunk/integration-tests/pom.xml	2014-09-24 23:51:58 UTC (rev 1083)
@@ -27,20 +27,17 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <excludes>
-                        <exclude>/org/hps/TestRunEvioToLcioTest.java</exclude>
+                        <exclude>org/hps/TestRunEvioToLcioTest.java</exclude>
                     </excludes>
                 </configuration>
             </plugin>
-        </plugins>            
+        </plugins>
     </build>
-    <profiles>
+     <profiles>
         <profile>
-            <id>non-slac</id>
+            <id>no-integration-tests</id>
             <activation>
                 <activeByDefault>false</activeByDefault>
-                <file>
-                    <missing>/nfs/slac/g/hps3/</missing>
-                </file>
             </activation>
             <build>
                 <plugins>
@@ -48,14 +45,10 @@
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-surefire-plugin</artifactId>
                         <configuration>
-                            <excludes>
-                                <exclude>org/hps/EcalReadoutSimTest.java</exclude>
-                                <exclude>org/hps/EtSystemTest.java</exclude>
-                                <exclude>org/hps/MCReconTest</exclude>
-                            </excludes>
+                            <skipTests>true</skipTests>
                         </configuration>
                     </plugin>
-                </plugins>            
+                </plugins>
             </build>
         </profile>    
     </profiles>    

java/trunk/integration-tests/src/test/java/org/hps
EcalReadoutSimTest.java 1082 -> 1083
--- java/trunk/integration-tests/src/test/java/org/hps/EcalReadoutSimTest.java	2014-09-24 22:41:30 UTC (rev 1082)
+++ java/trunk/integration-tests/src/test/java/org/hps/EcalReadoutSimTest.java	2014-09-24 23:51:58 UTC (rev 1083)
@@ -7,6 +7,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -23,6 +24,7 @@
 import org.lcsim.job.JobControlManager;
 import org.lcsim.util.Driver;
 import org.lcsim.util.aida.AIDA;
+import org.lcsim.util.cache.FileCache;
 import org.lcsim.util.loop.LCSimLoop;
 
 /**
@@ -89,8 +91,11 @@
     static final String steeringResource = "/org/hps/steering/test/EcalReadoutSimTest.lcsim";
     static final String triggeredEventsResource = "/org/hps/test/EcalReadoutSimTest/triggered_events.txt";
     
-    // File information.
-    static final File inputFile = new File("/nfs/slac/g/hps3/data/testcase/ecal_readout_sim_input.slcio");
+    // File information.    
+    //static final File inputFile = new File("/nfs/slac/g/hps3/data/testcase/ecal_readout_sim_input.slcio");
+    
+    static final String fileLocation = "ftp://ftp-hps.slac.stanford.edu/hps/hps_data/hps_java_test_case_data/EcalReadoutSimInput.slcio";
+    
     static final File outputDir = new File("./target/test-output/" + className);    
     static final File outputFile = new File(outputDir + File.separator + className);
     static final File aidaOutputFile = new File(outputDir + File.separator + className + ".aida");
@@ -118,7 +123,7 @@
     /**
      * Run an integration test of the ECAL readout simulation.
      */
-    public void testEcalReadoutSim() {
+    public void testEcalReadoutSim() throws Exception {
         
         // Run the ECAL readout simulation.
         runEcalReadoutSim();
@@ -131,13 +136,11 @@
      * This method runs the simulation and writes the data to an output LCIO file
      * located in the <tt>target</tt> directory.
      */
-    private void runEcalReadoutSim() {
+    private void runEcalReadoutSim() throws Exception {
         
-        if (!inputFile.exists()) {
-            System.err.println("File " + inputFile.getPath() + " is not accessible.");
-            throw new RuntimeException("Input file not found.");
-        }
-        
+        FileCache cache = new FileCache();
+        File inputFile = cache.getCachedFile(new URL(fileLocation));
+                         
         outputDir.mkdirs();
         if (!outputDir.exists()) {
             System.err.println("Failed to create output directory " + outputDir.getPath());

java/trunk/integration-tests/src/test/java/org/hps
EtSystemTest.java 1082 -> 1083
--- java/trunk/integration-tests/src/test/java/org/hps/EtSystemTest.java	2014-09-24 22:41:30 UTC (rev 1082)
+++ java/trunk/integration-tests/src/test/java/org/hps/EtSystemTest.java	2014-09-24 23:51:58 UTC (rev 1083)
@@ -4,11 +4,13 @@
 import java.io.File;
 import java.io.IOException;
 import java.net.InetAddress;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 
 import junit.framework.TestCase;
 
+import org.hps.record.evio.EvioFileProducer;
 import org.jlab.coda.et.EtAttachment;
 import org.jlab.coda.et.EtConstants;
 import org.jlab.coda.et.EtEvent;
@@ -25,9 +27,8 @@
 import org.jlab.coda.et.exception.EtException;
 import org.jlab.coda.et.exception.EtTimeoutException;
 import org.jlab.coda.et.exception.EtWakeUpException;
+import org.lcsim.util.cache.FileCache;
 
-import org.hps.record.evio.EvioFileProducer;
-
 /**
  * <p>
  * This class runs an ET ring, EVIO file producer, and an ET station in separate system processes,
@@ -45,7 +46,8 @@
 
     static final String loadPath = new File("../et/lib/Linux-x86_64/").getAbsoluteFile().getAbsolutePath();
     //static final String evioFile = "/nfs/slac/g/hps3/data/testrun/runs/evio/hps_000975.evio.0";
-    static final String evioFile = "/nfs/slac/g/hps3/data/testcase/hps_000975.evio.0";
+    //static final String evioFile = "/nfs/slac/g/hps3/data/testcase/hps_000975.evio.0";
+    static final String fileLocation = "ftp://ftp-hps.slac.stanford.edu/hps/hps_data/hps_java_test_case_data/EtSystemTest.evio";
     static final String classPath = System.getProperty("java.class.path");
     static final String javaPath = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java";        
     static final String etBuffer = "ETBuffer";
@@ -60,8 +62,11 @@
      * file onto the ring.  Each of these tasks is done on a separate operating system
      * process.
      */
-    public void testEtSystem() {
+    public void testEtSystem() throws Exception {
         
+        FileCache cache = new FileCache();
+        File inputFile = cache.getCachedFile(new URL(fileLocation));
+                
         // Add shutdown hook to cleanup processes in case test case is interrupted.
         Runtime.getRuntime().addShutdownHook(new ProcessCleanupThread());
                         
@@ -89,7 +94,7 @@
         processes.add(etStationProcess);
         
         // Start the file producer.
-        Process fileProducerProcess = execFileProducer();
+        Process fileProducerProcess = execFileProducer(inputFile);
         processes.add(fileProducerProcess);
                 
         // Wait for the file producer to finish.
@@ -154,7 +159,7 @@
      * Execute the EVIO file producer process.
      * @return The <tt>Process</tt> that was created by <tt>ProcessBuilder</tt>.
      */
-    Process execFileProducer() {        
+    Process execFileProducer(File file) {        
         
         ProcessBuilder processBuilder = new ProcessBuilder(
                 javaPath,
@@ -163,7 +168,7 @@
                 classPath,                
                 EvioFileProducer.class.getName(),                
                 "-e",
-                evioFile,
+                file.getPath(),
                 "-f",
                 etBuffer,
                 "-host",

java/trunk/integration-tests/src/test/java/org/hps
MCReconTest.java 1082 -> 1083
--- java/trunk/integration-tests/src/test/java/org/hps/MCReconTest.java	2014-09-24 22:41:30 UTC (rev 1082)
+++ java/trunk/integration-tests/src/test/java/org/hps/MCReconTest.java	2014-09-24 23:51:58 UTC (rev 1083)
@@ -1,6 +1,7 @@
 package org.hps;
 
 import java.io.File;
+import java.net.URL;
 
 import junit.framework.TestCase;
 
@@ -12,6 +13,7 @@
 import org.lcsim.event.TrackerHit;
 import org.lcsim.job.JobControlManager;
 import org.lcsim.util.Driver;
+import org.lcsim.util.cache.FileCache;
 import org.lcsim.util.test.TestUtil.TestOutputFile;
 
 /**
@@ -22,8 +24,9 @@
 public class MCReconTest extends TestCase {
     
     File reconOutputFile = new TestOutputFile("recon");
-    File inputFile = new File("/nfs/slac/g/hps3/data/testcase/MCReconTestInput.slcio");
     
+    static final String fileLocation = "ftp://ftp-hps.slac.stanford.edu/hps/hps_data/hps_java_test_case_data/MCReconTest.slcio";
+    
     static final int TOTAL_CLUSTERS = 3960;        
     static final int TOTAL_TRACKER_HITS = 28691;
     static final int TOTAL_CALORIMETER_HITS = 61924;
@@ -41,6 +44,9 @@
         
     public void testMCRecon() throws Exception {
         
+        FileCache cache = new FileCache();
+        File inputFile = cache.getCachedFile(new URL(fileLocation));
+        
         System.out.println("Running MC recon on " + inputFile.getPath() + " ...");
         JobControlManager job = new JobControlManager();
         job.addVariableDefinition("outputFile", reconOutputFile.getPath());

java/trunk/integration-tests/src/test/java/org/hps
MockDataReconTest.java 1082 -> 1083
--- java/trunk/integration-tests/src/test/java/org/hps/MockDataReconTest.java	2014-09-24 22:41:30 UTC (rev 1082)
+++ java/trunk/integration-tests/src/test/java/org/hps/MockDataReconTest.java	2014-09-24 23:51:58 UTC (rev 1083)
@@ -1,7 +1,5 @@
 package org.hps;
 
-import hep.aida.IHistogram1D;
-
 import java.io.File;
 import java.io.IOException;
 import java.net.URL;
@@ -53,7 +51,9 @@
 
     AIDA aida = AIDA.defaultInstance();
 
-    static final String mockDataUrl = "http://www.slac.stanford.edu/~meeg/hps2/meeg/mock_data/tritrig-beam-tri_1-10_readout.slcio";
+    // FIXME: Move this out of a personal web directory to a more standard location on lcsim.org.
+    //static final String mockDataUrl = "http://www.slac.stanford.edu/~meeg/hps2/meeg/mock_data/tritrig-beam-tri_1-10_readout.slcio";
+    static final String fileLocation = "ftp://ftp-hps.slac.stanford.edu/hps/hps_data/hps_java_test_case_data/MockDataReconTest.slcio";
 
     public void setUp() {
         // Delete files if they already exist.
@@ -84,12 +84,12 @@
     private void runRecon() {
         
         System.out.println("caching file ...");
-        System.out.println(mockDataUrl);
+        System.out.println(fileLocation);
         
         File mockDataFile = null;
         try {
             FileCache cache = new FileCache();
-            mockDataFile = cache.getCachedFile(new URL(mockDataUrl));
+            mockDataFile = cache.getCachedFile(new URL(fileLocation));
         } catch (IOException e) {
             throw new RuntimeException(e);
         }

java/trunk/integration-tests/src/test/java/org/hps
TestRunEvioToLcioTest.java 1082 -> 1083
--- java/trunk/integration-tests/src/test/java/org/hps/TestRunEvioToLcioTest.java	2014-09-24 22:41:30 UTC (rev 1082)
+++ java/trunk/integration-tests/src/test/java/org/hps/TestRunEvioToLcioTest.java	2014-09-24 23:51:58 UTC (rev 1083)
@@ -1,11 +1,14 @@
 package org.hps;
 
+import java.io.File;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 
 import junit.framework.TestCase;
 
 import org.hps.evio.TestRunEvioToLcio;
+import org.lcsim.util.cache.FileCache;
 import org.lcsim.util.test.TestUtil.TestOutputFile;
 
 /**
@@ -13,8 +16,14 @@
  * @author Jeremy McCormick <[log in to unmask]>
  */
 public class TestRunEvioToLcioTest extends TestCase {
+    
+    final static String fileLocation = "ftp://ftp-hps.slac.stanford.edu/hps/hps_data/hps_java_test_case_data/TestRunEvioToLcioTest.evio"; 
+    
+    public void testTestRunEvioToLcio() throws Exception {
         
-    public void testTestRunEvioToLcio() {
+        System.out.println("Caching file...");
+        FileCache cache = new FileCache();
+        File inputFile = cache.getCachedFile(new URL(fileLocation));
         
         List<String> argList = new ArrayList<String>();
         argList.add("-r");                       
@@ -26,7 +35,8 @@
         argList.add("runNumber=1351");
         argList.add("-D");
         argList.add("outputFile=" + new TestOutputFile("TestRunEvioToLcioTest").getPath());
-        argList.add("/nfs/slac/g/hps3/data/testrun/runs/evio/hps_001351.evio.0");
+        argList.add(inputFile.getPath());
+        System.out.println("Running TestRunEvioToLcio.main ...");
         TestRunEvioToLcio.main(argList.toArray(new String[]{}));
     }
 
SVNspam 0.1