16 modified files
lcsim
diff -u -r1.5 -r1.6
--- maven.xml 25 Jan 2007 19:36:55 -0000 1.5
+++ maven.xml 9 Aug 2007 22:47:17 -0000 1.6
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project default="jar">
- <postGoal name="xdoc:register-reports">
- <attainGoal name="maven-checkstyle-plugin:deregister"/>
- <attainGoal name="maven-license-plugin:deregister"/>
- </postGoal>
-
- <goal name="Install_in_JAS3">
- <attainGoal name="jar:install"/>
- <attainGoal name="jas:install"/>
- </goal>
+<project default="jar" xmlns:ant="jelly:ant">
+
+ <postGoal name="xdoc:register-reports">
+ <attainGoal name="maven-checkstyle-plugin:deregister"/>
+ <attainGoal name="maven-license-plugin:deregister"/>
+ </postGoal>
+
+ <goal name="Install_in_JAS3">
+ <attainGoal name="jar:install"/>
+ <attainGoal name="jas:install"/>
+ </goal>
+
+ <!-- Make the output directory for test files before testing starts. -->
+ <preGoal name="test:test">
+ <attainGoal name="make-test-output-dir" />
+ </preGoal>
+
+ <preGoal name="test:single">
+ <attainGoal name="make-test-output-dir" />
+ </preGoal>
+
+ <goal name="make-test-output-dir">
+ <ant:mkdir dir="${maven.build.dir}/test-output" />
+ </goal>
+
</project>
lcsim
diff -u -r1.7 -r1.8
--- pom2.xml 9 Aug 2007 20:27:44 -0000 1.7
+++ pom2.xml 9 Aug 2007 22:47:17 -0000 1.8
@@ -83,6 +83,24 @@
</includes>
</configuration>
</plugin>
+
+ <!-- Create the directory for test output. -->
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-test-resources</phase>
+ <configuration>
+ <tasks>
+ <mkdir dir="${project.build.directory}/test-output" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
lcsim/test/org/lcsim
diff -u -r1.1 -r1.2
--- LCIOReadTest.java 9 Aug 2007 20:12:09 -0000 1.1
+++ LCIOReadTest.java 9 Aug 2007 22:47:17 -0000 1.2
@@ -4,9 +4,11 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
+
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
+
import org.lcsim.event.Cluster;
import org.lcsim.event.EventHeader;
import org.lcsim.recon.cluster.cheat.CheatClusterDriver;
@@ -14,8 +16,8 @@
import org.lcsim.util.cache.FileCache;
import org.lcsim.util.loop.LCIODriver;
import org.lcsim.util.loop.LCIOEventSource;
-
import org.lcsim.util.loop.LCSimLoop;
+import org.lcsim.util.test.TestUtil.TestOutputFile;
/**
* @author tonyj
@@ -43,7 +45,7 @@
loop.setLCIORecordSource(file);
loop.add(new CheatClusterDriver());
loop.add(new ReadDriver());
- loop.add(new LCIODriver(new File("test.slcio")));
+ loop.add(new LCIODriver(new TestOutputFile("LCIOReadTest.slcio")));
loop.loop(-1);
assertEquals(200, loop.getTotalCountableSupplied());
loop.dispose();
lcsim/test/org/lcsim
diff -u -r1.1 -r1.2
--- ReadoutTest.java 9 Aug 2007 20:12:09 -0000 1.1
+++ ReadoutTest.java 9 Aug 2007 22:47:17 -0000 1.2
@@ -4,17 +4,20 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
+
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
+
import org.lcsim.event.EventHeader;
-import org.lcsim.event.EventHeader.LCMetaData;
import org.lcsim.event.SimCalorimeterHit;
+import org.lcsim.event.EventHeader.LCMetaData;
import org.lcsim.geometry.IDDecoder;
import org.lcsim.util.Driver;
import org.lcsim.util.cache.FileCache;
import org.lcsim.util.loop.LCIODriver;
import org.lcsim.util.loop.LCSimLoop;
+import org.lcsim.util.test.TestUtil.TestOutputFile;
/**
*
* @author tonyj
@@ -40,7 +43,7 @@
LCSimLoop loop = new LCSimLoop();
loop.setLCIORecordSource(file);
loop.add(new CopyDriver());
- loop.add(new LCIODriver(new File("test2.slcio")));
+ loop.add(new LCIODriver(new TestOutputFile("ReadoutTest.slcio")));
loop.loop(-1);
loop.dispose();
}
lcsim/test/org/lcsim
diff -u -r1.1 -r1.2
--- StdhepFilterTest.java 9 Aug 2007 20:12:09 -0000 1.1
+++ StdhepFilterTest.java 9 Aug 2007 22:47:17 -0000 1.2
@@ -2,12 +2,15 @@
import java.io.File;
import java.net.URL;
+
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
+
import org.lcsim.util.cache.FileCache;
import org.lcsim.util.loop.LCSimLoop;
import org.lcsim.util.loop.StdhepDriver;
+import org.lcsim.util.test.TestUtil.TestOutputFile;
/**
*
@@ -34,7 +37,7 @@
FileCache cache = new FileCache();
File stdhep = cache.getCachedFile(url);
- StdhepDriver writer = new StdhepDriver("filter.stdhep","myTitle","myComment",0);
+ StdhepDriver writer = new StdhepDriver((new TestOutputFile("filter.stdhep")).getAbsolutePath(),"myTitle","myComment",0);
LCSimLoop loop = new LCSimLoop();
loop.setStdhepRecordSource(stdhep,detectorName);
lcsim/test/org/lcsim
diff -u -r1.1 -r1.2
--- TestFastMC.java 9 Aug 2007 20:12:09 -0000 1.1
+++ TestFastMC.java 9 Aug 2007 22:47:17 -0000 1.2
@@ -1,18 +1,20 @@
package org.lcsim;
-import org.lcsim.util.aida.AIDA;
import java.io.File;
import java.net.URL;
+
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
+
import org.lcsim.event.util.JetDriver;
import org.lcsim.mc.fast.MCFast;
import org.lcsim.util.Driver;
+import org.lcsim.util.aida.AIDA;
import org.lcsim.util.cache.FileCache;
-
import org.lcsim.util.loop.LCIODriver;
import org.lcsim.util.loop.LCSimLoop;
+import org.lcsim.util.test.TestUtil.TestOutputFile;
/**
*
@@ -35,7 +37,7 @@
*/
public void testFastMC() throws Exception
{
- final String detectorName = "sidaug05";
+ final String detectorName = "sidaug05";
URL url = new URL("ftp://ftp-lcd.slac.stanford.edu/lcd/NewData/NLC500/ZZ/stdhep/pythia/pythiaZZ_nunu_bbbar.stdhep");
FileCache cache = new FileCache();
File stdhep = cache.getCachedFile(url);
@@ -43,7 +45,7 @@
Driver fast = new MCFast();
fast.setHistogramLevel(1);
- LCIODriver writer = new LCIODriver("mcfast.slcio");
+ LCIODriver writer = new LCIODriver(new TestOutputFile("mcfast.slcio"));
LCSimLoop loop = new LCSimLoop();
loop.setStdhepRecordSource(stdhep,detectorName);
@@ -53,6 +55,6 @@
loop.loop(100);
loop.dispose();
- AIDA.defaultInstance().saveAs("fastmc.aida");
+ AIDA.defaultInstance().saveAs((new TestOutputFile("fastmc.aida")).getAbsolutePath());
}
}
lcsim/test/org/lcsim
diff -u -r1.1 -r1.2
--- TestFastMCGenerator.java 9 Aug 2007 20:12:09 -0000 1.1
+++ TestFastMCGenerator.java 9 Aug 2007 22:47:17 -0000 1.2
@@ -1,15 +1,16 @@
package org.lcsim;
-import org.lcsim.util.aida.AIDA;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
+
import org.lcsim.mc.fast.MCFast;
import org.lcsim.util.Driver;
+import org.lcsim.util.aida.AIDA;
import org.lcsim.util.event.LCSimEventGenerator;
-
import org.lcsim.util.loop.LCIODriver;
import org.lcsim.util.loop.LCSimLoop;
+import org.lcsim.util.test.TestUtil.TestOutputFile;
/**
*
@@ -39,7 +40,7 @@
Driver fast = new MCFast();
fast.setHistogramLevel(1);
- LCIODriver writer = new LCIODriver("mcfastgenerator.slcio");
+ LCIODriver writer = new LCIODriver(new TestOutputFile("mcfastgenerator.slcio"));
LCSimLoop loop = new LCSimLoop();
loop.setRecordSource(gen);
@@ -48,6 +49,6 @@
loop.loop(100);
loop.dispose();
- AIDA.defaultInstance().saveAs("fastmcgenerator.aida");
+ AIDA.defaultInstance().saveAs(new TestOutputFile("fastmcgenerator.aida").getAbsolutePath());
}
}
lcsim/test/org/lcsim/contrib/JanStrube/tracking
diff -u -r1.2 -r1.3
--- HelixTest.java 18 Sep 2006 17:09:31 -0000 1.2
+++ HelixTest.java 9 Aug 2007 22:47:17 -0000 1.3
@@ -18,7 +18,7 @@
/**
*
* @author tonyj
- * @version $Id: HelixTest.java,v 1.2 2006/09/18 17:09:31 ngraf Exp $
+ * @version $Id: HelixTest.java,v 1.3 2007/08/09 22:47:17 jeremy Exp $
*/
public class HelixTest extends TestCase
{
@@ -138,7 +138,7 @@
assertEquals(0,xy.meanY(),1e-14);
assertEquals(Math.sqrt(2)/2,xy.rmsX(),1e-14);
assertEquals(Math.sqrt(2)/2,xy.rmsY(),1e-14);
- aida.saveAs("helix.aida");
+ //aida.saveAs("helix.aida");
}
public void testGetDistanceFromHelixToPoint() {
lcsim/test/org/lcsim/contrib/tracking
diff -u -r1.6 -r1.7
--- TrackerHitCheaterTest.java 9 Aug 2007 20:11:02 -0000 1.6
+++ TrackerHitCheaterTest.java 9 Aug 2007 22:47:17 -0000 1.7
@@ -1,11 +1,14 @@
package org.lcsim.contrib.tracking;
+import java.io.File;
+import java.net.URL;
+import java.util.List;
+
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.lcsim.event.EventHeader;
-import org.lcsim.geometry.Detector;
import org.lcsim.event.SimTrackerHit;
import org.lcsim.event.TrackerHit;
import org.lcsim.event.base.BaseTrackerHitMC;
@@ -13,11 +16,6 @@
import org.lcsim.util.cache.FileCache;
import org.lcsim.util.loop.LCSimLoop;
-import java.io.File;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* Reads 2 muon event generated in sid01_polyhedra, which uses
* SiTrackerBarrel. For DetectorElements where there is a
lcsim/test/org/lcsim/detector/driver
diff -u -r1.3 -r1.4
--- RawTrackerHitReadoutDriverTest.java 3 Jul 2007 23:15:32 -0000 1.3
+++ RawTrackerHitReadoutDriverTest.java 9 Aug 2007 22:47:17 -0000 1.4
@@ -11,6 +11,7 @@
import org.lcsim.util.cache.FileCache;
import org.lcsim.util.loop.LCIODriver;
import org.lcsim.util.loop.LCSimLoop;
+import org.lcsim.util.test.TestUtil.TestOutputFile;
/**
* Test {@link org.lcsim.detector.RawTrackerHitReadout}.
@@ -31,7 +32,7 @@
writeLoop.add(new SimTrackerHitIdentifierReadoutDriver(new String[] { "SiTrackerBarrel_RO" } ));
writeLoop.add(new ExampleRawTrackerHitReadoutDriver());
writeLoop.add(new CheckDriver());
- writeLoop.add(new LCIODriver("rawhits.slcio"));
+ writeLoop.add(new LCIODriver(new TestOutputFile("RawTrackerHitTreadoutDriverTest.slcio")));
writeLoop.loop(1);
writeLoop.dispose();
}
lcsim/test/org/lcsim/recon/cluster/fixedcone
diff -u -r1.7 -r1.8
--- FixedConeClustererTest.java 22 May 2006 19:55:08 -0000 1.7
+++ FixedConeClustererTest.java 9 Aug 2007 22:47:17 -0000 1.8
@@ -11,15 +11,17 @@
import java.io.IOException;
import java.net.URL;
import java.util.List;
+
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
+
import org.lcsim.event.Cluster;
import org.lcsim.event.EventHeader;
-
import org.lcsim.util.cache.FileCache;
import org.lcsim.util.lcio.LCIOReader;
import org.lcsim.util.lcio.LCIOWriter;
+import org.lcsim.util.test.TestUtil.TestOutputFile;
/**
*
@@ -45,7 +47,7 @@
File file = cache.getCachedFile(url);
LCIOReader reader = new LCIOReader(file);
- LCIOWriter writer = new LCIOWriter("FixedConeRecon.slcio");
+ LCIOWriter writer = new LCIOWriter(new TestOutputFile("FixedConeRecon.slcio"));
double radius = 0.1;
double seed = 0.;
double minE = 0.;
lcsim/test/org/lcsim/recon/cluster/nn
diff -u -r1.6 -r1.7
--- NearestNeighborClustererTest.java 22 May 2006 19:55:08 -0000 1.6
+++ NearestNeighborClustererTest.java 9 Aug 2007 22:47:17 -0000 1.7
@@ -8,15 +8,16 @@
import java.io.File;
import java.io.IOException;
import java.net.URL;
-import java.util.List;
+
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.lcsim.event.Cluster;
+
import org.lcsim.event.EventHeader;
import org.lcsim.util.cache.FileCache;
import org.lcsim.util.lcio.LCIOReader;
import org.lcsim.util.lcio.LCIOWriter;
+import org.lcsim.util.test.TestUtil.TestOutputFile;
/**
* @author ngraf
@@ -42,7 +43,7 @@
File file = cache.getCachedFile(url);
LCIOReader reader = new LCIOReader(file);
- LCIOWriter writer = new LCIOWriter("NearestNeighborRecon.slcio");
+ LCIOWriter writer = new LCIOWriter(new TestOutputFile("NearestNeighborRecon.slcio"));
int minNumberOfCells = 5;
NearestNeighborClusterDriver driver = new NearestNeighborClusterDriver(minNumberOfCells);
// System.out.println("Processing events with " + driver);
lcsim/test/org/lcsim/recon/vertexing/billoir
diff -u -r1.3 -r1.4
--- VertexFitterTest.java 23 Oct 2006 19:42:36 -0000 1.3
+++ VertexFitterTest.java 9 Aug 2007 22:47:17 -0000 1.4
@@ -1,17 +1,20 @@
package org.lcsim.recon.vertexing.billoir;
/**
- * @version $Id: VertexFitterTest.java,v 1.3 2006/10/23 19:42:36 tonyj Exp $
+ * @version $Id: VertexFitterTest.java,v 1.4 2007/08/09 22:47:17 jeremy Exp $
*/
-import Jama.Matrix;
-import Jama.util.Maths;
+import static java.lang.Math.PI;
+import static java.lang.Math.atan;
+
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
+import junit.framework.TestCase;
+
import org.lcsim.event.EventHeader;
import org.lcsim.event.Track;
import org.lcsim.mc.fast.MCFast;
@@ -20,10 +23,10 @@
import org.lcsim.util.aida.AIDA;
import org.lcsim.util.cache.FileCache;
import org.lcsim.util.loop.LCSimLoop;
+import org.lcsim.util.test.TestUtil.TestOutputFile;
-import junit.framework.TestCase;
-import static java.lang.Math.PI;
-import static java.lang.Math.atan;
+import Jama.Matrix;
+import Jama.util.Maths;
/**
* @author jstrube
@@ -142,7 +145,7 @@
protected void tearDown() throws Exception {
super.tearDown();
- aida.saveAs("x.aida");
+ aida.saveAs(new TestOutputFile("VertexFitterTest.aida").getAbsolutePath());
loop.dispose();
}
}
lcsim/test/org/lcsim/util/heprep
diff -u -r1.4 -r1.5
--- LCSimHepRepConverterTest.java 23 Jun 2005 23:34:32 -0000 1.4
+++ LCSimHepRepConverterTest.java 9 Aug 2007 22:47:18 -0000 1.5
@@ -1,19 +1,23 @@
package org.lcsim.util.heprep;
import hep.graphics.heprep.HepRep;
-import junit.framework.*;
import hep.graphics.heprep.HepRepConverter;
import hep.graphics.heprep.HepRepFactory;
import hep.graphics.heprep.HepRepWriter;
+
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.net.URL;
-import org.lcsim.event.EventHeader;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.lcsim.event.EventHeader;
import org.lcsim.util.cache.FileCache;
import org.lcsim.util.lcio.LCIOReader;
+import org.lcsim.util.test.TestUtil.TestOutputFile;
/**
@@ -62,7 +66,7 @@
EventHeader event = reader.read();
HepRep heprep = converter.convert(event);
- OutputStream out = new BufferedOutputStream(new FileOutputStream("test.heprep"));
+ OutputStream out = new BufferedOutputStream(new FileOutputStream(new TestOutputFile("test.heprep")));
HepRepWriter writer = HepRepFactory.create().createHepRepWriter(out,false,false);
writer.write(heprep,"test");
writer.close();
lcsim/test/org/lcsim/util/swim
diff -u -r1.13 -r1.14
--- HelixTest.java 8 Nov 2005 22:33:18 -0000 1.13
+++ HelixTest.java 9 Aug 2007 22:47:18 -0000 1.14
@@ -3,16 +3,21 @@
import static java.lang.Math.cos;
import static java.lang.Math.sin;
import hep.aida.ICloud2D;
-import junit.framework.*;
import hep.physics.vec.BasicHep3Vector;
import hep.physics.vec.Hep3Vector;
+
import java.io.IOException;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
import org.lcsim.util.aida.AIDA;
-import hep.physics.vec.VecOp;
+import org.lcsim.util.test.TestUtil.TestOutputFile;
/**
*
* @author tonyj
- * @version $Id: HelixTest.java,v 1.13 2005/11/08 22:33:18 tonyj Exp $
+ * @version $Id: HelixTest.java,v 1.14 2007/08/09 22:47:18 jeremy Exp $
*/
public class HelixTest extends TestCase
{
@@ -132,7 +137,7 @@
assertEquals(0,xy.meanY(),1e-14);
assertEquals(Math.sqrt(2)/2,xy.rmsX(),1e-14);
assertEquals(Math.sqrt(2)/2,xy.rmsY(),1e-14);
- aida.saveAs("helix.aida");
+ aida.saveAs(new TestOutputFile("helix.aida").getAbsolutePath());
}
public void testGetDistanceFromHelixToPoint() {
lcsim/test/org/lcsim/util/swim
diff -u -r1.1 -r1.2
--- LineTest.java 20 Aug 2005 23:25:07 -0000 1.1
+++ LineTest.java 9 Aug 2007 22:47:18 -0000 1.2
@@ -1,17 +1,23 @@
package org.lcsim.util.swim;
import hep.aida.ICloud2D;
-import junit.framework.*;
import hep.physics.vec.BasicHep3Vector;
import hep.physics.vec.Hep3Vector;
import hep.physics.vec.VecOp;
+
import java.io.IOException;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
import org.lcsim.util.aida.AIDA;
+import org.lcsim.util.test.TestUtil.TestOutputFile;
/**
*
* @author tonyj
- * @version $Id: LineTest.java,v 1.1 2005/08/20 23:25:07 tonyj Exp $
+ * @version $Id: LineTest.java,v 1.2 2007/08/09 22:47:18 jeremy Exp $
*/
public class LineTest extends TestCase
{
@@ -88,7 +94,7 @@
// assertEquals(0,xy.meanY(),1e-14);
// assertEquals(Math.sqrt(2)/2,xy.rmsX(),1e-14);
// assertEquals(Math.sqrt(2)/2,xy.rmsY(),1e-14);
- aida.saveAs("line.aida");
+ aida.saveAs(new TestOutputFile("LineTest.aida").getAbsolutePath());
}
private void assertEquals(Hep3Vector v1, Hep3Vector v2)
{
CVSspam 0.2.8