diff options
author | Andy Clement <aclement@pivotal.io> | 2018-05-25 12:51:25 -0700 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2018-05-25 12:51:25 -0700 |
commit | 8c6b3ae13b105ce9bb9559de0ee4752cab5ba81c (patch) | |
tree | 7a6df8724f94ed5b5ba4cb21c79fee6260330715 /tests/src | |
parent | a024df9675409344ecdf232d6ac3a283602323d5 (diff) | |
download | aspectj-8c6b3ae13b105ce9bb9559de0ee4752cab5ba81c.tar.gz aspectj-8c6b3ae13b105ce9bb9559de0ee4752cab5ba81c.zip |
testcode for 535086
Diffstat (limited to 'tests/src')
3 files changed, 150 insertions, 0 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc192/Ajc192Tests.java b/tests/src/org/aspectj/systemtest/ajc192/Ajc192Tests.java new file mode 100644 index 000000000..989d74b2d --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc192/Ajc192Tests.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2018 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.ajc192; + +import java.io.File; + +import org.aspectj.testing.XMLBasedAjcTestCase; + +import junit.framework.Test; + +/** + * @author Andy Clement + */ +public class Ajc192Tests extends XMLBasedAjcTestCase { + + public void testPTW_nonPrivileged() { + runTest("ptw"); + } + + public void testPTW_nonPrivilegedSamePackage() { + runTest("ptw - same package"); + } + + public void testPTW_privileged() { + runTest("ptw - privileged"); + } + + public void testPTWW_privilegedSamePackage() { + runTest("ptw - privileged same package"); + } + + // --- + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(Ajc192Tests.class); + } + + @Override + protected File getSpecFile() { + return getClassResource("ajc192.xml"); + } + +} diff --git a/tests/src/org/aspectj/systemtest/ajc192/AllTestsAspectJ192.java b/tests/src/org/aspectj/systemtest/ajc192/AllTestsAspectJ192.java new file mode 100644 index 000000000..396caafff --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc192/AllTestsAspectJ192.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2018 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.ajc192; + +import junit.framework.Test; +import junit.framework.TestSuite; + +public class AllTestsAspectJ192 { + + public static Test suite() { + TestSuite suite = new TestSuite("AspectJ 1.9.2 tests"); + // $JUnit-BEGIN$ + suite.addTest(Ajc192Tests.suite()); + // $JUnit-END$ + return suite; + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc192/ajc192.xml b/tests/src/org/aspectj/systemtest/ajc192/ajc192.xml new file mode 100644 index 000000000..13e0ae9c1 --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc192/ajc192.xml @@ -0,0 +1,74 @@ +<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> + +<suite> + + <ajc-test dir="bugs192/ptw" title="ptw"> + <compile files="a/b/c/Code.java a/b/d/Foo.java" options="-8"> + </compile> + <run class="a.b.c.Code"> + <stdout> + <line text="staticinitialization(a.b.c.Code.PublicInner.<clinit>) getWithinTypeName() = a.b.c.Code$PublicInner"/> + <line text="staticinitialization(a.b.c.Code.PublicInner.<clinit>) aspectOf(a.b.c.Code$PublicInner) = a.b.d.Foo"/> + <line text="PublicInner.run()"/> + <line text="DefaultInner.run()"/> + <line text="PrivateInner.run()"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs192/ptw" title="ptw - same package"> + <compile files="a/b/c/Code.java a/b/c/Foo.java" options="-8"> + </compile> + <run class="a.b.c.Code"> + <stdout> + <line text="staticinitialization(a.b.c.Code.PublicInner.<clinit>) getWithinTypeName() = a.b.c.Code$PublicInner"/> + <line text="staticinitialization(a.b.c.Code.PublicInner.<clinit>) aspectOf(a.b.c.Code$PublicInner) = a.b.c.Foo"/> + <line text="PublicInner.run()"/> + <line text="staticinitialization(a.b.c.Code.DefaultInner.<clinit>) getWithinTypeName() = a.b.c.Code$DefaultInner"/> + <line text="staticinitialization(a.b.c.Code.DefaultInner.<clinit>) aspectOf(a.b.c.Code$DefaultInner) = a.b.c.Foo"/> + <line text="DefaultInner.run()"/> + <line text="staticinitialization(a.b.c.Code.PrivateInner.<clinit>) getWithinTypeName() = a.b.c.Code$PrivateInner"/> + <line text="staticinitialization(a.b.c.Code.PrivateInner.<clinit>) aspectOf(a.b.c.Code$PrivateInner) = a.b.c.Foo"/> + <line text="PrivateInner.run()"/> + </stdout> + </run> + </ajc-test> + + + <ajc-test dir="bugs192/ptw" title="ptw - privileged"> + <compile files="a/b/c/Code.java a/b/d/FooPrivileged.java" options="-8"> + </compile> + <run class="a.b.c.Code"> + <stdout> + <line text="getWithinTypeName() = a.b.c.Code$PublicInner"/> + <line text="Aspect instance = a.b.d.Foo"/> + <line text="PublicInner.run()"/> + <line text="getWithinTypeName() = a.b.c.Code$DefaultInner"/> + <line text="Aspect instance = a.b.d.Foo"/> + <line text="DefaultInner.run()"/> + <line text="getWithinTypeName() = a.b.c.Code$PrivateInner"/> + <line text="Aspect instance = a.b.d.Foo"/> + <line text="PrivateInner.run()"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs192/ptw" title="ptw - privileged same package"> + <compile files="a/b/c/Code.java a/b/c/FooPrivileged.java" options="-8"> + </compile> + <run class="a.b.c.Code"> + <stdout> + <line text="staticinitialization(a.b.c.Code.PublicInner.<clinit>) getWithinTypeName() = a.b.c.Code$PublicInner"/> + <line text="staticinitialization(a.b.c.Code.PublicInner.<clinit>) aspectOf(a.b.c.Code$PublicInner) = a.b.c.Foo"/> + <line text="PublicInner.run()"/> + <line text="staticinitialization(a.b.c.Code.DefaultInner.<clinit>) getWithinTypeName() = a.b.c.Code$DefaultInner"/> + <line text="staticinitialization(a.b.c.Code.DefaultInner.<clinit>) aspectOf(a.b.c.Code$DefaultInner) = a.b.c.Foo"/> + <line text="DefaultInner.run()"/> + <line text="staticinitialization(a.b.c.Code.PrivateInner.<clinit>) getWithinTypeName() = a.b.c.Code$PrivateInner"/> + <line text="staticinitialization(a.b.c.Code.PrivateInner.<clinit>) aspectOf(a.b.c.Code$PrivateInner) = a.b.c.Foo"/> + <line text="PrivateInner.run()"/> + </stdout> + </run> + </ajc-test> + +</suite> |