123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309 |
- /*******************************************************************************
- * 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.ajc1612;
-
- import java.io.File;
-
- import junit.framework.Test;
-
- import org.aspectj.apache.bcel.classfile.JavaClass;
- import org.aspectj.apache.bcel.classfile.Method;
- import org.aspectj.testing.XMLBasedAjcTestCase;
-
- /**
- * @author Andy Clement
- */
- public class Ajc1612Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
-
- // public void testAnnoCopying_345515() {
- // runTest("anno copying");
- // }
-
- // public void testDoubleITDF() throws Exception {
- // runTest("double itdf");
- // }
-
- // public void testItdSplitCompilation_354683() throws Exception {
- // runTest("itd split compilation");
- // }
-
- public void testNotEqualWithAnnotationValues_357013() throws Exception {
- runTest("annotation values not equal");
- }
-
- public void testNotEqualWithAnnotationValues_357013_2() throws Exception {
- runTest("annotation values not equal 2");
- }
-
- public void testClassRef_357012() throws Exception {
- runTest("class reference in annotation value");
- }
-
- public void testClassRefInvalidName_357012_2() throws Exception {
- runTest("class reference in annotation value - invalid typename");
- }
-
- public void testClassRef_357012_3() throws Exception {
- runTest("class reference in annotation value 3");
- }
-
- public void testAnnotationFieldBindingOptimization_356612() throws Exception {
- runTest("annotation field binding optimization");
- }
-
- public void testAnnotationFieldBindingOptimization_356612_2() throws Exception {
- runTest("annotation field binding optimization - 2");
- }
-
- public void testThisAspectInstance_239649_1() throws Exception {
- // simple case
- runTest("thisAspectInstance - 1");
- }
-
- public void testThisAspectInstance_239649_2() throws Exception {
- // before advice toggling on/off through if called method
- runTest("thisAspectInstance - 2");
- }
-
- public void testThisAspectInstance_239649_3() throws Exception {
- // after advice toggling on/off through if called method
- runTest("thisAspectInstance - 3");
- }
-
- public void testThisAspectInstance_239649_4() throws Exception {
- // before advice, also using thisJoinPointStaticPart
- runTest("thisAspectInstance - 4");
- }
-
- public void testThisAspectInstance_239649_5() throws Exception {
- // before advice, also using thisJoinPoint
- runTest("thisAspectInstance - 5");
- }
-
- public void testThisAspectInstance_239649_6() throws Exception {
- // before advice, also using thisEnclosingJoinPointStaticPart
- runTest("thisAspectInstance - 6");
- }
-
- public void testThisAspectInstance_239649_7() throws Exception {
- // before advice, also using thisJoinPoint and thisJoinPointStaticPart
- runTest("thisAspectInstance - 7");
- }
-
- public void testThisAspectInstance_239649_8() throws Exception {
- // before advice, also using abstract aspects
- runTest("thisAspectInstance - 8");
- }
-
- public void testThisAspectInstance_239649_9() throws Exception {
- // before advice, also using abstract aspects 2
- runTest("thisAspectInstance - 9");
- }
-
- public void testThisAspectInstance_239649_10() throws Exception {
- // aspects in a package
- runTest("thisAspectInstance - 10");
- }
-
- public void testThisAspectInstance_239649_11() throws Exception {
- // non-singleton aspect - should be an error for now
- runTest("thisAspectInstance - 11");
- }
-
- public void testThisAspectInstance_239649_12() throws Exception {
- // arg binding and tjpsp
- runTest("thisAspectInstance - 12");
- }
-
- public void testThisAspectInstance_239649_13() throws Exception {
- // pass instance
- runTest("thisAspectInstance - 13");
- }
-
- public void testThisAspectInstance_239649_14() throws Exception {
- // multiple ifs
- runTest("thisAspectInstance - 14");
- }
-
- public void testThisAspectInstance_239649_15() throws Exception {
- // abstract aspects
- runTest("thisAspectInstance - 15");
- }
-
- // public void testVerifyPerthis() throws Exception {
- // runTest("verify perthis");
- // }
-
- public void testRangeForLocalVariables_353936() throws ClassNotFoundException {
- runTest("local variable tables");
- JavaClass jc = getClassFrom(ajc.getSandboxDirectory(), "X");
- Method[] meths = jc.getMethods();
- boolean checked = false;
- for (int i = 0; i < meths.length; i++) {
- Method method = meths[i];
- if (method.getName().equals("ajc$before$X$2$3444dde4")) {
- System.out.println(method.getName());
- System.out.println(stringify(method.getLocalVariableTable()));
- System.out.println(method.getCode().getLength());
- checked = true;
- assertEquals("LX; this(0) start=0 len=48", stringify(method.getLocalVariableTable(), 0));
- assertEquals("Lorg/aspectj/lang/JoinPoint; thisJoinPoint(1) start=0 len=48",
- stringify(method.getLocalVariableTable(), 1));
- assertEquals("I i(2) start=8 len=22", stringify(method.getLocalVariableTable(), 2));
- }
- }
- assertTrue(checked);
- }
-
- public void testEmptyPattern_pr352363() {
- runTest("empty pattern");
- }
-
- public void testGenericsIssue_pr351592() {
- runTest("generics issue");
- }
-
- public void testGenericsIssue_pr351592_2() {
- runTest("generics issue - 2");
- }
-
- public void testGenericsNpe_pr350800() {
- runTest("generics npe");
- }
-
- public void testGenericsNpe_pr350800_code() {
- runTest("generics npe - code");
- }
-
- public void testGenericsNpe_pr350800_3() {
- runTest("generics npe - 3");
- }
-
- public void testOrdering_pr349961() {
- runTest("ordering");
- }
-
- public void testOrdering_pr349961_2() {
- runTest("ordering - 2");
- }
-
- /*
- * public void testVerifyError_pr347395() { runTest("verifyerror - inline"); }
- */
-
- public void testDuplicateMethods_349398() {
- runTest("duplicate methods");
- }
-
- public void testBindingInts_347684() {
- runTest("binding ints");
- }
-
- public void testBindingInts_347684_2() {
- runTest("binding ints - 2");
- }
-
- public void testBindingInts_347684_3() {
- runTest("binding ints - 3");
- }
-
- public void testBindingInts_347684_4() {
- runTest("binding ints - 4");
- }
-
- public void testBindingInts_347684_5() {
- runTest("binding ints - 5");
- }
-
- public void testBindingInts_347684_6() {
- runTest("binding ints - 6");
- }
-
- public void testIncorrectAnnos_345172() {
- runTest("incorrect annos");
- }
-
- public void testIncorrectAnnos_345172_2() {
- runTest("incorrect annos 2");
- }
-
- public void testIncorrectAnnos_345172_3() {
- runTest("incorrect annos 3");
- }
-
- public void testSyntheticMethods_327867() {
- runTest("synthetic methods");
- }
-
- // public void testSignedJarLtw_328099() {
- // runTest("signed jar ltw");
- // }
-
- public void testVerifyError_315398() {
- runTest("verifyerror");
- }
-
- public void testVerifyError_315398_2() {
- runTest("verifyerror - 2");
- }
-
- public void testRawTypePointcut_327134() {
- runTest("rawtype pointcut");
- }
-
- public void testRawTypeWarning_335810() {
- runTest("rawtype warning");
- }
-
- // public void testDecpGenerics_344005() {
- // runTest("decp generics");
- // }
-
- public void testIllegalAccessError_343051() {
- runTest("illegalaccesserror");
- }
-
- public void testItitNpe_339974() {
- runTest("itit npe");
- }
-
- // public void testNoImportError_342605() {
- // runTest("noimporterror");
- // }
-
- public void testClashingLocalTypes_342323() {
- runTest("clashing local types");
- }
-
- public void testITIT_338175() {
- runTest("itit");
- }
-
- public void testThrowsClause_292239() {
- runTest("throws clause");
- }
-
- public void testThrowsClause_292239_2() {
- runTest("throws clause - 2");
- }
-
- // ---
-
- public static Test suite() {
- return XMLBasedAjcTestCase.loadSuite(Ajc1612Tests.class);
- }
-
- @Override
- protected File getSpecFile() {
- return new File("../tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml");
- }
-
- }
|