public class InterestListDUnitTest extends DistributedTestCase
DistributedTestCase.ExpectedException, DistributedTestCase.WaitCriterion, DistributedTestCase.WaitCriterion2logPerTest, reconnect, system, testName| Constructor and Description |
|---|
InterestListDUnitTest(String name)
constructor
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addRegisterInterestListener() |
static void |
closeCache() |
static com.gemstone.gemfire.distributed.DistributedMember |
createClientCache(String host,
int port) |
static com.gemstone.gemfire.distributed.DistributedMember |
createClientCache(String host,
int port,
int port2) |
static void |
createEntriesK1andK2() |
static Integer |
createServerCache() |
static void |
flushQueues()
wait for queues to drain in the server
|
static void |
multiple_put() |
static void |
put_ALL_KEYS() |
static void |
put(String vm) |
static void |
putAgain(String vm) |
static void |
putSingleEntry(Object key,
String value) |
static void |
registerALL_KEYS() |
static void |
registerKey(Object key) |
static void |
registerKeyEx(Object key) |
static void |
registerKeyForClient(com.gemstone.gemfire.distributed.DistributedMember clientId,
Object key)
exercises the ClientSession interface to register interest in a server
on behalf of a client
|
static void |
registerKeys() |
static void |
registerKeysAgain() |
void |
setUp()
Sets up the test (noop).
|
void |
tearDown2()
Tears down the test.
|
void |
testInitializationOfRegionFromInterestList()
one server two clients
create Entries in all the vms
server directly puts some values
then both clients connect to the server
c1 register(k1,k2,k3) and c2 register (k4,k5)
then verify that updates has occured as a result of interest registration.
|
void |
testInterestListRegistration_ALL_KEYS()
one server two clients
create Entries in all the vms
register ALL_KEYS and verifies that updates are receiving to all the keys
|
void |
testInterestListRegistration()
one server two clients
create Entries in all the vms
c1 : register (k1)
c2 : register (k2)
c1 : put (k1 -> vm1-k1) AND (k2 -> vm1-k2)
c2 : validate (k1 == k1) AND (k2 == vm1-k2) // as k1 is not registered
c2 : put (k1 -> vm2-k1)
c1 : validate (k1 == vm2-k1) AND (k2 == vm1-k2)// as k2 is not registered
c1 : unregister(k1)
c2 : unregister(k2)
c1 : put (k1 -> vm1-k1-again) AND (k2 -> vm1-k2-again)
c2 : validate (k1 == vm2-k1) AND (k2 == vm2-k2) // as both are not registered
c2 : put (k1 -> vm2-k1-again) AND (k2 -> vm2-k2-again)
c1 : validate (k1 == vm1-k1-again) AND (k2 == vm1-k2-again)// as both are not registered
|
void |
testInterestListRegistrationOnServer()
one server two clients
create Entries in all the vms
s1 : register (k1) for c1
s1 : register (k2) for c2
c1 : put (k1 -> vm1-k1) AND (k2 -> vm1-k2)
c2 : validate (k1 == k1) AND (k2 == vm1-k2) // as k1 is not registered
c2 : put (k1 -> vm2-k1)
c1 : validate (k1 == vm2-k1) AND (k2 == vm1-k2)// as k2 is not registered
s1 : unregister(k1) for c1
s1 : unregister(k2) for c2
c1 : put (k1 -> vm1-k1-again) AND (k2 -> vm1-k2-again)
c2 : validate (k1 == vm2-k1) AND (k2 == vm2-k2) // as both are not registered
c2 : put (k1 -> vm2-k1-again) AND (k2 -> vm2-k2-again)
c1 : validate (k1 == vm1-k1-again) AND (k2 == vm1-k2-again)// as both are not registered
|
void |
testInterestRegistrationListeners()
two servers one client
create Entries in all the vms
register interest in various ways and ensure that registration listeners
are properly invoked
|
void |
testNoAvailableServer()
This tests whether an exception is thrown in register/unregister when no
server is available.
|
void |
testValueRefresh()
one server two clients
create Entries in all the vms
STEP 1:
c2: put (k2 -> vm-k2)
c1: validate k2 == k2 (not updated because no interest)
STEP 2
c1: register k2
c1 : validate k2 == vm-k2 (updated because of registerInterest)
c1: validate k1 == k1 (other key not updated because still no interest)
STEP 3:
c1: put (k1 -> vm-k1)
c2: validate k1 == k1 (not updated because no interest)
c2: register k1
c2: validate k1 == vm-k1 (updated because of registerInterest)
STEP 4:
c2: unregister k1
c1: put k1->k1 (old value)
c2: validate k1 == vm-k1 (no interest, so missing update)
|
static void |
unregisterKey(Object key) |
static void |
unregisterKeyEx(Object key) |
static void |
unregisterKeyForClient(com.gemstone.gemfire.distributed.DistributedMember clientId,
Object key)
unregister a key for a particular client in the server
|
static void |
validate_ALL_KEYS() |
static void |
validateEntriesAgain(String vm) |
static void |
validateEntriesK1andK2(String vm) |
static void |
validateRegionEntriesFromInterestListInVm1() |
static void |
validateRegionEntriesFromInterestListInVm2() |
static void |
validateSingleEntry(Object key,
String value) |
static void |
verifyCountsAndClear(int count1,
int count2) |
addExpectedException, addExpectedException, addHydraProperties, attachDebugger, checkBBFlag, cleanupAllVms, clearBBFlag, crashDistributedSystem, crashDistributedSystem, createLogWriter, disconnectAllFromDS, disconnectFromDS, dumpAllStacks, dumpMyThreads, dumpStack, dumpStack, dumpStack, dumpStackTrace, fail, getAllDistributedSystemProperties, getDistributedSystemProperties, 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, toStringpublic InterestListDUnitTest(String name)
public void setUp()
throws Exception
DistributedTestCasesetUp in class DistributedTestCaseExceptionpublic void testInterestListRegistration()
public void testValueRefresh()
public void testInterestListRegistration_ALL_KEYS()
public void testInitializationOfRegionFromInterestList()
public void testInterestListRegistrationOnServer()
public void testInterestRegistrationListeners()
public void testNoAvailableServer()
public static com.gemstone.gemfire.distributed.DistributedMember createClientCache(String host, int port) throws Exception
Exceptionpublic static com.gemstone.gemfire.distributed.DistributedMember createClientCache(String host, int port, int port2) throws Exception
Exceptionpublic static void flushQueues()
throws Exception
Exceptionpublic static void addRegisterInterestListener()
public static void verifyCountsAndClear(int count1,
int count2)
public static void createEntriesK1andK2()
public static void registerKey(Object key)
public static void registerKeyForClient(com.gemstone.gemfire.distributed.DistributedMember clientId,
Object key)
clientId - the DM of the clientkey - the key that the client is interested inpublic static void registerKeyEx(Object key)
public static void registerALL_KEYS()
public static void put_ALL_KEYS()
public static void validate_ALL_KEYS()
public static void registerKeys()
public static void registerKeysAgain()
public static void unregisterKey(Object key)
public static void unregisterKeyForClient(com.gemstone.gemfire.distributed.DistributedMember clientId,
Object key)
clientId - the client's IDkey - the key it's no longer interest inpublic static void unregisterKeyEx(Object key)
public static void validateRegionEntriesFromInterestListInVm1()
public static void validateRegionEntriesFromInterestListInVm2()
public static void put(String vm)
public static void multiple_put()
public static void putAgain(String vm)
public static void validateEntriesK1andK2(String vm)
public static void validateEntriesAgain(String vm)
public void tearDown2()
throws Exception
DistributedTestCaseDistributedTestCase.tearDown() method, and should be over ridden in its place.tearDown2 in class DistributedTestCaseExceptionpublic static void closeCache()
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.