使用 JUnit 在 Eclipse IDE 中测试 @RooJavaBean 类
我使用 Spring Roo 生成 getter/setter。 当我更新正在测试的类,然后从 Eclipse IDE (STS) 运行 JUnit 测试时,它看不到我所做的更改。 例如:
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`
运行roo>执行测试
后,即使在 IDE 中,一切也运行良好。在项目设置中有 AspectJ 构建器。
如何在 IDE 中运行 @RooJavaBean 注解类的 JUnit 测试,而不调用 mvn test
或 roo>perform 测试
?
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
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您运行时,Roo shell 在 STS 中是否打开?为了根据目标类型的更改重新创建方面,Roo shell 必须在 IDE 中运行。如果它在命令行上运行(从 IDE 外部),STS 将不会意识到对方面进行了更改,并且不会在您的项目中拾取它。
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.