Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*******************************************************************************
  2. * Copyright (c) 2008 Contributors
  3. * All rights reserved. This program and the accompanying materials
  4. * are made available under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution, and is available at
  6. * http://www.eclipse.org/legal/epl-v10.html
  7. *
  8. * Contributors:
  9. * Andy Clement - initial API and implementation
  10. *******************************************************************************/
  11. package org.aspectj.systemtest.ajc161;
  12. import java.io.File;
  13. import java.util.Iterator;
  14. import java.util.Set;
  15. import junit.framework.Test;
  16. import org.aspectj.apache.bcel.classfile.LocalVariable;
  17. import org.aspectj.apache.bcel.classfile.LocalVariableTable;
  18. import org.aspectj.asm.AsmManager;
  19. import org.aspectj.asm.IRelationshipMap;
  20. import org.aspectj.testing.XMLBasedAjcTestCase;
  21. public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
  22. // AspectJ1.6.1
  23. public void testSignatureProcessing_pr237447() { runTest("signature processing"); }
  24. public void testGenericAtAround_pr237419() { runTest("generics ataround"); }
  25. public void testGenericMarkerMatch_pr203367() { runTest("generic marker match"); }
  26. // public void testSuperItds_pr134425() { runTest("super itds"); }
  27. public void testSuperItds_pr198196_1() { runTest("super itds - 2"); }
  28. public void testSuperItds_pr198196_2() { runTest("super itds - 3"); }
  29. public void testSuperItds_pr198196_3() { runTest("super itds - 4"); }
  30. public void testDeow_pr237381_1() { runTest("ataspectj deow - 1"); }
  31. public void testDeow_pr237381_2() { runTest("ataspectj deow - 2"); }
  32. public void testRunningBrokenCode_pr102733_2() { runTest("running broken code - 2"); }
  33. public void testRunningBrokenCode_pr102733() { runTest("running broken code"); }
  34. public void testErrorOnNonabstractGenericAtAspectJAspect_pr168982() { runTest("error on non-abstract generic ataspectj aspect");}
  35. public void testIgnoringTypeLevelSuppression_pr234933() { runTest("ignoring type level suppress");}
  36. public void testDuplicateMethodSignature_pr223226_2() { runTest("duplicate method signature - 2"); }
  37. public void testDuplicateMethodSignature_pr223226() { runTest("duplicate method signature"); }
  38. public void testProtectedMethodsAroundAdvice_pr197719_2() { runTest("protected methods and around advice - again - 2");}
  39. public void testProtectedMethodsAroundAdvice_pr197719() { runTest("protected methods and around advice - again");}
  40. public void testProtectedMethodsAroundAdvice_pr230075() { runTest("protected methods and around advice");}
  41. public void testFinalStringsAnnotationPointcut_pr174385() { runTest("static strings in annotation pointcuts");}
  42. public void testComplexBoundsGenericAspect_pr199130_1() { runTest("complex bounds on generic aspect - 1");}
  43. public void testComplexBoundsGenericAspect_pr199130_2() { runTest("complex bounds on generic aspect - 2");}
  44. public void testComplexBoundsGenericAspect_pr199130_3() { runTest("complex bounds on generic aspect - 3");}
  45. public void testPrivilegedGenericAspect_pr235505() { runTest("privileged generic aspect");}
  46. public void testPrivilegedGenericAspect_pr235505_2() { runTest("privileged generic aspect - 2");}
  47. public void testParsingAroundNoReturn_pr64222() { runTest("parsing around advice no return");}
  48. public void testParsingBeforeArrayRef_pr159268() { runTest("before array name");}
  49. public void testGenericAspectAroundAdvice_pr226201() { runTest("generic aspect around advice");}
  50. public void testCrazyGenericsInnerTypes_pr235829() { runTest("crazy generics and inner types");}
  51. public void testAnnotationExposureGenerics_pr235597() { runTest("annotation exposure and generics");}
  52. public void testIncorrectRelationship_pr235204() {
  53. runTest("incorrect call relationship");
  54. IRelationshipMap irm = AsmManager.getDefault().getRelationshipMap();
  55. Set entries = irm.getEntries();
  56. boolean gotSomethingValid = false;
  57. String expected = "<recursivepackage{RecursiveCatcher.java}RecursiveCatcher~recursiveCall~I?method-call(void recursivepackage.RecursiveCatcher.recursiveCall(int))";
  58. for (Iterator iterator = entries.iterator(); iterator.hasNext();) {
  59. String str = (String) iterator.next();
  60. if (str.indexOf(expected)!=-1) gotSomethingValid = true;
  61. }
  62. if (!gotSomethingValid) {
  63. fail("Did not find a relationship with the expected data in '"+expected+"'");
  64. }
  65. }
  66. // public void testLVTableAround_pr173978() throws Exception {
  67. // runTest("lv table for around");
  68. // JavaClass jc = Utils.getClassFrom(ajc.getSandboxDirectory().getAbsolutePath(),"Test");
  69. // Method[] ms = jc.getMethods();
  70. // Method m = null;
  71. // for (int i = 0; i < ms.length; i++) {
  72. // if (ms[i].getName().equals("sayHello")) {
  73. // m = ms[i];
  74. // }
  75. // }
  76. // if (m.getLocalVariableTable()==null) fail("Local variable table should not be null");
  77. // print(m.getLocalVariableTable());
  78. // }
  79. private void print(LocalVariableTable localVariableTable) {
  80. LocalVariable[] lvs = localVariableTable.getLocalVariableTable();
  81. for (int i = 0; i < lvs.length; i++) {
  82. LocalVariable localVariable = lvs[i];
  83. System.out.println(localVariable);
  84. }
  85. }
  86. public void testITDPrecedence_pr233838_1() { runTest("itd precedence - 1"); }
  87. public void testITDPrecedence_pr233838_2() { runTest("itd precedence - 2"); }
  88. public void testGetFieldGenerics_pr227401() { runTest("getfield problem with generics");}
  89. public void testGenericAbstractAspects_pr231478() { runTest("generic abstract aspects"); }
  90. public void testFieldJoinpointsAndAnnotationValues_pr227993() { runTest("field jp anno value"); }
  91. public void testGenericsBoundsDecp_pr231187() { runTest("generics bounds decp"); }
  92. public void testGenericsBoundsDecp_pr231187_2() { runTest("generics bounds decp - 2"); }
  93. public void testLtwInheritedCflow_pr230134() { runTest("ltw inherited cflow"); }
  94. public void testAroundAdviceOnFieldSet_pr229910() { runTest("around advice on field set"); }
  95. public void testPipelineCompilationGenericReturnType_pr226567() { runTest("pipeline compilation and generic return type"); }
  96. public static Test suite() {
  97. return XMLBasedAjcTestCase.loadSuite(Ajc161Tests.class);
  98. }
  99. protected File getSpecFile() {
  100. return new File("../tests/src/org/aspectj/systemtest/ajc161/ajc161.xml");
  101. }
  102. }