Skip to content

Instantly share code, notes, and snippets.

@loddar
Last active August 29, 2015 14:06
Show Gist options
  • Save loddar/e4b760b92b4c353f516e to your computer and use it in GitHub Desktop.
Save loddar/e4b760b92b4c353f516e to your computer and use it in GitHub Desktop.
ajUnit - Final Step 6 (Override method execute()).
/**
* ajUnit - Final Step 6 (Override method execute()).
*
* NOW you're done! No more "ajUnit - Setup Error: ..."! You can start developing your aspect - sorry I mean your pointcut :-)
*
* You got an test failure (not an setup error):
*
* java.lang.AssertionError: ajUnit - Pointcut test failed with 2 error(s).
*
* Details:
*
* - No join points selected. Possible reasons:
* * Method assertPointcut(JoinPointSelector) uses notYetSpecified().
* * You defined a join point selector which has a impossible condition.
*
* - Missing none selected join points. Possible reason:
* * Your ajUnit universe is too small. For example: Add a new method which should not selected by your pointcut definition.
* at org.junit.Assert.fail(Assert.java:88)
* at org.failearly.ajunit.AjUnit4Test.doFail(AjUnit4Test.java:42)
* (...)
*/
public class MyAjUnit6Test extends AjUnit4Test {
@Override
public void setup(AjUnitSetup ajUnitSetup) {
ajUnitSetup.assignAspect("com.company.project.aspects.MyAspect");
ajUnitSetup.addTestFixtureClass(com.company.project.aspects.testfixture.MyTestFixture.class);
}
@Override
public void execute() throws Exception {
// TODO: Do your callings on your test fixture class(es).
}
@Override
public void assertPointcut(JoinPointSelector joinPointSelector) {
// TODO: Replace notYetSpecified with your join point selectors.
joinPointSelector.notYetSpecified();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment