Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Error in advising test class being executed via JUnit test suite

Dear Frank and Andy,

Thank you for your replies.

Advised test method via JUnit test suite is working fine with both of CTW and LTW now.
It turned out to my careless mistake as Andy pointed out.
My sincere apology for having bothered you by this noise.

Warm regards,
Art
 


On Wed, Oct 23, 2013 at 7:03 AM, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
> java.lang.NoSuchMethodError: com.newmainsoftech.jecommerce.dao.TestCentral$DumpTestExceptionAspect.
aspectOf()Lcom/newmainsoftech/jecommerce/dao/TestCentral$DumpTestExceptionAspect;
>    at com.newmainsoftech.jecommerce.dao.impl.AbstractCategoryFacadeImplTest.test_create(AbstractCategoryFacadeImplTest.java:137)

Is that an annotation style or code style aspect? If it is an annotation style you must make sure it is included in the ltw configuration (weaver include section) in addition to the target types you want to weave because the weaver needs to 'finish it off' (i.e. add aspectOf()/hasAspect()). The error here is what would happen if the aspect was not correctly processed by the weaver.

Andy


On 12 October 2013 03:07, Frank Pavageau <frank.pavageau@xxxxxxxxx> wrote:

Hi.

This happens with the HotSpot JVM from JDK 7 when it uses its new stack verifier. You can disable it with the -XX:-UseSplitVerifier JVM parameter.

Frank

Le 12 oct. 2013 00:36, "Arata Yamamoto" <artymt@xxxxxxxxx> a écrit :
Dear group,

I would like to ask whether someone knows the work around for the error by advising test class being executed via JUnit test suite.
With crosscutting the invocation of method in JUnit test class, I encounter the following types of exception for running test via JUnit test suite (using @SuiteClasses annotation):
VerifyError with CTW:
  • java.lang.VerifyError: Expecting a stackmap frame at branch target 501 in method com.newmainsoftech.jecommerce.dao.impl.AbstractCategoryFacadeImplTest.test_create_via_cascade()V at offset 3
     at java.lang.Class.getDeclaredMethods0(Native Method)
     at java.lang.Class.privateGetDeclaredMethods(Class.java:2451)
     at java.lang.Class.getMethod0(Class.java:2694)
     at java.lang.Class.getMethod(Class.java:1622)
     at org.junit.internal.builders.SuiteMethodBuilder.hasSuiteMethod(SuiteMethodBuilder.java:18)
     at org.junit.internal.builders.SuiteMethodBuilder.runnerForClass(SuiteMethodBuilder.java:10)
  • java.lang.VerifyError: (class: com/newmainsoftech/jecommerce/dao/impl/AbstractCategoryFacadeImplTest, method: test_create signature: ()V) Unable to pop operand off an empty stack
     at java.lang.Class.getDeclaredMethods0(Native Method)
     at java.lang.Class.privateGetDeclaredMethods(Class.java:2451)
     at java.lang.Class.getMethod0(Class.java:2694)
     at java.lang.Class.getMethod(Class.java:1622)
     at org.junit.internal.builders.SuiteMethodBuilder.hasSuiteMethod(SuiteMethodBuilder.java:18)
     at org.junit.internal.builders.SuiteMethodBuilder.runnerForClass(SuiteMethodBuilder.java:10)
     at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)


NoSuchMethodError with LTW:

test_create(com.newmainsoftech.jecommerce.dao.impl.AbstractCategoryFacadeImplTest)  Time elapsed: 0.156 sec  <<< ERROR!
java.lang.NoSuchMethodError: com.newmainsoftech.jecommerce.dao.TestCentral$DumpTestExceptionAspect.aspectOf()Lcom/newmainsoftech/jecommerce/dao/TestCentral$DumpTestExceptionAspect;
    at com.newmainsoftech.jecommerce.dao.impl.AbstractCategoryFacadeImplTest.test_create(AbstractCategoryFacadeImplTest.java:137)

The above such exceptions are not hit when the same unit test is executed individually not via test suite.
I would like to know of the way of working around such errors even test is executed via test suite.

Regards,
Art




_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top