+ add setter for servlet minor version to MockServletContext
This commit is contained in:
Costin Leau
2009-11-09 11:51:30 +00:00
parent 7ec9f1506a
commit 9a111e504f
3 changed files with 41 additions and 8 deletions

View File

@@ -30,7 +30,8 @@ import org.junit.Test;
*/
public class MockServletContextTests {
@Ignore // fails to work under ant after move from .testsuite -> .test
@Ignore
// fails to work under ant after move from .testsuite -> .test
@Test
public void testListFiles() {
MockServletContext sc = new MockServletContext("org/springframework/mock");
@@ -39,7 +40,8 @@ public class MockServletContextTests {
assertTrue(paths.contains("/web/MockServletContextTests.class"));
}
@Ignore // fails to work under ant after move from .testsuite -> .test
@Ignore
// fails to work under ant after move from .testsuite -> .test
@Test
public void testListSubdirectories() {
MockServletContext sc = new MockServletContext("org/springframework/mock");
@@ -79,4 +81,24 @@ public class MockServletContextTests {
assertEquals("image/gif", sc.getMimeType("test.gif"));
}
@Test
public void testMinorVersion() {
MockServletContext sc = new MockServletContext();
assertEquals(5, sc.getMinorVersion());
sc.setMinorVersion(4);
assertEquals(4, sc.getMinorVersion());
}
@Test
public void testIllegalMinorVersion() {
MockServletContext sc = new MockServletContext();
assertEquals(5, sc.getMinorVersion());
try {
sc.setMinorVersion(2);
fail("expected expection for illegal argument");
}
catch (IllegalArgumentException iae) {
// expected
}
}
}