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.

AfterReturningWeaveTestCase.java 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* *******************************************************************
  2. * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/epl-v10.html
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.weaver.bcel;
  13. import java.io.IOException;
  14. import org.aspectj.weaver.ShadowMunger;
  15. public class AfterReturningWeaveTestCase extends WeaveTestCase {
  16. {
  17. regenerate = false;
  18. }
  19. public AfterReturningWeaveTestCase(String name) {
  20. super(name);
  21. }
  22. public void testAfterReturning() throws IOException {
  23. weaveTest(
  24. getStandardTargets(),
  25. "AfterReturning",
  26. makeAdviceAll("afterReturning"));
  27. }
  28. public void testAfterReturningParam() throws IOException {
  29. weaveTest(
  30. getStandardTargets(),
  31. "AfterReturningParam",
  32. makeAdviceField("afterReturning", "java.lang.Object"));
  33. }
  34. public void testAfterReturningCheckcastParam() throws IOException {
  35. weaveTest(
  36. getStandardTargets(),
  37. "AfterReturningCheckcastParam",
  38. makeAdviceField("afterReturning", "java.rmi.server.LogStream"));
  39. }
  40. public void testAfterReturningConversionParam() throws IOException {
  41. String mungerString =
  42. "afterReturning(): call(int *.*(..)) -> "
  43. + "static void Aspect.ajc_afterReturning_field_get(java.lang.Object)";
  44. ShadowMunger cm = makeConcreteAdvice(mungerString, 1);
  45. weaveTest("FancyHelloWorld", "AfterReturningConversionParam", cm);
  46. }
  47. }