aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2006-08-07 13:04:28 +0000
committeraclement <aclement>2006-08-07 13:04:28 +0000
commitc779c96eff482f8b99fe5d7f85505f1792780281 (patch)
tree05dcb30d67255d81ef51a0e87996cbfff162f5f2 /tests
parent73368931c7c7b346b062321c83a55c86ecd41ffd (diff)
downloadaspectj-c779c96eff482f8b99fe5d7f85505f1792780281.tar.gz
aspectj-c779c96eff482f8b99fe5d7f85505f1792780281.zip
fix for 152871: parsing bytecode too often
Diffstat (limited to 'tests')
-rw-r--r--tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java12
-rw-r--r--tests/src/org/aspectj/systemtest/ajc153/ajc153.xml13
2 files changed, 23 insertions, 2 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
index bca2c1443..e2e1e2582 100644
--- a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
@@ -16,6 +16,7 @@ import junit.framework.Test;
import org.aspectj.testing.Utils;
import org.aspectj.testing.XMLBasedAjcTestCase;
+import org.aspectj.weaver.bcel.Utility;
public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
@@ -47,9 +48,16 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public void testCantFindType_pr149322_01() {runTest("can't find type on interface call 1");}
public void testCantFindType_pr149322_02() {runTest("can't find type on interface call 2");}
public void testCantFindType_pr149322_03() {runTest("can't find type on interface call 3");}
-
+ public void testParsingBytecodeLess_pr152871() {
+ Utility.testingParseCounter=0;
+ runTest("parsing bytecode less");
+ assertTrue("Should have called parse 5 times, not "+Utility.testingParseCounter+" times",Utility.testingParseCounter==5);
+ // 5 means:
+ // (1)=registerAspect
+ // (2,3)=checkingIfShouldWeave,AcceptingResult for class
+ // (4,5)=checkingIfShouldWeave,AcceptingResult for aspect
+ }
public void testMatchVolatileField_pr150671() {runTest("match volatile field");};
-
public void testDuplicateJVMTIAgents_pr151938() {runTest("Duplicate JVMTI agents");};
/////////////////////////////////////////
diff --git a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
index d0e994614..5b221f8d9 100644
--- a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
+++ b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
@@ -3,6 +3,19 @@
<!-- AspectJ v1.5.3 Tests -->
<suite>
+ <ajc-test dir="bugs153/pr152871" title="parsing bytecode less">
+ <compile files="MyClass.java" options="-1.5"/>
+ <compile files="MyAspect.java" options="-1.5 -Xlint:ignore"/>
+ <run class="a.MyClass" ltw="aop.xml">
+ <stdout>
+ <line text="advice running"/>
+ <line text="hello"/>
+ <line text="advice running"/>
+ <line text="world"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
<ajc-test dir="bugs153/pr148381" title="argNames and javac">
<!--compile files="C.java" options="-1.5"/>
<compile files="A.java" options="-1.5"/-->