1.JUnit整合Spring

1.1创建Maven工程并加入Spring依赖

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0

org.example

unitTest1

1.0-SNAPSHOT

UTF-8

5.2.9.RELEASE

org.springframework

spring-core

${spring.version}

org.springframework

spring-context

${spring.version}

junit

junit

4.12

test

1.2.加入spring的配置文件applicationContext.xml,并申明一个date的bean。

xmlns="http://www.springframework.org/schema/beans"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:p="http://www.springframework.org/schema/p"

xsi:sche

精彩链接

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: