简体   繁体   English

SpringJUnit4ClassRunner测试-通过ant而不是IDE进行工作

[英]SpringJUnit4ClassRunner tests — work from ant, not from IDE

I have some tests that load up some Spring context files. 我有一些测试可以加载一些Spring上下文文件。 When I run the tests from my ant target they work as expected. 当我从蚂蚁目标运行测试时,它们将按预期工作。 When I run them from IntelliJ I get a NotWritablePropertyException. 当我从IntelliJ运行它们时,我收到一个NotWritablePropertyException。 I initially figured different classpaths, but the only differences are for IntelliJ's test runner. 我最初想出了不同的类路径,但是唯一的区别是IntelliJ的测试运行程序。

Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'sessionAcknowledgeMode' of bean class [org.springframework.jms.listener.DefaultMessageListenerContainer]: Bean property 'sessionAcknowledgeMode' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
    at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:801)
    at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:651)
    at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)
    at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1276)
    ... 42 more

It is possible you have some classpath issues. 您可能有一些类路径问题。 Idea may load resource files in a different way from command line ant call. Idea可能以与命令行ant调用不同的方式加载资源文件。

The classpaths were not the same. 类路径不同。 Sorry folks. 抱歉

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SpringJUnit4ClassRunner在Jar中打包后无法工作,但可以在IDE中工作 - SpringJUnit4ClassRunner not working after packaging in Jar but works in IDE 在Eclipse 4.3中使用@ContextConfiguration和SpringJUnit4ClassRunner进行的春季测试似乎很慢 - Spring tests with @ContextConfiguration and SpringJUnit4ClassRunner in Eclipse 4.3 seem slow 如何在单元测试中使用自定义Spring范围(SpringJUnit4ClassRunner) - How to use custom Spring scope with unit tests (SpringJUnit4ClassRunner) 为什么SpringJUnit4ClassRunner不能与surefire parallel =方法一起使用? - Why does SpringJUnit4ClassRunner not work with surefire parallel=methods? 找不到 SpringJUnit4ClassRunner 类 - SpringJUnit4ClassRunner class not found 在SpringJUnit4ClassRunner中使用spring @Conditional - spring @Conditional in SpringJUnit4ClassRunner 使用SpringJUnit4ClassRunner自定义BeanFactory? - Customize BeanFactory with SpringJUnit4ClassRunner? 使用SpringJUnit4ClassRunner的Junit TestSuite - Junit TestSuite with SpringJUnit4ClassRunner SpringJunit4ClassRunner的类路径在哪里,以及如何直接指向我的OS中的文件? - Where is classpath from SpringJunit4ClassRunner, and how to point to file in my OS straightly? JUnit,Spring(SpringJUnit4ClassRunner)和Spring接线不能正常工作(尝试从Eclipse和命令行Maven运行)? - JUnit, Spring (SpringJUnit4ClassRunner) and Spring wiring is not working properly (tried running from Eclipse and command line Maven)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM