diff options
author | wisberg <wisberg> | 2004-03-31 08:02:30 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2004-03-31 08:02:30 +0000 |
commit | 6cbf9cca10146bca581d4db989aebee0c82b558c (patch) | |
tree | e3cb1b30702f69336818a5bd89b9b26faaf66786 /org.aspectj.ajdt.core/testsrc | |
parent | bff61ab1e3ae811650af9b88e344035607619b33 (diff) | |
download | aspectj-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.java | 33 |
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")); + } +} |