/** * Return whether the aspect needs to be lazily instantiated. */ public boolean isLazilyInstantiated() { return (isPerThisOrPerTarget() || isPerTypeWithin()); }
@Test public void testPerThisAspect() { AspectMetadata am = new AspectMetadata(PerThisAspect.class,"someBean"); assertTrue(am.isPerThisOrPerTarget()); assertNotSame(Pointcut.TRUE, am.getPerClausePointcut()); assertEquals(PerClauseKind.PERTHIS, am.getAjType().getPerClause().getKind()); } }
@Test public void testSingletonAspect() { AspectMetadata am = new AspectMetadata(ExceptionAspect.class,"someBean"); assertFalse(am.isPerThisOrPerTarget()); assertSame(Pointcut.TRUE, am.getPerClausePointcut()); assertEquals(PerClauseKind.SINGLETON, am.getAjType().getPerClause().getKind()); }
@Test public void testPerTargetAspect() { AspectMetadata am = new AspectMetadata(PerTargetAspect.class,"someBean"); assertTrue(am.isPerThisOrPerTarget()); assertNotSame(Pointcut.TRUE, am.getPerClausePointcut()); assertEquals(PerClauseKind.PERTARGET, am.getAjType().getPerClause().getKind()); }
/** * Return whether the aspect needs to be lazily instantiated. */ public boolean isLazilyInstantiated() { return (isPerThisOrPerTarget() || isPerTypeWithin()); }
/** * Return whether the aspect needs to be lazily instantiated. */ public boolean isLazilyInstantiated() { return (isPerThisOrPerTarget() || isPerTypeWithin()); }