]> source.dussan.org Git - aspectj.git/commitdiff
210470 merged into refactoring branch
authoraclement <aclement>
Wed, 28 May 2008 00:03:01 +0000 (00:03 +0000)
committeraclement <aclement>
Wed, 28 May 2008 00:03:01 +0000 (00:03 +0000)
org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java

index 17d2e7fae1141602b68bdcef57fb76fcef175dad..d15b6e2d95794a3c67de2f6ccd68e845b183d3db 100644 (file)
@@ -566,6 +566,11 @@ public class AjcTestCase extends TestCase {
         * the sandbox.
         */
        public RunResult run(String className, String[] args, final String classpath, boolean useLTW)  {
+           if (args != null) {
+            for (int i = 0; i < args.length; i++) {
+                args[i] = substituteSandbox(args[i]);
+            }
+        }
                lastRunResult = null;
                StringBuffer cp = new StringBuffer();
                if (classpath != null) {
@@ -636,7 +641,6 @@ public class AjcTestCase extends TestCase {
                        Class toRun = sandboxLoader.loadClass(className);
                        Method mainMethod = toRun.getMethod("main",new Class[] {String[].class});
                        mainMethod.invoke(null,new Object[] {args});
-                       lastRunResult = new RunResult(command.toString(),new String(baosOut.toByteArray()),new String(baosErr.toByteArray()));
                } catch(ClassNotFoundException cnf) {
                        fail("Can't find class: " + className);
                } catch(NoSuchMethodException nsm) {
@@ -649,6 +653,7 @@ public class AjcTestCase extends TestCase {
                } finally {
                        Thread.currentThread().setContextClassLoader(contexClassLoader);
                        stopCapture(baosErr,baosOut);
+                       lastRunResult = new RunResult(command.toString(),new String(baosOut.toByteArray()),new String(baosErr.toByteArray()));
                }
                return lastRunResult;
        }