You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2016/02/02 21:21:23 UTC
[16/44] incubator-geode git commit: Refactor dunit
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java
index f2da967..def0b2f 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java
@@ -47,11 +47,13 @@ import com.gemstone.gemfire.management.internal.cli.result.CommandResult;
import com.gemstone.gemfire.management.internal.cli.shell.Gfsh;
import com.gemstone.gemfire.management.internal.cli.util.CommandStringBuilder;
import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
import org.junit.Test;
@@ -199,7 +201,7 @@ public class DiskStoreCommandsDUnitTest extends CliCommandTestBase {
return "Waiting for another persistent member to come online";
}
};
- waitForCriterion(waitCriterion, 70000, 100, true);
+ Wait.waitForCriterion(waitCriterion, 70000, 100, true);
}
});
@@ -370,16 +372,16 @@ public class DiskStoreCommandsDUnitTest extends CliCommandTestBase {
}
});
String command = "validate offline-disk-store --name=" + diskStoreName1 + " --disk-dirs=" + diskStoreDir.getAbsolutePath();
- getLogWriter().info("testValidateDiskStore command: " + command);
+ LogWriterSupport.getLogWriter().info("testValidateDiskStore command: " + command);
CommandResult cmdResult = executeCommand(command);
if (cmdResult != null) {
String stringResult = commandResultToString(cmdResult);
- getLogWriter().info("testValidateDiskStore cmdResult is stringResult " + stringResult);
+ LogWriterSupport.getLogWriter().info("testValidateDiskStore cmdResult is stringResult " + stringResult);
assertEquals(Result.Status.OK, cmdResult.getStatus());
assertTrue(stringResult.contains("Total number of region entries in this disk store is"));
} else {
- getLogWriter().info("testValidateDiskStore cmdResult is null");
+ LogWriterSupport.getLogWriter().info("testValidateDiskStore cmdResult is null");
fail("Did not get CommandResult in testValidateDiskStore");
}
}
@@ -424,7 +426,7 @@ public class DiskStoreCommandsDUnitTest extends CliCommandTestBase {
}
});
String command = "export offline-disk-store --name=" + diskStoreName1 + " --disk-dirs=" + diskStoreDir.getAbsolutePath() + " --dir=" + exportDir;
- getLogWriter().info("testExportDiskStore command" + command);
+ LogWriterSupport.getLogWriter().info("testExportDiskStore command" + command);
CommandResult cmdResult = executeCommand(command);
if (cmdResult != null) {
assertEquals(Result.Status.OK, cmdResult.getStatus());
@@ -433,7 +435,7 @@ public class DiskStoreCommandsDUnitTest extends CliCommandTestBase {
SnapshotTestUtil.checkSnapshotEntries(exportDir, entries, diskStoreName1, region2);
} else {
- getLogWriter().info("testExportOfflineDiskStore cmdResult is null");
+ LogWriterSupport.getLogWriter().info("testExportOfflineDiskStore cmdResult is null");
fail("Did not get CommandResult in testExportOfflineDiskStore");
}
}
@@ -463,7 +465,7 @@ public class DiskStoreCommandsDUnitTest extends CliCommandTestBase {
final InternalLocator locator = (InternalLocator) Locator.startLocatorAndDS(locatorPort, locatorLogFile, null,
locatorProps);
- DistributedTestCase.WaitCriterion wc = new DistributedTestCase.WaitCriterion() {
+ WaitCriterion wc = new WaitCriterion() {
@Override
public boolean done() {
return locator.isSharedConfigurationRunning();
@@ -474,7 +476,7 @@ public class DiskStoreCommandsDUnitTest extends CliCommandTestBase {
return "Waiting for shared configuration to be started";
}
};
- DistributedTestCase.waitForCriterion(wc, 5000, 500, true);
+ Wait.waitForCriterion(wc, 5000, 500, true);
} catch (IOException ioex) {
fail("Unable to create a locator with a shared configuration");
}
@@ -665,7 +667,7 @@ public class DiskStoreCommandsDUnitTest extends CliCommandTestBase {
CommandResult cmdResult = executeCommand(commandString);
String resultString = commandResultToString(cmdResult);
- getLogWriter().info("#SB command output : \n" + resultString);
+ LogWriterSupport.getLogWriter().info("#SB command output : \n" + resultString);
assertEquals(true, Result.Status.OK.equals(cmdResult.getStatus()));
assertEquals(true, resultString.contains("concurrencyLevel=5"));
assertEquals(true, resultString.contains("lruAction=local-destroy"));
@@ -696,7 +698,7 @@ public class DiskStoreCommandsDUnitTest extends CliCommandTestBase {
cmdResult = executeCommand(commandString);
resultString = commandResultToString(cmdResult);
- getLogWriter().info("command output : \n" + resultString);
+ LogWriterSupport.getLogWriter().info("command output : \n" + resultString);
assertEquals(true, Result.Status.OK.equals(cmdResult.getStatus()));
Object postDestroyValue = vm1.invoke(new SerializableCallable() {
@@ -723,7 +725,7 @@ public class DiskStoreCommandsDUnitTest extends CliCommandTestBase {
cmdResult = executeCommand(commandString);
resultString = commandResultToString(cmdResult);
- getLogWriter().info("Alter DiskStore with wrong remove option : \n" + resultString);
+ LogWriterSupport.getLogWriter().info("Alter DiskStore with wrong remove option : \n" + resultString);
assertEquals(true, Result.Status.ERROR.equals(cmdResult.getStatus()));
filesToBeDeleted.add(diskDirName);
@@ -790,7 +792,7 @@ public class DiskStoreCommandsDUnitTest extends CliCommandTestBase {
CommandResult cmdResult = executeCommand(commandString);
String resultAsString = commandResultToString(cmdResult);
- getLogWriter().info("Result from full backup : \n" + resultAsString);
+ LogWriterSupport.getLogWriter().info("Result from full backup : \n" + resultAsString);
assertEquals(Result.Status.OK, cmdResult.getStatus());
assertEquals(true, resultAsString.contains("Manager"));
assertEquals(true, resultAsString.contains(vm1Name));
@@ -820,7 +822,7 @@ public class DiskStoreCommandsDUnitTest extends CliCommandTestBase {
cmdResult = executeCommand(csb.toString());
resultAsString = commandResultToString(cmdResult);
- getLogWriter().info("Result from incremental backup : \n" + resultAsString);
+ LogWriterSupport.getLogWriter().info("Result from incremental backup : \n" + resultAsString);
assertEquals(Result.Status.OK, cmdResult.getStatus());
assertEquals(true, resultAsString.contains("Manager"));
@@ -1147,7 +1149,7 @@ public class DiskStoreCommandsDUnitTest extends CliCommandTestBase {
try {
FileUtil.delete(new File(path));
} catch (IOException e) {
- getLogWriter().error("Unable to delete file", e);
+ LogWriterSupport.getLogWriter().error("Unable to delete file", e);
}
}
this.filesToBeDeleted.clear();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/FunctionCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/FunctionCommandsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/FunctionCommandsDUnitTest.java
index 1698609..494890e 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/FunctionCommandsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/FunctionCommandsDUnitTest.java
@@ -31,11 +31,13 @@ import com.gemstone.gemfire.management.internal.cli.i18n.CliStrings;
import com.gemstone.gemfire.management.internal.cli.json.GfJsonException;
import com.gemstone.gemfire.management.internal.cli.result.CommandResult;
import com.gemstone.gemfire.management.internal.cli.result.TabularResultData;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
import java.util.List;
import java.util.Properties;
@@ -118,11 +120,11 @@ public class FunctionCommandsDUnitTest extends CliCommandTestBase {
e.printStackTrace();
}
String command = "execute function --id=" + function.getId() + " --region=" + "/" + "RegionOne";
- getLogWriter().info("testExecuteFunctionWithNoRegionOnManager command : " + command);
+ LogWriterSupport.getLogWriter().info("testExecuteFunctionWithNoRegionOnManager command : " + command);
CommandResult cmdResult = executeCommand(command);
if (cmdResult != null) {
String strCmdResult = commandResultToString(cmdResult);
- getLogWriter().info("testExecuteFunctionWithNoRegionOnManager stringResult : " + strCmdResult);
+ LogWriterSupport.getLogWriter().info("testExecuteFunctionWithNoRegionOnManager stringResult : " + strCmdResult);
assertEquals(Result.Status.OK, cmdResult.getStatus());
assertTrue(strCmdResult.contains("Execution summary"));
} else {
@@ -150,13 +152,13 @@ public class FunctionCommandsDUnitTest extends CliCommandTestBase {
});
String command = "execute function --id=" + function.getId() + " --region=" + REGION_NAME;
- getLogWriter().info("testExecuteFunctionOnRegion command=" + command);
+ LogWriterSupport.getLogWriter().info("testExecuteFunctionOnRegion command=" + command);
CommandResult cmdResult = executeCommand(command);
if (cmdResult != null) {
assertEquals(Result.Status.OK, cmdResult.getStatus());
- getLogWriter().info("testExecuteFunctionOnRegion cmdResult=" + cmdResult);
+ LogWriterSupport.getLogWriter().info("testExecuteFunctionOnRegion cmdResult=" + cmdResult);
String stringResult = commandResultToString(cmdResult);
- getLogWriter().info("testExecuteFunctionOnRegion stringResult=" + stringResult);
+ LogWriterSupport.getLogWriter().info("testExecuteFunctionOnRegion stringResult=" + stringResult);
assert (stringResult.contains("Execution summary"));
} else {
fail("testExecuteFunctionOnRegion did not return CommandResult");
@@ -193,7 +195,7 @@ public class FunctionCommandsDUnitTest extends CliCommandTestBase {
if (bean == null) {
return false;
} else {
- getLogWriter().info("Probing for checkRegionMBeans testExecuteFunctionOnRegionBug51480 finished");
+ LogWriterSupport.getLogWriter().info("Probing for checkRegionMBeans testExecuteFunctionOnRegionBug51480 finished");
return true;
}
}
@@ -203,7 +205,7 @@ public class FunctionCommandsDUnitTest extends CliCommandTestBase {
return "Probing for testExecuteFunctionOnRegionBug51480";
}
};
- DistributedTestCase.waitForCriterion(waitForMaangerMBean, 2 * 60 * 1000, 2000, true);
+ Wait.waitForCriterion(waitForMaangerMBean, 2 * 60 * 1000, 2000, true);
DistributedRegionMXBean bean = ManagementService.getManagementService(getCache()).getDistributedRegionMXBean(
Region.SEPARATOR + REGION_ONE);
assertNotNull(bean);
@@ -226,13 +228,13 @@ public class FunctionCommandsDUnitTest extends CliCommandTestBase {
String command = "execute function --id=" + function.getId() + " --region=" + REGION_ONE;
- getLogWriter().info("testExecuteFunctionOnRegionBug51480 command=" + command);
+ LogWriterSupport.getLogWriter().info("testExecuteFunctionOnRegionBug51480 command=" + command);
CommandResult cmdResult = executeCommand(command);
if (cmdResult != null) {
- getLogWriter().info("testExecuteFunctionOnRegionBug51480 cmdResult=" + cmdResult);
+ LogWriterSupport.getLogWriter().info("testExecuteFunctionOnRegionBug51480 cmdResult=" + cmdResult);
assertEquals(Result.Status.OK, cmdResult.getStatus());
String stringResult = commandResultToString(cmdResult);
- getLogWriter().info("testExecuteFunctionOnRegionBug51480 stringResult=" + stringResult);
+ LogWriterSupport.getLogWriter().info("testExecuteFunctionOnRegionBug51480 stringResult=" + stringResult);
assert (stringResult.contains("Execution summary"));
} else {
fail("testExecuteFunctionOnRegionBug51480 did not return CommandResult");
@@ -261,12 +263,12 @@ public class FunctionCommandsDUnitTest extends CliCommandTestBase {
});
String command = "execute function --id=" + function.getId() + " --member=" + vm1MemberId;
- getLogWriter().info("testExecuteFunctionOnMember command=" + command);
+ LogWriterSupport.getLogWriter().info("testExecuteFunctionOnMember command=" + command);
CommandResult cmdResult = executeCommand(command);
assertEquals(Result.Status.OK, cmdResult.getStatus());
String stringResult = commandResultToString(cmdResult);
- getLogWriter().info("testExecuteFunctionOnMember stringResult:" + stringResult);
+ LogWriterSupport.getLogWriter().info("testExecuteFunctionOnMember stringResult:" + stringResult);
assertTrue(stringResult.contains("Execution summary"));
}
@@ -290,13 +292,13 @@ public class FunctionCommandsDUnitTest extends CliCommandTestBase {
}
});
String command = "execute function --id=" + function.getId();
- getLogWriter().info("testExecuteFunctionOnMembers command=" + command);
+ LogWriterSupport.getLogWriter().info("testExecuteFunctionOnMembers command=" + command);
CommandResult cmdResult = executeCommand(command);
if (cmdResult != null) {
assertEquals(Result.Status.OK, cmdResult.getStatus());
- getLogWriter().info("testExecuteFunctionOnMembers cmdResult:" + cmdResult);
+ LogWriterSupport.getLogWriter().info("testExecuteFunctionOnMembers cmdResult:" + cmdResult);
String stringResult = commandResultToString(cmdResult);
- getLogWriter().info("testExecuteFunctionOnMembers stringResult:" + stringResult);
+ LogWriterSupport.getLogWriter().info("testExecuteFunctionOnMembers stringResult:" + stringResult);
assertTrue(stringResult.contains("Execution summary"));
} else {
fail("testExecuteFunctionOnMembers did not return CommandResult");
@@ -324,13 +326,13 @@ public class FunctionCommandsDUnitTest extends CliCommandTestBase {
String command = "execute function --id=" + function.getId() + " --arguments=arg1,arg2";
- getLogWriter().info("testExecuteFunctionOnMembersWithArgs command=" + command);
+ LogWriterSupport.getLogWriter().info("testExecuteFunctionOnMembersWithArgs command=" + command);
CommandResult cmdResult = executeCommand(command);
if (cmdResult != null) {
assertEquals(Result.Status.OK, cmdResult.getStatus());
- getLogWriter().info("testExecuteFunctionOnMembersWithArgs cmdResult:" + cmdResult);
+ LogWriterSupport.getLogWriter().info("testExecuteFunctionOnMembersWithArgs cmdResult:" + cmdResult);
String stringResult = commandResultToString(cmdResult);
- getLogWriter().info("testExecuteFunctionOnMembersWithArgs stringResult:" + stringResult);
+ LogWriterSupport.getLogWriter().info("testExecuteFunctionOnMembersWithArgs stringResult:" + stringResult);
assertTrue(stringResult.contains("Execution summary"));
assertTrue(stringResult.contains("arg1"));
} else {
@@ -386,13 +388,13 @@ public class FunctionCommandsDUnitTest extends CliCommandTestBase {
});
String command = "execute function --id=" + TestFunction.TEST_FUNCTION1 + " --groups=Group1,Group2";
- getLogWriter().info("testExecuteFunctionOnGroups command=" + command);
+ LogWriterSupport.getLogWriter().info("testExecuteFunctionOnGroups command=" + command);
CommandResult cmdResult = executeCommand(command);
- getLogWriter().info("testExecuteFunctionOnGroups cmdResult=" + cmdResult);
+ LogWriterSupport.getLogWriter().info("testExecuteFunctionOnGroups cmdResult=" + cmdResult);
assertEquals(Result.Status.OK, cmdResult.getStatus());
TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
List<String> members = resultData.retrieveAllValues("Member ID/Name");
- getLogWriter().info("testExecuteFunctionOnGroups members=" + members);
+ LogWriterSupport.getLogWriter().info("testExecuteFunctionOnGroups members=" + members);
assertTrue(members.size() == 2 && members.contains(vm1id) && members.contains(vm2id));
}
@@ -404,12 +406,12 @@ public class FunctionCommandsDUnitTest extends CliCommandTestBase {
final VM vm1 = Host.getHost(0).getVM(1);
final String vm1MemberId = (String) vm1.invoke(FunctionCommandsDUnitTest.class, "getMemberId");
String command = "destroy function --id=" + function.getId() + " --member=" + vm1MemberId;
- getLogWriter().info("testDestroyOnMember command=" + command);
+ LogWriterSupport.getLogWriter().info("testDestroyOnMember command=" + command);
CommandResult cmdResult = executeCommand(command);
if (cmdResult != null) {
String strCmdResult = commandResultToString(cmdResult);
assertEquals(Result.Status.OK, cmdResult.getStatus());
- getLogWriter().info("testDestroyOnMember strCmdResult=" + strCmdResult);
+ LogWriterSupport.getLogWriter().info("testDestroyOnMember strCmdResult=" + strCmdResult);
assertTrue(strCmdResult.contains("Destroyed TestFunction1 Successfully"));
} else {
fail("testDestroyOnMember failed as did not get CommandResult");
@@ -462,14 +464,14 @@ public class FunctionCommandsDUnitTest extends CliCommandTestBase {
});
String command = "destroy function --id=" + TestFunction.TEST_FUNCTION1 + " --groups=Group1,Group2";
- getLogWriter().info("testDestroyOnGroups command=" + command);
+ LogWriterSupport.getLogWriter().info("testDestroyOnGroups command=" + command);
CommandResult cmdResult = executeCommand(command);
- getLogWriter().info("testDestroyOnGroups cmdResult=" + cmdResult);
+ LogWriterSupport.getLogWriter().info("testDestroyOnGroups cmdResult=" + cmdResult);
assertEquals(Result.Status.OK, cmdResult.getStatus());
String content = null;
try {
content = cmdResult.getContent().get("message").toString();
- getLogWriter().info("testDestroyOnGroups content = " + content);
+ LogWriterSupport.getLogWriter().info("testDestroyOnGroups content = " + content);
} catch (GfJsonException e) {
fail("testDestroyOnGroups exception=" + e);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
index 302d79f..c09973d 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
@@ -56,12 +56,14 @@ import com.gemstone.gemfire.management.internal.cli.result.ResultData;
import com.gemstone.gemfire.management.internal.cli.result.TabularResultData;
import com.gemstone.gemfire.management.internal.cli.util.CommandStringBuilder;
import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
import hydra.GsRandom;
@@ -142,29 +144,29 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
RegionFactory regionFactory = cache.createRegionFactory(RegionShortcut.REPLICATE);
Region dataRegion = regionFactory.create(DATA_REGION_NAME);
assertNotNull(dataRegion);
- getLogWriter().info("Created Region " + dataRegion);
+ LogWriterSupport.getLogWriter().info("Created Region " + dataRegion);
dataRegion = dataRegion.createSubregion(DATA_REGION_NAME_CHILD_1, dataRegion.getAttributes());
assertNotNull(dataRegion);
- getLogWriter().info("Created Region " + dataRegion);
+ LogWriterSupport.getLogWriter().info("Created Region " + dataRegion);
dataRegion = dataRegion.createSubregion(DATA_REGION_NAME_CHILD_1_2, dataRegion.getAttributes());
assertNotNull(dataRegion);
- getLogWriter().info("Created Region " + dataRegion);
+ LogWriterSupport.getLogWriter().info("Created Region " + dataRegion);
dataRegion = regionFactory.create(DATA_REGION_NAME_VM1);
assertNotNull(dataRegion);
- getLogWriter().info("Created Region " + dataRegion);
+ LogWriterSupport.getLogWriter().info("Created Region " + dataRegion);
PartitionAttributes partitionAttrs = new PartitionAttributesFactory().setRedundantCopies(2).create();
RegionFactory<Object, Object> partitionRegionFactory = cache.createRegionFactory(RegionShortcut.PARTITION);
partitionRegionFactory.setPartitionAttributes(partitionAttrs);
Region dataParRegion = partitionRegionFactory.create(DATA_PAR_REGION_NAME);
assertNotNull(dataParRegion);
- getLogWriter().info("Created Region " + dataParRegion);
+ LogWriterSupport.getLogWriter().info("Created Region " + dataParRegion);
dataParRegion = partitionRegionFactory.create(DATA_PAR_REGION_NAME_VM1);
assertNotNull(dataParRegion);
- getLogWriter().info("Created Region " + dataParRegion);
+ LogWriterSupport.getLogWriter().info("Created Region " + dataParRegion);
}
});
@@ -175,19 +177,19 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
RegionFactory regionFactory = cache.createRegionFactory(RegionShortcut.REPLICATE);
Region dataRegion = regionFactory.create(DATA_REGION_NAME);
assertNotNull(dataRegion);
- getLogWriter().info("Created Region " + dataRegion);
+ LogWriterSupport.getLogWriter().info("Created Region " + dataRegion);
dataRegion = dataRegion.createSubregion(DATA_REGION_NAME_CHILD_1, dataRegion.getAttributes());
assertNotNull(dataRegion);
- getLogWriter().info("Created Region " + dataRegion);
+ LogWriterSupport.getLogWriter().info("Created Region " + dataRegion);
dataRegion = dataRegion.createSubregion(DATA_REGION_NAME_CHILD_1_2, dataRegion.getAttributes());
assertNotNull(dataRegion);
- getLogWriter().info("Created Region " + dataRegion);
+ LogWriterSupport.getLogWriter().info("Created Region " + dataRegion);
dataRegion = regionFactory.create(DATA_REGION_NAME_VM2);
assertNotNull(dataRegion);
- getLogWriter().info("Created Region " + dataRegion);
+ LogWriterSupport.getLogWriter().info("Created Region " + dataRegion);
PartitionAttributes partitionAttrs = new PartitionAttributesFactory().setRedundantCopies(2).create();
@@ -195,18 +197,18 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
partitionRegionFactory.setPartitionAttributes(partitionAttrs);
Region dataParRegion = partitionRegionFactory.create(DATA_PAR_REGION_NAME);
assertNotNull(dataParRegion);
- getLogWriter().info("Created Region " + dataParRegion);
+ LogWriterSupport.getLogWriter().info("Created Region " + dataParRegion);
dataParRegion = partitionRegionFactory.create(DATA_PAR_REGION_NAME_VM2);
assertNotNull(dataParRegion);
- getLogWriter().info("Created Region " + dataParRegion);
+ LogWriterSupport.getLogWriter().info("Created Region " + dataParRegion);
}
});
final String vm1MemberId = (String) vm1.invoke(GemfireDataCommandsDUnitTest.class, "getMemberId");
final String vm2MemberId = (String) vm2.invoke(GemfireDataCommandsDUnitTest.class, "getMemberId");
- getLogWriter().info("Vm1 ID : " + vm1MemberId);
- getLogWriter().info("Vm2 ID : " + vm2MemberId);
+ LogWriterSupport.getLogWriter().info("Vm1 ID : " + vm1MemberId);
+ LogWriterSupport.getLogWriter().info("Vm2 ID : " + vm2MemberId);
final VM manager = Host.getHost(0).getVM(0);
@@ -222,10 +224,10 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
ManagerMXBean bean1 = service.getManagerMXBean();
DistributedRegionMXBean bean2 = service.getDistributedRegionMXBean(DATA_REGION_NAME_PATH);
if (bean1 == null) {
- getLogWriter().info("Still probing for ManagerMBean");
+ LogWriterSupport.getLogWriter().info("Still probing for ManagerMBean");
return false;
} else {
- getLogWriter().info("Still probing for DistributedRegionMXBean=" + bean2);
+ LogWriterSupport.getLogWriter().info("Still probing for DistributedRegionMXBean=" + bean2);
return (bean2 != null);
}
}
@@ -236,7 +238,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
}
};
- DistributedTestCase.waitForCriterion(waitForMaangerMBean, 30000, 2000, true);
+ Wait.waitForCriterion(waitForMaangerMBean, 30000, 2000, true);
assertNotNull(service.getMemberMXBean());
assertNotNull(service.getManagerMXBean());
@@ -266,7 +268,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
}
if (!flag) {
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
"Still probing for regionMbeans " + DATA_REGION_NAME_PATH + "=" + beans[0] + " " + DATA_REGION_NAME_VM1_PATH + "=" + beans[1] + " " + DATA_REGION_NAME_VM2_PATH + "=" + beans[2] + " " + DATA_PAR_REGION_NAME_PATH + "=" + beans[3] + " " + DATA_PAR_REGION_NAME_VM1_PATH + "=" + beans[4] + " " + DATA_PAR_REGION_NAME_VM2_PATH + "=" + beans[5] + " "
//+ DATA_REGION_NAME_CHILD_1_PATH
// +"="+ beans[6] + " " + DATA_REGION_NAME_CHILD_1_2_PATH
@@ -274,7 +276,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
);
return false;
} else {
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
"Probing complete for regionMbeans " + DATA_REGION_NAME_PATH + "=" + beans[0] + " " + DATA_REGION_NAME_VM1_PATH + "=" + beans[1] + " " + DATA_REGION_NAME_VM2_PATH + "=" + beans[2] + " " + DATA_PAR_REGION_NAME_PATH + "=" + beans[3] + " " + DATA_PAR_REGION_NAME_VM1_PATH + "=" + beans[4] + " " + DATA_PAR_REGION_NAME_VM2_PATH + "=" + beans[5] + " "
//+ DATA_REGION_NAME_CHILD_1_PATH
// +"="+ beans[6] + " " + DATA_REGION_NAME_CHILD_1_2_PATH
@@ -296,7 +298,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
}
};
- DistributedTestCase.waitForCriterion(waitForRegionMBeans, 30000, 2000, true);
+ Wait.waitForCriterion(waitForRegionMBeans, 30000, 2000, true);
String regions[] = {DATA_REGION_NAME_PATH, DATA_REGION_NAME_VM1_PATH, DATA_REGION_NAME_VM2_PATH, DATA_PAR_REGION_NAME_PATH, DATA_PAR_REGION_NAME_VM1_PATH, DATA_PAR_REGION_NAME_VM2_PATH, /*DATA_REGION_NAME_CHILD_1_PATH, DATA_REGION_NAME_CHILD_1_2_PATH*/};
@@ -304,7 +306,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
bean = service.getDistributedRegionMXBean(region);
assertNotNull(bean);
String[] membersName = bean.getMembers();
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
"Members Array for region " + region + " : " + StringUtils.objectToString(membersName, true, 10));
if (bean.getMemberCount() < 1) fail(
"Even after waiting mbean reports number of member hosting region " + DATA_REGION_NAME_VM1_PATH + " is less than one");
@@ -369,7 +371,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
query = query.replace("?" + i, r);
i++;
}
- getLogWriter().info("Checking members for query : " + query);
+ LogWriterSupport.getLogWriter().info("Checking members for query : " + query);
QCompiler compiler = new QCompiler();
Set<String> regionsInQuery = null;
try {
@@ -377,11 +379,11 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
Set regionSet = new HashSet();
compiledQuery.getRegionsInQuery(regionSet, null);//GFSH ENV VARIBLES
regionsInQuery = Collections.unmodifiableSet(regionSet);
- getLogWriter().info("Region in query : " + regionsInQuery);
+ LogWriterSupport.getLogWriter().info("Region in query : " + regionsInQuery);
if (regionsInQuery.size() > 0) {
Set<DistributedMember> members = DataCommands.getQueryRegionsAssociatedMembers(regionsInQuery, cache,
returnAll);
- getLogWriter().info("Members for Region in query : " + members);
+ LogWriterSupport.getLogWriter().info("Members for Region in query : " + members);
if (expectedMembers != -1) {
assertNotNull(members);
assertEquals(expectedMembers, members.size());
@@ -453,7 +455,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
MemberMXBean member = service.getMemberMXBean();
String cmdResult = member.processCommand(query);
assertNotNull(cmdResult);
- getLogWriter().info("Text Command Output : " + cmdResult);
+ LogWriterSupport.getLogWriter().info("Text Command Output : " + cmdResult);
}
});
}
@@ -505,7 +507,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
CommandResult cmdResult = executeCommand(query);
printCommandOutput(cmdResult);
validateSelectResult(cmdResult, true, -1, null);
- IgnoredException ex = IgnoredException.addExpectedException(QueryInvalidException.class.getSimpleName(), Host.getHost(0).getVM(0));
+ IgnoredException ex = IgnoredException.addIgnoredException(QueryInvalidException.class.getSimpleName(), Host.getHost(0).getVM(0));
try {
query = "query --query=\"select ID , status , createTime , pk, floatMinValue from ${DATA_REGION2} where ID <= ${PORTFOLIO_ID2}" + " and status='${STATUS2}'" + "\" --interactive=false";
cmdResult = executeCommand(query);
@@ -550,15 +552,15 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
Double doubleKey = Double.valueOf("12432.235425");
Double doubleValue = Double.valueOf("111111.111111");
- getLogWriter().info("Testing Byte Wrappers");
+ LogWriterSupport.getLogWriter().info("Testing Byte Wrappers");
testGetPutLocateEntryFromShellAndGemfire(byteKey, byteValue, Byte.class, true, true);
- getLogWriter().info("Testing Short Wrappers");
+ LogWriterSupport.getLogWriter().info("Testing Short Wrappers");
testGetPutLocateEntryFromShellAndGemfire(shortKey, shortValue, Short.class, true, true);
- getLogWriter().info("Testing Integer Wrappers");
+ LogWriterSupport.getLogWriter().info("Testing Integer Wrappers");
testGetPutLocateEntryFromShellAndGemfire(integerKey, integerValue, Integer.class, true, true);
- getLogWriter().info("Testing Float Wrappers");
+ LogWriterSupport.getLogWriter().info("Testing Float Wrappers");
testGetPutLocateEntryFromShellAndGemfire(floatKey, flaotValue, Float.class, true, true);
- getLogWriter().info("Testing Double Wrappers");
+ LogWriterSupport.getLogWriter().info("Testing Double Wrappers");
testGetPutLocateEntryFromShellAndGemfire(doubleKey, doubleValue, Double.class, true, true);
}
@@ -760,7 +762,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
try {
for (String col : expectedCols) {
boolean found = false;
- getLogWriter().info("Validating column " + col);
+ LogWriterSupport.getLogWriter().info("Validating column " + col);
for (int i = 0; i < array.size(); i++) {
String header = (String) array.get(i);
if (col.equals(header)) found = true;
@@ -781,7 +783,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
try {
for (String col : expectedCols) {
boolean found = false;
- getLogWriter().info("Validating column " + col);
+ LogWriterSupport.getLogWriter().info("Validating column " + col);
for (int i = 0; i < array.size(); i++) {
String header = (String) array.get(i);
if (col.equals(header)) found = true;
@@ -815,7 +817,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
assertEquals(cols.length, array.size());
for (String col : cols) {
boolean found = false;
- getLogWriter().info("Validating column " + col);
+ LogWriterSupport.getLogWriter().info("Validating column " + col);
for (int i = 0; i < array.size(); i++) {
String header = (String) array.get(i);
if (col.equals(header)) found = true;
@@ -1277,7 +1279,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
String valueJson = valueTemplate.replaceAll("\\?1", population);
valueJson = valueJson.replaceAll("\\?2", area);
valueJson = valueJson.replaceAll("\\?", keyString);
- getLogWriter().info("Getting key with json key : " + keyJson);
+ LogWriterSupport.getLogWriter().info("Getting key with json key : " + keyJson);
command = command + " " + "--key=" + keyJson + " --region=" + DATA_REGION_NAME_PATH + " --key-class=" + Key1.class.getCanonicalName();
command = command + " --value-class=" + Value2.class.getCanonicalName();
CommandResult cmdResult = executeCommand(command);
@@ -1306,7 +1308,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
String valueJson = valueTemplate.replaceAll("\\?1", population);
valueJson = valueJson.replaceAll("\\?2", area);
valueJson = valueJson.replaceAll("\\?", keyString);
- getLogWriter().info("Getting key with json key : " + keyJson);
+ LogWriterSupport.getLogWriter().info("Getting key with json key : " + keyJson);
command = command + " " + "--key=" + keyJson + " --region=" + DATA_REGION_NAME_PATH + " --key-class=" + Key1.class.getCanonicalName();
command = command + " --value-class=" + Value2.class.getCanonicalName();
CommandResult cmdResult = executeCommand(command);
@@ -1343,8 +1345,8 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
String valueJson = valueTemplate.replaceAll("\\?1", population);
valueJson = valueJson.replaceAll("\\?2", area);
valueJson = valueJson.replaceAll("\\?", keyString);
- getLogWriter().info("Putting key with json key : " + keyJson);
- getLogWriter().info("Putting key with json valye : " + valueJson);
+ LogWriterSupport.getLogWriter().info("Putting key with json key : " + keyJson);
+ LogWriterSupport.getLogWriter().info("Putting key with json valye : " + valueJson);
command = command + " " + "--key=" + keyJson + " --value=" + valueJson + " --region=" + DATA_REGION_NAME_PATH;
command = command + " --key-class=" + Key1.class.getCanonicalName() + " --value-class=" + Value2.class.getCanonicalName();
;
@@ -1372,8 +1374,8 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
valueJson = valueJson.replaceAll("\\?set", set);
valueJson = valueJson.replaceAll("\\?map", map);
- getLogWriter().info("Putting key with json key : " + keyJson);
- getLogWriter().info("Putting key with json valye : " + valueJson);
+ LogWriterSupport.getLogWriter().info("Putting key with json key : " + keyJson);
+ LogWriterSupport.getLogWriter().info("Putting key with json valye : " + valueJson);
command = command + " " + "--key=" + keyJson + " --value=" + valueJson + " --region=" + DATA_REGION_NAME_PATH;
command = command + " --key-class=" + Key1.class.getCanonicalName() + " --value-class=" + Car.class.getCanonicalName();
;
@@ -1483,7 +1485,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
String command = "remove";
String keyString = keyPrefix + i;
String keyJson = keyTemplate.replaceAll("\\?", keyString);
- getLogWriter().info("Removing key with json key : " + keyJson);
+ LogWriterSupport.getLogWriter().info("Removing key with json key : " + keyJson);
command = command + " " + "--key=" + keyJson + " --region=" + DATA_REGION_NAME_PATH + " --key-class=" + Key1.class.getCanonicalName();
CommandResult cmdResult = executeCommand(command);
printCommandOutput(cmdResult);
@@ -1564,8 +1566,8 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
CommandResult cmdResult = executeCommand(commandString);
String resultAsString = commandResultToString(cmdResult);
assertEquals(Result.Status.OK, cmdResult.getStatus());
- getLogWriter().info("Command Output");
- getLogWriter().info(resultAsString);
+ LogWriterSupport.getLogWriter().info("Command Output");
+ LogWriterSupport.getLogWriter().info(resultAsString);
vm1.invoke(new SerializableRunnable() {
public void run() {
@@ -1588,8 +1590,8 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
cmdResult = executeCommand(commandString);
resultAsString = commandResultToString(cmdResult);
- getLogWriter().info("Result of import data");
- getLogWriter().info(resultAsString);
+ LogWriterSupport.getLogWriter().info("Result of import data");
+ LogWriterSupport.getLogWriter().info(resultAsString);
assertEquals(Result.Status.OK, cmdResult.getStatus());
/**
@@ -1614,8 +1616,8 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
cmdResult = executeCommand(commandString);
resultAsString = commandResultToString(cmdResult);
- getLogWriter().info("Result of import data with wrong region name");
- getLogWriter().info(resultAsString);
+ LogWriterSupport.getLogWriter().info("Result of import data with wrong region name");
+ LogWriterSupport.getLogWriter().info(resultAsString);
assertEquals(Result.Status.ERROR, cmdResult.getStatus());
csb = new CommandStringBuilder(CliStrings.IMPORT_DATA);
@@ -1626,8 +1628,8 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
cmdResult = executeCommand(commandString);
resultAsString = commandResultToString(cmdResult);
- getLogWriter().info("Result of import data with wrong file");
- getLogWriter().info(resultAsString);
+ LogWriterSupport.getLogWriter().info("Result of import data with wrong file");
+ LogWriterSupport.getLogWriter().info(resultAsString);
assertEquals(Result.Status.ERROR, cmdResult.getStatus());
} finally {
@@ -1687,7 +1689,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
final DistributedRegionMXBean bean = service.getDistributedRegionMXBean(
Region.SEPARATOR + REBALANCE_REGION_NAME);
if (bean == null) {
- getLogWriter().info("Still probing for checkRegionMBeans ManagerMBean");
+ LogWriterSupport.getLogWriter().info("Still probing for checkRegionMBeans ManagerMBean");
return false;
} else {
// verify that bean is proper before executing tests
@@ -1704,7 +1706,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
return "Probing for testRebalanceCommandForSimulateWithNoMember ManagerMBean";
}
};
- DistributedTestCase.waitForCriterion(waitForMaangerMBean, 2 * 60 * 1000, 2000, true);
+ Wait.waitForCriterion(waitForMaangerMBean, 2 * 60 * 1000, 2000, true);
DistributedRegionMXBean bean = ManagementService.getManagementService(getCache()).getDistributedRegionMXBean(
"/" + REBALANCE_REGION_NAME);
assertNotNull(bean);
@@ -1717,13 +1719,13 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
//check if DistributedRegionMXBean is available so that command will not fail
final VM manager = Host.getHost(0).getVM(0);
manager.invoke(checkRegionMBeans);
- getLogWriter().info("testRebalanceCommandForTimeOut verified Mbean and executin command");
+ LogWriterSupport.getLogWriter().info("testRebalanceCommandForTimeOut verified Mbean and executin command");
String command = "rebalance --time-out=1";
CommandResult cmdResult = executeCommand(command);
- getLogWriter().info("testRebalanceCommandForTimeOut just after executing " + cmdResult);
+ LogWriterSupport.getLogWriter().info("testRebalanceCommandForTimeOut just after executing " + cmdResult);
if (cmdResult != null) {
String stringResult = commandResultToString(cmdResult);
- getLogWriter().info("testRebalanceCommandForTimeOut stringResult : " + stringResult);
+ LogWriterSupport.getLogWriter().info("testRebalanceCommandForTimeOut stringResult : " + stringResult);
assertEquals(Result.Status.OK, cmdResult.getStatus());
} else {
fail("testRebalanceCommandForTimeOut failed as did not get CommandResult");
@@ -1737,16 +1739,16 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
final VM manager = Host.getHost(0).getVM(0);
manager.invoke(checkRegionMBeans);
- getLogWriter().info("testRebalanceCommandForTimeOutForRegion verified Mbean and executin command");
+ LogWriterSupport.getLogWriter().info("testRebalanceCommandForTimeOutForRegion verified Mbean and executin command");
String command = "rebalance --time-out=1 --include-region=" + "/" + REBALANCE_REGION_NAME;
CommandResult cmdResult = executeCommand(command);
- getLogWriter().info("testRebalanceCommandForTimeOutForRegion just after executing " + cmdResult);
+ LogWriterSupport.getLogWriter().info("testRebalanceCommandForTimeOutForRegion just after executing " + cmdResult);
if (cmdResult != null) {
String stringResult = commandResultToString(cmdResult);
- getLogWriter().info("testRebalanceCommandForTimeOutForRegion stringResult : " + stringResult);
+ LogWriterSupport.getLogWriter().info("testRebalanceCommandForTimeOutForRegion stringResult : " + stringResult);
assertEquals(Result.Status.OK, cmdResult.getStatus());
} else {
fail("testRebalanceCommandForTimeOut failed as did not get CommandResult");
@@ -1760,13 +1762,13 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
final VM manager = Host.getHost(0).getVM(0);
manager.invoke(checkRegionMBeans);
- getLogWriter().info("testRebalanceCommandForSimulate verified Mbean and executin command");
+ LogWriterSupport.getLogWriter().info("testRebalanceCommandForSimulate verified Mbean and executin command");
String command = "rebalance --simulate=true --include-region=" + "/" + REBALANCE_REGION_NAME;
CommandResult cmdResult = executeCommand(command);
- getLogWriter().info("testRebalanceCommandForSimulate just after executing " + cmdResult);
+ LogWriterSupport.getLogWriter().info("testRebalanceCommandForSimulate just after executing " + cmdResult);
if (cmdResult != null) {
String stringResult = commandResultToString(cmdResult);
- getLogWriter().info("testRebalanceCommandForSimulate stringResult : " + stringResult);
+ LogWriterSupport.getLogWriter().info("testRebalanceCommandForSimulate stringResult : " + stringResult);
assertEquals(Result.Status.OK, cmdResult.getStatus());
} else {
fail("testRebalanceCommandForSimulate failed as did not get CommandResult");
@@ -1780,16 +1782,16 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
final VM manager = Host.getHost(0).getVM(0);
manager.invoke(checkRegionMBeans);
- getLogWriter().info("testRebalanceCommandForSimulateWithNoMember verified Mbean and executin command");
+ LogWriterSupport.getLogWriter().info("testRebalanceCommandForSimulateWithNoMember verified Mbean and executin command");
String command = "rebalance --simulate=true";
CommandResult cmdResult = executeCommand(command);
- getLogWriter().info("testRebalanceCommandForSimulateWithNoMember just after executing " + cmdResult);
+ LogWriterSupport.getLogWriter().info("testRebalanceCommandForSimulateWithNoMember just after executing " + cmdResult);
if (cmdResult != null) {
String stringResult = commandResultToString(cmdResult);
- getLogWriter().info("testRebalanceCommandForSimulateWithNoMember stringResult : " + stringResult);
+ LogWriterSupport.getLogWriter().info("testRebalanceCommandForSimulateWithNoMember stringResult : " + stringResult);
assertEquals(Result.Status.OK, cmdResult.getStatus());
} else {
fail("testRebalanceCommandForSimulateWithNoMember failed as did not get CommandResult");
@@ -1803,13 +1805,13 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
//check if DistributedRegionMXBean is available so that command will not fail
final VM manager = Host.getHost(0).getVM(0);
manager.invoke(checkRegionMBeans);
- getLogWriter().info("testRebalanceForIncludeRegionFunction verified Mbean and executin command");
+ LogWriterSupport.getLogWriter().info("testRebalanceForIncludeRegionFunction verified Mbean and executin command");
String command = "rebalance --include-region=" + "/" + REBALANCE_REGION_NAME + ",/" + REBALANCE_REGION2_NAME;
CommandResult cmdResult = executeCommand(command);
- getLogWriter().info("testRebalanceForIncludeRegionFunction just after executing " + cmdResult);
+ LogWriterSupport.getLogWriter().info("testRebalanceForIncludeRegionFunction just after executing " + cmdResult);
if (cmdResult != null) {
String stringResult = commandResultToString(cmdResult);
- getLogWriter().info("testRebalanceForIncludeRegionFunction stringResult : " + stringResult);
+ LogWriterSupport.getLogWriter().info("testRebalanceForIncludeRegionFunction stringResult : " + stringResult);
assertEquals(Result.Status.OK, cmdResult.getStatus());
} else {
fail("testRebalanceForIncludeRegionFunction failed as did not get CommandResult");
@@ -1822,17 +1824,17 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
final VM manager = Host.getHost(0).getVM(0);
manager.invoke(checkRegionMBeans);
- getLogWriter().info("testSimulateForEntireDS verified Mbean and executin command");
+ LogWriterSupport.getLogWriter().info("testSimulateForEntireDS verified Mbean and executin command");
String command = "rebalance --simulate=true";
CommandResult cmdResult = executeCommand(command);
- getLogWriter().info("testSimulateForEntireDS just after executing " + cmdResult);
+ LogWriterSupport.getLogWriter().info("testSimulateForEntireDS just after executing " + cmdResult);
if (cmdResult != null) {
String stringResult = commandResultToString(cmdResult);
- getLogWriter().info("testSimulateForEntireDS stringResult : " + stringResult);
+ LogWriterSupport.getLogWriter().info("testSimulateForEntireDS stringResult : " + stringResult);
assertEquals(Result.Status.OK, cmdResult.getStatus());
} else {
fail("testRebalanceForIncludeRegionFunction failed as did not get CommandResult");
@@ -1844,13 +1846,13 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
//check if DistributedRegionMXBean is available so that command will not fail
final VM manager = Host.getHost(0).getVM(0);
manager.invoke(checkRegionMBeans);
- getLogWriter().info("testRebalanceForEntireDS verified Mbean and executin command");
+ LogWriterSupport.getLogWriter().info("testRebalanceForEntireDS verified Mbean and executin command");
String command = "rebalance";
CommandResult cmdResult = executeCommand(command);
- getLogWriter().info("testRebalanceForEntireDS just after executing " + cmdResult);
+ LogWriterSupport.getLogWriter().info("testRebalanceForEntireDS just after executing " + cmdResult);
if (cmdResult != null) {
String stringResult = commandResultToString(cmdResult);
- getLogWriter().info("testRebalanceForEntireDS stringResult : " + stringResult);
+ LogWriterSupport.getLogWriter().info("testRebalanceForEntireDS stringResult : " + stringResult);
assertEquals(Result.Status.OK, cmdResult.getStatus());
} else {
fail("testRebalanceForIncludeRegionFunction failed as did not get CommandResult");
@@ -1901,14 +1903,14 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
private static void printCommandOutput(CommandResult cmdResult) {
assertNotNull(cmdResult);
- getLogWriter().info("Command Output : ");
+ LogWriterSupport.getLogWriter().info("Command Output : ");
StringBuilder sb = new StringBuilder();
cmdResult.resetToFirstLine();
while (cmdResult.hasNextLine()) {
sb.append(cmdResult.nextLine()).append(DataCommandRequest.NEW_LINE);
}
- getLogWriter().info(sb.toString());
- getLogWriter().info("");
+ LogWriterSupport.getLogWriter().info(sb.toString());
+ LogWriterSupport.getLogWriter().info("");
}
public static class Value1WithValue2 extends Value1 {
@@ -1935,15 +1937,15 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
final VM manager = Host.getHost(0).getVM(0);
manager.invoke(checkRegionMBeans);
- getLogWriter().info("testRebalanceForExcludeRegionFunction verified Mbean and executing command");
+ LogWriterSupport.getLogWriter().info("testRebalanceForExcludeRegionFunction verified Mbean and executing command");
String command = "rebalance --exclude-region=" + "/" + REBALANCE_REGION2_NAME;
- getLogWriter().info("testRebalanceForExcludeRegionFunction command : " + command);
+ LogWriterSupport.getLogWriter().info("testRebalanceForExcludeRegionFunction command : " + command);
CommandResult cmdResult = executeCommand(command);
- getLogWriter().info("testRebalanceForExcludeRegionFunction just after executing " + cmdResult);
+ LogWriterSupport.getLogWriter().info("testRebalanceForExcludeRegionFunction just after executing " + cmdResult);
if (cmdResult != null) {
String stringResult = commandResultToString(cmdResult);
- getLogWriter().info("testRebalanceForExcludeRegionFunction stringResult : " + stringResult);
+ LogWriterSupport.getLogWriter().info("testRebalanceForExcludeRegionFunction stringResult : " + stringResult);
assertEquals(Result.Status.OK, cmdResult.getStatus());
} else {
fail("testRebalanceForIncludeRegionFunction failed as did not get CommandResult");
@@ -1966,19 +1968,19 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
ManagerMXBean bean1 = service.getManagerMXBean();
DistributedRegionMXBean bean2 = service.getDistributedRegionMXBean(regionName);
if (bean1 == null) {
- getLogWriter().info("waitForListClientMbean Still probing for ManagerMBean");
+ LogWriterSupport.getLogWriter().info("waitForListClientMbean Still probing for ManagerMBean");
return false;
} else {
- getLogWriter().info("waitForListClientMbean Still probing for DistributedRegionMXBean=" + bean2);
+ LogWriterSupport.getLogWriter().info("waitForListClientMbean Still probing for DistributedRegionMXBean=" + bean2);
if (bean2 == null) {
bean2 = service.getDistributedRegionMXBean(Region.SEPARATOR + regionName);
}
if (bean2 == null) {
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
"waitForListClientMbean Still probing for DistributedRegionMXBean with separator = " + bean2);
return false;
} else {
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
"waitForListClientMbean Still probing for DistributedRegionMXBean with separator Not null " + bean2.getMembers().length);
if (bean2.getMembers().length > 1) {
return true;
@@ -1995,7 +1997,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
}
};
- DistributedTestCase.waitForCriterion(waitForMaangerMBean, 30000, 2000, true);
+ Wait.waitForCriterion(waitForMaangerMBean, 30000, 2000, true);
DistributedRegionMXBean bean = service.getDistributedRegionMXBean(regionName);
if (bean == null) {
bean = service.getDistributedRegionMXBean(Region.SEPARATOR + regionName);
@@ -2031,7 +2033,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
}
});
- getLogWriter().info("testRegionsViaMbeanAndFunctions memSizeFromMbean= " + memSizeFromMbean);
+ LogWriterSupport.getLogWriter().info("testRegionsViaMbeanAndFunctions memSizeFromMbean= " + memSizeFromMbean);
String memSizeFromFunctionCall = (String) manager.invoke(new SerializableCallable() {
public Object call() {
@@ -2041,7 +2043,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
}
});
- getLogWriter().info("testRegionsViaMbeanAndFunctions memSizeFromFunctionCall= " + memSizeFromFunctionCall);
+ LogWriterSupport.getLogWriter().info("testRegionsViaMbeanAndFunctions memSizeFromFunctionCall= " + memSizeFromFunctionCall);
assertTrue(memSizeFromFunctionCall.equals(memSizeFromMbean));
}
@@ -2070,7 +2072,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
}
});
- getLogWriter().info("testRegionsViaMbeanAndFunctionsForPartRgn memSizeFromMbean= " + memSizeFromMbean);
+ LogWriterSupport.getLogWriter().info("testRegionsViaMbeanAndFunctionsForPartRgn memSizeFromMbean= " + memSizeFromMbean);
String memSizeFromFunctionCall = (String) manager.invoke(new SerializableCallable() {
public Object call() {
@@ -2079,7 +2081,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
}
});
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
"testRegionsViaMbeanAndFunctionsForPartRgn memSizeFromFunctionCall= " + memSizeFromFunctionCall);
assertTrue(memSizeFromFunctionCall.equals(memSizeFromMbean));
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GetCommandOnRegionWithCacheLoaderDuringCacheMissDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GetCommandOnRegionWithCacheLoaderDuringCacheMissDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GetCommandOnRegionWithCacheLoaderDuringCacheMissDUnitTest.java
index f092196..d4bcb27 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GetCommandOnRegionWithCacheLoaderDuringCacheMissDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GetCommandOnRegionWithCacheLoaderDuringCacheMissDUnitTest.java
@@ -39,11 +39,13 @@ import com.gemstone.gemfire.management.internal.cli.result.CommandResult;
import com.gemstone.gemfire.management.internal.cli.result.CompositeResultData;
import com.gemstone.gemfire.management.internal.cli.result.ResultData;
import com.gemstone.gemfire.management.internal.cli.util.CommandStringBuilder;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.SerializableRunnableIF;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
/**
* The GetCommandOnRegionWithCacheLoaderDuringCacheMissDUnitTest class is test suite of test cases testing the Gfsh
@@ -172,7 +174,7 @@ public class GetCommandOnRegionWithCacheLoaderDuringCacheMissDUnitTest extends C
}
};
- DistributedTestCase.waitForCriterion(waitOnManagerCriterion, 30000, 2000, true);
+ Wait.waitForCriterion(waitOnManagerCriterion, 30000, 2000, true);
}
});
}
@@ -195,7 +197,7 @@ public class GetCommandOnRegionWithCacheLoaderDuringCacheMissDUnitTest extends C
protected void log(final String tag, final String message) {
//System.out.printf("%1$s (%2$s)%n", tag, message);
- getLogWriter().info(String.format("%1$s (%2$s)%n", tag, message));
+ LogWriterSupport.getLogWriter().info(String.format("%1$s (%2$s)%n", tag, message));
}
protected CommandResult runCommand(final String command) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/IndexCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/IndexCommandsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/IndexCommandsDUnitTest.java
index 8df678f..ba0c88e 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/IndexCommandsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/IndexCommandsDUnitTest.java
@@ -36,11 +36,13 @@ import com.gemstone.gemfire.management.internal.cli.i18n.CliStrings;
import com.gemstone.gemfire.management.internal.cli.result.CommandResult;
import com.gemstone.gemfire.management.internal.cli.util.CommandStringBuilder;
import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
import java.io.File;
import java.io.IOException;
@@ -605,7 +607,7 @@ public class IndexCommandsDUnitTest extends CliCommandTestBase {
final InternalLocator locator = (InternalLocator) Locator.startLocatorAndDS(locatorPort, locatorLogFile, null,
locatorProps);
- DistributedTestCase.WaitCriterion wc = new DistributedTestCase.WaitCriterion() {
+ WaitCriterion wc = new WaitCriterion() {
@Override
public boolean done() {
return locator.isSharedConfigurationRunning();
@@ -616,7 +618,7 @@ public class IndexCommandsDUnitTest extends CliCommandTestBase {
return "Waiting for shared configuration to be started";
}
};
- DistributedTestCase.waitForCriterion(wc, 5000, 500, true);
+ Wait.waitForCriterion(wc, 5000, 500, true);
} catch (IOException ioex) {
fail("Unable to create a locator with a shared configuration");
}
@@ -739,8 +741,8 @@ public class IndexCommandsDUnitTest extends CliCommandTestBase {
}
private void writeToLog(String text, String resultAsString) {
- getLogWriter().info(testName + "\n");
- getLogWriter().info(resultAsString);
+ LogWriterSupport.getLogWriter().info(testName + "\n");
+ LogWriterSupport.getLogWriter().info(resultAsString);
}
private void setupSystem() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListAndDescribeDiskStoreCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListAndDescribeDiskStoreCommandsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListAndDescribeDiskStoreCommandsDUnitTest.java
index acb7759..7418abd 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListAndDescribeDiskStoreCommandsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListAndDescribeDiskStoreCommandsDUnitTest.java
@@ -29,6 +29,7 @@ import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.management.cli.Result;
import com.gemstone.gemfire.management.internal.cli.i18n.CliStrings;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.SerializableRunnableIF;
import com.gemstone.gemfire.test.dunit.VM;
@@ -95,7 +96,7 @@ public class ListAndDescribeDiskStoreCommandsDUnitTest extends CliCommandTestBas
protected Properties createDistributedSystemProperties(final String gemfireName) {
final Properties distributedSystemProperties = new Properties();
- distributedSystemProperties.setProperty(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel());
+ distributedSystemProperties.setProperty(DistributionConfig.LOG_LEVEL_NAME, LogWriterSupport.getDUnitLogLevel());
distributedSystemProperties.setProperty(DistributionConfig.NAME_NAME, gemfireName);
return distributedSystemProperties;
@@ -131,7 +132,7 @@ public class ListAndDescribeDiskStoreCommandsDUnitTest extends CliCommandTestBas
final Result result = executeCommand(CliStrings.LIST_DISK_STORE);
assertNotNull(result);
- getLogWriter().info(toString(result));
+ LogWriterSupport.getLogWriter().info(toString(result));
assertEquals(Result.Status.OK, result.getStatus());
}
@@ -140,7 +141,7 @@ public class ListAndDescribeDiskStoreCommandsDUnitTest extends CliCommandTestBas
CliStrings.DESCRIBE_DISK_STORE + " --member=producerServer --name=producerData");
assertNotNull(result);
- getLogWriter().info(toString(result));
+ LogWriterSupport.getLogWriter().info(toString(result));
assertEquals(Result.Status.OK, result.getStatus());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListAndDescribeRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListAndDescribeRegionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListAndDescribeRegionDUnitTest.java
index a81a085..4956541 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListAndDescribeRegionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListAndDescribeRegionDUnitTest.java
@@ -35,6 +35,7 @@ import com.gemstone.gemfire.management.internal.cli.result.CommandResult;
import com.gemstone.gemfire.management.internal.cli.util.CommandStringBuilder;
import com.gemstone.gemfire.management.internal.cli.util.RegionAttributesNames;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -192,8 +193,8 @@ public class ListAndDescribeRegionDUnitTest extends CliCommandTestBase {
String commandString = csb.toString();
CommandResult commandResult = executeCommand(commandString);
String commandResultAsString = commandResultToString(commandResult);
- getLogWriter().info("Command String : " + commandString);
- getLogWriter().info("Output : \n" + commandResultAsString);
+ LogWriterSupport.getLogWriter().info("Command String : " + commandString);
+ LogWriterSupport.getLogWriter().info("Output : \n" + commandResultAsString);
assertEquals(Status.OK, commandResult.getStatus());
assertTrue(commandResultAsString.contains(PR1));
assertTrue(commandResultAsString.contains(LOCALREGIONONMANAGER));
@@ -207,8 +208,8 @@ public class ListAndDescribeRegionDUnitTest extends CliCommandTestBase {
commandString = csb.toString();
commandResult = executeCommand(commandString);
commandResultAsString = commandResultToString(commandResult);
- getLogWriter().info("Command String : " + commandString);
- getLogWriter().info("Output : \n" + commandResultAsString);
+ LogWriterSupport.getLogWriter().info("Command String : " + commandString);
+ LogWriterSupport.getLogWriter().info("Output : \n" + commandResultAsString);
assertEquals(Status.OK, commandResult.getStatus());
assertTrue(commandResultAsString.contains(PR1));
assertTrue(commandResultAsString.contains(LOCALREGIONONMANAGER));
@@ -218,8 +219,8 @@ public class ListAndDescribeRegionDUnitTest extends CliCommandTestBase {
commandString = csb.toString();
commandResult = executeCommand(commandString);
commandResultAsString = commandResultToString(commandResult);
- getLogWriter().info("Command String : " + commandString);
- getLogWriter().info("Output : \n" + commandResultAsString);
+ LogWriterSupport.getLogWriter().info("Command String : " + commandString);
+ LogWriterSupport.getLogWriter().info("Output : \n" + commandResultAsString);
assertEquals(Status.OK, commandResult.getStatus());
assertTrue(commandResultAsString.contains(PR1));
assertTrue(commandResultAsString.contains(REGION1));
@@ -232,8 +233,8 @@ public class ListAndDescribeRegionDUnitTest extends CliCommandTestBase {
commandString = csb.toString();
commandResult = executeCommand(commandString);
commandResultAsString = commandResultToString(commandResult);
- getLogWriter().info("Command String : " + commandString);
- getLogWriter().info("Output : \n" + commandResultAsString);
+ LogWriterSupport.getLogWriter().info("Command String : " + commandString);
+ LogWriterSupport.getLogWriter().info("Output : \n" + commandResultAsString);
assertEquals(Status.OK, commandResult.getStatus());
assertTrue(commandResultAsString.contains(PR1));
assertTrue(commandResultAsString.contains(LOCALREGIONONMANAGER));
@@ -243,8 +244,8 @@ public class ListAndDescribeRegionDUnitTest extends CliCommandTestBase {
commandString = csb.toString();
commandResult = executeCommand(commandString);
commandResultAsString = commandResultToString(commandResult);
- getLogWriter().info("Command String : " + commandString);
- getLogWriter().info("Output : \n" + commandResultAsString);
+ LogWriterSupport.getLogWriter().info("Command String : " + commandString);
+ LogWriterSupport.getLogWriter().info("Output : \n" + commandResultAsString);
assertEquals(Status.OK, commandResult.getStatus());
assertTrue(commandResultAsString.contains(PR1));
assertTrue(commandResultAsString.contains(REGION1));
@@ -260,8 +261,8 @@ public class ListAndDescribeRegionDUnitTest extends CliCommandTestBase {
String commandString = csb.toString();
CommandResult commandResult = executeCommand(commandString);
String commandResultAsString = commandResultToString(commandResult);
- getLogWriter().info("Command String : " + commandString);
- getLogWriter().info("Output : \n" + commandResultAsString);
+ LogWriterSupport.getLogWriter().info("Command String : " + commandString);
+ LogWriterSupport.getLogWriter().info("Output : \n" + commandResultAsString);
assertEquals(Status.OK, commandResult.getStatus());
assertTrue(commandResultAsString.contains(PR1));
assertTrue(commandResultAsString.contains("Server1"));
@@ -271,8 +272,8 @@ public class ListAndDescribeRegionDUnitTest extends CliCommandTestBase {
commandString = csb.toString();
commandResult = executeCommand(commandString);
commandResultAsString = commandResultToString(commandResult);
- getLogWriter().info("Command String : " + commandString);
- getLogWriter().info("Output : \n" + commandResultAsString);
+ LogWriterSupport.getLogWriter().info("Command String : " + commandString);
+ LogWriterSupport.getLogWriter().info("Output : \n" + commandResultAsString);
assertEquals(Status.OK, commandResult.getStatus());
assertTrue(commandResultAsString.contains(LOCALREGIONONMANAGER));
assertTrue(commandResultAsString.contains("Manager"));
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListIndexCommandDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListIndexCommandDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListIndexCommandDUnitTest.java
index 399e89c..de02b7a 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListIndexCommandDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListIndexCommandDUnitTest.java
@@ -45,6 +45,7 @@ import com.gemstone.gemfire.management.cli.Result;
import com.gemstone.gemfire.management.internal.cli.domain.IndexDetails;
import com.gemstone.gemfire.management.internal.cli.i18n.CliStrings;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.SerializableRunnableIF;
import com.gemstone.gemfire.test.dunit.VM;
@@ -142,7 +143,7 @@ public class ListIndexCommandDUnitTest extends CliCommandTestBase {
protected Properties createDistributedSystemProperties(final String gemfireName) {
final Properties distributedSystemProperties = new Properties();
- distributedSystemProperties.setProperty(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel());
+ distributedSystemProperties.setProperty(DistributionConfig.LOG_LEVEL_NAME, LogWriterSupport.getDUnitLogLevel());
distributedSystemProperties.setProperty(DistributionConfig.NAME_NAME, gemfireName);
return distributedSystemProperties;
@@ -180,7 +181,7 @@ public class ListIndexCommandDUnitTest extends CliCommandTestBase {
}
}
} catch (Exception e) {
- getLogWriter().error(
+ LogWriterSupport.getLogWriter().error(
String.format("Error occurred creating Index (%1$s) on Region (%2$s) - (%3$s)", indexName,
region.getFullPath(), e.getMessage()));
}
@@ -282,11 +283,11 @@ public class ListIndexCommandDUnitTest extends CliCommandTestBase {
@SuppressWarnings("unchecked")
protected <T extends Comparable<T>, B extends AbstractBean<T>> B query(final Cache cache, final String queryString) {
try {
- getLogWriter().info(String.format("Running Query (%1$s) in GemFire...", queryString));
+ LogWriterSupport.getLogWriter().info(String.format("Running Query (%1$s) in GemFire...", queryString));
final SelectResults<B> results = (SelectResults<B>) cache.getQueryService().newQuery(queryString).execute();
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
String.format("Running Query (%1$s) in GemFire returned (%2$d) result(s).", queryString, results.size()));
return (results.iterator().hasNext() ? results.iterator().next() : null);
@@ -298,12 +299,12 @@ public class ListIndexCommandDUnitTest extends CliCommandTestBase {
protected <T extends Comparable<T>, B extends AbstractBean<T>> B query(final Region<T, B> region,
final String queryPredicate) {
try {
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
String.format("Running Query (%1$s) on Region (%2$s)...", queryPredicate, region.getFullPath()));
final SelectResults<B> results = region.query(queryPredicate);
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
String.format("Running Query (%1$s) on Region (%2$s) returned (%3$d) result(s).", queryPredicate,
region.getFullPath(), results.size()));
@@ -319,7 +320,7 @@ public class ListIndexCommandDUnitTest extends CliCommandTestBase {
final Result result = executeCommand(CliStrings.LIST_INDEX + " --" + CliStrings.LIST_INDEX__STATS);
assertNotNull(result);
- getLogWriter().info(toString(result));
+ LogWriterSupport.getLogWriter().info(toString(result));
assertEquals(Result.Status.OK, result.getStatus());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MemberCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MemberCommandsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MemberCommandsDUnitTest.java
index a000053..9f5410c 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MemberCommandsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MemberCommandsDUnitTest.java
@@ -39,6 +39,8 @@ import com.gemstone.gemfire.management.internal.cli.i18n.CliStrings;
import com.gemstone.gemfire.management.internal.cli.remote.CommandProcessor;
import com.gemstone.gemfire.management.internal.cli.util.CommandStringBuilder;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -180,7 +182,7 @@ public class MemberCommandsDUnitTest extends CacheTestCase {
Properties props = new Properties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
- props.setProperty(DistributionConfig.LOCATORS_NAME, getServerHostName(host) + "[" + locatorPort + "]");
+ props.setProperty(DistributionConfig.LOCATORS_NAME, NetworkSupport.getServerHostName(host) + "[" + locatorPort + "]");
props.setProperty(DistributionConfig.LOG_LEVEL_NAME, "info");
props.setProperty(DistributionConfig.STATISTIC_SAMPLING_ENABLED_NAME, "true");
props.setProperty(DistributionConfig.ENABLE_TIME_STATISTICS_NAME, "true");
@@ -207,7 +209,7 @@ public class MemberCommandsDUnitTest extends CacheTestCase {
setupSystem();
CommandProcessor commandProcessor = new CommandProcessor();
Result result = commandProcessor.createCommandStatement(CliStrings.LIST_MEMBER, EMPTY_ENV).process();
- getLogWriter().info("#SB" + getResultAsString(result));
+ LogWriterSupport.getLogWriter().info("#SB" + getResultAsString(result));
assertEquals(true, result.getStatus().equals(Status.OK));
}
@@ -230,7 +232,7 @@ public class MemberCommandsDUnitTest extends CacheTestCase {
CommandProcessor commandProcessor = new CommandProcessor();
Result result = commandProcessor.createCommandStatement(CliStrings.LIST_MEMBER, EMPTY_ENV).process();
- getLogWriter().info("#SB" + getResultAsString(result));
+ LogWriterSupport.getLogWriter().info("#SB" + getResultAsString(result));
assertEquals(true, result.getStatus().equals(Status.ERROR));
} finally {
locator.stop(); // fix for bug 46562
@@ -249,7 +251,7 @@ public class MemberCommandsDUnitTest extends CacheTestCase {
CommandStringBuilder csb = new CommandStringBuilder(CliStrings.LIST_MEMBER);
csb.addOption(CliStrings.LIST_MEMBER__GROUP, "G1");
Result result = commandProcessor.createCommandStatement(csb.toString(), EMPTY_ENV).process();
- getLogWriter().info("#SB" + getResultAsString(result));
+ LogWriterSupport.getLogWriter().info("#SB" + getResultAsString(result));
assertEquals(true, result.getStatus().equals(Status.OK));
}
@@ -272,7 +274,7 @@ public class MemberCommandsDUnitTest extends CacheTestCase {
Result result = commandProcessor.createCommandStatement("describe member --name=" + member.getId(),
EMPTY_ENV).process();
assertEquals(true, result.getStatus().equals(Status.OK));
- getLogWriter().info("#SB" + getResultAsString(result));
+ LogWriterSupport.getLogWriter().info("#SB" + getResultAsString(result));
//assertEquals(true, result.getStatus().equals(Status.OK));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommandsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommandsDUnitTest.java
index e1b1543..d7c8712 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommandsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommandsDUnitTest.java
@@ -34,9 +34,13 @@ import com.gemstone.gemfire.management.internal.cli.result.CompositeResultData;
import com.gemstone.gemfire.management.internal.cli.result.CompositeResultData.SectionResultData;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
import com.gemstone.gemfire.management.internal.cli.result.ResultBuilder;
import com.gemstone.gemfire.management.internal.cli.result.ResultData;
import com.gemstone.gemfire.management.internal.cli.result.TabularResultData;
@@ -63,7 +67,7 @@ public class MiscellaneousCommandsDUnitTest extends CliCommandTestBase {
@Override
public void tearDown2() throws Exception {
- invokeInEveryVM(new SerializableRunnable("reset log level") {
+ Invoke.invokeInEveryVM(new SerializableRunnable("reset log level") {
public void run() {
if (cachedLogLevel != null) {
System.setProperty("gemfire.log-level", cachedLogLevel);
@@ -83,7 +87,7 @@ public class MiscellaneousCommandsDUnitTest extends CliCommandTestBase {
cmdResult.resetToFirstLine();
if (cmdResult != null) {
String cmdResultStr = commandResultToString(cmdResult);
- getLogWriter().info("testGCForGroup cmdResultStr=" + cmdResultStr + "; cmdResult=" + cmdResult);
+ LogWriterSupport.getLogWriter().info("testGCForGroup cmdResultStr=" + cmdResultStr + "; cmdResult=" + cmdResult);
assertEquals(Result.Status.OK, cmdResult.getStatus());
if (cmdResult.getType().equals(ResultData.TYPE_TABULAR)) {
TabularResultData table = (TabularResultData) cmdResult.getResultData();
@@ -111,7 +115,7 @@ public class MiscellaneousCommandsDUnitTest extends CliCommandTestBase {
cmdResult.resetToFirstLine();
if (cmdResult != null) {
String cmdResultStr = commandResultToString(cmdResult);
- getLogWriter().info("testGCForMemberID cmdResultStr=" + cmdResultStr);
+ LogWriterSupport.getLogWriter().info("testGCForMemberID cmdResultStr=" + cmdResultStr);
assertEquals(Result.Status.OK, cmdResult.getStatus());
if (cmdResult.getType().equals(ResultData.TYPE_TABULAR)) {
TabularResultData table = (TabularResultData) cmdResult.getResultData();
@@ -137,7 +141,7 @@ public class MiscellaneousCommandsDUnitTest extends CliCommandTestBase {
if (cmdResult != null) {
String log = commandResultToString(cmdResult);
assertNotNull(log);
- getLogWriter().info("Show Log is" + log);
+ LogWriterSupport.getLogWriter().info("Show Log is" + log);
assertEquals(Result.Status.OK, cmdResult.getStatus());
} else {
fail("testShowLog failed as did not get CommandResult");
@@ -159,7 +163,7 @@ public class MiscellaneousCommandsDUnitTest extends CliCommandTestBase {
if (cmdResult != null) {
String log = commandResultToString(cmdResult);
assertNotNull(log);
- getLogWriter().info("Show Log is" + log);
+ LogWriterSupport.getLogWriter().info("Show Log is" + log);
assertEquals(Result.Status.OK, cmdResult.getStatus());
} else {
fail("testShowLog failed as did not get CommandResult");
@@ -176,7 +180,7 @@ public class MiscellaneousCommandsDUnitTest extends CliCommandTestBase {
cmdResult.resetToFirstLine();
if (cmdResult != null) {
String cmdResultStr = commandResultToString(cmdResult);
- getLogWriter().info("testGCForEntireCluster cmdResultStr=" + cmdResultStr + "; cmdResult=" + cmdResult);
+ LogWriterSupport.getLogWriter().info("testGCForEntireCluster cmdResultStr=" + cmdResultStr + "; cmdResult=" + cmdResult);
assertEquals(Result.Status.OK, cmdResult.getStatus());
if (cmdResult.getType().equals(ResultData.TYPE_TABULAR)) {
TabularResultData table = (TabularResultData) cmdResult.getResultData();
@@ -223,7 +227,7 @@ public class MiscellaneousCommandsDUnitTest extends CliCommandTestBase {
public void testShutDownWithoutTimeout() {
- IgnoredException.addExpectedException("EntryDestroyedException");
+ IgnoredException.addIgnoredException("EntryDestroyedException");
setupForShutDown();
ThreadUtils.sleep(2500);
@@ -233,7 +237,7 @@ public class MiscellaneousCommandsDUnitTest extends CliCommandTestBase {
if (cmdResult != null) {
String cmdResultStr = commandResultToString(cmdResult);
- getLogWriter().info("testShutDownWithoutTimeout cmdResultStr=" + cmdResultStr);
+ LogWriterSupport.getLogWriter().info("testShutDownWithoutTimeout cmdResultStr=" + cmdResultStr);
}
verifyShutDown();
@@ -242,7 +246,7 @@ public class MiscellaneousCommandsDUnitTest extends CliCommandTestBase {
// Need for the Gfsh HTTP enablement during shutdown to properly assess the
// state of the connection.
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
public boolean done() {
return !defaultShell.isConnectedAndReady();
}
@@ -260,14 +264,14 @@ public class MiscellaneousCommandsDUnitTest extends CliCommandTestBase {
setupForShutDown();
ThreadUtils.sleep(2500);
- IgnoredException.addExpectedException("EntryDestroyedException");
+ IgnoredException.addIgnoredException("EntryDestroyedException");
String command = "shutdown --time-out=15";
CommandResult cmdResult = executeCommand(command);
if (cmdResult != null) {
String cmdResultStr = commandResultToString(cmdResult);
- getLogWriter().info("testShutDownWithTIMEOUT cmdResultStr=" + cmdResultStr);
+ LogWriterSupport.getLogWriter().info("testShutDownWithTIMEOUT cmdResultStr=" + cmdResultStr);
}
verifyShutDown();
@@ -275,7 +279,7 @@ public class MiscellaneousCommandsDUnitTest extends CliCommandTestBase {
final HeadlessGfsh defaultShell = getDefaultShell();
// Need for the Gfsh HTTP enablement during shutdown to properly assess the state of the connection.
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
public boolean done() {
return !defaultShell.isConnectedAndReady();
}
@@ -304,7 +308,7 @@ public class MiscellaneousCommandsDUnitTest extends CliCommandTestBase {
if (cmdResult != null) {
String cmdResultStr = commandResultToString(cmdResult);
- getLogWriter().info("testShutDownForTIMEOUT cmdResultStr = " + cmdResultStr);
+ LogWriterSupport.getLogWriter().info("testShutDownForTIMEOUT cmdResultStr = " + cmdResultStr);
CommandResult result = (CommandResult) ResultBuilder.createInfoResult(CliStrings.SHUTDOWN_TIMEDOUT);
String expectedResult = commandResultToString(result);
assertEquals(expectedResult, cmdResultStr);
@@ -384,7 +388,7 @@ public class MiscellaneousCommandsDUnitTest extends CliCommandTestBase {
return "Wait for gfsh to get disconnected from Manager.";
}
};
- waitForCriterion(waitCriterion, 5000, 200, true);
+ Wait.waitForCriterion(waitCriterion, 5000, 200, true);
assertTrue(Boolean.FALSE.equals(vm1.invoke(connectedChecker)));
assertTrue(Boolean.FALSE.equals(vm0.invoke(connectedChecker)));
@@ -415,7 +419,7 @@ public class MiscellaneousCommandsDUnitTest extends CliCommandTestBase {
String commandString = CliStrings.CHANGE_LOGLEVEL + " --" + CliStrings.CHANGE_LOGLEVEL__LOGLEVEL + "=finer" + " --" + CliStrings.CHANGE_LOGLEVEL__MEMBER + "=" + serverName1 + "," + serverName2;
CommandResult commandResult = executeCommand(commandString);
- getLogWriter().info("testChangeLogLevel commandResult=" + commandResult);
+ LogWriterSupport.getLogWriter().info("testChangeLogLevel commandResult=" + commandResult);
assertTrue(Status.OK.equals(commandResult.getStatus()));
CompositeResultData resultData = (CompositeResultData) commandResult.getResultData();
SectionResultData section = resultData.retrieveSection("section");
@@ -471,7 +475,7 @@ public class MiscellaneousCommandsDUnitTest extends CliCommandTestBase {
String commandString = CliStrings.CHANGE_LOGLEVEL + " --" + CliStrings.CHANGE_LOGLEVEL__LOGLEVEL + "=finer" + " --" + CliStrings.CHANGE_LOGLEVEL__GROUPS + "=" + grp1 + "," + grp2;
CommandResult commandResult = executeCommand(commandString);
- getLogWriter().info("testChangeLogLevelForGrps commandResult=" + commandResult);
+ LogWriterSupport.getLogWriter().info("testChangeLogLevelForGrps commandResult=" + commandResult);
assertTrue(Status.OK.equals(commandResult.getStatus()));