aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2016-03-29 10:01:01 -0700
committerAndy Clement <aclement@pivotal.io>2016-03-29 10:01:01 -0700
commit9eae797dd9c96826c7ab23f1ed9d3c26552c5c88 (patch)
tree88638bcdfa00f10d06cbf1a46d88ca247a5a89fc /tests
parentca093c254584afa382d073abe04144e968cdbccb (diff)
downloadaspectj-9eae797dd9c96826c7ab23f1ed9d3c26552c5c88.tar.gz
aspectj-9eae797dd9c96826c7ab23f1ed9d3c26552c5c88.zip
Fix 490315 - InvokeDynamic.java:126 there is no classname for invokedynamic
Diffstat (limited to 'tests')
-rwxr-xr-xtests/bugs1810/490315/FailingAspect.java27
-rwxr-xr-xtests/bugs1810/490315/SomeAnno.java4
-rwxr-xr-xtests/bugs1810/490315/SomeContext.java13
-rwxr-xr-xtests/bugs1810/490315/SomeCriteria.java7
-rwxr-xr-xtests/bugs1810/490315/SomeDTO.java10
-rwxr-xr-xtests/bugs1810/490315/SomeEnum.java5
-rwxr-xr-xtests/bugs1810/490315/SomePiece.java30
-rwxr-xr-xtests/bugs1810/490315/SomePropertyDTO.java17
-rwxr-xr-xtests/bugs1810/490315/SomeService.java8
-rwxr-xr-xtests/bugs1810/490315/SomeServiceImpl.java16
-rw-r--r--tests/src/org/aspectj/systemtest/AllTests18.java2
-rw-r--r--tests/src/org/aspectj/systemtest/ajc1810/Ajc1810Tests.java44
-rw-r--r--tests/src/org/aspectj/systemtest/ajc1810/AllTestsAspectJ1810.java25
-rw-r--r--tests/src/org/aspectj/systemtest/ajc1810/ajc1810.xml9
14 files changed, 217 insertions, 0 deletions
diff --git a/tests/bugs1810/490315/FailingAspect.java b/tests/bugs1810/490315/FailingAspect.java
new file mode 100755
index 000000000..4da191447
--- /dev/null
+++ b/tests/bugs1810/490315/FailingAspect.java
@@ -0,0 +1,27 @@
+package test;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+
+@Aspect
+public class FailingAspect {
+
+ SomeContext authenticationContext;
+
+ @SuppressWarnings("unchecked")
+ @Around("execution(* test..SomeServiceImpl.someMethod(test.SomeCriteria))" +
+ "&& @annotation(test.SomeAnno)")
+ public SomePiece<Collection<SomeDTO>> interceptSomeMethod(ProceedingJoinPoint pjp) throws Throwable {
+ SomePiece<Collection<SomeDTO>> piece = (SomePiece<Collection<SomeDTO>>) pjp.proceed();
+ List<SomeDTO> filteredResult = piece.getData().stream().filter(item ->
+ authenticationContext.getPermissionDetails().checkAccess(
+ item.getTag(), SomeEnum.R)).collect(Collectors.toList());
+ return new SomePiece<>(filteredResult, piece.isLast());
+ }
+
+}
diff --git a/tests/bugs1810/490315/SomeAnno.java b/tests/bugs1810/490315/SomeAnno.java
new file mode 100755
index 000000000..112d3be17
--- /dev/null
+++ b/tests/bugs1810/490315/SomeAnno.java
@@ -0,0 +1,4 @@
+package test;
+
+public @interface SomeAnno {
+}
diff --git a/tests/bugs1810/490315/SomeContext.java b/tests/bugs1810/490315/SomeContext.java
new file mode 100755
index 000000000..4eeb7a66a
--- /dev/null
+++ b/tests/bugs1810/490315/SomeContext.java
@@ -0,0 +1,13 @@
+package test;
+
+public class SomeContext
+{
+ public SomeContext getPermissionDetails()
+ {
+ return this;
+ }
+
+ public boolean checkAccess(String tag, SomeEnum accessType) {
+ return false;
+ }
+}
diff --git a/tests/bugs1810/490315/SomeCriteria.java b/tests/bugs1810/490315/SomeCriteria.java
new file mode 100755
index 000000000..0a0a90090
--- /dev/null
+++ b/tests/bugs1810/490315/SomeCriteria.java
@@ -0,0 +1,7 @@
+package test;
+
+/**
+ */
+public final class SomeCriteria {
+
+}
diff --git a/tests/bugs1810/490315/SomeDTO.java b/tests/bugs1810/490315/SomeDTO.java
new file mode 100755
index 000000000..d7bc67f30
--- /dev/null
+++ b/tests/bugs1810/490315/SomeDTO.java
@@ -0,0 +1,10 @@
+package test;
+
+import java.io.Serializable;
+
+public class SomeDTO implements Serializable {
+
+ public String getTag() {
+ return "tag";
+ }
+}
diff --git a/tests/bugs1810/490315/SomeEnum.java b/tests/bugs1810/490315/SomeEnum.java
new file mode 100755
index 000000000..1ec35b7b6
--- /dev/null
+++ b/tests/bugs1810/490315/SomeEnum.java
@@ -0,0 +1,5 @@
+package test;
+
+public enum SomeEnum {
+ R;
+}
diff --git a/tests/bugs1810/490315/SomePiece.java b/tests/bugs1810/490315/SomePiece.java
new file mode 100755
index 000000000..d12548b3d
--- /dev/null
+++ b/tests/bugs1810/490315/SomePiece.java
@@ -0,0 +1,30 @@
+package test;
+
+public class SomePiece<T> {
+
+ private T data;
+ private boolean last;
+ private Long totalCount;
+
+ public SomePiece(T data, boolean last) {
+ this.data = data;
+ this.last = last;
+ }
+
+ public T getData() {
+ return data;
+ }
+
+ public boolean isLast() {
+ return last;
+ }
+
+ public Long getTotalCount() {
+ return totalCount;
+ }
+
+ public void setTotalCount(Long totalCount) {
+ this.totalCount = totalCount;
+ }
+
+}
diff --git a/tests/bugs1810/490315/SomePropertyDTO.java b/tests/bugs1810/490315/SomePropertyDTO.java
new file mode 100755
index 000000000..0f2a835fc
--- /dev/null
+++ b/tests/bugs1810/490315/SomePropertyDTO.java
@@ -0,0 +1,17 @@
+package test;
+
+import java.io.Serializable;
+
+public class SomePropertyDTO implements Serializable, Comparable<SomePropertyDTO> {
+
+ /* (non-Javadoc)
+ * @see java.lang.Comparable#compareTo(java.lang.Object)
+ */
+ @Override
+ public int compareTo(SomePropertyDTO o)
+ {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+}
diff --git a/tests/bugs1810/490315/SomeService.java b/tests/bugs1810/490315/SomeService.java
new file mode 100755
index 000000000..b24dea2e9
--- /dev/null
+++ b/tests/bugs1810/490315/SomeService.java
@@ -0,0 +1,8 @@
+package test;
+
+import java.util.Collection;
+
+public interface SomeService {
+
+ SomePiece<Collection<SomeDTO>> someMethod(SomeCriteria criteria);
+} \ No newline at end of file
diff --git a/tests/bugs1810/490315/SomeServiceImpl.java b/tests/bugs1810/490315/SomeServiceImpl.java
new file mode 100755
index 000000000..98a9978ad
--- /dev/null
+++ b/tests/bugs1810/490315/SomeServiceImpl.java
@@ -0,0 +1,16 @@
+package test;
+
+import java.util.Collection;
+
+/**
+ */
+public class SomeServiceImpl implements SomeService {
+
+ @Override
+ @SomeAnno
+ public SomePiece<Collection<SomeDTO>> someMethod(SomeCriteria criteria) {
+ System.out.println("stuff");
+
+ return null;
+ }
+} \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/AllTests18.java b/tests/src/org/aspectj/systemtest/AllTests18.java
index a5382792b..2eadcb823 100644
--- a/tests/src/org/aspectj/systemtest/AllTests18.java
+++ b/tests/src/org/aspectj/systemtest/AllTests18.java
@@ -12,6 +12,7 @@ package org.aspectj.systemtest;
import org.aspectj.systemtest.ajc180.AllTestsAspectJ180;
import org.aspectj.systemtest.ajc181.AllTestsAspectJ181;
+import org.aspectj.systemtest.ajc1810.AllTestsAspectJ1810;
import org.aspectj.systemtest.ajc182.AllTestsAspectJ182;
import org.aspectj.systemtest.ajc183.AllTestsAspectJ183;
import org.aspectj.systemtest.ajc184.AllTestsAspectJ184;
@@ -29,6 +30,7 @@ public class AllTests18 {
public static Test suite() {
TestSuite suite = new TestSuite("AspectJ System Test Suite - 1.8");
// $JUnit-BEGIN$
+ suite.addTest(AllTestsAspectJ1810.suite());
suite.addTest(AllTestsAspectJ189.suite());
suite.addTest(AllTestsAspectJ188.suite());
suite.addTest(AllTestsAspectJ187.suite());
diff --git a/tests/src/org/aspectj/systemtest/ajc1810/Ajc1810Tests.java b/tests/src/org/aspectj/systemtest/ajc1810/Ajc1810Tests.java
new file mode 100644
index 000000000..2cdf148db
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/ajc1810/Ajc1810Tests.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc1810;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.aspectj.apache.bcel.classfile.JavaClass;
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+/**
+ * @author Andy Clement
+ */
+public class Ajc1810Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+
+ public void testInvokeDynamic_490315() {
+ runTest("indy");
+ }
+
+// public void testOverweaving_352389() throws Exception {
+// runTest("overweaving");
+// }
+
+ // ---
+
+ public static Test suite() {
+ return XMLBasedAjcTestCase.loadSuite(Ajc1810Tests.class);
+ }
+
+ @Override
+ protected File getSpecFile() {
+ return getClassResource("ajc1810.xml");
+ }
+
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc1810/AllTestsAspectJ1810.java b/tests/src/org/aspectj/systemtest/ajc1810/AllTestsAspectJ1810.java
new file mode 100644
index 000000000..b4fe6a8f3
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/ajc1810/AllTestsAspectJ1810.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc1810;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTestsAspectJ1810 {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("AspectJ 1.8.10 tests");
+ // $JUnit-BEGIN$
+ suite.addTest(Ajc1810Tests.suite());
+ // $JUnit-END$
+ return suite;
+ }
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc1810/ajc1810.xml b/tests/src/org/aspectj/systemtest/ajc1810/ajc1810.xml
new file mode 100644
index 000000000..be1c3d5f4
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/ajc1810/ajc1810.xml
@@ -0,0 +1,9 @@
+<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
+
+<suite>
+
+ <ajc-test dir="bugs1810/490315" title="indy">
+ <compile options="-1.8" files="FailingAspect.java SomeAnno.java SomeContext.java SomeCriteria.java SomeDTO.java SomeEnum.java SomePiece.java SomePropertyDTO.java SomeService.java SomeServiceImpl.java"/>
+ </ajc-test>
+
+</suite>