Testing @RooJavaBean class in Eclipse IDE with JUn

2019-08-02 07:58发布

I use Spring Roo to generate getters/setters. When I update my class under test and then run JUnit tests from Eclipse IDE (STS), it does't see changes I have made. For example:

java.lang.NoSuchMethodError: com.example.web.forms.UserRegistrationForm_Roo_JavaBean.ajc$interMethodDispatch1$com_datefitting_web_forms_UserRegistrationForm_Roo_JavaBean$com_example_web_forms_UserRegistrationForm$setName(Lcom/datefitting/web/forms/UserRegistrationForm;Ljava/lang/String;)V`

After running roo>perform tests everything runs fine even in IDE. In project settings there is AspectJ builder.

How to run JUnit tests of @RooJavaBean annotated class in IDE, without invoking mvn test or roo>perform tests?

1条回答
甜甜的少女心
2楼-- · 2019-08-02 08:35

Is the Roo shell open in STS while you are running? In order for your aspects to be recreated based on changes to the target types, the Roo shell must be running in the IDE. If it is running on the command line (from outside the IDE), STS will not be made aware that changes have been made to aspects and it will not be picked up in your project.

查看更多
登录 后发表回答