I get the error "java.lang.IllegalStateExcepton: Could not load application context" when I try to run my unit test from Eclipse.
The unit test itself seems very simple:
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
{
Assert.assertTrue(true);
}
}
But no matter what I do with @ContextConfiguration, I still get the same error.
The applicationContext.xml file is located in the / etc / ws folder, but even if I put the copy in the same folder, it still gives me errors.
I am very new to Java, Spring, Eclipse, and Ant, and really don't know where this is going.
source
share