Eclipse에서 유닛 테스트를 실행하려고 할 때 "java.lang.IllegalStateExcepton : 어플리케이션 컨텍스트로드 실패"오류가 발생합니다. .스프링 웹 서비스 유닛 테스트 : java.lang.IllegalStateExcepton : 어플리케이션 컨텍스트를로드하지 못했습니다.
package com.mycompany.interactive.cs.isales.ispr.ws.productupgrade;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"/applicationContext.xml"})
public class ProductUpgradeTest {
@Test
public void getProductUpgrade() throws Exception
{
//System.out.println(PrintClasspath.getClasspathAsString());
Assert.assertTrue(true);
}
}
을하지만, 아무리 내가 @ContextConfiguration
와 함께 할 것 내가 여전히 같은 오류를 얻을 :
단위 시험 자체는 매우 간단 보인다.
applicationContext.xml 파일은/etc/ws 폴더에 있지만, 같은 폴더에 복사본을 넣어도 오류가 발생합니다.
저는 Java, Spring, Eclipse 및 Ant에 매우 익숙하며, 이것이 어디에서 잘못 될지 정말로 알지 못합니다.