aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/org/aspectj
diff options
context:
space:
mode:
authorAndy Clement <aclement@vmware.com>2012-03-19 11:57:01 -0700
committerAndy Clement <aclement@vmware.com>2012-03-19 11:57:01 -0700
commit80de31e4da0415134aac8ab2fc492de58fb6bd03 (patch)
tree885a90619888110594fe93dbbc3bc4ccf07843d0 /tests/src/org/aspectj
parent42035aea54234894721cca2858035002c7bfa9c7 (diff)
downloadaspectj-80de31e4da0415134aac8ab2fc492de58fb6bd03.tar.gz
aspectj-80de31e4da0415134aac8ab2fc492de58fb6bd03.zip
invokedynamic support in bcel
Diffstat (limited to 'tests/src/org/aspectj')
-rw-r--r--tests/src/org/aspectj/systemtest/ajc170/IndyTests.java51
-rw-r--r--tests/src/org/aspectj/systemtest/ajc170/indy.xml28
2 files changed, 79 insertions, 0 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc170/IndyTests.java b/tests/src/org/aspectj/systemtest/ajc170/IndyTests.java
new file mode 100644
index 000000000..24503ce1b
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/ajc170/IndyTests.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.ajc170;
+
+import java.io.File;
+import java.io.IOException;
+
+import junit.framework.Test;
+
+import org.aspectj.apache.bcel.classfile.ClassParser;
+import org.aspectj.apache.bcel.classfile.Field;
+import org.aspectj.apache.bcel.classfile.JavaClass;
+import org.aspectj.testing.XMLBasedAjcTestCase;
+import org.aspectj.weaver.TypeFactory;
+import org.aspectj.weaver.UnresolvedType;
+
+/**
+ * @author Andy Clement
+ */
+public class IndyTests extends org.aspectj.testing.XMLBasedAjcTestCase {
+
+ // staticinitialization on bytecode containing methodtyperef/methodhandle/bootstrapmethods/invokedynamic
+ public void testInvokeDynamic_staticinitialization() throws IOException {
+ runTest("indy - 1");
+ }
+
+ // execution pointcuts on same bytecode
+ public void testInvokeDynamic_execution() throws IOException {
+ runTest("indy - 2");
+ }
+
+ // ---
+
+ public static Test suite() {
+ return XMLBasedAjcTestCase.loadSuite(IndyTests.class);
+ }
+
+ @Override
+ protected File getSpecFile() {
+ return new File("../tests/src/org/aspectj/systemtest/ajc170/indy.xml");
+ }
+
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc170/indy.xml b/tests/src/org/aspectj/systemtest/ajc170/indy.xml
new file mode 100644
index 000000000..0e1b85a12
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/ajc170/indy.xml
@@ -0,0 +1,28 @@
+<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
+
+<suite>
+
+ <ajc-test dir="indy/one" title="indy - 1">
+ <compile files="Code1.java,Asp.java" inpath="indy.jar" options="-1.7"/>
+ <run class="Invoker">
+ <stdout>
+ <line text="staticinitialization(Invoker.&lt;clinit&gt;)"/>
+ <line text="staticinitialization(Code1.&lt;clinit&gt;)"/>
+ <line text="foo() is running"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="indy/two" title="indy - 2">
+ <compile files="Code1.java,Asp.java" inpath="indy.jar" options="-1.7"/>
+ <run class="Invoker">
+ <stdout>
+ <line text="execution(void Invoker.main(String[]))"/>
+ <line text="execution(CallSite Code1.bootstrap(MethodHandles.Lookup, String, MethodType))"/>
+ <line text="execution(void Code1.foo())"/>
+ <line text="foo() is running"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+</suite>