Browse Source

Regression test for #190

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
tags/V1_9_20
Alexander Kriegisch 1 year ago
parent
commit
4b46caabfc

+ 20
- 0
tests/bugs1919/github_190/SwitchCaseWith_Integer_MAX_VALUE.java View File

@@ -0,0 +1,20 @@
public class SwitchCaseWith_Integer_MAX_VALUE {
public static void main(String[] args) {
System.out.println(switchTest(Integer.MAX_VALUE));
}

static String switchTest(int i) {
switch (i) {
case Integer.MAX_VALUE:
return "CASE_1";
default:
return "";
}
}
}

aspect MyAspect {
before() : execution(* switchTest(*)) {
System.out.println(thisJoinPoint);
}
}

+ 3
- 0
tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java View File

@@ -19,6 +19,9 @@ public class Bugs1919Tests extends XMLBasedAjcTestCase {
runTest("declare annotation with SOURCE retention");
}

public void testsSwitchWith_Integer_MAX_VALUE() {
runTest("switch with Integer.MAX_VALUE case");
}
public static Test suite() {
return XMLBasedAjcTestCase.loadSuite(Bugs1919Tests.class);
}

+ 13
- 0
tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml View File

@@ -172,4 +172,17 @@
</compile>
</ajc-test>

<!-- RuntimeException in BcelWeaver, see https://github.com/eclipse/org.aspectj/issues/190 -->
<ajc-test dir="bugs1919/github_190" vm="1.5" title="switch with Integer.MAX_VALUE case">
<compile files="SwitchCaseWith_Integer_MAX_VALUE.java" options="-1.5 -showWeaveInfo">
<message kind="weave" text="Join point 'method-execution(java.lang.String SwitchCaseWith_Integer_MAX_VALUE.switchTest(int))'"/>
</compile>
<run class="SwitchCaseWith_Integer_MAX_VALUE">
<stdout>
<line text="execution(String SwitchCaseWith_Integer_MAX_VALUE.switchTest(int))"/>
<line text="CASE_1"/>
</stdout>
</run>
</ajc-test>

</suite>

Loading…
Cancel
Save