aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/org')
-rw-r--r--tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java10
-rw-r--r--tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbedLauncher.java48
-rw-r--r--tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java4
3 files changed, 58 insertions, 4 deletions
diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java
index 9e864b089..36a7c2c1d 100644
--- a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java
+++ b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java
@@ -53,7 +53,7 @@ public class AjdeInteractionTestbed extends TestCase {
public static boolean VERBOSE = false; // do you want the gory details?
- public final static String testdataSrcDir = "../tests/multiIncremental";
+ public static String testdataSrcDir = "../tests/multiIncremental";
protected static File sandboxDir;
private static final String SANDBOX_NAME = "ajcSandbox";
@@ -365,6 +365,7 @@ public class AjdeInteractionTestbed extends TestCase {
}
private String projectName = null;
+ private String classPath = "";
public static void setActiveProject(String n) {
_instance.projectName = n;
@@ -383,6 +384,10 @@ public class AjdeInteractionTestbed extends TestCase {
}
}
+ public void setClasspath(String path) {
+ this.classPath = path;
+ }
+
// interface impl below
// DOESSOMETHING
@@ -429,7 +434,8 @@ public class AjdeInteractionTestbed extends TestCase {
String cp =
new File(testdataSrcDir) + File.pathSeparator +
System.getProperty("sun.boot.class.path") +
- File.pathSeparator + "../runtime/bin" +
+ File.pathSeparator + "../runtime/bin" +
+ File.pathSeparator + this.classPath +
File.pathSeparator + System.getProperty("aspectjrt.path") +
File.pathSeparator + "../lib/junit/junit.jar" +
File.pathSeparator+".."+File.separator+"lib" + File.separator+"test"+File.separator+"aspectjrt.jar";
diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbedLauncher.java b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbedLauncher.java
new file mode 100644
index 000000000..019b63023
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbedLauncher.java
@@ -0,0 +1,48 @@
+/* *******************************************************************
+ * Copyright (c) 2006 Contributors.
+ * All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Adrian Colyer Initial implementation
+ * ******************************************************************/
+package org.aspectj.systemtest.incremental.tools;
+
+
+/**
+ * command-line launcher for Ajde-like aspectj runs for use with
+ * profiling tools.
+ */
+public class AjdeInteractionTestbedLauncher extends
+ MultiProjectIncrementalTests {
+
+ /**
+ * usage: AjdeInteractionTestbedLauncher srcDir projectName
+ * @param args workspace_root_dir project_name
+ */
+ public static void main(String[] args) throws Exception {
+ //AjdeInteractionTestbed.VERBOSE = true;
+ //MultiProjectIncrementalTests.VERBOSE = true;
+ AjdeInteractionTestbedLauncher.testdataSrcDir = args[0];
+ AjdeInteractionTestbedLauncher launcher = new AjdeInteractionTestbedLauncher();
+ launcher.setUp();
+ launcher.buildProject(args[1]);
+ launcher.printBuildReport();
+ launcher.tearDown();
+ }
+
+ public AjdeInteractionTestbedLauncher() {
+ String classPath = System.getProperty("java.class.path");
+ ((MyProjectPropertiesAdapter)MyProjectPropertiesAdapter.getInstance()).setClasspath(classPath);
+ }
+
+ private void buildProject(String projectName) {
+ initialiseProject(projectName);
+ build(projectName);
+ }
+
+
+}
diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
index 4ae317a69..ca4dc81b0 100644
--- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
+++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
@@ -45,7 +45,7 @@ import org.aspectj.testing.util.FileUtil;
*/
public class MultiProjectIncrementalTests extends AjdeInteractionTestbed {
- private static boolean VERBOSE = false;
+ public static boolean VERBOSE = false;
protected void setUp() throws Exception {
super.setUp();
@@ -581,7 +581,7 @@ public class MultiProjectIncrementalTests extends AjdeInteractionTestbed {
* Fill in the working directory with the project base files,
* from the 'base' folder.
*/
- private void initialiseProject(String p) {
+ protected void initialiseProject(String p) {
File projectSrc=new File(testdataSrcDir+File.separatorChar+p+File.separatorChar+"base");
File destination=new File(getWorkingDir(),p);
if (!destination.exists()) {destination.mkdir();}