()
| 30 | public 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() { |
nothing calls this directly
no test coverage detected