選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

OverweavingTests.java 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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.ajc167;
  12. import java.io.File;
  13. import junit.framework.Test;
  14. import org.aspectj.testing.XMLBasedAjcTestCase;
  15. /**
  16. * Testing whether AspectJ can overweave. Overweaving is where we attempt to weave something that has already been woven. The simple
  17. * rule followed is that aspects that applied to the type before are not applied this time around (if they are visible to the
  18. * weaver).
  19. *
  20. * @author Andy Clement
  21. */
  22. public class OverweavingTests extends org.aspectj.testing.XMLBasedAjcTestCase {
  23. public void testGetSet1() {
  24. runTest("getset - 1"); // testing what should happen for get/set
  25. }
  26. public void testGetSet2() {
  27. runTest("getset - 2"); // testing what actually happens when overweaving
  28. }
  29. public void testGetSetTjp1() {
  30. runTest("getset - tjp - 1");
  31. }
  32. public void testCalls1() {
  33. runTest("calls - 1"); // testing what should happen for calls
  34. }
  35. public void testCalls2() {
  36. runTest("calls - 2"); // testing what actually happens when overweaving
  37. }
  38. public void testCallsTjp1() {
  39. runTest("calls - tjp - 1");
  40. }
  41. public void testComplex() {
  42. runTest("really messy");
  43. }
  44. public void testSimple() {
  45. runTest("simple");
  46. }
  47. /**
  48. * Now an aspect used on the original weave is mentioned in the aop.xml - we shouldn't apply it again!
  49. */
  50. public void testMessy() {
  51. runTest("messy");
  52. }
  53. /**
  54. * Testing a shadow munger created to support cflow
  55. */
  56. public void testCflow() {
  57. runTest("cflow");
  58. }
  59. // --
  60. public static Test suite() {
  61. return XMLBasedAjcTestCase.loadSuite(OverweavingTests.class);
  62. }
  63. protected java.net.URL getSpecFile() {
  64. return getClassResource("overweaving.xml");
  65. }
  66. }