]> git.argeo.org Git - gpl/argeo-slc.git/blob - AntSlcApplicationTestCase.java
7b28123c405099e5969d89bde486ce2984af08ec
[gpl/argeo-slc.git] / AntSlcApplicationTestCase.java
1 package org.argeo.slc.ant.unit;
2
3 import junit.framework.TestCase;
4
5 import org.argeo.slc.ant.AntExecutionContext;
6 import org.argeo.slc.cli.DefaultSlcRuntime;
7 import org.argeo.slc.runtime.SlcExecutionOutput;
8
9 public abstract class AntSlcApplicationTestCase extends TestCase implements
10 SlcExecutionOutput<AntExecutionContext> {
11
12 /** To be overriden */
13 public void postExecution(AntExecutionContext executionContext) {
14
15 }
16
17 protected String getRootDir() {
18 return System.getProperty("slc.rootDir", "src/main/slc/root");
19 }
20
21 protected String getAbsoluteScript(String relative) {
22 return getRootDir() + '/' + relative;
23 }
24
25 protected void execute(String relativeScript) {
26 execute(relativeScript, null);
27 }
28
29 protected void execute(String relativeScript, String targets) {
30 new DefaultSlcRuntime().executeScript(
31 getAbsoluteScript(relativeScript), targets, this);
32 }
33
34 }