Testing @RooJavaBean class in Eclipse IDE with JUnit

六月ゝ 毕业季﹏ 提交于 2019-12-11 07:16:29

问题


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:


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.



来源:https://stackoverflow.com/questions/4985466/testing-roojavabean-class-in-eclipse-ide-with-junit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!