package org.argeo.slc.ant;\r
\r
-import java.net.URL;\r
-\r
-import org.apache.commons.logging.Log;\r
-import org.apache.commons.logging.LogFactory;\r
+import java.io.File;\r
\r
+import org.argeo.slc.core.process.SlcExecution;\r
import org.argeo.slc.unit.AbstractSpringTestCase;\r
+import org.springframework.core.io.FileSystemResource;\r
\r
public class SlcAntTest extends AbstractSpringTestCase {\r
- private Log log = LogFactory.getLog(getClass());\r
+// private Log log = LogFactory.getLog(getClass());\r
\r
public void testSimpleRun() {\r
- // AntRegistryUtil.runAll(getClass().getResource(\r
- // "/org/argeo/slc/ant/build.xml"), "test", null);\r
+ AntSlcApplication slcApp = new AntSlcApplication();\r
+ slcApp.setRootDir(new FileSystemResource(new File("src/test/resources")\r
+ .getAbsolutePath()\r
+ + File.separator));\r
+ slcApp.setParentContext(getContext());\r
\r
- URL url = getClass().getResource("/org/argeo/slc/ant/build.xml");\r
- log.info("Run Ant file from URL: " + url);\r
- AntRunner antRunner = new AntRunner(getContext(), url, "test");\r
+ SlcExecution slcExecution = new SlcExecution();\r
+ slcExecution.getAttributes().put(SlcAntConstants.EXECATTR_ANT_FILE,\r
+ "/org/argeo/slc/ant/build.xml");\r
\r
- antRunner.run();\r
+ slcApp.execute(slcExecution, null, null);\r
}\r
\r
}\r