| /*========================================================================= |
| * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved. |
| * This product is protected by U.S. and international copyright |
| * and intellectual property laws. Pivotal products are covered by |
| * one or more patents listed at http://www.pivotal.io/patents. |
| *========================================================================= |
| */ |
| |
| #ifndef THINCLIENTPUTGETALL_HPP_ |
| #define THINCLIENTPUTGETALL_HPP_ |
| |
| #include "fw_dunit.hpp" |
| #include <gfcpp/GemfireCppCache.hpp> |
| #include <ace/OS.h> |
| #include <ace/High_Res_Timer.h> |
| #include <string> |
| #include <unordered_map> |
| |
| #define ROOT_NAME "Notifications" |
| #define ROOT_SCOPE DISTRIBUTED_ACK |
| |
| #include "CacheHelper.hpp" |
| #include "testobject/VariousPdxTypes.hpp" |
| #include "testobject/PdxClassV1.hpp" |
| #include "testobject/PdxClassV2.hpp" |
| |
| using namespace PdxTests; |
| using namespace gemfire; |
| using namespace test; |
| |
| #define CLIENT1 s1p1 |
| #define CLIENT2 s1p2 |
| #define SERVER1 s2p1 |
| |
| CacheHelper* cacheHelper = NULL; |
| static bool isLocalServer = false; |
| static bool isLocator = false; |
| static int numberOfLocators = 0; |
| const char * endPoints = CacheHelper::getTcrEndpoints(isLocalServer, 1); |
| const char* locatorsG = CacheHelper::getLocatorHostPort( isLocator, numberOfLocators); |
| const char* poolName="__TESTPOOL1_"; |
| |
| const char * keys[] = { "Key-1", "Key-2", "Key-3", "Key-4" }; |
| const char * vals[] = { "Value-1", "Value-2", "Value-3", "Value-4" }; |
| const char * nvals[] = { "New Value-1", "New Value-2", "New Value-3", "New Value-4" }; |
| const char * regionNames[] = { "DistRegionAck"}; |
| const bool USE_ACK = true; |
| const bool NO_ACK = false; |
| |
| #include "LocatorHelper.hpp" |
| |
| void initClient( const bool isthinClient ) |
| { |
| if ( cacheHelper == NULL ) { |
| cacheHelper = new CacheHelper(isthinClient); |
| } |
| ASSERT( cacheHelper, "Failed to create a CacheHelper client instance." ); |
| } |
| void cleanProc() |
| { |
| if ( cacheHelper != NULL ) { |
| delete cacheHelper; |
| cacheHelper = NULL; |
| } |
| } |
| |
| CacheHelper * getHelper() |
| { |
| ASSERT( cacheHelper != NULL, "No cacheHelper initialized." ); |
| return cacheHelper; |
| } |
| |
| void verifyGetAll(RegionPtr region,bool addToLocalCache, const char **vals, int startIndex, CacheablePtr callBack = NULLPTR) |
| { |
| CacheableKeyPtr keyPtr0 = CacheableKey::create(keys[0]); |
| CacheableKeyPtr keyPtr1 = CacheableKey::create(keys[1]); |
| CacheableKeyPtr keyPtr2 = CacheableKey::create("keyNotThere"); |
| |
| VectorOfCacheableKey keys1; |
| keys1.push_back(keyPtr0); |
| keys1.push_back(keyPtr1); |
| keys1.push_back(keyPtr2); |
| |
| std::unordered_map<std::string, std::string> expected; |
| expected[keys[0]] = vals[startIndex + 0]; |
| expected[keys[1]] = vals[startIndex + 1]; |
| |
| HashMapOfCacheablePtr valuesMap(new HashMapOfCacheable()); |
| valuesMap->clear(); |
| region->getAll(keys1, valuesMap, NULLPTR, addToLocalCache, callBack); |
| if(valuesMap->size() == keys1.size()){ |
| char buf[ 2048 ]; |
| for(HashMapOfCacheable::Iterator iter = valuesMap->begin(); iter != valuesMap->end(); iter++) |
| { |
| CacheableKeyPtr key = dynCast<CacheableKeyPtr>(iter.first()); |
| const char* actualKey = key->toString()->asChar(); |
| CacheablePtr mVal = iter.second(); |
| if(mVal != NULLPTR) |
| { |
| const char* expectedVal = expected[actualKey].c_str(); |
| const char* actualVal = mVal->toString()->asChar(); |
| sprintf( buf, "value from map %s , expected value %s " , actualVal, expectedVal ); |
| LOG(buf); |
| ASSERT( strcmp( actualVal, expectedVal ) == 0, "value not matched" ); |
| } |
| else |
| { |
| ASSERT( strcmp(actualKey, "keyNotThere") == 0, "keyNotThere value is not null"); |
| } |
| } |
| } |
| } |
| |
| void verifyGetAllWithCallBackArg(RegionPtr region,bool addToLocalCache, const char **vals, int startIndex, CacheablePtr callBack) |
| { |
| verifyGetAll(region, addToLocalCache, vals, startIndex, callBack); |
| } |
| |
| void createRegion( const char * name, bool ackMode, bool isCacheEnabled, const char * endpoints ,bool clientNotificationEnabled = false) |
| { |
| LOG( "createRegion() entered." ); |
| fprintf( stdout, "Creating region -- %s ackMode is %d\n", name, ackMode ); |
| fflush( stdout ); |
| RegionPtr regPtr = getHelper()->createRegion( name, ackMode, isCacheEnabled, |
| NULLPTR, endpoints,clientNotificationEnabled ); |
| ASSERT( regPtr != NULLPTR, "Failed to create region." ); |
| LOG( "Region created." ); |
| } |
| |
| void createPooledRegion( const char * name, bool ackMode, const char * endpoints, const char* locators,const char* poolname, bool clientNotificationEnabled = false, bool cachingEnable = true) |
| { |
| LOG( "createRegion_Pool() entered." ); |
| fprintf( stdout, "Creating region -- %s ackMode is %d\n", name, ackMode ); |
| fflush( stdout ); |
| RegionPtr regPtr = getHelper()->createPooledRegion(name,ackMode,endpoints, locators, poolname ,cachingEnable, clientNotificationEnabled); |
| ASSERT( regPtr != NULLPTR, "Failed to create region." ); |
| LOG( "Pooled Region created." ); |
| } |
| |
| DUNIT_TASK_DEFINITION(SERVER1, CreateServer1) |
| { |
| //start one server |
| if ( isLocalServer ) { |
| CacheHelper::initServer( 1, "cacheserver_notify_subscription.xml" ); |
| LOG("SERVER1 started"); |
| } |
| } |
| END_TASK_DEFINITION |
| |
| DUNIT_TASK_DEFINITION(CLIENT1, StepOne) |
| { |
| //start 1st client with caching enable true and client notification true |
| initClient(true); |
| createRegion( regionNames[0], USE_ACK, true, endPoints, true); |
| LOG( "StepOne complete." ); |
| } |
| END_TASK_DEFINITION |
| |
| DUNIT_TASK_DEFINITION(CLIENT1, StepOne_Pooled_Locator) |
| { |
| //start 1st client with caching enable true and client notification true |
| initClient(true); |
| createPooledRegion( regionNames[0], USE_ACK, NULL, locatorsG, poolName, true, true); |
| LOG( "StepOne_Pooled_Locator complete." ); |
| } |
| END_TASK_DEFINITION |
| |
| DUNIT_TASK_DEFINITION(CLIENT1, StepOne_Pooled_EndPoint) |
| { |
| //start 1st client with caching enable true and client notification true |
| initClient(true); |
| createPooledRegion( regionNames[0], USE_ACK, endPoints, NULL, poolName, true, true); |
| LOG( "StepOne_Pooled_EndPoint complete." ); |
| } |
| END_TASK_DEFINITION |
| |
| DUNIT_TASK_DEFINITION(CLIENT2, StepTwo) |
| { |
| initClient(true); |
| //start 2nd client with caching enable true and client notification true |
| createRegion( regionNames[0], USE_ACK, true, endPoints,true); |
| LOG( "StepTwo complete." ); |
| } |
| END_TASK_DEFINITION |
| |
| DUNIT_TASK_DEFINITION(CLIENT2, StepTwo_Pooled_Locator) |
| { |
| //start 1st client with caching enable true and client notification true |
| initClient(true); |
| createPooledRegion( regionNames[0], USE_ACK, NULL, locatorsG, poolName, true, true); |
| LOG( "StepTwo_Pooled_Locator complete." ); |
| } |
| END_TASK_DEFINITION |
| |
| DUNIT_TASK_DEFINITION(CLIENT2, StepTwo_Pooled_EndPoint) |
| { |
| //start 1st client with caching enable true and client notification true |
| initClient(true); |
| createPooledRegion( regionNames[0], USE_ACK, endPoints, NULL, poolName, true, true); |
| LOG( "StepTwo_Pooled_EndPoint complete." ); |
| } |
| END_TASK_DEFINITION |
| |
| DUNIT_TASK_DEFINITION(CLIENT1, StepThree) |
| { |
| //putAll from client 1 |
| HashMapOfCacheable map0; |
| map0.clear(); |
| for (int i=0; i<2; i++) { |
| map0.insert(CacheableKey::create(keys[i]), CacheableString::create(vals[i])); |
| } |
| RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]); |
| regPtr0->putAll(map0); |
| LOG( "StepThree complete." ); |
| } |
| END_TASK_DEFINITION |
| |
| DUNIT_TASK_DEFINITION(CLIENT2, StepFour) |
| { |
| // getAll and validate key and value. |
| RegionPtr region = getHelper()->getRegion(regionNames[0]); |
| verifyGetAll(region,true,vals,0); |
| verifyGetAllWithCallBackArg(region,true,vals,0, CacheableInt32::create(1000)); |
| LOG( "StepFour complete." ); |
| } |
| END_TASK_DEFINITION |
| DUNIT_TASK_DEFINITION(CLIENT1, StepFive) |
| { |
| //update keys,values by putAll |
| HashMapOfCacheable map0; |
| map0.clear(); |
| for (int i=0; i<2; i++) { |
| map0.insert(CacheableKey::create(keys[i]), CacheableString::create(nvals[i])); |
| } |
| RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]); |
| regPtr0->putAll(map0); |
| LOG( "StepFive complete." ); |
| } |
| END_TASK_DEFINITION |
| DUNIT_TASK_DEFINITION(CLIENT2, StepSix) |
| { |
| // verify getAll get the data from local cache. |
| RegionPtr region = getHelper()->getRegion(regionNames[0]); |
| verifyGetAll(region,true, vals,0); |
| verifyGetAllWithCallBackArg(region,true, vals,0, CacheableInt32::create(1000)); |
| LOG( "StepSix complete." ); |
| } |
| END_TASK_DEFINITION |
| |
| DUNIT_TASK_DEFINITION(CLIENT2, StepSeven) |
| { |
| // getAll and validate key and value after localDestroyRegion and recreation of region. |
| RegionPtr reg0 = getHelper()->getRegion(regionNames[0]); |
| reg0->localDestroyRegion(); |
| reg0 = NULLPTR; |
| createRegion( regionNames[0], USE_ACK, true, endPoints, true); |
| reg0 = getHelper()->getRegion(regionNames[0]); |
| verifyGetAll(reg0,true, nvals,0); |
| verifyGetAllWithCallBackArg(reg0,true, nvals,0, CacheableInt32::create(1000)); |
| } |
| END_TASK_DEFINITION |
| |
| DUNIT_TASK_DEFINITION(CLIENT2, StepSeven_Pool) |
| { |
| // getAll and validate key and value after localDestroyRegion and recreation of region. |
| RegionPtr reg0 = getHelper()->getRegion(regionNames[0]); |
| reg0->localDestroyRegion(); |
| reg0 = NULLPTR; |
| createPooledRegion( regionNames[0], USE_ACK, NULL, locatorsG, poolName, true, true); |
| reg0 = getHelper()->getRegion(regionNames[0]); |
| verifyGetAll(reg0,true, nvals,0); |
| verifyGetAllWithCallBackArg(reg0,true, nvals,0, CacheableInt32::create(1000)); |
| } |
| END_TASK_DEFINITION |
| |
| |
| DUNIT_TASK_DEFINITION(CLIENT1, putallAndGetallPdxWithCallBackArg) |
| { |
| LOG( "putallAndGetallPdxWithCallBackArg started." ); |
| |
| try{ |
| Serializable::registerPdxType(PdxTypes1::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| |
| try{ |
| Serializable::registerPdxType(PdxTypes2::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| |
| try{ |
| Serializable::registerPdxType(PdxTypes3::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| try{ |
| Serializable::registerPdxType(PdxTypes4::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| |
| try{ |
| Serializable::registerPdxType(PdxTypes5::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| |
| try{ |
| Serializable::registerPdxType(PdxTypes6::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| |
| try{ |
| Serializable::registerPdxType(PdxTypes7::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| |
| try{ |
| Serializable::registerPdxType(PdxTypes8::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| try{ |
| Serializable::registerPdxType(PdxTypes9::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| try{ |
| Serializable::registerPdxType(PdxTypes10::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| |
| PdxTypes1Ptr p1(new PdxTypes1()); |
| PdxTypes2Ptr p2(new PdxTypes2()); |
| PdxTypes3Ptr p3(new PdxTypes3()); |
| PdxTypes4Ptr p4(new PdxTypes4()); |
| PdxTypes5Ptr p5(new PdxTypes5()); |
| PdxTypes6Ptr p6(new PdxTypes6()); |
| PdxTypes7Ptr p7(new PdxTypes7()); |
| PdxTypes8Ptr p8(new PdxTypes8()); |
| PdxTypes9Ptr p9(new PdxTypes9()); |
| PdxTypes10Ptr p10(new PdxTypes10()); |
| |
| //putAll from client 1 |
| HashMapOfCacheable map0; |
| map0.clear(); |
| |
| map0.insert(CacheableInt32::create(21), p1); |
| map0.insert(CacheableInt32::create(22), p2); |
| map0.insert(CacheableInt32::create(23), p3); |
| map0.insert(CacheableInt32::create(24), p4); |
| map0.insert(CacheableInt32::create(25), p5); |
| map0.insert(CacheableInt32::create(26), p6); |
| map0.insert(CacheableInt32::create(27), p7); |
| map0.insert(CacheableInt32::create(28), p8); |
| map0.insert(CacheableInt32::create(29), p9); |
| map0.insert(CacheableInt32::create(30), p10); |
| |
| RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]); |
| regPtr0->putAll(map0, 15, CacheableInt32::create(1000)); |
| LOG("putallPdxWithCallBackArg on Pdx objects completed."); |
| |
| regPtr0->localDestroy(CacheableInt32::create(21)); |
| regPtr0->localDestroy(CacheableInt32::create(22)); |
| regPtr0->localDestroy(CacheableInt32::create(23)); |
| regPtr0->localDestroy(CacheableInt32::create(24)); |
| regPtr0->localDestroy(CacheableInt32::create(25)); |
| regPtr0->localDestroy(CacheableInt32::create(26)); |
| regPtr0->localDestroy(CacheableInt32::create(27)); |
| regPtr0->localDestroy(CacheableInt32::create(28)); |
| regPtr0->localDestroy(CacheableInt32::create(29)); |
| regPtr0->localDestroy(CacheableInt32::create(30)); |
| LOG("localDestroy on all Pdx objects completed."); |
| |
| VectorOfCacheableKey keys1; |
| keys1.push_back(CacheableInt32::create(21)); |
| keys1.push_back(CacheableInt32::create(22)); |
| keys1.push_back(CacheableInt32::create(23)); |
| keys1.push_back(CacheableInt32::create(24)); |
| keys1.push_back(CacheableInt32::create(25)); |
| keys1.push_back(CacheableInt32::create(26)); |
| keys1.push_back(CacheableInt32::create(27)); |
| keys1.push_back(CacheableInt32::create(28)); |
| keys1.push_back(CacheableInt32::create(29)); |
| keys1.push_back(CacheableInt32::create(30)); |
| HashMapOfCacheablePtr valuesMap(new HashMapOfCacheable()); |
| valuesMap->clear(); |
| regPtr0->getAll(keys1, valuesMap, NULLPTR, true, CacheableInt32::create(1000)); |
| LOG("GetallPdxWithCallBackArg on Pdx objects completed."); |
| |
| ASSERT(valuesMap->size() == keys1.size(), "getAll size did not match"); |
| |
| PdxTypes10Ptr pRet10 = valuesMap->operator[](CacheableInt32::create(30)); |
| ASSERT(p10->equals(pRet10) == true, "Objects of type PdxTypes10 should be equal"); |
| |
| PdxTypes9Ptr pRet9 = valuesMap->operator[](CacheableInt32::create(29)); |
| ASSERT(p9->equals(pRet9) == true, "Objects of type PdxTypes9 should be equal"); |
| |
| PdxTypes8Ptr pRet8 = valuesMap->operator[](CacheableInt32::create(28)); |
| ASSERT(p8->equals(pRet8) == true, "Objects of type PdxTypes8 should be equal"); |
| |
| PdxTypes7Ptr pRet7 = valuesMap->operator[](CacheableInt32::create(27)); |
| ASSERT(p7->equals(pRet7) == true, "Objects of type PdxTypes7 should be equal"); |
| |
| PdxTypes6Ptr pRet6 = valuesMap->operator[](CacheableInt32::create(26)); |
| ASSERT(p6->equals(pRet6) == true, "Objects of type PdxTypes6 should be equal"); |
| |
| PdxTypes5Ptr pRet5 = valuesMap->operator[](CacheableInt32::create(25)); |
| ASSERT(p5->equals(pRet5) == true, "Objects of type PdxTypes5 should be equal"); |
| |
| PdxTypes4Ptr pRet4 = valuesMap->operator[](CacheableInt32::create(24)); |
| ASSERT(p4->equals(pRet4) == true, "Objects of type PdxTypes4 should be equal"); |
| |
| PdxTypes3Ptr pRet3 = valuesMap->operator[](CacheableInt32::create(23)); |
| ASSERT(p3->equals(pRet3) == true, "Objects of type PdxTypes3 should be equal"); |
| |
| PdxTypes2Ptr pRet2 = valuesMap->operator[](CacheableInt32::create(22)); |
| ASSERT(p2->equals(pRet2) == true, "Objects of type PdxTypes2 should be equal"); |
| |
| PdxTypes1Ptr pRet1 = valuesMap->operator[](CacheableInt32::create(21)); |
| ASSERT(p1->equals(pRet1) == true, "Objects of type PdxTypes1 should be equal"); |
| |
| LOG( "putallAndGetallPdxWithCallBackArg complete." ); |
| } |
| END_TASK_DEFINITION |
| |
| |
| DUNIT_TASK_DEFINITION(CLIENT1, putallAndGetallPdx) |
| { |
| LOG( "putallAndGetallPdx started." ); |
| |
| try{ |
| Serializable::registerPdxType(PdxTypes1::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| |
| try{ |
| Serializable::registerPdxType(PdxTypes2::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| |
| try{ |
| Serializable::registerPdxType(PdxTypes3::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| try{ |
| Serializable::registerPdxType(PdxTypes4::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| |
| try{ |
| Serializable::registerPdxType(PdxTypes5::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| |
| try{ |
| Serializable::registerPdxType(PdxTypes6::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| |
| try{ |
| Serializable::registerPdxType(PdxTypes7::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| |
| try{ |
| Serializable::registerPdxType(PdxTypes8::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| try{ |
| Serializable::registerPdxType(PdxTypes9::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| try{ |
| Serializable::registerPdxType(PdxTypes10::createDeserializable); |
| }catch (const IllegalStateException& ) { |
| // ignore exception |
| } |
| |
| PdxTypes1Ptr p1(new PdxTypes1()); |
| PdxTypes2Ptr p2(new PdxTypes2()); |
| PdxTypes3Ptr p3(new PdxTypes3()); |
| PdxTypes4Ptr p4(new PdxTypes4()); |
| PdxTypes5Ptr p5(new PdxTypes5()); |
| PdxTypes6Ptr p6(new PdxTypes6()); |
| PdxTypes7Ptr p7(new PdxTypes7()); |
| PdxTypes8Ptr p8(new PdxTypes8()); |
| PdxTypes9Ptr p9(new PdxTypes9()); |
| PdxTypes10Ptr p10(new PdxTypes10()); |
| |
| //putAll from client 1 |
| HashMapOfCacheable map0; |
| map0.clear(); |
| |
| map0.insert(CacheableInt32::create(21), p1); |
| map0.insert(CacheableInt32::create(22), p2); |
| map0.insert(CacheableInt32::create(23), p3); |
| map0.insert(CacheableInt32::create(24), p4); |
| map0.insert(CacheableInt32::create(25), p5); |
| map0.insert(CacheableInt32::create(26), p6); |
| map0.insert(CacheableInt32::create(27), p7); |
| map0.insert(CacheableInt32::create(28), p8); |
| map0.insert(CacheableInt32::create(29), p9); |
| map0.insert(CacheableInt32::create(30), p10); |
| |
| RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]); |
| regPtr0->putAll(map0); |
| LOG("putAll on Pdx objects completed."); |
| |
| regPtr0->localDestroy(CacheableInt32::create(21)); |
| regPtr0->localDestroy(CacheableInt32::create(22)); |
| regPtr0->localDestroy(CacheableInt32::create(23)); |
| regPtr0->localDestroy(CacheableInt32::create(24)); |
| regPtr0->localDestroy(CacheableInt32::create(25)); |
| regPtr0->localDestroy(CacheableInt32::create(26)); |
| regPtr0->localDestroy(CacheableInt32::create(27)); |
| regPtr0->localDestroy(CacheableInt32::create(28)); |
| regPtr0->localDestroy(CacheableInt32::create(29)); |
| regPtr0->localDestroy(CacheableInt32::create(30)); |
| LOG("localDestroy on all Pdx objects completed."); |
| |
| VectorOfCacheableKey keys1; |
| keys1.push_back(CacheableInt32::create(21)); |
| keys1.push_back(CacheableInt32::create(22)); |
| keys1.push_back(CacheableInt32::create(23)); |
| keys1.push_back(CacheableInt32::create(24)); |
| keys1.push_back(CacheableInt32::create(25)); |
| keys1.push_back(CacheableInt32::create(26)); |
| keys1.push_back(CacheableInt32::create(27)); |
| keys1.push_back(CacheableInt32::create(28)); |
| keys1.push_back(CacheableInt32::create(29)); |
| keys1.push_back(CacheableInt32::create(30)); |
| HashMapOfCacheablePtr valuesMap(new HashMapOfCacheable()); |
| valuesMap->clear(); |
| regPtr0->getAll(keys1, valuesMap, NULLPTR, true); |
| LOG("getAll on Pdx objects completed."); |
| |
| ASSERT(valuesMap->size() == keys1.size(), "getAll size did not match"); |
| |
| PdxTypes10Ptr pRet10 = valuesMap->operator[](CacheableInt32::create(30)); |
| ASSERT(p10->equals(pRet10) == true, "Objects of type PdxTypes10 should be equal"); |
| |
| PdxTypes9Ptr pRet9 = valuesMap->operator[](CacheableInt32::create(29)); |
| ASSERT(p9->equals(pRet9) == true, "Objects of type PdxTypes9 should be equal"); |
| |
| PdxTypes8Ptr pRet8 = valuesMap->operator[](CacheableInt32::create(28)); |
| ASSERT(p8->equals(pRet8) == true, "Objects of type PdxTypes8 should be equal"); |
| |
| PdxTypes7Ptr pRet7 = valuesMap->operator[](CacheableInt32::create(27)); |
| ASSERT(p7->equals(pRet7) == true, "Objects of type PdxTypes7 should be equal"); |
| |
| PdxTypes6Ptr pRet6 = valuesMap->operator[](CacheableInt32::create(26)); |
| ASSERT(p6->equals(pRet6) == true, "Objects of type PdxTypes6 should be equal"); |
| |
| PdxTypes5Ptr pRet5 = valuesMap->operator[](CacheableInt32::create(25)); |
| ASSERT(p5->equals(pRet5) == true, "Objects of type PdxTypes5 should be equal"); |
| |
| PdxTypes4Ptr pRet4 = valuesMap->operator[](CacheableInt32::create(24)); |
| ASSERT(p4->equals(pRet4) == true, "Objects of type PdxTypes4 should be equal"); |
| |
| PdxTypes3Ptr pRet3 = valuesMap->operator[](CacheableInt32::create(23)); |
| ASSERT(p3->equals(pRet3) == true, "Objects of type PdxTypes3 should be equal"); |
| |
| PdxTypes2Ptr pRet2 = valuesMap->operator[](CacheableInt32::create(22)); |
| ASSERT(p2->equals(pRet2) == true, "Objects of type PdxTypes2 should be equal"); |
| |
| PdxTypes1Ptr pRet1 = valuesMap->operator[](CacheableInt32::create(21)); |
| ASSERT(p1->equals(pRet1) == true, "Objects of type PdxTypes1 should be equal"); |
| |
| LOG( "putallAndGetallPdx complete." ); |
| } |
| END_TASK_DEFINITION |
| |
| DUNIT_TASK_DEFINITION(CLIENT1,CloseCache1) |
| { |
| cleanProc(); |
| } |
| END_TASK_DEFINITION |
| |
| DUNIT_TASK_DEFINITION(CLIENT2,CloseCache2) |
| { |
| cleanProc(); |
| } |
| END_TASK_DEFINITION |
| |
| DUNIT_TASK_DEFINITION(SERVER1,CloseServer1) |
| { |
| if ( isLocalServer ) { |
| CacheHelper::closeServer( 1 ); |
| LOG("SERVER1 stopped"); |
| } |
| } |
| END_TASK_DEFINITION |
| |
| void runPutGetAll(bool poolConfig = true, bool isLocator = true) |
| { |
| if( poolConfig && isLocator ) |
| { |
| CALL_TASK(CreateLocator1); |
| CALL_TASK(CreateServer1_With_Locator_XML); |
| } |
| else |
| { |
| CALL_TASK( CreateServer1 ); |
| } |
| if(!poolConfig) |
| { |
| CALL_TASK(StepOne); |
| CALL_TASK(StepTwo); |
| } |
| else if(isLocator) |
| { |
| CALL_TASK(StepOne_Pooled_Locator); |
| CALL_TASK(StepTwo_Pooled_Locator); |
| } |
| else |
| { |
| CALL_TASK(StepOne_Pooled_EndPoint); |
| CALL_TASK(StepTwo_Pooled_EndPoint); |
| } |
| CALL_TASK(StepThree); |
| CALL_TASK(StepFour); |
| CALL_TASK(StepFive); |
| CALL_TASK(StepSix); |
| |
| if( poolConfig ) |
| { |
| CALL_TASK(StepSeven_Pool); |
| CALL_TASK(putallAndGetallPdx); |
| CALL_TASK(putallAndGetallPdxWithCallBackArg); |
| } |
| else |
| { |
| CALL_TASK(StepSeven); |
| } |
| CALL_TASK(CloseCache1); |
| CALL_TASK(CloseCache2); |
| CALL_TASK(CloseServer1); |
| if( poolConfig && isLocator ) |
| { |
| CALL_TASK(CloseLocator1); |
| } |
| } |
| #endif /* THINCLIENTPUTGETALL_HPP_ */ |