]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.support.ws.client/src/main/java/org/argeo/slc/ant/unit/MinimalAntClasspathTestCase.java
Introduce org.argeo.slc.lib.detached
[gpl/argeo-slc.git] / runtime / org.argeo.slc.support.ws.client / src / main / java / org / argeo / slc / ant / unit / MinimalAntClasspathTestCase.java
1 package org.argeo.slc.ant.unit;
2
3 import java.io.File;
4 import java.util.UUID;
5
6 import org.argeo.slc.ant.AntConstants;
7 import org.argeo.slc.ant.AntExecutionContext;
8 import org.argeo.slc.ant.AntSlcApplication;
9 import org.argeo.slc.core.process.SlcExecution;
10 import org.argeo.slc.runtime.SlcExecutionOutput;
11 import org.argeo.slc.unit.AbstractSpringTestCase;
12 import org.springframework.core.io.FileSystemResource;
13
14 public class MinimalAntClasspathTestCase extends AbstractSpringTestCase
15 implements SlcExecutionOutput<AntExecutionContext> {
16 protected void execute(String scriptPath) {
17 AntSlcApplication slcApp = new AntSlcApplication();
18 slcApp.setRootDir(new FileSystemResource(new File("src/test/resources")
19 .getAbsolutePath()
20 + File.separator));
21 slcApp.setWorkDir(new File(System.getProperty("java.io.tmpdir")));
22 slcApp.setParentContext(getContext());
23
24 SlcExecution slcExecution = new SlcExecution();
25 slcExecution.setUuid(UUID.randomUUID().toString());
26 slcExecution.getAttributes().put(AntConstants.EXECATTR_ANT_FILE,
27 scriptPath);
28 slcExecution.setUser("user");
29
30 slcApp.execute(slcExecution, null, null, this);
31 }
32
33 /** to be overridden */
34 public void postExecution(AntExecutionContext executionContext) {
35 }
36
37 }