]> source.dussan.org Git - aspectj.git/commitdiff
fix and test for
authorjhugunin <jhugunin>
Sun, 27 Apr 2003 23:29:27 +0000 (23:29 +0000)
committerjhugunin <jhugunin>
Sun, 27 Apr 2003 23:29:27 +0000 (23:29 +0000)
Bugzilla Bug 34951
   NPE compiling without aspectjrt.jar

org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BasicCommandTestCase.java

index a39d4d8a9c7b4a71358723a5859bc8c9f4dcfeff..b9a1ea58891f4e504f903937ce2b8d46a2e77161 100644 (file)
@@ -45,6 +45,7 @@ import org.aspectj.bridge.IProgressListener;
 import org.aspectj.bridge.Message;
 import org.aspectj.bridge.MessageUtil;
 import org.aspectj.bridge.Version;
+import org.aspectj.weaver.ResolvedTypeX;
 import org.aspectj.weaver.World;
 import org.aspectj.weaver.bcel.BcelWeaver;
 import org.aspectj.weaver.bcel.BcelWorld;
@@ -285,6 +286,14 @@ public class AjBuildManager {
                        File inJar = (File)i.next();
                        bcelWeaver.addJarFile(inJar, buildConfig.getOutputDir());
                }
+               
+               //check for org.aspectj.runtime.JoinPoint
+               bcelWorld.resolve("org.aspectj.lang.JoinPoint");
+               
+//             if () {
+//                     bcelWorld.showMessage(IMessage.ERROR,
+//                                     "can't find type org.aspectj.lang.JoinPoint on classpath", null, null);
+//             }
        }
        
        public World getWorld() {
index 107921ca06565428fe9b664365475f9cce0f0934..14736ab994dcde7abf55e5ffb9c49def4e68dd5e 100644 (file)
@@ -15,6 +15,10 @@ package org.aspectj.ajdt.internal.compiler.batch;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.aspectj.ajdt.ajc.AjdtCommand;
+import org.aspectj.bridge.ICommand;
+import org.aspectj.bridge.MessageHandler;
+
 /**
  * @author hugunin
  *
@@ -96,4 +100,21 @@ public class BasicCommandTestCase extends CommandTestCase {
                
                runCompiler(args, new int[] {2});
        }
+       public void testMissingRuntimeError() {
+               List args = new ArrayList();
+
+               args.add("-d");
+               args.add("out");
+               
+               args.add("-classpath");
+               args.add("../lib/junit/junit.jar;../testing-client/bin");
+               args.add("testdata/src1/Xlint.java");
+               
+               ICommand command = new AjdtCommand();
+               MessageHandler myHandler = new MessageHandler();
+               myHandler.setInterceptor(org.aspectj.tools.ajc.Main.MessagePrinter.TERSE);
+               boolean result = command.runCommand((String[])args.toArray(new String[args.size()]), myHandler);
+
+               assertEquals("error for org.aspectj.lang.JoinPoint not found", 1, myHandler.getErrors().length);
+       }
 }