You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AtAroundTests.java 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*******************************************************************************
  2. * Copyright (c) 2006 IBM Corporation and others.
  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 implementation
  10. *******************************************************************************/
  11. package org.aspectj.systemtest.ajc151;
  12. import org.aspectj.testing.XMLBasedAjcTestCase;
  13. import junit.framework.Test;
  14. /**
  15. * This testcode shows what is possible with code style and the current limitations
  16. * of @AJ style. Each program is written in both styles and those variations
  17. * not currently possible are commented out.
  18. *
  19. * @author AndyClement
  20. *
  21. */
  22. public class AtAroundTests extends XMLBasedAjcTestCase {
  23. public void testCodeBasic() { runTest("code style - basic"); }
  24. public void testAtBasicNoInline() { runTest("annotation style - basic - noinline"); }
  25. public void testAtBasic() { runTest("annotation style - basic"); }
  26. public void testCodeBindingTarget() { runTest("code style - correct usage, binding and passing same target for call"); }
  27. public void testAtBindingTargetNoInline() { runTest("annotation style - correct usage, binding and passing same target for call - noinline"); }
  28. public void testAtBindingTarget() { runTest("annotation style - correct usage, binding and passing same target for call"); }
  29. public void testCodeBindingTarget2() { runTest("code style - correct usage, binding and passing new target for call"); }
  30. public void testAtBindingTargetNoInline2() { runTest("annotation style - correct usage, binding and passing new target for call - noinline"); }
  31. public void testAtBindingTarget2() { runTest("annotation style - correct usage, binding and passing new target for call"); }
  32. public void testCodeErrorCase1() { runTest("code style - forget to pass target");}
  33. // Don't think we can report correct errors for @AJ as the parameters are specified as an object array
  34. //public void testAtErrorCase1() { runTest("annotation style - forget to pass target");}
  35. public void testCodeBindThisCallChangeProceed() { runTest("code style - bind this on call - change on proceed - no effect");}
  36. public void testAtBindThisCallChangeProceedNoInline() { runTest("annotation style - bind this on call - change on proceed - no effect - noinline");}
  37. public void testAtBindThisCallChangeProceed() { runTest("annotation style - bind this on call - change on proceed - no effect");}
  38. public void testCodeBindThisExecutionChangeProceed() { runTest("code style - bind this on execution - change on proceed - works");}
  39. public void testAtBindThisExecutionChangeProceedNoInline() { runTest("annotation style - bind this on execution - change on proceed - works - noinline");}
  40. public void testAtBindThisExecutionChangeProceed() { runTest("annotation style - bind this on execution - change on proceed - works");}
  41. public void testCodeBindBothExecutionChangeProceed() { runTest("code style - bind this and target on execution - change on proceed - works");}
  42. public void testAtBindBothExecutionChangeProceedNoInline() { runTest("annotation style - bind this and target on execution - change on proceed - works - noinline");}
  43. public void testAtBindBothExecutionChangeProceed() { runTest("annotation style - bind this and target on execution - change on proceed - works");}
  44. public void testCodeErrorCase2() { runTest("code style - incorrect arg types");}
  45. // Don't think we can report correct errors for @AJ as the parameters are specified as an object array
  46. // public void testAtErrorCase2() { runTest("annotation style - incorrect arg types");}
  47. public void testCodeChangingTargetDifferingOrder() { runTest("code style - changing target for call - reverse order"); }
  48. // @AJ cant cope with the changing of the order of arguments bound and passed through proceed
  49. //public void testAtChangingTargetDifferingOrder() { runTest("annotation style - changing target for call - reverse order"); }
  50. public void testCodeBindBothCallChangeProceed() { runTest("code style - bind this and target on call - change on proceed - works");}
  51. public void testAtBindBothCallChangeProceedNoInline() { runTest("annotation style - bind this and target on call - change on proceed - works - noinline");}
  52. public void testAtBindBothCallChangeProceed() { runTest("annotation style - bind this and target on call - change on proceed - works");}
  53. public void testBreakingIt1() { runTest("breaking it - one");}
  54. public void testBreakingIt2() { runTest("breaking it - two");}
  55. public void testBugCase1() { runTest("bug case one");}
  56. public void testBugCase2() { runTest("bug case two");}
  57. public void testMultipleArgs() { runTest("multiple args");}
  58. public void testCodeSubsetArguments() { runTest("code style - works with subset of arguments in advice");}
  59. // cant do this for annotation style
  60. //public void testAtSubsetArguments() { runTest("annotation style - works with subset of arguments in advice");}
  61. // ---
  62. public static Test suite() {
  63. return XMLBasedAjcTestCase.loadSuite(AtAroundTests.class);
  64. }
  65. protected java.net.URL getSpecFile() {
  66. return getClassResource("ataround.xml");
  67. }
  68. }