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

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