解决方案 »

  1.   

    我是专门复制了一个配置文件专门供jUnit来runwith
    比较方便吧,可以达到目的就没有去找别的方法了~
      

  2.   

    就是这个配置文件是没有错的,但是我不知道怎么junit之前还好好的但是现在就只是打印出这两条信息,就不执行test方法。
    [2014-11-06 20:34:34 678 INFO ] context.support.DefaultTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]
    [2014-11-06 20:34:34 695 INFO ] context.support.DefaultTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@7904f4c8, org.springframework.test.context.support.DependencyInjectionTestExecutionListener@3462b48a, org.springframework.test.context.support.DirtiesContextTestExecutionListener@3c3aeae4, org.springframework.test.context.transaction.TransactionalTestExecutionListener@40133da0, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@2f32f43d]
      

  3.   

    路径错了,应是:
    "classpath:/spring/applicationContext.xml" 
      

  4.   

    没错啊,spring目录下只有rootcontext
      

  5.   

    我的问题解决了,原因,我的sring用的最新的4.X,后面我把junit升级到4.11然后重新用maven构建好久没问题了。