MCPcopy Create free account
hub / github.com/apache/tomcat / bug58086a

Method bug58086a

test/org/apache/catalina/ant/TestDeployTask.java:32–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30public class TestDeployTask extends TomcatBaseTest {
31
32 @Test
33 public void bug58086a() {
34 DeployTask deployTask = new DeployTask() {
35
36 @Override
37 public void execute(String command, InputStream istream, String contentType, long contentLength)
38 throws BuildException {
39 Assert.assertEquals("/deploy?path=somepath", command);
40 Assert.assertEquals("application/octet-stream", contentType);
41 try {
42 istream.close();
43 } catch (IOException ignore) {
44 // Ignore
45 }
46 }
47
48 };
49
50 setDefaults(deployTask);
51
52 testExecute(deployTask, "file:./test/deployment/context.war");
53 testExecute(deployTask, new File("test/deployment/context.war").toURI().toString());
54 testExecute(deployTask, new File("test/deployment/context.war").getAbsolutePath());
55 testExecute(deployTask, "jar:" + new File("test/deployment/context.jar").toURI().toString() + "!/context.war");
56 testExecute(deployTask, new File("test/deployment/dir with spaces/context.war").toURI().toString());
57 testExecute(deployTask, new File("test/deployment/dir with spaces/context.war").getAbsolutePath());
58 testExecute(deployTask,
59 "jar:" + new File("test/deployment/dir with spaces/context.jar").toURI().toString() + "!/context.war");
60 testExecute(deployTask, "file:./test/deployment/dir%20with%20spaces/context.war");
61 }
62
63 @Test(expected = BuildException.class)
64 public void bug58086b() {

Callers

nothing calls this directly

Calls 4

setDefaultsMethod · 0.95
testExecuteMethod · 0.95
toStringMethod · 0.65
getAbsolutePathMethod · 0.45

Tested by

no test coverage detected