public void testPrintStacks() throws Exception { // create a gemfire.properties that lets SystemAdmin find the dunit locator Properties p = getAllDistributedSystemProperties(getDistributedSystemProperties()); try { SystemAdmin inst = new SystemAdmin(); SystemAdmin.setDistributedSystemProperties(p); String filename2 = getUniqueName()+"2.txt"; List<String> options = new ArrayList<String>(1); options.add(filename2); inst.printStacks("print-stacks", options, true); checkStackDumps(filename2, false); disconnect(); String filename1 = getUniqueName()+"1.txt"; options.clear(); options.add(filename1); inst.printStacks("print-stacks", options, false); checkStackDumps(filename1, true); } finally { // SystemAdmin calls methods that set these static variables DistributionManager.isDedicatedAdminVM = false; DistributionManager.isCommandLineAdminVM = false; SystemAdmin.setDistributedSystemProperties(null); } }