Author: adietish
Date: 2011-06-03 16:36:04 -0400 (Fri, 03 Jun 2011)
New Revision: 31827
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTDeploymentWarUpdateXML.java
Log:
[JBIDE-9069] fixed testWarUpdateMockPublishMethodJBoss7: formerly only .deploy marker was
removed, now also .failed marker is always removed. I corrected the asserts in the test
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTDeploymentWarUpdateXML.java
===================================================================
---
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTDeploymentWarUpdateXML.java 2011-06-03
19:18:57 UTC (rev 31826)
+++
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTDeploymentWarUpdateXML.java 2011-06-03
20:36:04 UTC (rev 31827)
@@ -60,16 +60,24 @@
public void testWarUpdateMockPublishMethod() throws CoreException, IOException {
server = ServerRuntimeUtils.useMockPublishMethod(server);
- testMockPublishMethod(7,1,"newModule.war");
+ testMockPublishMethod(7,"newModule.war");
}
public void testWarUpdateMockPublishMethodJBoss7() throws CoreException, IOException {
server = ServerRuntimeUtils.createMockJBoss7Server();
server = ServerRuntimeUtils.useMockPublishMethod(server);
- testMockPublishMethod(8,1,"newModule.war" + DeploymentMarkerUtils.DEPLOYED);
+ /*
+ * removing module newModule.war will remove 2 markers:
+ * <ul>
+ * <li>newModule.war.deployed</li>
+ * <li>newModule.war.failed</li>
+ * </ul>
+ */
+ testMockPublishMethod(8,"newModule.war" +
DeploymentMarkerUtils.FAILED_DEPLOY,"newModule.war" +
DeploymentMarkerUtils.DEPLOYED);
}
- private void testMockPublishMethod(int initial, int remove, String removedFile) throws
CoreException, IOException {
+ private void testMockPublishMethod(int initial, String... filesToRemove) throws
CoreException, IOException {
+ // add
MockPublishMethod.reset();
IModule mod = ServerUtil.getModule(project);
server = ServerRuntimeUtils.addModule(server,mod);
@@ -77,10 +85,14 @@
assertEquals(initial, MockPublishMethod.getChanged().length);
MockPublishMethod.reset();
+ // remove
server = ServerRuntimeUtils.removeModule(server, mod);
ServerRuntimeUtils.publish(server);
- assertEquals(remove, MockPublishMethod.getRemoved().length);
- assertEquals(removedFile, MockPublishMethod.getRemoved()[0].toString());
+ assertEquals(filesToRemove.length, MockPublishMethod.getRemoved().length);
+ IPath[] removedFiles = MockPublishMethod.getRemoved();
+ for(int i = 0; i < removedFiles.length; i++) {
+ assertEquals(filesToRemove[i], removedFiles[i].toString());
+ }
MockPublishMethod.reset();
}
}
Show replies by date