本文介绍了使用JUnit在Eclipse IDE中测试@RooJavaBean类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Spring Roo生成getter/setter.当我更新要测试的类,然后从Eclipse IDE(STS)运行JUnit测试时,看不到我所做的更改.例如:

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`

运行roo>perform tests后,即使在IDE中,一切都可以正常运行.在项目设置中,有 AspectJ构建器.

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

如何在IDE中运行 @RooJavaBean 注释类的JUnit测试,而无需调用mvn testroo>perform tests?

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

推荐答案

在运行时,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.

这篇关于使用JUnit在Eclipse IDE中测试@RooJavaBean类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-09 21:50