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:
parent
6f70ce5e18
commit
5e92b61edb
|
|
@ -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" 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" />
|
<dependency org="org.objectweb.asm" name="com.springsource.org.objectweb.asm.commons" rev="2.2.3" conf="optional->compile" />
|
||||||
<!-- test dependencies -->
|
<!-- 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" />
|
<dependency org="org.junit" name="com.springsource.org.junit" rev="4.4.0" conf="test->runtime" />
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ import java.io.PrintWriter;
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
||||||
|
import junit.framework.Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Rod Johnson
|
* @author Rod Johnson
|
||||||
|
|
@ -51,7 +52,7 @@ public class NestedExceptionTests extends TestCase {
|
||||||
ServletException rootCause = new ServletException(rootCauseMesg);
|
ServletException rootCause = new ServletException(rootCauseMesg);
|
||||||
// Making a class abstract doesn't _really_ prevent instantiation :-)
|
// Making a class abstract doesn't _really_ prevent instantiation :-)
|
||||||
NestedRuntimeException nex = new NestedRuntimeException(myMessage, rootCause) {};
|
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(myMessage) != -1);
|
||||||
assertTrue(nex.getMessage().indexOf(rootCauseMesg) != -1);
|
assertTrue(nex.getMessage().indexOf(rootCauseMesg) != -1);
|
||||||
|
|
||||||
|
|
@ -87,7 +88,7 @@ public class NestedExceptionTests extends TestCase {
|
||||||
ServletException rootCause = new ServletException(rootCauseMesg);
|
ServletException rootCause = new ServletException(rootCauseMesg);
|
||||||
// Making a class abstract doesn't _really_ prevent instantiation :-)
|
// Making a class abstract doesn't _really_ prevent instantiation :-)
|
||||||
NestedCheckedException nex = new NestedCheckedException(myMessage, rootCause) {};
|
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(myMessage) != -1);
|
||||||
assertTrue(nex.getMessage().indexOf(rootCauseMesg) != -1);
|
assertTrue(nex.getMessage().indexOf(rootCauseMesg) != -1);
|
||||||
|
|
||||||
|
|
@ -34,7 +34,7 @@ public class Log4jConfigurerTests extends TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testInitLoggingWithRelativeFilePath() throws FileNotFoundException {
|
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 {
|
public void testInitLoggingWithAbsoluteFilePath() throws FileNotFoundException {
|
||||||
|
|
@ -47,7 +47,7 @@ public class Log4jConfigurerTests extends TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testInitLoggingWithRelativeFilePathAndRefreshInterval() throws FileNotFoundException {
|
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
|
/* only works on Windows
|
||||||
|
|
@ -22,7 +22,7 @@ import javax.servlet.ServletException;
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
import org.springframework.beans.FatalBeanException;
|
import org.springframework.core.task.TaskRejectedException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Rod Johnson
|
* @author Rod Johnson
|
||||||
|
|
@ -36,7 +36,7 @@ public final class ObjectUtilsTests extends TestCase {
|
||||||
assertTrue(ObjectUtils.isCheckedException(new ServletException()));
|
assertTrue(ObjectUtils.isCheckedException(new ServletException()));
|
||||||
|
|
||||||
assertFalse(ObjectUtils.isCheckedException(new RuntimeException()));
|
assertFalse(ObjectUtils.isCheckedException(new RuntimeException()));
|
||||||
assertFalse(ObjectUtils.isCheckedException(new FatalBeanException("")));
|
assertFalse(ObjectUtils.isCheckedException(new TaskRejectedException("")));
|
||||||
|
|
||||||
// Any Throwable other than RuntimeException and Error
|
// Any Throwable other than RuntimeException and Error
|
||||||
// has to be considered checked according to the JLS.
|
// has to be considered checked according to the JLS.
|
||||||
Loading…
Reference in New Issue