X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.agent%2Fsrc%2Ftest%2Fjava%2Forg%2Fargeo%2Fslc%2Fant%2FSlcAntTest.java;h=b52f38a250b84be2f17b3455a7b09e6ede1d9cdb;hb=489db3e2297debe1a32e5e98534d5dbf059e1c1d;hp=c49fcc74fc53b613944658989bae6ec4bedbdd1b;hpb=0bc20690292697d0c7950ccd8c3e1e0887d8b88a;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.agent/src/test/java/org/argeo/slc/ant/SlcAntTest.java b/org.argeo.slc.agent/src/test/java/org/argeo/slc/ant/SlcAntTest.java index c49fcc74f..b52f38a25 100644 --- a/org.argeo.slc.agent/src/test/java/org/argeo/slc/ant/SlcAntTest.java +++ b/org.argeo.slc.agent/src/test/java/org/argeo/slc/ant/SlcAntTest.java @@ -1,40 +1,27 @@ package org.argeo.slc.ant; import java.io.File; -import java.net.URL; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.argeo.slc.core.process.SlcExecution; -import org.argeo.slc.runtime.SimpleSlcRuntime; import org.argeo.slc.unit.AbstractSpringTestCase; import org.springframework.core.io.FileSystemResource; public class SlcAntTest extends AbstractSpringTestCase { - private Log log = LogFactory.getLog(getClass()); + // private Log log = LogFactory.getLog(getClass()); public void testSimpleRun() { - // AntRegistryUtil.runAll(getClass().getResource( - // "/org/argeo/slc/ant/build.xml"), "test", null); - - URL url = getClass().getResource("/org/argeo/slc/ant/build.xml"); - log.info("Run Ant file from URL: " + url); - - // AntRunner antRunner = new AntRunner(getContext(), url, "test"); - // antRunner.run(); - AntSlcApplication slcApp = new AntSlcApplication(); - slcApp.setSlcRuntime(new SimpleSlcRuntime(getContext())); slcApp.setRootDir(new FileSystemResource(new File("src/test/resources") .getAbsolutePath() + File.separator)); + slcApp.setWorkDir(new File(System.getProperty("java.io.tmpdir"))); + slcApp.setParentContext(getContext()); SlcExecution slcExecution = new SlcExecution(); slcExecution.getAttributes().put(SlcAntConstants.EXECATTR_ANT_FILE, - url.toString()); + "/org/argeo/slc/ant/build.xml"); - slcApp.execute(slcExecution, null, null); + slcApp.execute(slcExecution, null, null, null); } }