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.

AtAjMisuseTests.java 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*******************************************************************************
  2. * Copyright (c) 2005 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. * Alexandre Vasseur initial implementation
  10. *******************************************************************************/
  11. package org.aspectj.systemtest.ajc150.ataspectj;
  12. import org.aspectj.testing.XMLBasedAjcTestCase;
  13. import junit.framework.Test;
  14. /**
  15. * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
  16. */
  17. public class AtAjMisuseTests extends XMLBasedAjcTestCase {
  18. protected java.net.URL getSpecFile() {
  19. return getClassResource("misuse.xml");
  20. }
  21. public static Test suite() {
  22. return XMLBasedAjcTestCase.loadSuite(AtAjMisuseTests.class);
  23. }
  24. public void testQAspectClassExtendingQAspectClass() {
  25. runTest("@Aspect class extending @Aspect class");
  26. }
  27. // TODO asc commented out for now until Alex manages to get ajdtcore up to date...
  28. // public void testClassWithQBeforeExtendingQAspectClass() {
  29. // runTest("class with @Before extending @Aspect class");
  30. // }
  31. public void testQPointcutNotReturningVoid() {
  32. runTest("@Pointcut not returning void");
  33. }
  34. public void testQPointcutWithGarbageString() {
  35. runTest("@Pointcut with garbage string");
  36. }
  37. public void testQPointcutWithThrowsClause() {
  38. runTest("@Pointcut with throws clause");
  39. }
  40. public void testQAfterReturningWithWrongNumberOfArgs() {
  41. runTest("@AfterReturning with wrong number of args");
  42. }
  43. public void testQBeforeOnNon_publicMethod() {
  44. runTest("@Before on non-public method");
  45. }
  46. public void testQBeforeOnMethodNotReturningVoid() {
  47. runTest("@Before on method not returning void");
  48. }
  49. public void testQBeforeWithPJP() {
  50. runTest("@Before with PJP");
  51. }
  52. }