public class JmxClientStatResourcesCleanupDUnitTest extends AdminDUnitTestCase
For testCleanUp:
1. Start agent from current JMX client VM (VM#4)
2. From JMX client VM, invoke connectToSystem on agent VM. Collect reference
to distributed system MBean in setUp.
3. Start the cache & initialize the system in cache VM (CACHE_VM i.e. VM#0).
4. From JMX client VM, invoke manageSystemMemberApplications on distributed
system MBean (in step 2). On the SystemMember manageStat method is called
over JMX.
5. Count number of JMX statistics resources.
6. Start & connect a cache client (CLIENT_VM i.e. VM#2) to the cache VM.
7. Invoke operation manageStat on the SystemMember. Count number of JMX
statistics resources.
8. Stop the client & disconnect from the cacheVM.
9. Invoke operation manageStat on the SystemMember. Count number of JMX
statistics resources, it should be same as in step 5.
For testClientMembership:
1. Start agent from current JMX client VM (VM#4)
2. From JMX client VM, invoke connectToSystem on agent VM. Collect reference
to distributed system MBean in setUp.
3. Start the cache & initialize the system in cache VM (CACHE_VM i.e. VM#0).
4. From JMX client VM, invoke manageSystemMemberApplications on distributed
system MBean (in step 2). On the SystemMember manageStat method is called
over JMX. Register Notification Listener on this SystemMember MBean.
5. Count number of Notifications.
6. Start & connect a cache client (CLIENT_VM i.e. VM#2) to the cache VM.
7. Invoke operation manageStat on the SystemMember. Count number
Notifications, it should be more than in step 5.
8. Stop the client & disconnect from the cacheVM.
9. Invoke operation manageStat on the SystemMember. Count number of JMX
Notifications, it should be more than in step 7.
DistributedTestCase.ExpectedException, DistributedTestCase.WaitCriterion, DistributedTestCase.WaitCriterion2| Modifier and Type | Field and Description |
|---|---|
protected static String |
REGION_NAME |
agent, AGENT_VM, debug, NUM_RETRY, RETRY_INTERVAL, shutdownThread, tcSystem, urlStringcachelogPerTest, reconnect, system, testName| Constructor and Description |
|---|
JmxClientStatResourcesCleanupDUnitTest(String name) |
| Modifier and Type | Method and Description |
|---|---|
Properties |
getDistributedSystemProperties()
Over-ridden to ensure that all the members connect to the same distributed
system.
|
static void |
initDSProperties(int mcastPort)
Initializes the properties for the distributed system to be started.
|
protected boolean |
isJMX()
Whether JMX is to be used in this test case.
|
void |
setUp()
In addition to the setup done by the superclass, also creates a
DistributedSystem admin object. |
void |
tearDown2()
Destroys the
DistributedSystem created in AdminDUnitTestCase.setUp()
and performs the tear down inherited from the superclass. |
void |
testCleanUp()
Test to check clean up of managed stats resources.
|
void |
testClientMembership()
Test to check notifications received as the client membership changes.
|
assertAgent, assertLog, createDistributedSystem, disconnect, getAdminDistributedSystem, getDistributedMember, getDistributionConfig, getLocators, isRMI, isSSL, reconnectToSystem, startAgent, stopAgentaddExceptionTag1, basicGetCache, beginCacheXml, cleanDiskDirs, closeAllCache, closeCache, createLonerCache, createMcastCache, createMcastCache, createRegion, createRegion, createRootRegion, createRootRegion, disconnectFromDS, finishCacheXml, finishCacheXml, getCache, getCache, getCache, getCache, getClientCache, getDiskDirs, getGemfireCache, getInternalRegionArguments, getRootRegion, getRootRegion, hasCache, remoteTearDown, removeExceptionTag1, sendSerialMessageToAll, sendUnorderedMessageToAlladdExpectedException, addExpectedException, addHydraProperties, attachDebugger, checkBBFlag, cleanupAllVms, clearBBFlag, crashDistributedSystem, crashDistributedSystem, createLogWriter, disconnectAllFromDS, dumpAllStacks, dumpMyThreads, dumpStack, dumpStack, dumpStack, dumpStackTrace, fail, getAllDistributedSystemProperties, getDUnitLocatorAddress, getDUnitLocatorPort, getDUnitLocatorString, getDUnitLogLevel, getIPLiteral, getLogWriter, getLonerSystem, getMcastSystem, getMcastSystem, getRepeatTimeoutMs, getServerHostName, getSystem, getSystem, getTestClass, getTestName, getUniqueName, getVMCount, incBBFlag, invokeInEveryVM, invokeInEveryVM, invokeInEveryVM, invokeInEveryVM, invokeInEveryVMRepeatingIfNecessary, invokeInLocator, invokeRepeatingIfNecessary, isConnectedToDS, join, noteTiming, pause, pause, perVMSetUp, realTearDown, setDiskStoreForGateway, setSystem, setTestName, staticPause, tearDown, unregisterAllDataSerializersFromAllVms, unregisterDataSerializerInThisVM, unregisterInstantiatorsInThisVM, waitForBBFlag, waitForCriterion, waitMutexassertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toStringprotected static final String REGION_NAME
public JmxClientStatResourcesCleanupDUnitTest(String name)
protected boolean isJMX()
true.isJMX in class AdminDUnitTestCasepublic void testCleanUp()
throws Exception
Exception - one of the reasons could be failure of JMX operationspublic void testClientMembership()
throws Exception
Exception - one of the reasons could be failure of JMX operationspublic Properties getDistributedSystemProperties()
getDistributedSystemProperties in class DistributedTestCasepublic static void initDSProperties(int mcastPort)
mcastPort - mcast-port to use for setting up DSpublic void setUp()
throws Exception
AdminDUnitTestCaseDistributedSystem admin object.setUp in class AdminDUnitTestCaseExceptionpublic void tearDown2()
throws Exception
AdminDUnitTestCaseDistributedSystem created in AdminDUnitTestCase.setUp()
and performs the tear down inherited from the superclass.tearDown2 in class AdminDUnitTestCaseExceptionCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.