内容简介:我正在尝试使用Maven在我的春季网络应用程序上运行一些单元测试.该应用程序安装并运行正常,它生成一个可部署的war文件,一切正常(全部使用Maven).我的测试类(位于src / test /java中):但是我收到了错误:
我正在尝试使用Maven在我的春季网络应用程序上运行一些单元测试.该应用程序安装并运行正常,它生成一个可部署的war文件,一切正常(全部使用Maven).
我的测试类(位于src / test /java中):
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"file:C:/myProjects/myWebapp/src/main/webapp/WEB-INF/applicationContext-test.xml"})
@Transactional
public class MyTest {
...
但是我收到了错误:
Configuration problem: spring-security-web classes are not available. You need these to use <filter-chain-map> Offending resource: URL [file:C:/myProjects/myWebapp/src/main/webapp/WEB-INF/applicationContext-test.xml]
运行Maven时>测试
我的pom依赖被定义为
<dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-web</artifactId> <version>3.0.5.RELEASE</version> </dependency>
哪个默认编译范围, which should be OK ?当我将范围更改为测试并提供时,它返回相同的错误.
我的.classpath看起来像这样:
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
如何正确设置我的应用程序上下文和测试?
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- 怎样才能成为资深架构师?
- 如何让别人发现自己的才能
- 如何才能快速入门python3?
- 漫谈核心能力(六):同心才能同理
- 中型公司如何才能克服DevOps挑战?
- 正确理解 memcached,才能更好的使用
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Beginning ASP.NET 4 in C# and Vb
Imar Spaanjaars / Wrox / 2010-3-19 / GBP 29.99
This book is for anyone who wants to learn how to build rich and interactive web sites that run on the Microsoft platform. With the knowledge you gain from this book, you create a great foundation to ......一起来看看 《Beginning ASP.NET 4 in C# and Vb》 这本书的介绍吧!