Permalink
Browse files

AS7-4062 - Fix CLITestSuite and DomainTestSuite failures on windows p…

…latform.
  • Loading branch information...
1 parent c1f21f5 commit 51abeffffe41b4df37ad0fb4a1f4f41aa83d0f1d @dpospisil committed Mar 6, 2012
@@ -81,7 +81,7 @@ public void addConcurrentGroups(Map<String, RolloutPolicy> concurrentGroups) {
public String buildAsString() {
ModelNode plan = build();
String planString = plan.toString();
- planString = planString.replace(System.getProperty("line.separator"), " ");
+ planString = planString.replace("\n", " ");
return planString;
}
@@ -22,6 +22,7 @@
package org.jboss.as.test.integration.domain.suites;
+import java.io.File;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ANY_ADDRESS;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.BOOT_TIME;
@@ -118,6 +119,8 @@
private static final ModelNode OTHER_RUNNING_SERVER_ADDRESS = new ModelNode();
private static final ModelNode OTHER_RUNNING_SERVER_PROP_ADDRESS = new ModelNode();
private static final ModelNode OTHER_RUNNING_SERVER_CLASSLOADING_ADDRESS = new ModelNode();
+
+ private static final String fileSeparator = System.getProperty("file.separator");
static {
ROOT_PROP_ADDRESS.add(SYSTEM_PROPERTY, TEST);
@@ -487,21 +490,21 @@ public void testDomainSnapshot() throws Exception {
ModelNode listResult = validateResponse(masterClient.execute(listSnapshotOperation));
Set<String> snapshots = new HashSet<String>();
for (ModelNode curr : listResult.get(NAMES).asList()) {
- snapshots.add(listResult.get(DIRECTORY).asString() + "/" + curr.asString());
+ snapshots.add(listResult.get(DIRECTORY).asString() + fileSeparator + curr.asString());
}
Assert.assertTrue(snapshots.contains(snapshot));
ModelNode deleteSnapshotOperation = new ModelNode();
deleteSnapshotOperation.get(OP).set(SnapshotDeleteHandler.OPERATION_NAME);
deleteSnapshotOperation.get(OP_ADDR).setEmptyList();
- deleteSnapshotOperation.get(NAME).set(snapshot.substring(snapshot.lastIndexOf("/") + 1));
+ deleteSnapshotOperation.get(NAME).set(snapshot.substring(snapshot.lastIndexOf(fileSeparator) + fileSeparator.length()));
validateResponse(masterClient.execute(deleteSnapshotOperation), false);
listResult = validateResponse(masterClient.execute(listSnapshotOperation));
snapshots = new HashSet<String>();
for (ModelNode curr : listResult.get(NAMES).asList()) {
- snapshots.add(listResult.get(DIRECTORY).asString() + "/" + curr.asString());
+ snapshots.add(listResult.get(DIRECTORY).asString() + fileSeparator + curr.asString());
}
Assert.assertFalse(snapshots.contains(snapshot));
@@ -838,21 +841,21 @@ private void testSnapshot(ModelNode addr) throws Exception {
ModelNode listResult = validateResponse(masterClient.execute(listSnapshotOperation));
Set<String> snapshots = new HashSet<String>();
for (ModelNode curr : listResult.get(NAMES).asList()) {
- snapshots.add(listResult.get(DIRECTORY).asString() + "/" + curr.asString());
+ snapshots.add(listResult.get(DIRECTORY).asString() + fileSeparator + curr.asString());
}
Assert.assertTrue(snapshots.contains(snapshot));
ModelNode deleteSnapshotOperation = new ModelNode();
deleteSnapshotOperation.get(OP).set(SnapshotDeleteHandler.OPERATION_NAME);
deleteSnapshotOperation.get(OP_ADDR).set(addr);
- deleteSnapshotOperation.get(NAME).set(snapshot.substring(snapshot.lastIndexOf("/") + 1));
+ deleteSnapshotOperation.get(NAME).set(snapshot.substring(snapshot.lastIndexOf(fileSeparator) + fileSeparator.length()));
validateResponse(masterClient.execute(deleteSnapshotOperation));
listResult = validateResponse(masterClient.execute(listSnapshotOperation));
snapshots = new HashSet<String>();
for (ModelNode curr : listResult.get(NAMES).asList()) {
- snapshots.add(listResult.get(DIRECTORY).asString() + "/" + curr.asString());
+ snapshots.add(listResult.get(DIRECTORY).asString() + fileSeparator + curr.asString());
}
Assert.assertFalse(snapshots.contains(snapshot));

0 comments on commit 51abeff

Please sign in to comment.