]> source.dussan.org Git - aspectj.git/commitdiff
test for 144465
authoraclement <aclement>
Tue, 30 May 2006 16:09:31 +0000 (16:09 +0000)
committeraclement <aclement>
Tue, 30 May 2006 16:09:31 +0000 (16:09 +0000)
tests/bugs152/pr144465/AnAspect.java [new file with mode: 0644]
tests/bugs152/pr144465/BigHorribleClass.java [new file with mode: 0644]
tests/bugs152/pr144465/aop1.xml [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java
tests/src/org/aspectj/systemtest/ajc152/ajc152.xml

diff --git a/tests/bugs152/pr144465/AnAspect.java b/tests/bugs152/pr144465/AnAspect.java
new file mode 100644 (file)
index 0000000..eff8137
--- /dev/null
@@ -0,0 +1,5 @@
+aspect AnAspect {
+       before(): staticinitialization(BigHorribleClass) {
+               
+       }
+}
\ No newline at end of file
diff --git a/tests/bugs152/pr144465/BigHorribleClass.java b/tests/bugs152/pr144465/BigHorribleClass.java
new file mode 100644 (file)
index 0000000..7668307
--- /dev/null
@@ -0,0 +1,28 @@
+import java.io.Serializable;
+import java.lang.reflect.Field;
+
+public class BigHorribleClass implements Serializable,Comparable {
+  public static void main(String[] args) {
+         try {
+                 BigHorribleClass b = (BigHorribleClass)BigHorribleClass.class.newInstance();
+             Field f = BigHorribleClass.class.getDeclaredField("serialVersionUID");
+             long l = f.getLong(b);
+             System.err.println("SerialVersionUID is "+l);
+         } catch (Exception e) {
+             System.err.println("Problem: "+e.toString());
+         }
+  }
+  
+  public int anInt;
+  
+  public static boolean aBoolean = false;
+  
+  public long foo = 376;
+  
+  public void m() {}
+  public int compareTo(Object o) { return 0;}
+  public String m2(boolean b,long l, String s) { return "";}
+  
+  public static transient short fo2 = 3;
+  
+}
\ No newline at end of file
diff --git a/tests/bugs152/pr144465/aop1.xml b/tests/bugs152/pr144465/aop1.xml
new file mode 100644 (file)
index 0000000..d429edb
--- /dev/null
@@ -0,0 +1,8 @@
+<aspectj>
+        <aspects>
+                <aspect name="AnAspect"/>
+        </aspects>
+
+        <weaver options="-showWeaveInfo -XaddSerialVersionUID">
+        </weaver>
+</aspectj>
index 67cb7c1db4f92c0e78d8d71ad70232867d0be637..7cb98a6ef92715cc4329960e7e82ef29e19c09de 100644 (file)
@@ -24,6 +24,7 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 
 public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 
+  public void testLTWAndGeneratingSUID_pr144465() { runTest("ltw with serialversionUID creation"); }
   public void testAspects14PerSingleton_pr122253() { runTest("aspects14 - persingleton");}
   public void testAspects14PerCflow_pr122253() { runTest("aspects14 - percflow");}
   public void testAspects14PerThis_pr122253() { runTest("aspects14 - perthis");}
index 5741576b1558de12979a60c04ea2b4278c3a9efc..03bbb19d6464cd71fc65e2f15440ef9669ab0a7f 100644 (file)
       </compile>
     </ajc-test>
     
+    <ajc-test dir="bugs152/pr144465" title="ltw with serialversionUID creation">
+      <compile files="BigHorribleClass.java"/>
+      <compile files="AnAspect.java"/>
+      <run class="BigHorribleClass" ltw="aop1.xml">
+        <stderr>
+          <line text="weaveinfo Join point 'staticinitialization(void BigHorribleClass.&lt;clinit&gt;())'"/>
+          <line text="SerialVersionUID is "/>
+        </stderr>
+      </run>
+    </ajc-test>
+    
     <ajc-test dir="bugs152/pr125480" title="aop.xml aspect inheriting abstract method ">
         <compile files="HelloWorld.java"/>
         <compile files="AbstractMethods.aj, ConcreteMethods.aj" options="-1.5"/>