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=9cfa214223575e109daae75322f7bad224f8868e;hb=2d93486e9d12f22409944d774911fe755e1350dc;hp=4cbdb86cb6515338bc59b12f20dfb91a066bd8cf;hpb=787d5761e4d125e527104a0455ab47d4eaf38ac1;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 4cbdb86cb..9cfa21422 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,41 +1,16 @@ 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.ant.unit.MinimalAntClasspathTestCase; 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()); +public class SlcAntTest extends MinimalAntClasspathTestCase { + // 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.init(); - - SlcExecution slcExecution = new SlcExecution(); - slcExecution.getAttributes().put(SlcAntConstants.EXECATTR_ANT_FILE, - url.toString()); - - slcApp.execute(slcExecution, null, null); + execute("/org/argeo/slc/ant/build.xml"); } - }