aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core/testsrc
diff options
context:
space:
mode:
authorwisberg <wisberg>2004-03-31 08:02:30 +0000
committerwisberg <wisberg>2004-03-31 08:02:30 +0000
commit6cbf9cca10146bca581d4db989aebee0c82b558c (patch)
treee3cb1b30702f69336818a5bd89b9b26faaf66786 /org.aspectj.ajdt.core/testsrc
parentbff61ab1e3ae811650af9b88e344035607619b33 (diff)
downloadaspectj-6cbf9cca10146bca581d4db989aebee0c82b558c.tar.gz
aspectj-6cbf9cca10146bca581d4db989aebee0c82b558c.zip
Convenience method to run ajc in a child classloader and get List/String results in the parent (e.g., when running as a JUnit test)
Diffstat (limited to 'org.aspectj.ajdt.core/testsrc')
-rw-r--r--org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/MainTest.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/MainTest.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/MainTest.java
new file mode 100644
index 000000000..29d64c27c
--- /dev/null
+++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/MainTest.java
@@ -0,0 +1,33 @@
+/* *******************************************************************
+ * Copyright (c) 2004 Contributors.
+ * All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Common Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Wes Isberg initial implementation
+ * ******************************************************************/
+
+package org.aspectj.tools.ajc;
+
+import java.util.ArrayList;
+
+import junit.framework.TestCase;
+
+/**
+ *
+ */
+public class MainTest extends TestCase {
+
+ public void testMainbare() {
+ ArrayList list = new ArrayList();
+ Main.bareMain(new String[] {"-help"}, false, list, null, null, null);
+ assertTrue(1 == list.size());
+ Object o = list.get(0);
+ assertTrue(o instanceof String);
+ assertTrue(-1 != ((String)o).indexOf("-aspectpath"));
+ assertTrue(-1 != ((String)o).indexOf("-incremental"));
+ }
+}