This is an automated email from the ASF dual-hosted git repository.
bbender pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git
The following commit(s) were added to refs/heads/develop by this push:
new 9f91019 GEODE-5738: Fixes google-global-names-in-headers warning
9f91019 is described below
commit 9f9101926d8566f03d90976109e9e4225f235cf8
Author: Jacob Barrett <[email protected]>
AuthorDate: Wed Sep 19 07:41:12 2018 -0700
GEODE-5738: Fixes google-global-names-in-headers warning
- Wrap using inside anonymous namespaces
- Ignore unused-member-function warnings in old integration tests.
- Removes unused methods.
- Update ThinClientListenerWriter.hpp
---
.clang-tidy | 2 +-
.../integration-test/BuiltinCacheableWrappers.hpp | 11 +-
cppcache/integration-test/CMakeLists.txt | 10 +
cppcache/integration-test/CacheImplHelper.hpp | 7 +-
cppcache/integration-test/CacheableWrapper.cpp | 10 +
cppcache/integration-test/CacheableWrapper.hpp | 10 +-
cppcache/integration-test/DeltaEx.hpp | 4 +
cppcache/integration-test/LibraryCallbacks.cpp | 4 +
cppcache/integration-test/LocatorHelper.hpp | 4 +
cppcache/integration-test/QueryHelper.hpp | 4 +
cppcache/integration-test/TallyListener.hpp | 10 +
cppcache/integration-test/TallyLoader.hpp | 16 +-
cppcache/integration-test/TallyWriter.hpp | 10 +
cppcache/integration-test/ThinClientCQ.hpp | 16 +-
.../integration-test/ThinClientCallbackArg.hpp | 17 +-
cppcache/integration-test/ThinClientDistOps.hpp | 16 +-
cppcache/integration-test/ThinClientDistOps2.hpp | 15 +-
cppcache/integration-test/ThinClientDurable.hpp | 20 +-
.../integration-test/ThinClientDurableConnect.hpp | 16 +-
.../integration-test/ThinClientDurableFailover.hpp | 20 +-
.../integration-test/ThinClientDurableInit.hpp | 16 +-
.../integration-test/ThinClientDurableInterest.hpp | 4 +
.../ThinClientDurableReconnect.hpp | 12 +-
cppcache/integration-test/ThinClientFailover.hpp | 4 +
cppcache/integration-test/ThinClientFailover2.hpp | 4 +
cppcache/integration-test/ThinClientFailover3.hpp | 48 ++--
.../ThinClientFailoverInterest.hpp | 4 +
.../ThinClientFailoverInterest2.hpp | 4 +
.../ThinClientFailoverInterestAllWithCache.hpp | 4 +
.../integration-test/ThinClientFailoverRegex.hpp | 4 +
.../integration-test/ThinClientGatewayTest.hpp | 46 ++--
cppcache/integration-test/ThinClientHeapLRU.hpp | 10 +-
cppcache/integration-test/ThinClientHelper.hpp | 4 +
cppcache/integration-test/ThinClientInterest1.hpp | 10 +-
cppcache/integration-test/ThinClientInterest2.hpp | 10 +-
cppcache/integration-test/ThinClientInterest3.hpp | 24 +-
.../ThinClientInterest3Cacheless.hpp | 24 +-
.../integration-test/ThinClientInterestList.hpp | 5 +-
.../integration-test/ThinClientInterestList2.hpp | 16 +-
.../integration-test/ThinClientListenerInit.hpp | 22 +-
.../integration-test/ThinClientListenerWriter.hpp | 241 +++++++++++----------
.../ThinClientLocalCacheLoader.hpp | 7 +
.../integration-test/ThinClientMultipleCaches.hpp | 5 +-
.../integration-test/ThinClientNotification.hpp | 4 +
.../integration-test/ThinClientPdxSerializer.hpp | 5 +-
.../integration-test/ThinClientPdxSerializers.hpp | 42 ++--
cppcache/integration-test/ThinClientPutAll.hpp | 4 +
.../integration-test/ThinClientPutAllTimeout.hpp | 9 +
.../ThinClientPutAllWithCallBack.hpp | 4 +
cppcache/integration-test/ThinClientPutGetAll.hpp | 4 +
.../ThinClientRIwithlocalRegionDestroy.hpp | 4 +
cppcache/integration-test/ThinClientRegex.hpp | 16 +-
cppcache/integration-test/ThinClientRegex2.hpp | 5 +-
cppcache/integration-test/ThinClientRegex3.hpp | 4 +
cppcache/integration-test/ThinClientRemoveAll.hpp | 9 +
cppcache/integration-test/ThinClientSSL.hpp | 4 +
.../integration-test/ThinClientSSLWithPassword.hpp | 14 +-
cppcache/integration-test/ThinClientSecurity.hpp | 4 +
.../integration-test/ThinClientSecurityHelper.hpp | 90 ++++----
cppcache/integration-test/ThinClientTXFailover.hpp | 4 +
cppcache/integration-test/ThinClientTasks_C2S2.hpp | 4 +
.../integration-test/ThinClientTransactions.hpp | 4 +
.../integration-test/ThinClientTransactionsXA.hpp | 10 +-
.../integration-test/ThinClientVersionedOps.hpp | 10 +-
cppcache/integration-test/TimeBomb.hpp | 10 +-
cppcache/integration-test/locator_globals.hpp | 4 +
cppcache/integration-test/testCacheless.cpp | 2 +
.../integration-test/testThinClientCacheables.cpp | 16 +-
.../testThinClientCacheablesLimits.cpp | 1 +
.../integration-test/testThinClientHeapLRU.cpp | 6 +-
.../testThinClientLRUExpiration.cpp | 5 +
.../testThinClientListenerCallbackArgTest.cpp | 6 +
...ThinClientNotificationWithDeltaWithoutcache.cpp | 8 +
.../testThinClientPRPutAllFailover.cpp | 2 +
.../integration-test/testThinClientPRSingleHop.cpp | 4 +
.../testThinClientPdxDeltaWithNotification.cpp | 1 +
.../testThinClientPutAllPRSingleHop.cpp | 1 +
.../testThinClientPutWithDelta.cpp | 8 +
.../testThinClientWriterException.cpp | 3 +
cppcache/integration-test/testUtils.hpp | 4 +
tests/cpp/fwklib/QueryHelper.hpp | 180 ++-------------
81 files changed, 724 insertions(+), 541 deletions(-)
diff --git a/.clang-tidy b/.clang-tidy
index 61eb050..d60c8ca 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -1,6 +1,6 @@
---
Checks:
'-*,clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-alpha*,google-*,-google-readability-todo,-google-runtime-references'
-WarningsAsErrors:
'google-build-using-namespace,google-readability-redundant-smartptr-get,google-explicit-constructor'
+WarningsAsErrors:
'google-build-using-namespace,google-readability-redundant-smartptr-get,google-explicit-constructor,google-global-names-in-headers'
HeaderFilterRegex: '.*'
AnalyzeTemporaryDtors: false
FormatStyle: file
diff --git a/cppcache/integration-test/BuiltinCacheableWrappers.hpp
b/cppcache/integration-test/BuiltinCacheableWrappers.hpp
index 0c7851c..9726b64 100644
--- a/cppcache/integration-test/BuiltinCacheableWrappers.hpp
+++ b/cppcache/integration-test/BuiltinCacheableWrappers.hpp
@@ -35,6 +35,9 @@
#include <geode/CacheableUndefined.hpp>
#include <geode/CacheableObjectArray.hpp>
+namespace CacheableHelper {
+
+using apache::geode::client::Cacheable;
using apache::geode::client::CacheableArrayList;
using apache::geode::client::CacheableBoolean;
using apache::geode::client::CacheableByte;
@@ -68,8 +71,10 @@ using apache::geode::client::CacheableVector;
using apache::geode::client::CacheHelper;
using apache::geode::client::Serializable;
using apache::geode::client::internal::DataSerializablePrimitive;
+using apache::geode::client::internal::DSCode;
-namespace CacheableHelper {
+using apache::geode::client::testing::CacheableWrapper;
+using apache::geode::client::testing::CacheableWrapperFactory;
const uint32_t m_crc32Table[] = {
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
@@ -220,7 +225,6 @@ inline bool isContainerTypeId(DSCode typeId) {
(typeId == DSCode::CacheableLinkedHashSet) ||
(typeId == DSCode::CacheableLinkedList);
}
-} // namespace CacheableHelper
// Cacheable types that can be used as keys
@@ -1219,8 +1223,6 @@ class CacheableObjectArrayWrapper : public
CacheableWrapper {
}
};
-namespace CacheableHelper {
-
void registerBuiltins(bool isRegisterFileName = false) {
// Initialize the random number generator.
srand(getpid() + static_cast<int>(time(nullptr)));
@@ -1328,6 +1330,7 @@ void registerBuiltins(bool isRegisterFileName = false) {
"CacheableStack",
CacheableStackWrapper::create, false);
}
+
} // namespace CacheableHelper
#endif // GEODE_INTEGRATION_TEST_BUILTINCACHEABLEWRAPPERS_H_
diff --git a/cppcache/integration-test/CMakeLists.txt
b/cppcache/integration-test/CMakeLists.txt
index 77c99d3..28dd53f 100644
--- a/cppcache/integration-test/CMakeLists.txt
+++ b/cppcache/integration-test/CMakeLists.txt
@@ -97,6 +97,16 @@ foreach(FILE ${SOURCES})
$<TARGET_PROPERTY:apache-geode,SOURCE_DIR>/../src
)
+ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ target_compile_options(${TEST} PRIVATE
+ -Wno-unused-function
+ )
+ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ target_compile_options(${TEST} PRIVATE
+ -Wno-unused-member-function
+ )
+ endif()
+
# Some tests depend on these library
add_dependencies(${TEST} securityImpl cryptoImpl DHImpl SqLiteImpl)
diff --git a/cppcache/integration-test/CacheImplHelper.hpp
b/cppcache/integration-test/CacheImplHelper.hpp
index 573cec6..ac7c66d 100644
--- a/cppcache/integration-test/CacheImplHelper.hpp
+++ b/cppcache/integration-test/CacheImplHelper.hpp
@@ -26,14 +26,16 @@
#include "testUtils.hpp"
#ifndef ROOT_NAME
-ROOT_NAME++ + DEFINE ROOT_NAME before including CacheHelper.hpp
+#define ROOT_NAME "DEFINE ROOT_NAME before including CacheHelper.hpp"
#endif
#ifndef ROOT_SCOPE
#define ROOT_SCOPE LOCAL
#endif
- using apache::geode::client::Properties;
+namespace {
+
+using apache::geode::client::CacheHelper;
using apache::geode::client::Properties;
using apache::geode::client::RegionAttributesFactory;
@@ -67,5 +69,6 @@ class CacheImplHelper : public CacheHelper {
ASSERT(regionPtr != nullptr, "failed to create region.");
}
};
+} // namespace
#endif // GEODE_INTEGRATION_TEST_CACHEIMPLHELPER_H_
diff --git a/cppcache/integration-test/CacheableWrapper.cpp
b/cppcache/integration-test/CacheableWrapper.cpp
index 80867a4..f972e23 100644
--- a/cppcache/integration-test/CacheableWrapper.cpp
+++ b/cppcache/integration-test/CacheableWrapper.cpp
@@ -17,6 +17,11 @@
#include "CacheableWrapper.hpp"
+namespace apache {
+namespace geode {
+namespace client {
+namespace testing {
+
void CacheableWrapper::initKey(int32_t, int32_t) {
throw IllegalArgumentException("Cannot call initKey.");
}
@@ -76,3 +81,8 @@ std::string CacheableWrapperFactory::getTypeForId(DSCode
typeId) {
return "";
}
}
+
+} // namespace testing
+} // namespace client
+} // namespace geode
+} // namespace apache
diff --git a/cppcache/integration-test/CacheableWrapper.hpp
b/cppcache/integration-test/CacheableWrapper.hpp
index 2e4ae4e..0db3057 100644
--- a/cppcache/integration-test/CacheableWrapper.hpp
+++ b/cppcache/integration-test/CacheableWrapper.hpp
@@ -26,6 +26,11 @@
#include <geode/CacheableBuiltins.hpp>
+namespace apache {
+namespace geode {
+namespace client {
+namespace testing {
+
using apache::geode::client::Cacheable;
using apache::geode::client::IllegalArgumentException;
using apache::geode::client::internal::DSCode;
@@ -80,6 +85,9 @@ class CacheableWrapperFactory {
static std::map<DSCode, std::string> m_typeIdNameMap;
};
-
+} // namespace testing
+} // namespace client
+} // namespace geode
+} // namespace apache
#endif // GEODE_INTEGRATION_TEST_CACHEABLEWRAPPER_H_
diff --git a/cppcache/integration-test/DeltaEx.hpp
b/cppcache/integration-test/DeltaEx.hpp
index 3533d89..260cb30 100644
--- a/cppcache/integration-test/DeltaEx.hpp
+++ b/cppcache/integration-test/DeltaEx.hpp
@@ -30,6 +30,8 @@
#include "CacheHelper.hpp"
+namespace {
+
using apache::geode::client::DataInput;
using apache::geode::client::DataOutput;
using apache::geode::client::DataSerializable;
@@ -164,4 +166,6 @@ class PdxDeltaEx : public PdxSerializable, public Delta {
}
};
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_DELTAEX_H_
diff --git a/cppcache/integration-test/LibraryCallbacks.cpp
b/cppcache/integration-test/LibraryCallbacks.cpp
index 3f00117..baa595b 100644
--- a/cppcache/integration-test/LibraryCallbacks.cpp
+++ b/cppcache/integration-test/LibraryCallbacks.cpp
@@ -46,6 +46,10 @@ void millisleep(uint32_t x) {
extern "C" {
+using apache::geode::client::testing::TallyListener;
+using apache::geode::client::testing::TallyLoader;
+using apache::geode::client::testing::TallyWriter;
+
_T_DLL_EXPORT apache::geode::client::CacheListener* createCacheListener() {
TallyListener* tl = new TallyListener();
tl->beQuiet(true);
diff --git a/cppcache/integration-test/LocatorHelper.hpp
b/cppcache/integration-test/LocatorHelper.hpp
index 2223ae9..202022d 100644
--- a/cppcache/integration-test/LocatorHelper.hpp
+++ b/cppcache/integration-test/LocatorHelper.hpp
@@ -23,6 +23,8 @@
#define SERVER2 s2p2
#endif
+namespace {
+
using apache::geode::client::CacheHelper;
DUNIT_TASK_DEFINITION(SERVER1, CreateLocator1)
@@ -151,4 +153,6 @@ DUNIT_TASK_DEFINITION(SERVER1, CloseLocator1)
}
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_LOCATORHELPER_H_
diff --git a/cppcache/integration-test/QueryHelper.hpp
b/cppcache/integration-test/QueryHelper.hpp
index 01d17d3..7aa59af 100644
--- a/cppcache/integration-test/QueryHelper.hpp
+++ b/cppcache/integration-test/QueryHelper.hpp
@@ -51,6 +51,8 @@
#define ROOT_SCOPE LOCAL
#endif
+namespace {
+
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableStringArray;
using apache::geode::client::CacheRegionHelper;
@@ -386,4 +388,6 @@ bool QueryHelper::verifySS(std::shared_ptr<SelectResults>&
structSet,
return false;
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_QUERYHELPER_H_
diff --git a/cppcache/integration-test/TallyListener.hpp
b/cppcache/integration-test/TallyListener.hpp
index 0207ca9..f0285ae 100644
--- a/cppcache/integration-test/TallyListener.hpp
+++ b/cppcache/integration-test/TallyListener.hpp
@@ -24,6 +24,11 @@
#include <string>
#include <util/Log.hpp>
+namespace apache {
+namespace geode {
+namespace client {
+namespace testing {
+
using apache::geode::client::Cacheable;
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
@@ -221,4 +226,9 @@ void TallyListener::afterRegionClear(const EntryEvent&
event) {
checkcallbackArg(event);
}
+} // namespace testing
+} // namespace client
+} // namespace geode
+} // namespace apache
+
#endif // GEODE_INTEGRATION_TEST_TALLYLISTENER_H_
diff --git a/cppcache/integration-test/TallyLoader.hpp
b/cppcache/integration-test/TallyLoader.hpp
index 43ddd54..9581849 100644
--- a/cppcache/integration-test/TallyLoader.hpp
+++ b/cppcache/integration-test/TallyLoader.hpp
@@ -20,6 +20,11 @@
#ifndef GEODE_INTEGRATION_TEST_TALLYLOADER_H_
#define GEODE_INTEGRATION_TEST_TALLYLOADER_H_
+namespace apache {
+namespace geode {
+namespace client {
+namespace testing {
+
using apache::geode::client::Cacheable;
using apache::geode::client::CacheableInt32;
using apache::geode::client::CacheableKey;
@@ -32,11 +37,7 @@ class TallyLoader : virtual public CacheLoader {
int32_t m_loads;
public:
- TallyLoader()
- : CacheLoader(),
- m_loads(0)
-
- {}
+ TallyLoader() : CacheLoader(), m_loads(0) {}
virtual ~TallyLoader() = default;
std::shared_ptr<Cacheable> load(Region&, const
std::shared_ptr<CacheableKey>&,
@@ -70,4 +71,9 @@ class TallyLoader : virtual public CacheLoader {
}
};
+} // namespace testing
+} // namespace client
+} // namespace geode
+} // namespace apache
+
#endif // GEODE_INTEGRATION_TEST_TALLYLOADER_H_
diff --git a/cppcache/integration-test/TallyWriter.hpp
b/cppcache/integration-test/TallyWriter.hpp
index 611b0e5..3eb860a 100644
--- a/cppcache/integration-test/TallyWriter.hpp
+++ b/cppcache/integration-test/TallyWriter.hpp
@@ -23,6 +23,11 @@
#include <geode/CacheableKey.hpp>
#include <geode/CacheWriter.hpp>
+namespace apache {
+namespace geode {
+namespace client {
+namespace testing {
+
using apache::geode::client::Cacheable;
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheWriter;
@@ -154,4 +159,9 @@ class TallyWriter : virtual public CacheWriter {
}
};
+} // namespace testing
+} // namespace client
+} // namespace geode
+} // namespace apache
+
#endif // GEODE_INTEGRATION_TEST_TALLYWRITER_H_
diff --git a/cppcache/integration-test/ThinClientCQ.hpp
b/cppcache/integration-test/ThinClientCQ.hpp
index 0b66d33..cf450a8 100644
--- a/cppcache/integration-test/ThinClientCQ.hpp
+++ b/cppcache/integration-test/ThinClientCQ.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_THINCLIENTCQ_H_
-#define GEODE_INTEGRATION_TEST_THINCLIENTCQ_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -19,12 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/*
- * ThinClientCQ.hpp
- *
- * Created on: Nov 14, 2008
- * Author: vrao
- */
+
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_THINCLIENTCQ_H_
+#define GEODE_INTEGRATION_TEST_THINCLIENTCQ_H_
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
diff --git a/cppcache/integration-test/ThinClientCallbackArg.hpp
b/cppcache/integration-test/ThinClientCallbackArg.hpp
index 1c130f8..964d972 100644
--- a/cppcache/integration-test/ThinClientCallbackArg.hpp
+++ b/cppcache/integration-test/ThinClientCallbackArg.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_THINCLIENTCALLBACKARG_H_
-#define GEODE_INTEGRATION_TEST_THINCLIENTCALLBACKARG_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -20,6 +15,11 @@
* limitations under the License.
*/
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_THINCLIENTCALLBACKARG_H_
+#define GEODE_INTEGRATION_TEST_THINCLIENTCALLBACKARG_H_
+
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
#include "TallyListener.hpp"
@@ -37,6 +37,11 @@
* + callback Argument
*/
+namespace {
+
+using apache::geode::client::testing::TallyListener;
+using apache::geode::client::testing::TallyWriter;
+
static bool isLocalServer = false;
static bool isLocator = false;
static int numberOfLocators = 0;
@@ -196,4 +201,6 @@ void runCallbackArg() {
CALL_TASK(CloseLocator1);
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTCALLBACKARG_H_
diff --git a/cppcache/integration-test/ThinClientDistOps.hpp
b/cppcache/integration-test/ThinClientDistOps.hpp
index 3990e9f..6e1e47c 100644
--- a/cppcache/integration-test/ThinClientDistOps.hpp
+++ b/cppcache/integration-test/ThinClientDistOps.hpp
@@ -39,6 +39,8 @@
#define CREATE_TWICE_KEY "__create_twice_key"
#define CREATE_TWICE_VALUE "__create_twice_value"
+namespace {
+
using apache::geode::client::CacheableInt32;
using apache::geode::client::CacheableInt64;
using apache::geode::client::CacheableKey;
@@ -598,11 +600,13 @@ DUNIT_TASK_DEFINITION(CLIENT1,
VerifyUpdateLocatorListThread)
// too strict.
// Assert(numLocatorListUpdates <= numExpectedLocatorListUpdates+2) is
// ideal.
- ASSERT(numLocatorListUpdates >= numExpectedLocatorListUpdates -
- 1 /*&& numLocatorListUpdates <=
-
numExpectedLocatorListUpdates+2*/
- ,
- "Got unexpected number of LocatorList updates");
+ ASSERT(
+ numLocatorListUpdates >=
+ numExpectedLocatorListUpdates -
+ 1 /*&& numLocatorListUpdates <=
+
numExpectedLocatorListUpdates+2*/
+ ,
+ "Got unexpected number of LocatorList updates");
} else {
ASSERT(
numLocatorListUpdates == 0,
@@ -894,4 +898,6 @@ void runDistOpsDontUpdateLocatorList() {
CALL_TASK(CloseLocator1);
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTDISTOPS_H_
diff --git a/cppcache/integration-test/ThinClientDistOps2.hpp
b/cppcache/integration-test/ThinClientDistOps2.hpp
index d8371ad..4cf486a 100644
--- a/cppcache/integration-test/ThinClientDistOps2.hpp
+++ b/cppcache/integration-test/ThinClientDistOps2.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_THINCLIENTDISTOPS2_H_
-#define GEODE_INTEGRATION_TEST_THINCLIENTDISTOPS2_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -20,6 +15,11 @@
* limitations under the License.
*/
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_THINCLIENTDISTOPS2_H_
+#define GEODE_INTEGRATION_TEST_THINCLIENTDISTOPS2_H_
+
#include "fw_dunit.hpp"
#include <ace/OS.h>
@@ -31,12 +31,13 @@
#include "ThinClientHelper.hpp"
-
#define CLIENT1 s1p1
#define CLIENT2 s1p2
#define SERVER1 s2p1
#define SERVER2 s2p2
+namespace {
+
using apache::geode::client::CacheableInt32;
using apache::geode::client::CacheableInt64;
using apache::geode::client::CacheableKey;
@@ -345,4 +346,6 @@ DUNIT_TASK_DEFINITION(SERVER2, CloseServer2)
}
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTDISTOPS2_H_
diff --git a/cppcache/integration-test/ThinClientDurable.hpp
b/cppcache/integration-test/ThinClientDurable.hpp
index 5edccc2..5fd025d 100644
--- a/cppcache/integration-test/ThinClientDurable.hpp
+++ b/cppcache/integration-test/ThinClientDurable.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_THINCLIENTDURABLE_H_
-#define GEODE_INTEGRATION_TEST_THINCLIENTDURABLE_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -19,12 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/*
- * ThinClientDurable.hpp
- *
- * Created on: Oct 31, 2008
- * Author: abhaware
- */
+
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_THINCLIENTDURABLE_H_
+#define GEODE_INTEGRATION_TEST_THINCLIENTDURABLE_H_
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
@@ -52,6 +46,8 @@ Client 1 is with R =0 and Client 2 with R = 1
#define SERVER1 s2p1
#define FEEDER s2p2
+namespace {
+
using apache::geode::client::EntryEvent;
using apache::geode::client::Exception;
using apache::geode::client::HashMapOfCacheable;
@@ -504,4 +500,6 @@ DUNIT_TASK_DEFINITION(SERVER1, CloseServers)
}
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTDURABLE_H_
diff --git a/cppcache/integration-test/ThinClientDurableConnect.hpp
b/cppcache/integration-test/ThinClientDurableConnect.hpp
index 8ee9e7a..6fdf04b 100644
--- a/cppcache/integration-test/ThinClientDurableConnect.hpp
+++ b/cppcache/integration-test/ThinClientDurableConnect.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_THINCLIENTDURABLECONNECT_H_
-#define GEODE_INTEGRATION_TEST_THINCLIENTDURABLECONNECT_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -19,12 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/*
- * ThinClientDurableConnect.hpp
- *
- * Created on: Nov 3, 2008
- * Author: abhaware
- */
+
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_THINCLIENTDURABLECONNECT_H_
+#define GEODE_INTEGRATION_TEST_THINCLIENTDURABLECONNECT_H_
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
diff --git a/cppcache/integration-test/ThinClientDurableFailover.hpp
b/cppcache/integration-test/ThinClientDurableFailover.hpp
index 2da31d4..2220265 100644
--- a/cppcache/integration-test/ThinClientDurableFailover.hpp
+++ b/cppcache/integration-test/ThinClientDurableFailover.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_THINCLIENTDURABLEFAILOVER_H_
-#define GEODE_INTEGRATION_TEST_THINCLIENTDURABLEFAILOVER_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -19,12 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/*
- * ThinClientDurableFailover.hpp
- *
- * Created on: Nov 4, 2008
- * Author: abhaware
- */
+
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_THINCLIENTDURABLEFAILOVER_H_
+#define GEODE_INTEGRATION_TEST_THINCLIENTDURABLEFAILOVER_H_
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
@@ -51,6 +45,8 @@ Shutdown
#define SERVER1 s2p1
#define FEEDER s2p2
+namespace {
+
using apache::geode::client::EntryEvent;
using apache::geode::client::Exception;
using apache::geode::client::HashMapOfCacheable;
@@ -417,4 +413,6 @@ void doThinClientDurableFailoverClientClosedRedundancy() {
CALL_TASK(CloseLocator);
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTDURABLEFAILOVER_H_
diff --git a/cppcache/integration-test/ThinClientDurableInit.hpp
b/cppcache/integration-test/ThinClientDurableInit.hpp
index f57c856..d5375dc 100644
--- a/cppcache/integration-test/ThinClientDurableInit.hpp
+++ b/cppcache/integration-test/ThinClientDurableInit.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_THINCLIENTDURABLEINIT_H_
-#define GEODE_INTEGRATION_TEST_THINCLIENTDURABLEINIT_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -19,12 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/*
- * ThinClientDurableInit.hpp
- *
- * Created on: Nov 3, 2008
- * Author: abhaware
- */
+
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_THINCLIENTDURABLEINIT_H_
+#define GEODE_INTEGRATION_TEST_THINCLIENTDURABLEINIT_H_
bool isLocalServer = false;
diff --git a/cppcache/integration-test/ThinClientDurableInterest.hpp
b/cppcache/integration-test/ThinClientDurableInterest.hpp
index f20e4b1..4a798ad 100644
--- a/cppcache/integration-test/ThinClientDurableInterest.hpp
+++ b/cppcache/integration-test/ThinClientDurableInterest.hpp
@@ -44,6 +44,8 @@ recieved.
#define SERVER1 s2p1
#define FEEDER s2p2
+namespace {
+
using apache::geode::client::EntryEvent;
using apache::geode::client::HashMapOfCacheable;
using apache::geode::client::RegionEvent;
@@ -369,4 +371,6 @@ DUNIT_TASK_DEFINITION(SERVER1, closeServer)
}
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTDURABLEINTEREST_H_
diff --git a/cppcache/integration-test/ThinClientDurableReconnect.hpp
b/cppcache/integration-test/ThinClientDurableReconnect.hpp
index 9d39491..c4adb99 100644
--- a/cppcache/integration-test/ThinClientDurableReconnect.hpp
+++ b/cppcache/integration-test/ThinClientDurableReconnect.hpp
@@ -38,6 +38,8 @@
#define SERVER1 s2p1
#define FEEDER s2p2
+namespace {
+
using apache::geode::client::EntryEvent;
class OperMonitor : public CacheListener {
@@ -67,11 +69,13 @@ class OperMonitor : public CacheListener {
}
};
-void setCacheListener(const char* regName, std::shared_ptr<OperMonitor>
monitor) {
+void setCacheListener(const char* regName,
+ std::shared_ptr<OperMonitor> monitor) {
auto reg = getHelper()->getRegion(regName);
auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(monitor);
-}std::shared_ptr<OperMonitor> mon1 = nullptr;
+}
+std::shared_ptr<OperMonitor> mon1 = nullptr;
const char* mixKeys[] = {"D-Key-1"};
@@ -89,7 +93,7 @@ void initClientCache(int redundancy,
std::shared_ptr<OperMonitor>& mon) {
setCacheListener(regionNames[0], mon);
getHelper()->cachePtr->readyForEvents();
- auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->registerAllKeys(true);
}
@@ -169,4 +173,6 @@ void doThinClientDurableReconnect() {
closeLocator();
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTDURABLERECONNECT_H_
diff --git a/cppcache/integration-test/ThinClientFailover.hpp
b/cppcache/integration-test/ThinClientFailover.hpp
index 7611681..1ce764d 100644
--- a/cppcache/integration-test/ThinClientFailover.hpp
+++ b/cppcache/integration-test/ThinClientFailover.hpp
@@ -31,6 +31,8 @@
#include "CacheHelper.hpp"
+namespace {
+
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheHelper;
@@ -425,4 +427,6 @@ void runThinClientFailover(bool isSticky = false) {
CALL_TASK(CloseLocator1);
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTFAILOVER_H_
diff --git a/cppcache/integration-test/ThinClientFailover2.hpp
b/cppcache/integration-test/ThinClientFailover2.hpp
index 96e0dd0..37c63ca 100644
--- a/cppcache/integration-test/ThinClientFailover2.hpp
+++ b/cppcache/integration-test/ThinClientFailover2.hpp
@@ -31,6 +31,8 @@
#include "CacheHelper.hpp"
+namespace {
+
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheHelper;
@@ -548,4 +550,6 @@ void runThinClientFailover2() {
CALL_TASK(CloseLocator1);
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTFAILOVER2_H_
diff --git a/cppcache/integration-test/ThinClientFailover3.hpp
b/cppcache/integration-test/ThinClientFailover3.hpp
index 64f2484..a3bb641 100644
--- a/cppcache/integration-test/ThinClientFailover3.hpp
+++ b/cppcache/integration-test/ThinClientFailover3.hpp
@@ -31,13 +31,15 @@
#include "CacheHelper.hpp"
+namespace {
+
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheHelper;
bool isLocalServer = false;
-const char *endPoints = CacheHelper::getTcrEndpoints(isLocalServer, 3);
-CacheHelper *cacheHelper = nullptr;
+const char* endPoints = CacheHelper::getTcrEndpoints(isLocalServer, 3);
+CacheHelper* cacheHelper = nullptr;
#define CLIENT1 s1p1
#define CLIENT2 s1p2
@@ -45,7 +47,7 @@ CacheHelper *cacheHelper = nullptr;
#define SERVER2 s2p2
static bool isLocator = false;
// static int numberOfLocators = 0;
-const char *locatorsG =
+const char* locatorsG =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
#include "LocatorHelper.hpp"
void initClient(const bool isthinClient) {
@@ -61,17 +63,17 @@ void cleanProc() {
}
}
-CacheHelper *getHelper() {
+CacheHelper* getHelper() {
ASSERT(cacheHelper != nullptr, "No cacheHelper initialized.");
return cacheHelper;
}
-void _verifyEntry(const char *name, const char *key, const char *val,
+void _verifyEntry(const char* name, const char* key, const char* val,
bool noKey) {
// Verify key and value exist in this region, in this process.
const char* value = val ? val : "";
- char *buf =
- reinterpret_cast<char *>(malloc(1024 + strlen(key) + strlen(value)));
+ char* buf =
+ reinterpret_cast<char*>(malloc(1024 + strlen(key) + strlen(value)));
ASSERT(buf, "Unable to malloc buffer for logging.");
if (noKey) {
sprintf(buf, "Verify key %s does not exist in region %s", key, name);
@@ -141,7 +143,7 @@ void _verifyEntry(const char *name, const char *key, const
char *val,
#define verifyEntry(x, y, z) _verifyEntry(x, y, z, __LINE__)
-void _verifyEntry(const char *name, const char *key, const char *val,
+void _verifyEntry(const char* name, const char* key, const char* val,
int line) {
char logmsg[1024];
sprintf(logmsg, "verifyEntry() called from %d.\n", line);
@@ -150,8 +152,8 @@ void _verifyEntry(const char *name, const char *key, const
char *val,
LOG("Entry verified.");
}
-void createPooledRegion(const char *name, bool ackMode, const char *locators,
- const char *poolname,
+void createPooledRegion(const char* name, bool ackMode, const char* locators,
+ const char* poolname,
bool clientNotificationEnabled = false,
bool cachingEnable = true) {
LOG("createRegion_Pool() entered.");
@@ -163,7 +165,7 @@ void createPooledRegion(const char *name, bool ackMode,
const char *locators,
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Pooled Region created.");
}
-void createEntry(const char *name, const char *key, const char *value) {
+void createEntry(const char* name, const char* key, const char* value) {
LOG("createEntry() entered.");
fprintf(stdout, "Creating entry -- key: %s value: %s in region %s\n", key,
value, name);
@@ -188,7 +190,7 @@ void createEntry(const char *name, const char *key, const
char *value) {
LOG("Entry created.");
}
-void updateEntry(const char *name, const char *key, const char *value) {
+void updateEntry(const char* name, const char* key, const char* value) {
LOG("updateEntry() entered.");
fprintf(stdout, "Updating entry -- key: %s value: %s in region %s\n", key,
value, name);
@@ -209,7 +211,7 @@ void updateEntry(const char *name, const char *key, const
char *value) {
LOG("Entry updated.");
}
-void doNetsearch(const char *name, const char *key, const char *value) {
+void doNetsearch(const char* name, const char* key, const char* value) {
LOG("doNetsearch() entered.");
fprintf(
stdout,
@@ -240,11 +242,11 @@ void doNetsearch(const char *name, const char *key, const
char *value) {
LOG("Netsearch complete.");
}
-std::vector<char *> storeEndPoints(const char *points) {
- std::vector<char *> endpointNames;
+std::vector<char*> storeEndPoints(const char* points) {
+ std::vector<char*> endpointNames;
if (points != nullptr) {
- char *ep = strdup(points);
- char *token = strtok(ep, ",");
+ char* ep = strdup(points);
+ char* token = strtok(ep, ",");
while (token) {
endpointNames.push_back(token);
token = strtok(nullptr, ",");
@@ -254,13 +256,13 @@ std::vector<char *> storeEndPoints(const char *points) {
return endpointNames;
}
-std::vector<char *> endpointNames = storeEndPoints(endPoints);
-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",
+std::vector<char*> endpointNames = storeEndPoints(endPoints);
+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", "DistRegionNoAck"};
+const char* regionNames[] = {"DistRegionAck", "DistRegionNoAck"};
const bool USE_ACK = true;
const bool NO_ACK = false;
@@ -373,4 +375,6 @@ DUNIT_TASK_DEFINITION(SERVER2, CloseServer2and3)
}
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTFAILOVER3_H_
diff --git a/cppcache/integration-test/ThinClientFailoverInterest.hpp
b/cppcache/integration-test/ThinClientFailoverInterest.hpp
index ae2373f..7af0822 100644
--- a/cppcache/integration-test/ThinClientFailoverInterest.hpp
+++ b/cppcache/integration-test/ThinClientFailoverInterest.hpp
@@ -30,6 +30,8 @@
#include "CacheHelper.hpp"
+namespace {
+
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheHelper;
@@ -428,4 +430,6 @@ void runThinClientFailoverInterest() {
CALL_TASK(CloseLocator1);
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTFAILOVERINTEREST_H_
diff --git a/cppcache/integration-test/ThinClientFailoverInterest2.hpp
b/cppcache/integration-test/ThinClientFailoverInterest2.hpp
index 57a103c..5674478 100644
--- a/cppcache/integration-test/ThinClientFailoverInterest2.hpp
+++ b/cppcache/integration-test/ThinClientFailoverInterest2.hpp
@@ -30,6 +30,8 @@
#include "CacheHelper.hpp"
+namespace {
+
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheHelper;
@@ -457,4 +459,6 @@ void runThinClientFailoverInterest2() {
CALL_TASK(CloseLocator1);
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTFAILOVERINTEREST2_H_
diff --git
a/cppcache/integration-test/ThinClientFailoverInterestAllWithCache.hpp
b/cppcache/integration-test/ThinClientFailoverInterestAllWithCache.hpp
index 0675bb9..faf6b9d 100644
--- a/cppcache/integration-test/ThinClientFailoverInterestAllWithCache.hpp
+++ b/cppcache/integration-test/ThinClientFailoverInterestAllWithCache.hpp
@@ -29,6 +29,8 @@
#include "CacheHelper.hpp"
+namespace {
+
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheHelper;
@@ -494,4 +496,6 @@ DUNIT_TASK_DEFINITION(SERVER2, CloseServer2)
}
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTFAILOVERINTERESTALLWITHCACHE_H_
diff --git a/cppcache/integration-test/ThinClientFailoverRegex.hpp
b/cppcache/integration-test/ThinClientFailoverRegex.hpp
index 43eff8d..71ea18d 100644
--- a/cppcache/integration-test/ThinClientFailoverRegex.hpp
+++ b/cppcache/integration-test/ThinClientFailoverRegex.hpp
@@ -30,6 +30,8 @@
#include "CacheHelper.hpp"
+namespace {
+
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheHelper;
@@ -501,4 +503,6 @@ void runThinClientFailOverRegex() {
CALL_TASK(CloseLocator1);
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTFAILOVERREGEX_H_
diff --git a/cppcache/integration-test/ThinClientGatewayTest.hpp
b/cppcache/integration-test/ThinClientGatewayTest.hpp
index 9002507..06a786b 100644
--- a/cppcache/integration-test/ThinClientGatewayTest.hpp
+++ b/cppcache/integration-test/ThinClientGatewayTest.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_THINCLIENTGATEWAYTEST_H_
-#define GEODE_INTEGRATION_TEST_THINCLIENTGATEWAYTEST_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -20,6 +15,11 @@
* limitations under the License.
*/
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_THINCLIENTGATEWAYTEST_H_
+#define GEODE_INTEGRATION_TEST_THINCLIENTGATEWAYTEST_H_
+
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
#include "TallyListener.hpp"
@@ -31,9 +31,15 @@
#define CLIENT1 s1p1
#define CLIENT2 s1p2
-
#include <string>
+namespace {
+
+using apache::geode::client::EntryEvent;
+using apache::geode::client::RegionEvent;
+
+using apache::geode::client::testing::TallyListener;
+
class MyListener : public CacheListener {
private:
int m_events;
@@ -60,7 +66,8 @@ class MyListener : public CacheListener {
int getNumEvents() { return m_events; }
};
-void setCacheListener(const char* regName, std::shared_ptr<TallyListener>
regListener) {
+void setCacheListener(const char* regName,
+ std::shared_ptr<TallyListener> regListener) {
auto reg = getHelper()->getRegion(regName);
auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(regListener);
@@ -103,24 +110,23 @@ DUNIT_TASK_DEFINITION(SERVER2, SetupClient2)
{
// CacheHelper ch = getHelper();
reg1Listener1 = std::make_shared<MyListener>();
- auto regPtr = createPooledRegion("exampleRegion", false, locHostPort2,
- "poolName", true, reg1Listener1);
- regPtr->registerAllKeys();
+ auto regPtr = createPooledRegion("exampleRegion", false, locHostPort2,
+ "poolName", true, reg1Listener1);
+ regPtr->registerAllKeys();
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(SERVER1, SetupClient)
{
initClientWithPool(true, "poolName", locHostPort1, nullptr);
- auto regPtr =
- createRegionAndAttachPool("exampleRegion", true, nullptr);
- LOG(" region is created ");
- for (int i = 0; i < 100; i++) {
- LOG(" region is created put");
- regPtr->put(i, i);
- }
-
- dunit::sleep(10000);
+ auto regPtr = createRegionAndAttachPool("exampleRegion", true, nullptr);
+ LOG(" region is created ");
+ for (int i = 0; i < 100; i++) {
+ LOG(" region is created put");
+ regPtr->put(i, i);
+ }
+
+ dunit::sleep(10000);
}
END_TASK_DEFINITION
@@ -185,4 +191,6 @@ void runListenerInit() {
CALL_TASK(StopLocator2);
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTGATEWAYTEST_H_
diff --git a/cppcache/integration-test/ThinClientHeapLRU.hpp
b/cppcache/integration-test/ThinClientHeapLRU.hpp
index 3e5e828..b551d47 100644
--- a/cppcache/integration-test/ThinClientHeapLRU.hpp
+++ b/cppcache/integration-test/ThinClientHeapLRU.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_THINCLIENTHEAPLRU_H_
-#define GEODE_INTEGRATION_TEST_THINCLIENTHEAPLRU_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -20,6 +15,11 @@
* limitations under the License.
*/
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_THINCLIENTHEAPLRU_H_
+#define GEODE_INTEGRATION_TEST_THINCLIENTHEAPLRU_H_
+
#include "fw_dunit.hpp"
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
diff --git a/cppcache/integration-test/ThinClientHelper.hpp
b/cppcache/integration-test/ThinClientHelper.hpp
index d9a950a..c8e4484 100644
--- a/cppcache/integration-test/ThinClientHelper.hpp
+++ b/cppcache/integration-test/ThinClientHelper.hpp
@@ -42,6 +42,8 @@
#include "CacheHelper.hpp"
+namespace {
+
using apache::geode::client::CacheableInt32;
using apache::geode::client::CacheHelper;
using apache::geode::client::CacheListener;
@@ -725,4 +727,6 @@ class RegionOperations {
std::shared_ptr<Region> m_regionPtr;
};
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTHELPER_H_
diff --git a/cppcache/integration-test/ThinClientInterest1.hpp
b/cppcache/integration-test/ThinClientInterest1.hpp
index 3c8a190..6015ea0 100644
--- a/cppcache/integration-test/ThinClientInterest1.hpp
+++ b/cppcache/integration-test/ThinClientInterest1.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_THINCLIENTINTEREST1_H_
-#define GEODE_INTEGRATION_TEST_THINCLIENTINTEREST1_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -20,6 +15,11 @@
* limitations under the License.
*/
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_THINCLIENTINTEREST1_H_
+#define GEODE_INTEGRATION_TEST_THINCLIENTINTEREST1_H_
+
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
diff --git a/cppcache/integration-test/ThinClientInterest2.hpp
b/cppcache/integration-test/ThinClientInterest2.hpp
index 85699a2..b121446 100644
--- a/cppcache/integration-test/ThinClientInterest2.hpp
+++ b/cppcache/integration-test/ThinClientInterest2.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_THINCLIENTINTEREST2_H_
-#define GEODE_INTEGRATION_TEST_THINCLIENTINTEREST2_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -20,6 +15,11 @@
* limitations under the License.
*/
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_THINCLIENTINTEREST2_H_
+#define GEODE_INTEGRATION_TEST_THINCLIENTINTEREST2_H_
+
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
diff --git a/cppcache/integration-test/ThinClientInterest3.hpp
b/cppcache/integration-test/ThinClientInterest3.hpp
index 1538746..0f7c5fe 100644
--- a/cppcache/integration-test/ThinClientInterest3.hpp
+++ b/cppcache/integration-test/ThinClientInterest3.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_THINCLIENTINTEREST3_H_
-#define GEODE_INTEGRATION_TEST_THINCLIENTINTEREST3_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -20,6 +15,11 @@
* limitations under the License.
*/
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_THINCLIENTINTEREST3_H_
+#define GEODE_INTEGRATION_TEST_THINCLIENTINTEREST3_H_
+
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
#include "TallyListener.hpp"
@@ -29,11 +29,15 @@
#define CLIENT2 s1p2
#define SERVER1 s2p1
+namespace {
+
+using apache::geode::client::testing::TallyListener;
+using apache::geode::client::testing::TallyWriter;
bool isLocalServer = true;
-const char *endPoint = CacheHelper::getTcrEndpoints(isLocalServer, 1);
+const char* endPoint = CacheHelper::getTcrEndpoints(isLocalServer, 1);
static bool isLocator = false;
-const char *locatorsG =
+const char* locatorsG =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
#include "LocatorHelper.hpp"
std::shared_ptr<TallyListener> reg1Listener1;
@@ -43,14 +47,14 @@ int numUpdates = 0;
int numInvalidates = 0;
int numDestroys = 0;
-void setCacheListener(const char *regName,
+void setCacheListener(const char* regName,
std::shared_ptr<TallyListener> regListener) {
auto reg = getHelper()->getRegion(regName);
auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(regListener);
}
-void setCacheWriter(const char *regName,
+void setCacheWriter(const char* regName,
std::shared_ptr<TallyWriter> regWriter) {
auto reg = getHelper()->getRegion(regName);
auto attrMutator = reg->getAttributesMutator();
@@ -177,4 +181,6 @@ DUNIT_TASK_DEFINITION(SERVER1, StopServer)
}
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTINTEREST3_H_
diff --git a/cppcache/integration-test/ThinClientInterest3Cacheless.hpp
b/cppcache/integration-test/ThinClientInterest3Cacheless.hpp
index 60b8a78..17ed22c 100644
--- a/cppcache/integration-test/ThinClientInterest3Cacheless.hpp
+++ b/cppcache/integration-test/ThinClientInterest3Cacheless.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_THINCLIENTINTEREST3CACHELESS_H_
-#define GEODE_INTEGRATION_TEST_THINCLIENTINTEREST3CACHELESS_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -20,6 +15,11 @@
* limitations under the License.
*/
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_THINCLIENTINTEREST3CACHELESS_H_
+#define GEODE_INTEGRATION_TEST_THINCLIENTINTEREST3CACHELESS_H_
+
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
#include "TallyListener.hpp"
@@ -29,11 +29,15 @@
#define CLIENT2 s1p2
#define SERVER1 s2p1
+namespace {
+
+using apache::geode::client::testing::TallyListener;
+using apache::geode::client::testing::TallyWriter;
bool isLocalServer = true;
-const char *endPoint = CacheHelper::getTcrEndpoints(isLocalServer, 1);
+const char* endPoint = CacheHelper::getTcrEndpoints(isLocalServer, 1);
static bool isLocator = false;
-const char *locatorsG =
+const char* locatorsG =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
#include "LocatorHelper.hpp"
std::shared_ptr<TallyListener> reg1Listener1;
@@ -43,14 +47,14 @@ int numUpdates = 0;
int numInvalidates = 0;
int numDestroys = 0;
-void setCacheListener(const char *regName,
+void setCacheListener(const char* regName,
std::shared_ptr<TallyListener> regListener) {
auto reg = getHelper()->getRegion(regName);
auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(regListener);
}
-void setCacheWriter(const char *regName,
+void setCacheWriter(const char* regName,
std::shared_ptr<TallyWriter> regWriter) {
auto reg = getHelper()->getRegion(regName);
auto attrMutator = reg->getAttributesMutator();
@@ -150,4 +154,6 @@ DUNIT_TASK_DEFINITION(SERVER1, StopServer)
}
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTINTEREST3CACHELESS_H_
diff --git a/cppcache/integration-test/ThinClientInterestList.hpp
b/cppcache/integration-test/ThinClientInterestList.hpp
index 3271e82..b2f563a 100644
--- a/cppcache/integration-test/ThinClientInterestList.hpp
+++ b/cppcache/integration-test/ThinClientInterestList.hpp
@@ -29,11 +29,12 @@
#include "CacheHelper.hpp"
-
#define CLIENT1 s1p1
#define CLIENT2 s1p2
#define SERVER1 s2p1
+namespace {
+
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheHelper;
@@ -412,4 +413,6 @@ DUNIT_TASK_DEFINITION(SERVER1, CloseServer1)
}
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTINTERESTLIST_H_
diff --git a/cppcache/integration-test/ThinClientInterestList2.hpp
b/cppcache/integration-test/ThinClientInterestList2.hpp
index 83e6347..47dad05 100644
--- a/cppcache/integration-test/ThinClientInterestList2.hpp
+++ b/cppcache/integration-test/ThinClientInterestList2.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_THINCLIENTINTERESTLIST2_H_
-#define GEODE_INTEGRATION_TEST_THINCLIENTINTERESTLIST2_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -19,6 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_THINCLIENTINTERESTLIST2_H_
+#define GEODE_INTEGRATION_TEST_THINCLIENTINTERESTLIST2_H_
+
#include "fw_dunit.hpp"
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
@@ -29,11 +30,12 @@
#include "CacheHelper.hpp"
-
#define CLIENT1 s1p1
#define CLIENT2 s1p2
#define SERVER1 s2p1
+namespace {
+
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheHelper;
@@ -397,4 +399,6 @@ DUNIT_TASK_DEFINITION(SERVER1, CloseServer1)
}
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTINTERESTLIST2_H_
diff --git a/cppcache/integration-test/ThinClientListenerInit.hpp
b/cppcache/integration-test/ThinClientListenerInit.hpp
index 6874e65..601b90a 100644
--- a/cppcache/integration-test/ThinClientListenerInit.hpp
+++ b/cppcache/integration-test/ThinClientListenerInit.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_THINCLIENTLISTENERINIT_H_
-#define GEODE_INTEGRATION_TEST_THINCLIENTLISTENERINIT_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -20,6 +15,11 @@
* limitations under the License.
*/
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_THINCLIENTLISTENERINIT_H_
+#define GEODE_INTEGRATION_TEST_THINCLIENTLISTENERINIT_H_
+
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
#include "TallyListener.hpp"
@@ -30,6 +30,13 @@
#define CLIENT2 s1p2
#define SERVER1 s2p1
+namespace {
+
+using apache::geode::client::Cacheable;
+
+using apache::geode::client::testing::TallyListener;
+using apache::geode::client::testing::TallyLoader;
+using apache::geode::client::testing::TallyWriter;
static bool isLocator = false;
static bool isLocalServer = true;
@@ -53,8 +60,7 @@ class ThinClientTallyLoader : public TallyLoader {
virtual ~ThinClientTallyLoader() = default;
std::shared_ptr<Cacheable> load(
- Region& rp,
- const std::shared_ptr<CacheableKey>& key,
+ Region& rp, const std::shared_ptr<CacheableKey>& key,
const std::shared_ptr<Serializable>& aCallbackArgument) {
int32_t loadValue = std::dynamic_pointer_cast<CacheableInt32>(
TallyLoader::load(rp, key, aCallbackArgument))
@@ -256,4 +262,6 @@ DUNIT_TASK_DEFINITION(CLIENT1, CloseCache1)
{ cleanProc(); }
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTLISTENERINIT_H_
diff --git a/cppcache/integration-test/ThinClientListenerWriter.hpp
b/cppcache/integration-test/ThinClientListenerWriter.hpp
index 74ad038..550bef0 100644
--- a/cppcache/integration-test/ThinClientListenerWriter.hpp
+++ b/cppcache/integration-test/ThinClientListenerWriter.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_THINCLIENTLISTENERWRITER_H_
-#define GEODE_INTEGRATION_TEST_THINCLIENTLISTENERWRITER_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -20,6 +15,11 @@
* limitations under the License.
*/
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_THINCLIENTLISTENERWRITER_H_
+#define GEODE_INTEGRATION_TEST_THINCLIENTLISTENERWRITER_H_
+
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
#include "TallyListener.hpp"
@@ -30,6 +30,13 @@
#define SERVER1 s2p1
#define CLIENT3 s2p2
+namespace {
+using apache::geode::client::EntryEvent;
+using apache::geode::client::RegionEvent;
+
+using apache::geode::client::testing::TallyListener;
+using apache::geode::client::testing::TallyWriter;
+
class SimpleCacheListener;
// The SimpleCacheListener class.
@@ -117,7 +124,10 @@ static bool isLocator = false;
static int numberOfLocators = 0;
const char* locatorsG =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer,
numberOfLocators);
-const char* poolName = "__TESTPOOL1_"; std::shared_ptr<TallyListener>
regListener; std::shared_ptr<SimpleCacheListener> parentRegCacheListener;
std::shared_ptr<SimpleCacheListener> subRegCacheListener;
+const char* poolName = "__TESTPOOL1_";
+std::shared_ptr<TallyListener> regListener;
+std::shared_ptr<SimpleCacheListener> parentRegCacheListener;
+std::shared_ptr<SimpleCacheListener> subRegCacheListener;
std::shared_ptr<SimpleCacheListener> distRegCacheListener;
std::shared_ptr<TallyWriter> regWriter;
@@ -205,20 +215,20 @@ DUNIT_TASK_DEFINITION(CLIENT1,
SetupClient1withCachingEnabled_Pooled_Locator)
true);
// create subregion
- auto exmpRegptr = getHelper()->getRegion(myRegNames[2]);
- auto lattribPtr = exmpRegptr->getAttributes();
- auto subregPtr1 = exmpRegptr->createSubregion(myRegNames[3], lattribPtr);
- auto subregPtr2 = exmpRegptr->createSubregion(myRegNames[4], lattribPtr);
-
- LOGINFO(
- " CLIENT1 SetupClient1withCachingEnabled_Pooled_Locator subRegions "
- "created successfully");
+ auto exmpRegptr = getHelper()->getRegion(myRegNames[2]);
+ auto lattribPtr = exmpRegptr->getAttributes();
+ auto subregPtr1 = exmpRegptr->createSubregion(myRegNames[3], lattribPtr);
+ auto subregPtr2 = exmpRegptr->createSubregion(myRegNames[4], lattribPtr);
+
+ LOGINFO(
+ " CLIENT1 SetupClient1withCachingEnabled_Pooled_Locator subRegions "
+ "created successfully");
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, Register2WithTrue)
{
- auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->registerAllKeys();
}
END_TASK_DEFINITION
@@ -226,23 +236,23 @@ END_TASK_DEFINITION
// RegisterKeys
DUNIT_TASK_DEFINITION(CLIENT2, RegisterKeys)
{
- auto regPtr0 = getHelper()->getRegion(myRegNames[0]);
+ auto regPtr0 = getHelper()->getRegion(myRegNames[0]);
- auto exmpRegPtr = getHelper()->getRegion(myRegNames[2]);
- auto subregPtr0 = exmpRegPtr->getSubregion(myRegNames[3]);
- auto subregPtr1 = exmpRegPtr->getSubregion(myRegNames[4]);
+ auto exmpRegPtr = getHelper()->getRegion(myRegNames[2]);
+ auto subregPtr0 = exmpRegPtr->getSubregion(myRegNames[3]);
+ auto subregPtr1 = exmpRegPtr->getSubregion(myRegNames[4]);
- // 1. registerAllKeys on parent and both subregions
- regPtr0->registerAllKeys();
- exmpRegPtr->registerAllKeys();
- subregPtr0->registerAllKeys();
- subregPtr1->registerAllKeys();
+ // 1. registerAllKeys on parent and both subregions
+ regPtr0->registerAllKeys();
+ exmpRegPtr->registerAllKeys();
+ subregPtr0->registerAllKeys();
+ subregPtr1->registerAllKeys();
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, Register2WithFalse)
{
- auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->registerAllKeys(false, false, false);
}
END_TASK_DEFINITION
@@ -264,7 +274,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, SetupClient2_Pooled_Locator)
regListener, false);
regWriter = std::make_shared<TallyWriter>();
setCacheWriter(regionNames[0], regWriter);
- auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
// regPtr0->registerAllKeys();
}
END_TASK_DEFINITION
@@ -289,23 +299,23 @@ DUNIT_TASK_DEFINITION(CLIENT2,
SetupClient2withCachingEnabled_Pooled_Locator)
setCacheWriter(myRegNames[2], regWriter);
// create subregion
- auto exmpRegptr = getHelper()->getRegion(myRegNames[2]);
- auto lattribPtr = exmpRegptr->getAttributes();
- auto subregPtr1 = exmpRegptr->createSubregion(myRegNames[3], lattribPtr);
- auto subregPtr2 = exmpRegptr->createSubregion(myRegNames[4], lattribPtr);
+ auto exmpRegptr = getHelper()->getRegion(myRegNames[2]);
+ auto lattribPtr = exmpRegptr->getAttributes();
+ auto subregPtr1 = exmpRegptr->createSubregion(myRegNames[3], lattribPtr);
+ auto subregPtr2 = exmpRegptr->createSubregion(myRegNames[4], lattribPtr);
- LOGINFO(
- "CLIENT2 SetupClient2withCachingEnabled_Pooled_Locator:: subRegions "
- "created successfully");
+ LOGINFO(
+ "CLIENT2 SetupClient2withCachingEnabled_Pooled_Locator:: subRegions "
+ "created successfully");
- // Attach Listener to subRegion
- // Attache Listener
+ // Attach Listener to subRegion
+ // Attache Listener
- auto subregAttrMutatorPtr = subregPtr1->getAttributesMutator();
- subRegCacheListener = std::make_shared<SimpleCacheListener>();
- subregAttrMutatorPtr->setCacheListener(subRegCacheListener);
+ auto subregAttrMutatorPtr = subregPtr1->getAttributesMutator();
+ subRegCacheListener = std::make_shared<SimpleCacheListener>();
+ subregAttrMutatorPtr->setCacheListener(subRegCacheListener);
- LOG("StepTwo_Pool complete.");
+ LOG("StepTwo_Pool complete.");
}
END_TASK_DEFINITION
@@ -360,54 +370,53 @@ DUNIT_TASK_DEFINITION(CLIENT1, doEventOperations)
{
LOG("do entry operation from client 1");
- auto regPtr0 = getHelper()->getRegion(myRegNames[0]);
- auto exmpRegPtr = getHelper()->getRegion(myRegNames[2]);
-
- auto subregPtr1 = exmpRegPtr->getSubregion(myRegNames[3]);
- auto subregPtr2 = exmpRegPtr->getSubregion(myRegNames[4]);
-
- for (int index = 0; index < 5; index++) {
- char key[100] = {0};
- char value[100] = {0};
- ACE_OS::sprintf(key, "Key-%d", index);
- ACE_OS::sprintf(value, "Value-%d", index);
- auto keyptr = CacheableKey::create(key);
- auto valuePtr = CacheableString::create(value);
- regPtr0->put(keyptr, valuePtr);
- exmpRegPtr->put(keyptr, valuePtr);
- subregPtr1->put(keyptr, valuePtr);
- subregPtr2->put(keyptr, valuePtr);
- }
-
- LOGINFO(
- "CLIENT-1 localCaching Enabled After Put ....ExampleRegion.size() = %d",
- exmpRegPtr->size());
- ASSERT(exmpRegPtr->size() == 5,
- "Total number of entries in the region should be 5");
- // SLEEP( 1000 ); // let the events reach at other end.
-
- LOGINFO(
- "CLIENT-1 localCaching Enabled After Put ....DistRegionAck.size() = %d",
- regPtr0->size());
-
- // TEST COVERAGE FOR cacheListener.afterRegionClear() API
- exmpRegPtr->clear();
- LOGINFO("CLIENT-1 AFTER Clear() call ....reg.size() = %d",
- exmpRegPtr->size());
- ASSERT(exmpRegPtr->size() == 0,
- "Total number of entries in the region should be 0");
-
- LOGINFO("CLIENT-1 AFTER Clear() call ....SubRegion-1.size() = %d",
- subregPtr1->size());
- ASSERT(subregPtr1->size() == 5,
- "Total number of entries in the region should be 0");
-
- LOGINFO("CLIENT-1 AFTER Clear() call ....SubRegion-2.size() = %d",
- subregPtr2->size());
- ASSERT(subregPtr2->size() == 5,
- "Total number of entries in the region should be 0");
-
- SLEEP(1000);
+ auto regPtr0 = getHelper()->getRegion(myRegNames[0]);
+ auto exmpRegPtr = getHelper()->getRegion(myRegNames[2]);
+
+ auto subregPtr1 = exmpRegPtr->getSubregion(myRegNames[3]);
+ auto subregPtr2 = exmpRegPtr->getSubregion(myRegNames[4]);
+
+ for (int index = 0; index < 5; index++) {
+ char key[100] = {0};
+ char value[100] = {0};
+ ACE_OS::sprintf(key, "Key-%d", index);
+ ACE_OS::sprintf(value, "Value-%d", index);
+ auto keyptr = CacheableKey::create(key);
+ auto valuePtr = CacheableString::create(value);
+ regPtr0->put(keyptr, valuePtr);
+ exmpRegPtr->put(keyptr, valuePtr);
+ subregPtr1->put(keyptr, valuePtr);
+ subregPtr2->put(keyptr, valuePtr);
+ }
+
+ LOGINFO(
+ "CLIENT-1 localCaching Enabled After Put ....ExampleRegion.size() =
%d",
+ exmpRegPtr->size());
+ ASSERT(exmpRegPtr->size() == 5,
+ "Total number of entries in the region should be 5");
+
+ LOGINFO(
+ "CLIENT-1 localCaching Enabled After Put ....DistRegionAck.size() =
%d",
+ regPtr0->size());
+
+ // TEST COVERAGE FOR cacheListener.afterRegionClear() API
+ exmpRegPtr->clear();
+ LOGINFO("CLIENT-1 AFTER Clear() call ....reg.size() = %d",
+ exmpRegPtr->size());
+ ASSERT(exmpRegPtr->size() == 0,
+ "Total number of entries in the region should be 0");
+
+ LOGINFO("CLIENT-1 AFTER Clear() call ....SubRegion-1.size() = %d",
+ subregPtr1->size());
+ ASSERT(subregPtr1->size() == 5,
+ "Total number of entries in the region should be 0");
+
+ LOGINFO("CLIENT-1 AFTER Clear() call ....SubRegion-2.size() = %d",
+ subregPtr2->size());
+ ASSERT(subregPtr2->size() == 5,
+ "Total number of entries in the region should be 0");
+
+ SLEEP(1000);
}
END_TASK_DEFINITION
@@ -433,35 +442,35 @@ DUNIT_TASK_DEFINITION(CLIENT2,
validateListenerWriterEventsWithNBSTrue)
ASSERT(parentRegCacheListener->getClears() == 1,
"region.clear() should be called once");
- auto exmpRegPtr = getHelper()->getRegion(myRegNames[2]);
+ auto exmpRegPtr = getHelper()->getRegion(myRegNames[2]);
// LOGINFO(" Total Entries in ExampleRegion = %d ", exmpRegPtr->size());
- ASSERT(exmpRegPtr->size() == 0,
- "Client-2 ExampleRegion.clear() should have called and so "
- "Exampleregion size is expected to 0 ");
-
- // Verify entries in Sub-Region.
- auto subregPtr1 = exmpRegPtr->getSubregion(myRegNames[3]);
- auto subregPtr2 = exmpRegPtr->getSubregion(myRegNames[4]);
-
- // LOGINFO(" Total Entries in SubRegion-1 = %d ", subregPtr1->size());
- // LOGINFO(" Total Entries in SubRegion-2 = %d ", subregPtr2->size());
- ASSERT(subRegCacheListener->getCreates() == 5,
- "should be 5 creates for SubRegion-1 ");
- ASSERT(subRegCacheListener->getClears() == 0,
- "should be 0 clears for SubRegion-1 ");
- ASSERT(subregPtr1->size() == 5,
- "Client-2 SubRegion-1 should contains 5 entries ");
- ASSERT(subregPtr2->size() == 5,
- "Client-2 SubRegion-2 should contains 5 entries ");
-
- // LOGINFO(" SubRegion-1 CREATES:: subRegCacheListener::m_creates = %d ",
- // subRegCacheListener->getCreates());
- // LOGINFO(" SubRegion-1 CLEARS:: subRegCacheListener::m_clears = %d ",
- // subRegCacheListener->getClears());
-
- LOGINFO(
- "validateListenerWriterEventsWithNBSTrue :: Event Validation "
- "Passed....!!");
+ ASSERT(exmpRegPtr->size() == 0,
+ "Client-2 ExampleRegion.clear() should have called and so "
+ "Exampleregion size is expected to 0 ");
+
+ // Verify entries in Sub-Region.
+ auto subregPtr1 = exmpRegPtr->getSubregion(myRegNames[3]);
+ auto subregPtr2 = exmpRegPtr->getSubregion(myRegNames[4]);
+
+ // LOGINFO(" Total Entries in SubRegion-1 = %d ", subregPtr1->size());
+ // LOGINFO(" Total Entries in SubRegion-2 = %d ", subregPtr2->size());
+ ASSERT(subRegCacheListener->getCreates() == 5,
+ "should be 5 creates for SubRegion-1 ");
+ ASSERT(subRegCacheListener->getClears() == 0,
+ "should be 0 clears for SubRegion-1 ");
+ ASSERT(subregPtr1->size() == 5,
+ "Client-2 SubRegion-1 should contains 5 entries ");
+ ASSERT(subregPtr2->size() == 5,
+ "Client-2 SubRegion-2 should contains 5 entries ");
+
+ // LOGINFO(" SubRegion-1 CREATES:: subRegCacheListener::m_creates = %d ",
+ // subRegCacheListener->getCreates());
+ // LOGINFO(" SubRegion-1 CLEARS:: subRegCacheListener::m_clears = %d ",
+ // subRegCacheListener->getClears());
+
+ LOGINFO(
+ "validateListenerWriterEventsWithNBSTrue :: Event Validation "
+ "Passed....!!");
}
END_TASK_DEFINITION
@@ -494,4 +503,6 @@ DUNIT_TASK_DEFINITION(SERVER1, CloseServer1)
}
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTLISTENERWRITER_H_
diff --git a/cppcache/integration-test/ThinClientLocalCacheLoader.hpp
b/cppcache/integration-test/ThinClientLocalCacheLoader.hpp
index 4310bb3..472670d 100644
--- a/cppcache/integration-test/ThinClientLocalCacheLoader.hpp
+++ b/cppcache/integration-test/ThinClientLocalCacheLoader.hpp
@@ -28,8 +28,13 @@
#define CLIENT1 s1p1
#define SERVER1 s2p1
+namespace {
+
+using apache::geode::client::Cacheable;
using apache::geode::client::CacheFactory;
+using apache::geode::client::testing::TallyLoader;
+
std::shared_ptr<TallyLoader> reg1Loader1;
int numLoads = 0;
std::shared_ptr<Cache> cachePtr;
@@ -258,4 +263,6 @@ void runCacheLoaderTest() {
CALL_TASK(StopServer)
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTLOCALCACHELOADER_H_
diff --git a/cppcache/integration-test/ThinClientMultipleCaches.hpp
b/cppcache/integration-test/ThinClientMultipleCaches.hpp
index 5148a67..a994d1c 100644
--- a/cppcache/integration-test/ThinClientMultipleCaches.hpp
+++ b/cppcache/integration-test/ThinClientMultipleCaches.hpp
@@ -29,10 +29,11 @@
#include "CacheHelper.hpp"
#include "fw_dunit.hpp"
-
#define CLIENT1 s1p1
#define SERVER1 s2p1
+namespace {
+
using apache::geode::client::Cache;
using apache::geode::client::CacheFactory;
using apache::geode::client::CacheHelper;
@@ -106,4 +107,6 @@ void run() {
CALL_TASK(CloseLocator1);
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTMULTIPLECACHES_H_
diff --git a/cppcache/integration-test/ThinClientNotification.hpp
b/cppcache/integration-test/ThinClientNotification.hpp
index 0cfe575..db5a896 100644
--- a/cppcache/integration-test/ThinClientNotification.hpp
+++ b/cppcache/integration-test/ThinClientNotification.hpp
@@ -30,6 +30,8 @@
#include "CacheHelper.hpp"
+namespace {
+
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheHelper;
@@ -494,4 +496,6 @@ void doThinClientNotification() {
CALL_TASK(CloseLocator1);
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTNOTIFICATION_H_
diff --git a/cppcache/integration-test/ThinClientPdxSerializer.hpp
b/cppcache/integration-test/ThinClientPdxSerializer.hpp
index 869c021..ef6b255 100644
--- a/cppcache/integration-test/ThinClientPdxSerializer.hpp
+++ b/cppcache/integration-test/ThinClientPdxSerializer.hpp
@@ -34,12 +34,13 @@
#include "ThinClientPdxSerializers.hpp"
#include "CacheRegionHelper.hpp"
-
#define CLIENT1 s1p1
#define CLIENT2 s1p2
#define LOCATOR s2p2
#define SERVER1 s2p1
+namespace {
+
using apache::geode::client::CacheableBoolean;
using apache::geode::client::UserObjectSizer;
@@ -392,4 +393,6 @@ DUNIT_TASK_DEFINITION(LOCATOR, CloseLocator)
}
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTPDXSERIALIZER_H_
diff --git a/cppcache/integration-test/ThinClientPdxSerializers.hpp
b/cppcache/integration-test/ThinClientPdxSerializers.hpp
index 5a978b9..7f6ed15 100644
--- a/cppcache/integration-test/ThinClientPdxSerializers.hpp
+++ b/cppcache/integration-test/ThinClientPdxSerializers.hpp
@@ -20,6 +20,8 @@
#ifndef GEODE_INTEGRATION_TEST_THINCLIENTPDXSERIALIZERS_H_
#define GEODE_INTEGRATION_TEST_THINCLIENTPDXSERIALIZERS_H_
+namespace {
+
using apache::geode::client::CacheableArrayList;
using apache::geode::client::CacheableHashMap;
using apache::geode::client::CacheableHashSet;
@@ -35,41 +37,41 @@ using PdxTests::TestPdxSerializerForV2;
using PdxTests::V1CLASSNAME2;
using PdxTests::V2CLASSNAME4;
-static const char *CLASSNAME1 = "PdxTests.PdxType";
-static const char *CLASSNAME2 = "PdxTests.Address";
+static const char* CLASSNAME1 = "PdxTests.PdxType";
+static const char* CLASSNAME2 = "PdxTests.Address";
class TestPdxSerializer : public PdxSerializer {
public:
- static void deallocate(void *testObject, const std::string &className) {
+ static void deallocate(void* testObject, const std::string& className) {
ASSERT(className == CLASSNAME1 || className == CLASSNAME2,
"Unexpected classname in deallocate()");
LOG("TestPdxSerializer::deallocate called");
if (className == CLASSNAME1) {
- PdxTests::NonPdxType *nonPdxType =
- reinterpret_cast<PdxTests::NonPdxType *>(testObject);
+ PdxTests::NonPdxType* nonPdxType =
+ reinterpret_cast<PdxTests::NonPdxType*>(testObject);
delete nonPdxType;
} else {
- PdxTests::NonPdxAddress *nonPdxAddress =
- reinterpret_cast<PdxTests::NonPdxAddress *>(testObject);
+ PdxTests::NonPdxAddress* nonPdxAddress =
+ reinterpret_cast<PdxTests::NonPdxAddress*>(testObject);
delete nonPdxAddress;
}
}
- static size_t objectSize(const std::shared_ptr<const void> &,
- const std::string &className) {
+ static size_t objectSize(const std::shared_ptr<const void>&,
+ const std::string& className) {
ASSERT(className == CLASSNAME1 || className == CLASSNAME2,
"Unexpected classname in objectSize()");
LOG("TestPdxSerializer::objectSize called");
return 12345; // dummy value
}
- UserObjectSizer getObjectSizer(const std::string &className) override {
+ UserObjectSizer getObjectSizer(const std::string& className) override {
ASSERT(className == CLASSNAME1 || className == CLASSNAME2,
"Unexpected classname in getObjectSizer");
return objectSize;
}
- std::shared_ptr<void> fromDataForAddress(PdxReader &pr) {
+ std::shared_ptr<void> fromDataForAddress(PdxReader& pr) {
try {
auto nonPdxAddress = std::make_shared<PdxTests::NonPdxAddress>();
nonPdxAddress->_aptNumber = pr.readInt("_aptNumber");
@@ -81,8 +83,8 @@ class TestPdxSerializer : public PdxSerializer {
}
}
- std::shared_ptr<void> fromData(const std::string &className,
- PdxReader &pdxReader) override {
+ std::shared_ptr<void> fromData(const std::string& className,
+ PdxReader& pdxReader) override {
ASSERT(className == CLASSNAME1 || className == CLASSNAME2,
"Unexpected classname in fromData");
@@ -177,8 +179,8 @@ class TestPdxSerializer : public PdxSerializer {
return nonPdxType;
}
- bool toDataForAddress(const std::shared_ptr<const void> &testObject,
- PdxWriter &pdxWriter) {
+ bool toDataForAddress(const std::shared_ptr<const void>& testObject,
+ PdxWriter& pdxWriter) {
try {
auto nonPdxAddress =
std::static_pointer_cast<const PdxTests::NonPdxAddress>(testObject);
@@ -191,8 +193,8 @@ class TestPdxSerializer : public PdxSerializer {
}
}
- bool toData(const std::shared_ptr<const void> &testObject,
- const std::string &className, PdxWriter &pdxWriter) override {
+ bool toData(const std::shared_ptr<const void>& testObject,
+ const std::string& className, PdxWriter& pdxWriter) override {
ASSERT(className == CLASSNAME1 || className == CLASSNAME2,
"Unexpected classname in toData");
@@ -204,7 +206,7 @@ class TestPdxSerializer : public PdxSerializer {
std::static_pointer_cast<const PdxTests::NonPdxType>(testObject);
try {
- int *lengthArr = new int[2];
+ int* lengthArr = new int[2];
lengthArr[0] = 1;
lengthArr[1] = 2;
@@ -263,7 +265,7 @@ class TestPdxSerializer : public PdxSerializer {
pdxWriter.writeByteArray("m_sbyteArray", nonPdxType->m_sbyteArray);
pdxWriter.markIdentityField("m_sbyteArray");
- int *strlengthArr = new int[2];
+ int* strlengthArr = new int[2];
strlengthArr[0] = 5;
strlengthArr[1] = 5;
@@ -305,4 +307,6 @@ class TestPdxSerializer : public PdxSerializer {
}
};
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTPDXSERIALIZERS_H_
diff --git a/cppcache/integration-test/ThinClientPutAll.hpp
b/cppcache/integration-test/ThinClientPutAll.hpp
index 07ec729..b4a3e88 100644
--- a/cppcache/integration-test/ThinClientPutAll.hpp
+++ b/cppcache/integration-test/ThinClientPutAll.hpp
@@ -33,6 +33,8 @@
#define ROOT_SCOPE DISTRIBUTED_ACK
#include "CacheHelper.hpp"
+namespace {
+
using apache::geode::client::Cache;
using apache::geode::client::CacheableInt32;
using apache::geode::client::CacheableInt64;
@@ -829,4 +831,6 @@ void runPutAll1(bool concurrencyCheckEnabled = true) {
CALL_TASK(CloseLocator1);
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTPUTALL_H_
diff --git a/cppcache/integration-test/ThinClientPutAllTimeout.hpp
b/cppcache/integration-test/ThinClientPutAllTimeout.hpp
index 660efd5..d865e7c 100644
--- a/cppcache/integration-test/ThinClientPutAllTimeout.hpp
+++ b/cppcache/integration-test/ThinClientPutAllTimeout.hpp
@@ -29,17 +29,24 @@
#define CLIENT2 s1p2
#define SERVER1 s2p1
+namespace {
+
using apache::geode::client::Exception;
using apache::geode::client::HashMapOfCacheable;
using apache::geode::client::TimeoutException;
+using apache::geode::client::testing::TallyListener;
+using apache::geode::client::testing::TallyWriter;
+
bool isLocalServer = true;
static bool isLocator = false;
const char* locatorsG =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
#include "LocatorHelper.hpp"
+
std::shared_ptr<TallyListener> reg1Listener1;
std::shared_ptr<TallyWriter> reg1Writer1;
+
int numCreates = 0;
int numUpdates = 0;
int numInvalidates = 0;
@@ -254,4 +261,6 @@ DUNIT_TASK_DEFINITION(SERVER1, StopServer)
}
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTPUTALLTIMEOUT_H_
diff --git a/cppcache/integration-test/ThinClientPutAllWithCallBack.hpp
b/cppcache/integration-test/ThinClientPutAllWithCallBack.hpp
index 629eccc..ba6cec3 100644
--- a/cppcache/integration-test/ThinClientPutAllWithCallBack.hpp
+++ b/cppcache/integration-test/ThinClientPutAllWithCallBack.hpp
@@ -39,6 +39,8 @@
#define SERVER1 s2p1
#define SERVER2 s2p2
+namespace {
+
using apache::geode::client::CacheableInt32;
using apache::geode::client::CacheableInt64;
using apache::geode::client::CacheableKey;
@@ -815,4 +817,6 @@ DUNIT_TASK_DEFINITION(SERVER2, CloseServer2)
}
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTPUTALLWITHCALLBACK_H_
diff --git a/cppcache/integration-test/ThinClientPutGetAll.hpp
b/cppcache/integration-test/ThinClientPutGetAll.hpp
index 6ce7452..a62f1e3 100644
--- a/cppcache/integration-test/ThinClientPutGetAll.hpp
+++ b/cppcache/integration-test/ThinClientPutGetAll.hpp
@@ -38,6 +38,8 @@
#define CLIENT2 s1p2
#define SERVER1 s2p1
+namespace {
+
using PdxTests::PdxTypes1;
using PdxTests::PdxTypes10;
using PdxTests::PdxTypes2;
@@ -648,4 +650,6 @@ void runPutGetAll() {
CALL_TASK(CloseLocator1);
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTPUTGETALL_H_
diff --git a/cppcache/integration-test/ThinClientRIwithlocalRegionDestroy.hpp
b/cppcache/integration-test/ThinClientRIwithlocalRegionDestroy.hpp
index 1d85f2e..498173b 100644
--- a/cppcache/integration-test/ThinClientRIwithlocalRegionDestroy.hpp
+++ b/cppcache/integration-test/ThinClientRIwithlocalRegionDestroy.hpp
@@ -30,6 +30,8 @@
#include "CacheHelper.hpp"
+namespace {
+
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheHelper;
@@ -505,4 +507,6 @@ void testSubregionForLocalRegionDestroy() {
CALL_TASK(CloseLocator1);
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTRIWITHLOCALREGIONDESTROY_H_
diff --git a/cppcache/integration-test/ThinClientRegex.hpp
b/cppcache/integration-test/ThinClientRegex.hpp
index e540239..7282d92 100644
--- a/cppcache/integration-test/ThinClientRegex.hpp
+++ b/cppcache/integration-test/ThinClientRegex.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_THINCLIENTREGEX_H_
-#define GEODE_INTEGRATION_TEST_THINCLIENTREGEX_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -19,6 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_THINCLIENTREGEX_H_
+#define GEODE_INTEGRATION_TEST_THINCLIENTREGEX_H_
+
#include "fw_dunit.hpp"
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
@@ -29,11 +30,12 @@
#include "CacheHelper.hpp"
-
#define CLIENT1 s1p1
#define CLIENT2 s1p2
#define SERVER1 s2p1
+namespace {
+
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheHelper;
@@ -397,4 +399,6 @@ DUNIT_TASK_DEFINITION(SERVER1, CloseServer1)
}
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTREGEX_H_
diff --git a/cppcache/integration-test/ThinClientRegex2.hpp
b/cppcache/integration-test/ThinClientRegex2.hpp
index 3b19b88..511be90 100644
--- a/cppcache/integration-test/ThinClientRegex2.hpp
+++ b/cppcache/integration-test/ThinClientRegex2.hpp
@@ -30,11 +30,12 @@
#include "CacheHelper.hpp"
-
#define CLIENT1 s1p1
#define CLIENT2 s1p2
#define SERVER1 s2p1
+namespace {
+
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheHelper;
@@ -435,4 +436,6 @@ DUNIT_TASK_DEFINITION(SERVER1, CloseServer1)
}
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTREGEX2_H_
diff --git a/cppcache/integration-test/ThinClientRegex3.hpp
b/cppcache/integration-test/ThinClientRegex3.hpp
index cb928d1..612a8b0 100644
--- a/cppcache/integration-test/ThinClientRegex3.hpp
+++ b/cppcache/integration-test/ThinClientRegex3.hpp
@@ -33,6 +33,8 @@
#define CLIENT2 s1p2
#define SERVER1 s2p1
+namespace {
+
using apache::geode::client::Cacheable;
using apache::geode::client::CacheableInt32;
using apache::geode::client::CacheableInt64;
@@ -385,4 +387,6 @@ DUNIT_TASK_DEFINITION(SERVER1, CloseServer1)
}
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTREGEX3_H_
diff --git a/cppcache/integration-test/ThinClientRemoveAll.hpp
b/cppcache/integration-test/ThinClientRemoveAll.hpp
index 0af586c..b58f38d 100644
--- a/cppcache/integration-test/ThinClientRemoveAll.hpp
+++ b/cppcache/integration-test/ThinClientRemoveAll.hpp
@@ -41,8 +41,15 @@
#define SERVER1 s2p1
#define SERVER2 s2p2
+namespace {
+
+using apache::geode::client::CacheableInt32;
+using apache::geode::client::CacheableKey;
+using apache::geode::client::CacheableString;
+using apache::geode::client::CacheHelper;
using apache::geode::client::EntryNotFoundException;
using apache::geode::client::HashMapOfCacheable;
+using apache::geode::client::IllegalArgumentException;
CacheHelper* cacheHelper = nullptr;
static bool isLocalServer = false;
@@ -424,4 +431,6 @@ DUNIT_TASK_DEFINITION(SERVER2, CloseServer2)
}
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTREMOVEALL_H_
diff --git a/cppcache/integration-test/ThinClientSSL.hpp
b/cppcache/integration-test/ThinClientSSL.hpp
index 90c8609..8850bef 100644
--- a/cppcache/integration-test/ThinClientSSL.hpp
+++ b/cppcache/integration-test/ThinClientSSL.hpp
@@ -30,6 +30,8 @@
#include "CacheHelper.hpp"
+namespace {
+
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheHelper;
@@ -507,4 +509,6 @@ void doThinClientSSL() {
CALL_TASK(CloseLocator1_With_SSL);
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTSSL_H_
diff --git a/cppcache/integration-test/ThinClientSSLWithPassword.hpp
b/cppcache/integration-test/ThinClientSSLWithPassword.hpp
index 06184a8..06b34a8 100644
--- a/cppcache/integration-test/ThinClientSSLWithPassword.hpp
+++ b/cppcache/integration-test/ThinClientSSLWithPassword.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_THINCLIENTSSLWITHPASSWORD_H_
-#define GEODE_INTEGRATION_TEST_THINCLIENTSSLWITHPASSWORD_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -20,6 +15,11 @@
* limitations under the License.
*/
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_THINCLIENTSSLWITHPASSWORD_H_
+#define GEODE_INTEGRATION_TEST_THINCLIENTSSLWITHPASSWORD_H_
+
#include "fw_dunit.hpp"
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
@@ -30,6 +30,8 @@
#include "CacheHelper.hpp"
+namespace {
+
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheHelper;
@@ -521,4 +523,6 @@ void doThinClientSSLWithPassword() {
CALL_TASK(CloseLocator1_With_SSL);
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTSSLWITHPASSWORD_H_
diff --git a/cppcache/integration-test/ThinClientSecurity.hpp
b/cppcache/integration-test/ThinClientSecurity.hpp
index 2a0864a..0ada7ca 100644
--- a/cppcache/integration-test/ThinClientSecurity.hpp
+++ b/cppcache/integration-test/ThinClientSecurity.hpp
@@ -26,6 +26,8 @@
#include "CacheImplHelper.hpp"
#include "testUtils.hpp"
+namespace {
+
using apache::geode::client::AuthenticatedView;
static bool isLocalServer = false;
@@ -80,4 +82,6 @@ AuthenticatedView getVirtualCache(std::shared_ptr<Properties>
creds,
return cachePtr->createAuthenticatedView(creds, pool->getName());
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTSECURITY_H_
diff --git a/cppcache/integration-test/ThinClientSecurityHelper.hpp
b/cppcache/integration-test/ThinClientSecurityHelper.hpp
index 2a9df6f..f82e95f 100644
--- a/cppcache/integration-test/ThinClientSecurityHelper.hpp
+++ b/cppcache/integration-test/ThinClientSecurityHelper.hpp
@@ -23,6 +23,8 @@
#include "ThinClientHelper.hpp"
#include "ace/Process.h"
+namespace {
+
using apache::geode::client::CacheableBoolean;
using apache::geode::client::Exception;
using apache::geode::client::testframework::security::CredentialGenerator;
@@ -127,44 +129,44 @@ opCodeList::value_type tmpAArr[] = {OP_CREATE,
OP_UPDATE,
#define TYPE_USER_CLIENT 'U'
void initClientAuth(char UserType) {
- auto config = Properties::create();
- opCodeList wr(tmpWArr, tmpWArr + sizeof tmpWArr / sizeof *tmpWArr);
- opCodeList rt(tmpRArr, tmpRArr + sizeof tmpRArr / sizeof *tmpRArr);
- opCodeList ad(tmpAArr, tmpAArr + sizeof tmpAArr / sizeof *tmpAArr);
- credentialGeneratorHandler->getAuthInit(config);
- switch (UserType) {
- case 'W':
- credentialGeneratorHandler->getAllowedCredentialsForOps(wr, config,
- nullptr);
- printf("User is %s Pass is %s ",
- config->find("security-username")->value().c_str(),
- (config->find("security-password") != nullptr
- ? config->find("security-password")->value().c_str()
- : " not set"));
- break;
- case 'R':
- credentialGeneratorHandler->getAllowedCredentialsForOps(rt, config,
- nullptr);
- printf("User is %s Pass is %s ",
- config->find("security-username")->value().c_str(),
- (config->find("security-password") != nullptr
- ? config->find("security-password")->value().c_str()
- : " not set"));
- break;
- case 'A':
- credentialGeneratorHandler->getAllowedCredentialsForOps(ad, config,
- nullptr);
- printf("User is %s Pass is %s ",
- config->find("security-username")->value().c_str(),
- (config->find("security-password") != nullptr
- ? config->find("security-password")->value().c_str()
- : " not set"));
- default:
- break;
- }
+ auto config = Properties::create();
+ opCodeList wr(tmpWArr, tmpWArr + sizeof tmpWArr / sizeof *tmpWArr);
+ opCodeList rt(tmpRArr, tmpRArr + sizeof tmpRArr / sizeof *tmpRArr);
+ opCodeList ad(tmpAArr, tmpAArr + sizeof tmpAArr / sizeof *tmpAArr);
+ credentialGeneratorHandler->getAuthInit(config);
+ switch (UserType) {
+ case 'W':
+ credentialGeneratorHandler->getAllowedCredentialsForOps(wr, config,
+ nullptr);
+ printf("User is %s Pass is %s ",
+ config->find("security-username")->value().c_str(),
+ (config->find("security-password") != nullptr
+ ? config->find("security-password")->value().c_str()
+ : " not set"));
+ break;
+ case 'R':
+ credentialGeneratorHandler->getAllowedCredentialsForOps(rt, config,
+ nullptr);
+ printf("User is %s Pass is %s ",
+ config->find("security-username")->value().c_str(),
+ (config->find("security-password") != nullptr
+ ? config->find("security-password")->value().c_str()
+ : " not set"));
+ break;
+ case 'A':
+ credentialGeneratorHandler->getAllowedCredentialsForOps(ad, config,
+ nullptr);
+ printf("User is %s Pass is %s ",
+ config->find("security-username")->value().c_str(),
+ (config->find("security-password") != nullptr
+ ? config->find("security-password")->value().c_str()
+ : " not set"));
+ default:
+ break;
+ }
- try {
- initClient(true, config);
+ try {
+ initClient(true, config);
} catch (...) {
throw;
}
@@ -233,10 +235,10 @@ class putThread : public ACE_Task_Base {
key = CacheableKey::create(buf);
if (m_opcode == 0) {
if (m_isCallBack) {
- auto boolptr = CacheableBoolean::create("true");
- sprintf(valbuf, "client1-value%d", ops);
- value = CacheableString::create(valbuf);
- m_reg->put(key, value, boolptr);
+ auto boolptr = CacheableBoolean::create("true");
+ sprintf(valbuf, "client1-value%d", ops);
+ value = CacheableString::create(valbuf);
+ m_reg->put(key, value, boolptr);
} else {
sprintf(valbuf, "client2-value%d", ops);
value = CacheableString::create(valbuf);
@@ -254,8 +256,8 @@ class putThread : public ACE_Task_Base {
} else {
try {
if (m_isCallBack) {
- auto boolptr = CacheableBoolean::create("true");
- m_reg->destroy(key, boolptr);
+ auto boolptr = CacheableBoolean::create("true");
+ m_reg->destroy(key, boolptr);
} else {
m_reg->destroy(key);
}
@@ -279,4 +281,6 @@ class putThread : public ACE_Task_Base {
int m_waitTime;
};
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTSECURITYHELPER_H_
diff --git a/cppcache/integration-test/ThinClientTXFailover.hpp
b/cppcache/integration-test/ThinClientTXFailover.hpp
index 31a49b3..01d3608 100644
--- a/cppcache/integration-test/ThinClientTXFailover.hpp
+++ b/cppcache/integration-test/ThinClientTXFailover.hpp
@@ -32,6 +32,8 @@
#include "CacheHelper.hpp"
+namespace {
+
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheHelper;
@@ -433,4 +435,6 @@ void runThinClientFailover(bool isSticky = false) {
CALL_TASK(CloseLocator1);
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTTXFAILOVER_H_
diff --git a/cppcache/integration-test/ThinClientTasks_C2S2.hpp
b/cppcache/integration-test/ThinClientTasks_C2S2.hpp
index c461c68..37fc0bf 100644
--- a/cppcache/integration-test/ThinClientTasks_C2S2.hpp
+++ b/cppcache/integration-test/ThinClientTasks_C2S2.hpp
@@ -32,6 +32,8 @@
#define PROCESS3 s2p1
#define PROCESS4 s2p2
+namespace {
+
using apache::geode::client::CacheHelper;
DUNIT_TASK_DEFINITION(SERVER1, StartLocator)
@@ -95,4 +97,6 @@ void startServer() { CALL_TASK(startServerWithLocator); }
void closeLocator() { CALL_TASK(CloseLocator); }
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTTASKS_C2S2_H_
diff --git a/cppcache/integration-test/ThinClientTransactions.hpp
b/cppcache/integration-test/ThinClientTransactions.hpp
index 384f836..6a781b9 100644
--- a/cppcache/integration-test/ThinClientTransactions.hpp
+++ b/cppcache/integration-test/ThinClientTransactions.hpp
@@ -34,6 +34,8 @@
#include "CacheHelper.hpp"
+namespace {
+
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheHelper;
@@ -1103,4 +1105,6 @@ DUNIT_TASK_DEFINITION(SERVER1, CloseServer1)
}
END_TASK_DEFINITION
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTTRANSACTIONS_H_
diff --git a/cppcache/integration-test/ThinClientTransactionsXA.hpp
b/cppcache/integration-test/ThinClientTransactionsXA.hpp
index 897a168..a2b4cd4 100644
--- a/cppcache/integration-test/ThinClientTransactionsXA.hpp
+++ b/cppcache/integration-test/ThinClientTransactionsXA.hpp
@@ -34,6 +34,8 @@
#include "CacheHelper.hpp"
+namespace {
+
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheHelper;
@@ -666,11 +668,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, SuspendResumeCommit)
bool threwTransactionException = false;
try {
txManager->suspend();
- }
- catch (const TransactionException) {
+ } catch (const TransactionException) {
threwTransactionException = true;
}
- ASSERT(threwTransactionException, "SuspendResumeCommit: Transaction
shouldnt have been suspended");
+ ASSERT(threwTransactionException,
+ "SuspendResumeCommit: Transaction shouldnt have been suspended");
}
END_TASK_DEFINITION
@@ -1167,4 +1169,6 @@ void runTransactionOps(bool isSticky = false) {
CALL_TASK(CloseLocator1);
}
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_THINCLIENTTRANSACTIONSXA_H_
diff --git a/cppcache/integration-test/ThinClientVersionedOps.hpp
b/cppcache/integration-test/ThinClientVersionedOps.hpp
index 2e06b24..c812b07 100644
--- a/cppcache/integration-test/ThinClientVersionedOps.hpp
+++ b/cppcache/integration-test/ThinClientVersionedOps.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_THINCLIENTVERSIONEDOPS_H_
-#define GEODE_INTEGRATION_TEST_THINCLIENTVERSIONEDOPS_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -20,6 +15,11 @@
* limitations under the License.
*/
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_THINCLIENTVERSIONEDOPS_H_
+#define GEODE_INTEGRATION_TEST_THINCLIENTVERSIONEDOPS_H_
+
#define ROOT_NAME "testThinClientVersionedOps"
#include "ThinClientSecurityHelper.hpp"
diff --git a/cppcache/integration-test/TimeBomb.hpp
b/cppcache/integration-test/TimeBomb.hpp
index cf02bcc..97d58f5 100644
--- a/cppcache/integration-test/TimeBomb.hpp
+++ b/cppcache/integration-test/TimeBomb.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_INTEGRATION_TEST_TIMEBOMB_H_
-#define GEODE_INTEGRATION_TEST_TIMEBOMB_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -20,6 +15,11 @@
* limitations under the License.
*/
+#pragma once
+
+#ifndef GEODE_INTEGRATION_TEST_TIMEBOMB_H_
+#define GEODE_INTEGRATION_TEST_TIMEBOMB_H_
+
#include <ace/Task.h>
#include <ace/OS.h>
#include <ace/Time_Value.h>
diff --git a/cppcache/integration-test/locator_globals.hpp
b/cppcache/integration-test/locator_globals.hpp
index eb77ab6..d1bc3d1 100644
--- a/cppcache/integration-test/locator_globals.hpp
+++ b/cppcache/integration-test/locator_globals.hpp
@@ -20,6 +20,8 @@
#ifndef GEODE_INTEGRATION_TEST_LOCATOR_GLOBALS_H_
#define GEODE_INTEGRATION_TEST_LOCATOR_GLOBALS_H_
+namespace {
+
using apache::geode::client::CacheHelper;
static int numberOfLocators = 1;
@@ -28,4 +30,6 @@ bool isLocator = false;
const char* locatorsG =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer,
numberOfLocators);
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_LOCATOR_GLOBALS_H_
diff --git a/cppcache/integration-test/testCacheless.cpp
b/cppcache/integration-test/testCacheless.cpp
index 1b1f1d8..61ea1d7 100644
--- a/cppcache/integration-test/testCacheless.cpp
+++ b/cppcache/integration-test/testCacheless.cpp
@@ -26,6 +26,8 @@ using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheListener;
+using apache::geode::client::testing::TallyListener;
+
std::shared_ptr<CacheListener> nullListenerPtr;
class RegionWrapper {
diff --git a/cppcache/integration-test/testThinClientCacheables.cpp
b/cppcache/integration-test/testThinClientCacheables.cpp
index 24fe03d..1470eed 100644
--- a/cppcache/integration-test/testThinClientCacheables.cpp
+++ b/cppcache/integration-test/testThinClientCacheables.cpp
@@ -33,6 +33,18 @@
#define CLIENT2 s1p2
#define SERVER1 s2p1
+using apache::geode::client::Cacheable;
+using apache::geode::client::CacheableInt32;
+using apache::geode::client::CacheableKey;
+using apache::geode::client::CacheHelper;
+using apache::geode::client::EntryNotFoundException;
+using apache::geode::client::Region;
+using apache::geode::client::Utils;
+using apache::geode::client::internal::DSCode;
+
+using apache::geode::client::testing::CacheableWrapper;
+using apache::geode::client::testing::CacheableWrapperFactory;
+
CacheHelper* cacheHelper = nullptr;
bool isLocalServer = false;
@@ -45,10 +57,6 @@ bool isLocalServer = false;
#define KEYSIZE 256
#define VALUESIZE 1024
-using apache::geode::client::EntryNotFoundException;
-using apache::geode::client::Region;
-using apache::geode::client::Utils;
-
void initClient(const bool isthinClient) {
if (cacheHelper == nullptr) {
cacheHelper = new CacheHelper(isthinClient);
diff --git a/cppcache/integration-test/testThinClientCacheablesLimits.cpp
b/cppcache/integration-test/testThinClientCacheablesLimits.cpp
index 265563d..4ca8566 100644
--- a/cppcache/integration-test/testThinClientCacheablesLimits.cpp
+++ b/cppcache/integration-test/testThinClientCacheablesLimits.cpp
@@ -33,6 +33,7 @@
#define CLIENT1 s1p1
#define SERVER1 s2p1
+using apache::geode::client::CacheableBytes;
using apache::geode::client::CacheHelper;
using apache::geode::client::OutOfMemoryException;
diff --git a/cppcache/integration-test/testThinClientHeapLRU.cpp
b/cppcache/integration-test/testThinClientHeapLRU.cpp
index d9af437..3b20da7 100644
--- a/cppcache/integration-test/testThinClientHeapLRU.cpp
+++ b/cppcache/integration-test/testThinClientHeapLRU.cpp
@@ -26,7 +26,6 @@
#include <string>
#include "ThinClientHelper.hpp"
-
#define CLIENT1 s1p1
#define CLIENT2 s1p2
#define SERVER1 s2p1
@@ -34,6 +33,11 @@
#include "locator_globals.hpp"
#include "LocatorHelper.hpp"
+using apache::geode::client::internal::DSCode;
+
+using apache::geode::client::testing::CacheableWrapper;
+using apache::geode::client::testing::CacheableWrapperFactory;
+
const char* _regionNames[] = {"DistRegionAck"};
void createOnekEntries() {
diff --git a/cppcache/integration-test/testThinClientLRUExpiration.cpp
b/cppcache/integration-test/testThinClientLRUExpiration.cpp
index ef6fcbf..16f9ebf 100644
--- a/cppcache/integration-test/testThinClientLRUExpiration.cpp
+++ b/cppcache/integration-test/testThinClientLRUExpiration.cpp
@@ -35,6 +35,8 @@
#define CLIENT2 s1p2
#define SERVER1 s2p1
+using apache::geode::client::CacheableKey;
+using apache::geode::client::CacheableString;
using apache::geode::client::CacheHelper;
using apache::geode::client::EntryNotFoundException;
using apache::geode::client::Exception;
@@ -42,6 +44,9 @@ using apache::geode::client::ExpirationAction;
using apache::geode::client::RegionAttributes;
using apache::geode::client::RegionDestroyedException;
+using apache::geode::client::testing::TallyListener;
+using apache::geode::client::testing::TallyWriter;
+
CacheHelper* cacheHelper = nullptr;
bool isLocalServer = false;
diff --git
a/cppcache/integration-test/testThinClientListenerCallbackArgTest.cpp
b/cppcache/integration-test/testThinClientListenerCallbackArgTest.cpp
index cbeb413..70ddcc4 100644
--- a/cppcache/integration-test/testThinClientListenerCallbackArgTest.cpp
+++ b/cppcache/integration-test/testThinClientListenerCallbackArgTest.cpp
@@ -34,7 +34,13 @@
#include "testobject/Portfolio.hpp"
+using apache::geode::client::Cacheable;
using apache::geode::client::ClassCastException;
+using apache::geode::client::EntryEvent;
+using apache::geode::client::RegionEvent;
+
+using apache::geode::client::testing::TallyListener;
+using apache::geode::client::testing::TallyWriter;
bool isLocalServer = true;
static bool isLocator = false;
diff --git
a/cppcache/integration-test/testThinClientNotificationWithDeltaWithoutcache.cpp
b/cppcache/integration-test/testThinClientNotificationWithDeltaWithoutcache.cpp
index 0ff127e..9308d8f 100644
---
a/cppcache/integration-test/testThinClientNotificationWithDeltaWithoutcache.cpp
+++
b/cppcache/integration-test/testThinClientNotificationWithDeltaWithoutcache.cpp
@@ -44,11 +44,19 @@ CacheHelper* cacheHelper = nullptr;
#define CLIENT2 s1p2
#define SERVER1 s2p1
#include "LocatorHelper.hpp"
+
int DeltaEx::toDeltaCount = 0;
int DeltaEx::toDataCount = 0;
int DeltaEx::fromDeltaCount = 0;
int DeltaEx::fromDataCount = 0;
int DeltaEx::cloneCount = 0;
+
+int PdxDeltaEx::m_toDeltaCount = 0;
+int PdxDeltaEx::m_toDataCount = 0;
+int PdxDeltaEx::m_fromDeltaCount = 0;
+int PdxDeltaEx::m_fromDataCount = 0;
+int PdxDeltaEx::m_cloneCount = 0;
+
void initClient(const bool isthinClient) {
if (cacheHelper == nullptr) {
cacheHelper = new CacheHelper(isthinClient);
diff --git a/cppcache/integration-test/testThinClientPRPutAllFailover.cpp
b/cppcache/integration-test/testThinClientPRPutAllFailover.cpp
index 60cebfe..812366d 100644
--- a/cppcache/integration-test/testThinClientPRPutAllFailover.cpp
+++ b/cppcache/integration-test/testThinClientPRPutAllFailover.cpp
@@ -42,6 +42,8 @@
using apache::geode::client::Exception;
using apache::geode::client::HashMapOfCacheable;
+using apache::geode::client::testing::TallyListener;
+
std::shared_ptr<TallyListener> reg1Listener1;
bool isLocalServer = false;
static bool isLocator = false;
diff --git a/cppcache/integration-test/testThinClientPRSingleHop.cpp
b/cppcache/integration-test/testThinClientPRSingleHop.cpp
index 56ac839..9ee66d5 100644
--- a/cppcache/integration-test/testThinClientPRSingleHop.cpp
+++ b/cppcache/integration-test/testThinClientPRSingleHop.cpp
@@ -46,6 +46,10 @@
using apache::geode::client::CacheServerException;
using apache::geode::client::CacheWriterException;
using apache::geode::client::Exception;
+using apache::geode::client::internal::DSCode;
+
+using apache::geode::client::testing::CacheableWrapper;
+using apache::geode::client::testing::CacheableWrapperFactory;
bool isLocalServer = false;
const char* endPoints = CacheHelper::getTcrEndpoints(isLocalServer, 3);
diff --git
a/cppcache/integration-test/testThinClientPdxDeltaWithNotification.cpp
b/cppcache/integration-test/testThinClientPdxDeltaWithNotification.cpp
index 261bbb8..190ef9f 100644
--- a/cppcache/integration-test/testThinClientPdxDeltaWithNotification.cpp
+++ b/cppcache/integration-test/testThinClientPdxDeltaWithNotification.cpp
@@ -41,6 +41,7 @@ const char* locatorsG =
#define CLIENT2 s1p2
#define SERVER1 s2p1
#include "LocatorHelper.hpp"
+
int DeltaEx::toDeltaCount = 0;
int DeltaEx::toDataCount = 0;
int DeltaEx::fromDeltaCount = 0;
diff --git a/cppcache/integration-test/testThinClientPutAllPRSingleHop.cpp
b/cppcache/integration-test/testThinClientPutAllPRSingleHop.cpp
index 280e240..fd0a7c3 100644
--- a/cppcache/integration-test/testThinClientPutAllPRSingleHop.cpp
+++ b/cppcache/integration-test/testThinClientPutAllPRSingleHop.cpp
@@ -43,6 +43,7 @@
#define SERVER2 s1p2
#define SERVER3 s2p2
+using apache::geode::client::Cacheable;
using apache::geode::client::CacheServerException;
using apache::geode::client::CacheWriterException;
using apache::geode::client::Exception;
diff --git a/cppcache/integration-test/testThinClientPutWithDelta.cpp
b/cppcache/integration-test/testThinClientPutWithDelta.cpp
index fa0e5f4..53b0aef 100644
--- a/cppcache/integration-test/testThinClientPutWithDelta.cpp
+++ b/cppcache/integration-test/testThinClientPutWithDelta.cpp
@@ -39,11 +39,19 @@ const char* locatorsG =
#define CLIENT2 s1p2
#define SERVER1 s2p1
#include "LocatorHelper.hpp"
+
int DeltaEx::toDeltaCount = 0;
int DeltaEx::toDataCount = 0;
int DeltaEx::fromDeltaCount = 0;
int DeltaEx::fromDataCount = 0;
int DeltaEx::cloneCount = 0;
+
+int PdxDeltaEx::m_toDeltaCount = 0;
+int PdxDeltaEx::m_toDataCount = 0;
+int PdxDeltaEx::m_fromDeltaCount = 0;
+int PdxDeltaEx::m_fromDataCount = 0;
+int PdxDeltaEx::m_cloneCount = 0;
+
void initClient(const bool isthinClient) {
if (cacheHelper == nullptr) {
cacheHelper = new CacheHelper(isthinClient);
diff --git a/cppcache/integration-test/testThinClientWriterException.cpp
b/cppcache/integration-test/testThinClientWriterException.cpp
index aff5806..aa96e3a 100644
--- a/cppcache/integration-test/testThinClientWriterException.cpp
+++ b/cppcache/integration-test/testThinClientWriterException.cpp
@@ -39,6 +39,9 @@ using
apache::geode::client::testframework::security::OP_REGISTER_INTEREST;
using apache::geode::client::testframework::security::OP_UNREGISTER_INTEREST;
using apache::geode::client::testframework::security::opCodeList;
+using apache::geode::client::testing::TallyListener;
+using apache::geode::client::testing::TallyWriter;
+
std::shared_ptr<TallyListener> regListener;
std::shared_ptr<TallyWriter> regWriter;
diff --git a/cppcache/integration-test/testUtils.hpp
b/cppcache/integration-test/testUtils.hpp
index 6c4f3a1..84c746e 100644
--- a/cppcache/integration-test/testUtils.hpp
+++ b/cppcache/integration-test/testUtils.hpp
@@ -40,6 +40,8 @@
#include <DistributedSystemImpl.hpp>
#include <CacheImpl.hpp>
+namespace {
+
using apache::geode::client::Cache;
using apache::geode::client::CacheableKey;
using apache::geode::client::CacheableString;
@@ -186,4 +188,6 @@ class TestUtils {
};
} // namespace unitTests
+} // namespace
+
#endif // GEODE_INTEGRATION_TEST_TESTUTILS_H_
diff --git a/tests/cpp/fwklib/QueryHelper.hpp b/tests/cpp/fwklib/QueryHelper.hpp
index 8c84a94..8ab6593 100644
--- a/tests/cpp/fwklib/QueryHelper.hpp
+++ b/tests/cpp/fwklib/QueryHelper.hpp
@@ -1,8 +1,3 @@
-#pragma once
-
-#ifndef GEODE_FWKLIB_QUERYHELPER_H_
-#define GEODE_FWKLIB_QUERYHELPER_H_
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -20,6 +15,11 @@
* limitations under the License.
*/
+#pragma once
+
+#ifndef GEODE_FWKLIB_QUERYHELPER_H_
+#define GEODE_FWKLIB_QUERYHELPER_H_
+
#include <cstdlib>
#include <geode/SystemProperties.hpp>
#include <ace/OS.h>
@@ -41,20 +41,6 @@
#define ROOT_SCOPE LOCAL
#endif
-using apache::geode::client::Cacheable;
-using apache::geode::client::CacheableKey;
-using apache::geode::client::DataOutputInternal;
-using apache::geode::client::Exception;
-using apache::geode::client::Region;
-using apache::geode::client::ResultSet;
-using apache::geode::client::SelectResults;
-using apache::geode::client::Serializable;
-using apache::geode::client::Struct;
-using apache::geode::client::StructSet;
-
-using testobject::Portfolio;
-using testobject::Position;
-
namespace testData {
const int RS_ARRAY_SIZE = 41;
@@ -655,6 +641,22 @@ const int cqResultsetRowCounts[CQRS_ARRAY_SIZE] = {20, 1,
19, 0, 0, 0, 0, 20,
const int constantExpectedRowsCQRS[1] = {35};
} // namespace testData
+namespace {
+
+using apache::geode::client::Cacheable;
+using apache::geode::client::CacheableKey;
+using apache::geode::client::DataOutputInternal;
+using apache::geode::client::Exception;
+using apache::geode::client::Region;
+using apache::geode::client::ResultSet;
+using apache::geode::client::SelectResults;
+using apache::geode::client::Serializable;
+using apache::geode::client::Struct;
+using apache::geode::client::StructSet;
+
+using testobject::Portfolio;
+using testobject::Position;
+
using testData::constantExpectedRowsCQRS;
using testData::constantExpectedRowsPQRS;
using testData::constantExpectedRowsRS;
@@ -719,15 +721,6 @@ class QueryHelper {
virtual bool verifySS(std::shared_ptr<SelectResults>& structset,
size_t rowCount, int fieldCount);
- void populateRangePositionData(std::shared_ptr<Region>& rptr, int start,
- int end);
- bool compareTwoPositionObjects(std::shared_ptr<Serializable> por1,
- std::shared_ptr<Serializable> por2);
- std::shared_ptr<Serializable> getExactPositionObject(int iForExactPosObject);
- void putExactPositionObject(std::shared_ptr<Region>& rptr,
- int iForExactPosObject);
- std::shared_ptr<Serializable> getCachedPositionObject(
- std::shared_ptr<Region>& rptr, int iForExactPosObject);
// utility methods
virtual int getPortfolioSetSize() { return portfolioSetSize; };
@@ -735,68 +728,6 @@ class QueryHelper {
virtual int getPositionSetSize() { return positionSetSize; };
virtual int getPositionNumSets() { return positionNumSets; };
- bool isExpectedRowsConstantRS(int queryindex) {
- for (int i = (sizeof(constantExpectedRowsRS) / sizeof(int)) - 1; i > -1;
- i--) {
- if (constantExpectedRowsRS[i] == queryindex) {
- FWKINFO("index " << constantExpectedRowsRS[i]
- << " is having constant rows ");
- return true;
- }
- }
-
- return false;
- }
-
- bool isExpectedRowsConstantSS(int queryindex) {
- for (int i = (sizeof(constantExpectedRowsSS) / sizeof(int)) - 1; i > -1;
- i--) {
- if (constantExpectedRowsSS[i] == queryindex) {
- FWKINFO("index " << constantExpectedRowsSS[i]
- << " is having constant rows ");
- return true;
- }
- }
-
- return false;
- }
-
- bool isExpectedRowsConstantCQRS(int queryindex) {
- for (int i = (sizeof(constantExpectedRowsCQRS) / sizeof(int)) - 1; i > -1;
- i--) {
- if (constantExpectedRowsCQRS[i] == queryindex) {
- FWKINFO("index " << constantExpectedRowsCQRS[i]
- << " is having constant rows ");
- return true;
- }
- }
-
- return false;
- }
-
- bool isExpectedRowsConstantPQRS(int queryindex) {
- for (int i = (sizeof(constantExpectedRowsPQRS) / sizeof(int)) - 1; i > -1;
- i--) {
- if (constantExpectedRowsPQRS[i] == queryindex) {
- printf("index %d is having constant rows \n",
- constantExpectedRowsPQRS[i]);
- return true;
- }
- }
-
- return false;
- }
- bool isExpectedRowsConstantSSPQ(int queryindex) {
- for (int i = (sizeof(constantExpectedRowsSSPQ) / sizeof(int)) - 1; i > -1;
- i--) {
- if (constantExpectedRowsSSPQ[i] == queryindex) {
- printf("index %d is having constant rows \n",
- constantExpectedRowsSSPQ[i]);
- return true;
- }
- }
- return false;
- }
private:
int portfolioSetSize;
@@ -807,73 +738,6 @@ class QueryHelper {
QueryHelper* QueryHelper::singleton = nullptr;
-//===========================================================================================
-
-void QueryHelper::populateRangePositionData(std::shared_ptr<Region>& rptr,
- int start, int end) {
- for (int i = start; i <= end; i++) {
- auto pos = std::make_shared<Position>(i);
- char key[100];
- ACE_OS::sprintf(key, "pos%d", i);
- auto keyptr = CacheableKey::create(key);
- rptr->put(keyptr, pos);
- }
-}
-
-bool QueryHelper::compareTwoPositionObjects(
- std::shared_ptr<Serializable> pos1, std::shared_ptr<Serializable> pos2) {
- Position* p1 = dynamic_cast<Position*>(pos1.get());
- Position* p2 = dynamic_cast<Position*>(pos2.get());
-
- if (!p1 || !p2) {
- printf("ERROR: The object(s) passed are not of Portflio type\n");
- return false;
- }
-
- DataOutputInternal o1, o2;
- p1->toData(o1);
- p2->toData(o2);
-
- auto len1 = o1.getBufferLength();
- auto len2 = o2.getBufferLength();
-
- if (len1 != len2) {
- return false;
- }
-
- const uint8_t* ptr1 = o1.getBuffer();
- const uint8_t* ptr2 = o2.getBuffer();
-
- for (uint8_t i = 0; i < len1; i++) {
- if (*ptr1++ != *ptr2++) {
- return false;
- }
- }
- return true;
-}
-std::shared_ptr<Serializable> QueryHelper::getExactPositionObject(
- int iForExactPosObject) {
- return std::make_shared<Position>(iForExactPosObject);
-}
-
-void QueryHelper::putExactPositionObject(std::shared_ptr<Region>& rptr,
- int iForExactPosObject) {
- char key[100];
- ACE_OS::sprintf(key, "pos%d", iForExactPosObject);
- auto keyptr = CacheableKey::create(key);
- auto pos = std::make_shared<Position>(iForExactPosObject);
- rptr->put(keyptr, pos);
-}
-std::shared_ptr<Serializable> QueryHelper::getCachedPositionObject(
- std::shared_ptr<Region>& rptr, int iForExactPosObject) {
- char key[100];
- ACE_OS::sprintf(key, "pos%d", iForExactPosObject);
- auto keyptr = CacheableKey::create(key);
- return rptr->get(keyptr);
-}
-
-//===========================================================================================
-
void QueryHelper::populatePortfolioData(std::shared_ptr<Region>& rptr,
int setSize, int numSets,
int32_t objSize) {
@@ -1102,4 +966,6 @@ bool QueryHelper::verifySS(std::shared_ptr<SelectResults>&
structSet,
return false;
}
+} // namespace
+
#endif // GEODE_FWKLIB_QUERYHELPER_H_