]> source.dussan.org Git - aspectj.git/commitdiff
tests for 112783 and 113066
authoraclement <aclement>
Mon, 7 Nov 2005 10:54:42 +0000 (10:54 +0000)
committeraclement <aclement>
Mon, 7 Nov 2005 10:54:42 +0000 (10:54 +0000)
tests/bugs150/pr112783.aj
tests/bugs150/pr113066/Consts.java
tests/bugs150/pr113066/Consts2.java [new file with mode: 0644]
tests/bugs150/pr113066/Consts3.java [new file with mode: 0644]
tests/bugs150/pr113066/TestNPE2.java [new file with mode: 0644]
tests/bugs150/pr113066/TestNPE3.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml

index b8ef21e53ac39b657967c9ff33ce0291aa19c817..b424fe5e7773b19350c3d039a419f55a822764d9 100644 (file)
@@ -10,4 +10,4 @@ class NotYetABean {
 
        public NotYetABean(Long l) {            
        }
-}
\ No newline at end of file
+}
index d79bcbdec181c2bcdddcf65e3293e2985dccd707..e1f76e091128c4d7da5d427729843f4e0dc4da24 100644 (file)
@@ -1,4 +1,4 @@
 package a;
 public class Consts {
-   static String A_CONST="bla";
+   static String A_CONST="bla"; // default visibility - will be OK, TestNPE is in the same package
 }
diff --git a/tests/bugs150/pr113066/Consts2.java b/tests/bugs150/pr113066/Consts2.java
new file mode 100644 (file)
index 0000000..ac145d1
--- /dev/null
@@ -0,0 +1,4 @@
+package a;
+public class Consts2 {
+   private static String A_CONST="bla"; // Should get error in TestNPE - it can't see this to import it.
+}
diff --git a/tests/bugs150/pr113066/Consts3.java b/tests/bugs150/pr113066/Consts3.java
new file mode 100644 (file)
index 0000000..1cf722b
--- /dev/null
@@ -0,0 +1,5 @@
+package a;
+public class Consts3 {
+   protected static String A_CONST="bla"; // should be ok, TestNPE3 is a subclass of Consts
+
+}
diff --git a/tests/bugs150/pr113066/TestNPE2.java b/tests/bugs150/pr113066/TestNPE2.java
new file mode 100644 (file)
index 0000000..9682dc8
--- /dev/null
@@ -0,0 +1,4 @@
+package a;
+import static a.Consts2.A_CONST;
+public class TestNPE2 {}
+
diff --git a/tests/bugs150/pr113066/TestNPE3.java b/tests/bugs150/pr113066/TestNPE3.java
new file mode 100644 (file)
index 0000000..3ae7c41
--- /dev/null
@@ -0,0 +1,4 @@
+package a;
+import static a.Consts3.A_CONST;
+public class TestNPE3 extends a.Consts3 {}
+
index 915c557945bfcf1162fb1343f301c8ad24137384..9faf3872fb853ec51fbf5c3cfbdb3354af78724a 100644 (file)
@@ -42,16 +42,18 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
     return new File("../tests/src/org/aspectj/systemtest/ajc150/ajc150.xml");
   }
 
-  public void testCantCallSuperMethods_pr90143() { runTest("cant call super methods");}
   /*
   public void testBrokenDispatchByITD_pr72834() { runTest("broken dispatch");}
   public void testMissingAccessor_pr73856() { runTest("missing accessor");}
   public void testCunningDeclareParents_pr92311() { runTest("cunning declare parents");}
   public void testGenericITDsAndAbstractMethodError_pr102357() { runTest("generic itds and abstract method error");}
-  public void testITDCtor_pr112783()       { runTest("Problem with constructor ITDs");}
   */
   
-  public void testPossibleStaticImports_pr113066() { runTest("possible static imports bug");}
+  public void testPossibleStaticImports_pr113066_1() { runTest("possible static imports bug - 1");}
+  public void testPossibleStaticImports_pr113066_2() { runTest("possible static imports bug - 2");}
+  public void testPossibleStaticImports_pr113066_3() { runTest("possible static imports bug - 3");}
+  public void testITDCtor_pr112783()          { runTest("Problem with constructor ITDs");}
+  public void testCantCallSuperMethods_pr90143() { runTest("cant call super methods");}
   public void testBrokenDecp_pr112476()       { runTest("binary weaving decp broken");}
   public void testUnboundFormal_pr112027()    { runTest("unexpected error unboundFormalInPC");}
   public void testNPEScopeSetup_pr115038()    { runTest("NPE in ensureScopeSetup");}
index 4dab46ce29c440d7cf0856e54334c15ccbac443e..b502511ee6df9feacad11134e448947821a81710 100644 (file)
     </ajc-test>
     
     
-    <ajc-test dir="bugs150/pr113066" title="possible static imports bug">
+    <ajc-test dir="bugs150/pr113066" title="possible static imports bug - 1">
         <compile files="Consts.java,TestNPE.java" options="-1.5"/>
     </ajc-test>
     
+    <ajc-test dir="bugs150/pr113066" title="possible static imports bug - 2">
+        <compile files="Consts2.java,TestNPE2.java" options="-1.5">
+          <message kind="error" line="2" text="The import a.Consts2.A_CONST cannot be resolved"/>
+        </compile>
+    </ajc-test>
+    
+    <ajc-test dir="bugs150/pr113066" title="possible static imports bug - 3">
+        <compile files="Consts3.java,TestNPE3.java" options="-1.5"/>
+    </ajc-test>
+    
     <ajc-test dir="java5/staticImports" title="import static java.lang.System.out">
         <compile files="StaticImport.aj" options="-1.5"/>
     </ajc-test>