123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- /*******************************************************************************
- * 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.ajc161;
-
- import java.io.File;
- import java.util.Iterator;
- import java.util.Set;
-
- import junit.framework.Test;
-
- import org.aspectj.apache.bcel.classfile.LocalVariable;
- import org.aspectj.apache.bcel.classfile.LocalVariableTable;
- import org.aspectj.asm.AsmManager;
- import org.aspectj.asm.IRelationshipMap;
- import org.aspectj.testing.XMLBasedAjcTestCase;
-
- public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
-
- // AspectJ1.6.1
- public void testSignatureProcessing_pr237447() { runTest("signature processing"); }
- public void testGenericAtAround_pr237419() { runTest("generics ataround"); }
- public void testGenericMarkerMatch_pr203367() { runTest("generic marker match"); }
- // public void testSuperItds_pr134425() { runTest("super itds"); }
- public void testSuperItds_pr198196_1() { runTest("super itds - 2"); }
- public void testSuperItds_pr198196_2() { runTest("super itds - 3"); }
- public void testSuperItds_pr198196_3() { runTest("super itds - 4"); }
- public void testDeow_pr237381_1() { runTest("ataspectj deow - 1"); }
- public void testDeow_pr237381_2() { runTest("ataspectj deow - 2"); }
- public void testRunningBrokenCode_pr102733_2() { runTest("running broken code - 2"); }
- public void testRunningBrokenCode_pr102733() { runTest("running broken code"); }
- public void testErrorOnNonabstractGenericAtAspectJAspect_pr168982() { runTest("error on non-abstract generic ataspectj aspect");}
- public void testIgnoringTypeLevelSuppression_pr234933() { runTest("ignoring type level suppress");}
- public void testDuplicateMethodSignature_pr223226_2() { runTest("duplicate method signature - 2"); }
- public void testDuplicateMethodSignature_pr223226() { runTest("duplicate method signature"); }
- public void testProtectedMethodsAroundAdvice_pr197719_2() { runTest("protected methods and around advice - again - 2");}
- public void testProtectedMethodsAroundAdvice_pr197719() { runTest("protected methods and around advice - again");}
- public void testProtectedMethodsAroundAdvice_pr230075() { runTest("protected methods and around advice");}
- public void testFinalStringsAnnotationPointcut_pr174385() { runTest("static strings in annotation pointcuts");}
- public void testComplexBoundsGenericAspect_pr199130_1() { runTest("complex bounds on generic aspect - 1");}
- public void testComplexBoundsGenericAspect_pr199130_2() { runTest("complex bounds on generic aspect - 2");}
- public void testComplexBoundsGenericAspect_pr199130_3() { runTest("complex bounds on generic aspect - 3");}
- public void testPrivilegedGenericAspect_pr235505() { runTest("privileged generic aspect");}
- public void testPrivilegedGenericAspect_pr235505_2() { runTest("privileged generic aspect - 2");}
- public void testParsingAroundNoReturn_pr64222() { runTest("parsing around advice no return");}
- public void testParsingBeforeArrayRef_pr159268() { runTest("before array name");}
- public void testGenericAspectAroundAdvice_pr226201() { runTest("generic aspect around advice");}
- public void testCrazyGenericsInnerTypes_pr235829() { runTest("crazy generics and inner types");}
- public void testAnnotationExposureGenerics_pr235597() { runTest("annotation exposure and generics");}
- public void testIncorrectRelationship_pr235204() {
- runTest("incorrect call relationship");
- IRelationshipMap irm = AsmManager.getDefault().getRelationshipMap();
- Set entries = irm.getEntries();
- boolean gotSomethingValid = false;
- String expected = "<recursivepackage{RecursiveCatcher.java}RecursiveCatcher~recursiveCall~I?method-call(void recursivepackage.RecursiveCatcher.recursiveCall(int))";
- for (Iterator iterator = entries.iterator(); iterator.hasNext();) {
- String str = (String) iterator.next();
- if (str.indexOf(expected)!=-1) gotSomethingValid = true;
- }
- if (!gotSomethingValid) {
- fail("Did not find a relationship with the expected data in '"+expected+"'");
- }
- }
-
- // public void testLVTableAround_pr173978() throws Exception {
- // runTest("lv table for around");
- // JavaClass jc = Utils.getClassFrom(ajc.getSandboxDirectory().getAbsolutePath(),"Test");
- // Method[] ms = jc.getMethods();
- // Method m = null;
- // for (int i = 0; i < ms.length; i++) {
- // if (ms[i].getName().equals("sayHello")) {
- // m = ms[i];
- // }
- // }
- // if (m.getLocalVariableTable()==null) fail("Local variable table should not be null");
- // print(m.getLocalVariableTable());
- // }
-
- private void print(LocalVariableTable localVariableTable) {
- LocalVariable[] lvs = localVariableTable.getLocalVariableTable();
- for (int i = 0; i < lvs.length; i++) {
- LocalVariable localVariable = lvs[i];
- System.out.println(localVariable);
- }
- }
- public void testITDPrecedence_pr233838_1() { runTest("itd precedence - 1"); }
- public void testITDPrecedence_pr233838_2() { runTest("itd precedence - 2"); }
- public void testGetFieldGenerics_pr227401() { runTest("getfield problem with generics");}
- public void testGenericAbstractAspects_pr231478() { runTest("generic abstract aspects"); }
- public void testFieldJoinpointsAndAnnotationValues_pr227993() { runTest("field jp anno value"); }
- public void testGenericsBoundsDecp_pr231187() { runTest("generics bounds decp"); }
- public void testGenericsBoundsDecp_pr231187_2() { runTest("generics bounds decp - 2"); }
- public void testLtwInheritedCflow_pr230134() { runTest("ltw inherited cflow"); }
- public void testAroundAdviceOnFieldSet_pr229910() { runTest("around advice on field set"); }
- public void testPipelineCompilationGenericReturnType_pr226567() { runTest("pipeline compilation and generic return type"); }
-
- public static Test suite() {
- return XMLBasedAjcTestCase.loadSuite(Ajc161Tests.class);
- }
-
- protected File getSpecFile() {
- return new File("../tests/src/org/aspectj/systemtest/ajc161/ajc161.xml");
- }
-
- }
|