Moved tests over from testsuite to core

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@178 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Arjen Poutsma 2008-10-29 11:54:19 +00:00
parent 6f70ce5e18
commit 5e92b61edb
26 changed files with 8 additions and 6 deletions

View File

@ -30,6 +30,7 @@
<dependency org="org.objectweb.asm" name="com.springsource.org.objectweb.asm" rev="2.2.3" conf="optional->compile" />
<dependency org="org.objectweb.asm" name="com.springsource.org.objectweb.asm.commons" rev="2.2.3" conf="optional->compile" />
<!-- test dependencies -->
<dependency org="javax.servlet" name="com.springsource.javax.servlet" rev="2.4.0" conf="test->compile"/>
<dependency org="org.junit" name="com.springsource.org.junit" rev="4.4.0" conf="test->runtime" />
</dependencies>

View File

@ -22,6 +22,7 @@ import java.io.PrintWriter;
import javax.servlet.ServletException;
import junit.framework.TestCase;
import junit.framework.Assert;
/**
* @author Rod Johnson
@ -51,7 +52,7 @@ public class NestedExceptionTests extends TestCase {
ServletException rootCause = new ServletException(rootCauseMesg);
// Making a class abstract doesn't _really_ prevent instantiation :-)
NestedRuntimeException nex = new NestedRuntimeException(myMessage, rootCause) {};
assertEquals(nex.getCause(), rootCause);
Assert.assertEquals(nex.getCause(), rootCause);
assertTrue(nex.getMessage().indexOf(myMessage) != -1);
assertTrue(nex.getMessage().indexOf(rootCauseMesg) != -1);
@ -87,7 +88,7 @@ public class NestedExceptionTests extends TestCase {
ServletException rootCause = new ServletException(rootCauseMesg);
// Making a class abstract doesn't _really_ prevent instantiation :-)
NestedCheckedException nex = new NestedCheckedException(myMessage, rootCause) {};
assertEquals(nex.getCause(), rootCause);
Assert.assertEquals(nex.getCause(), rootCause);
assertTrue(nex.getMessage().indexOf(myMessage) != -1);
assertTrue(nex.getMessage().indexOf(rootCauseMesg) != -1);

View File

@ -34,7 +34,7 @@ public class Log4jConfigurerTests extends TestCase {
}
public void testInitLoggingWithRelativeFilePath() throws FileNotFoundException {
doTestInitLogging("test/org/springframework/util/testlog4j.properties", false);
doTestInitLogging("src/test/resources/org/springframework/util/testlog4j.properties", false);
}
public void testInitLoggingWithAbsoluteFilePath() throws FileNotFoundException {
@ -47,7 +47,7 @@ public class Log4jConfigurerTests extends TestCase {
}
public void testInitLoggingWithRelativeFilePathAndRefreshInterval() throws FileNotFoundException {
doTestInitLogging("test/org/springframework/util/testlog4j.properties", true);
doTestInitLogging("src/test/resources/org/springframework/util/testlog4j.properties", true);
}
/* only works on Windows

View File

@ -22,7 +22,7 @@ import javax.servlet.ServletException;
import junit.framework.TestCase;
import org.springframework.beans.FatalBeanException;
import org.springframework.core.task.TaskRejectedException;
/**
* @author Rod Johnson
@ -36,7 +36,7 @@ public final class ObjectUtilsTests extends TestCase {
assertTrue(ObjectUtils.isCheckedException(new ServletException()));
assertFalse(ObjectUtils.isCheckedException(new RuntimeException()));
assertFalse(ObjectUtils.isCheckedException(new FatalBeanException("")));
assertFalse(ObjectUtils.isCheckedException(new TaskRejectedException("")));
// Any Throwable other than RuntimeException and Error
// has to be considered checked according to the JLS.