You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2012/07/16 23:53:03 UTC
svn commit: r1362280 - in /activemq/activemq-cpp/trunk/activemq-cpp/src:
main/ main/decaf/util/ main/decaf/util/concurrent/ test/ test/decaf/util/
test/decaf/util/concurrent/
Author: tabish
Date: Mon Jul 16 21:53:02 2012
New Revision: 1362280
URL: http://svn.apache.org/viewvc?rev=1362280&view=rev
Log:
Some initial classes and tests for Hashed containers .
Added:
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashCode.cpp (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashCode.h (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashMap.cpp (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashMap.h (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LRUCache.cpp (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LRUCache.h (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/ConcurrentHashMap.cpp (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/ConcurrentHashMap.h (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashCodeTest.cpp (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashCodeTest.h (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashMapTest.cpp (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashMapTest.h (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/LRUCacheTest.cpp (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/LRUCacheTest.h (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ConcurrentHashMapTest.cpp (with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ConcurrentHashMapTest.h (with props)
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am
activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am
activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am?rev=1362280&r1=1362279&r2=1362280&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am Mon Jul 16 21:53:02 2012
@@ -427,7 +427,10 @@ cc_sources = \
decaf/util/ConcurrentModificationException.cpp \
decaf/util/Date.cpp \
decaf/util/Deque.cpp \
+ decaf/util/HashCode.cpp \
+ decaf/util/HashMap.cpp \
decaf/util/Iterator.cpp \
+ decaf/util/LRUCache.cpp \
decaf/util/LinkedList.cpp \
decaf/util/List.cpp \
decaf/util/ListIterator.cpp \
@@ -450,6 +453,7 @@ cc_sources = \
decaf/util/concurrent/BlockingQueue.cpp \
decaf/util/concurrent/BrokenBarrierException.cpp \
decaf/util/concurrent/Callable.cpp \
+ decaf/util/concurrent/ConcurrentHashMap.cpp \
decaf/util/concurrent/ConcurrentMap.cpp \
decaf/util/concurrent/ConcurrentStlMap.cpp \
decaf/util/concurrent/CopyOnWriteArrayList.cpp \
@@ -1036,7 +1040,10 @@ h_sources = \
decaf/util/Config.h \
decaf/util/Date.h \
decaf/util/Deque.h \
+ decaf/util/HashCode.h \
+ decaf/util/HashMap.h \
decaf/util/Iterator.h \
+ decaf/util/LRUCache.h \
decaf/util/LinkedList.h \
decaf/util/List.h \
decaf/util/ListIterator.h \
@@ -1062,6 +1069,7 @@ h_sources = \
decaf/util/concurrent/Callable.h \
decaf/util/concurrent/CancellationException.h \
decaf/util/concurrent/Concurrent.h \
+ decaf/util/concurrent/ConcurrentHashMap.h \
decaf/util/concurrent/ConcurrentMap.h \
decaf/util/concurrent/ConcurrentStlMap.h \
decaf/util/concurrent/CopyOnWriteArrayList.h \
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashCode.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashCode.cpp?rev=1362280&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashCode.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashCode.cpp Mon Jul 16 21:53:02 2012
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "HashCode.h"
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashCode.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashCode.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashCode.h?rev=1362280&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashCode.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashCode.h Mon Jul 16 21:53:02 2012
@@ -0,0 +1,170 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_UTIL_HASHCODE_H_
+#define _DECAF_UTIL_HASHCODE_H_
+
+#include <decaf/util/Config.h>
+
+#include <decaf/lang/Pointer.h>
+#include <decaf/lang/Float.h>
+#include <decaf/lang/Double.h>
+
+#include <string>
+#include <functional>
+
+namespace decaf {
+namespace util {
+
+ /**
+ * Base HashCode template, specializations are created from this to account for
+ * the various native types.
+ *
+ * @since 1.0
+ */
+ template<typename T>
+ struct HashCode : public std::unary_function<T, int> {
+ public:
+ int operator()(T arg);
+ };
+
+ template<typename T>
+ struct HashCode<T*> : public std::unary_function<T*, int> {
+ int operator()(T* arg) {
+ return reinterpret_cast<int>(arg);
+ }
+ };
+
+ template<typename T>
+ struct HashCode<const T&> : public std::unary_function<const T&, int> {
+ int operator()(const T& arg) {
+ return HashCode<const T*>(&arg);
+ }
+ };
+
+ template<>
+ struct HashCode<bool> : public std::unary_function<bool, int> {
+ int operator()(bool arg) {
+ return arg ? 1231 : 1237;
+ }
+ };
+
+ template<>
+ struct HashCode<unsigned char> : public std::unary_function<unsigned char, int> {
+ int operator()(unsigned char arg) {
+ return (int) arg;
+ }
+ };
+
+ template<>
+ struct HashCode<char> : public std::unary_function<char, int> {
+ int operator()(char arg) {
+ return (int) arg;
+ }
+ };
+
+ template<>
+ struct HashCode<wchar_t> : public std::unary_function<wchar_t, int> {
+ int operator()(wchar_t arg) {
+ return (int) arg;
+ }
+ };
+
+ template<>
+ struct HashCode<unsigned short> : public std::unary_function<unsigned short, int> {
+ int operator()(unsigned short arg) {
+ return (int) arg;
+ }
+ };
+
+ template<>
+ struct HashCode<short> : public std::unary_function<short, int> {
+ int operator()(short arg) {
+ return (int) arg;
+ }
+ };
+
+ template<>
+ struct HashCode<unsigned int> : public std::unary_function<unsigned int, int> {
+ int operator()(unsigned int arg) {
+ return (int) arg;
+ }
+ };
+
+ template<>
+ struct HashCode<int> : public std::unary_function<int, int> {
+ int operator()(int arg) {
+ return arg;
+ }
+ };
+
+ template<>
+ struct HashCode<unsigned long long> : public std::unary_function<unsigned long long, int> {
+ int operator()(unsigned long long arg) {
+ return (int) (arg ^ (arg >> 32));
+ }
+ };
+
+ template<>
+ struct HashCode<long long> : public std::unary_function<long long, int> {
+ int operator()(long long arg) {
+ return (int) (arg ^ ((unsigned long long) arg >> 32));
+ }
+ };
+
+ template<>
+ struct HashCode<float> : public std::unary_function<float, int> {
+ int operator()(float arg) {
+ return decaf::lang::Float::floatToIntBits(arg);
+ }
+ };
+
+ template<>
+ struct HashCode<double> : public std::unary_function<double, int> {
+ int operator()(double arg) {
+ long long value = decaf::lang::Double::doubleToLongBits(arg);
+ return (int) (value ^ ((unsigned long long) value >> 32));
+ }
+ };
+
+ template<>
+ struct HashCode<std::string> : public std::unary_function<const std::string&, int> {
+ int operator()(const std::string& arg) {
+ int h = 0;
+ if (h == 0 && arg.length() > 0) {
+ std::string::const_iterator iter = arg.begin();
+ for (; iter != arg.end(); ++iter) {
+ h = 31 * h + (*iter);
+ }
+ }
+ return h;
+ }
+ };
+
+ template<typename T>
+ struct HashCode< decaf::lang::Pointer<T> > : public std::unary_function<decaf::lang::Pointer<T>, int> {
+ int operator()(decaf::lang::Pointer<T> arg) {
+ if (arg != NULL) {
+ return HashCode<T>()(*arg);
+ }
+ return 0;
+ }
+ };
+
+}}
+
+#endif /* _DECAF_UTIL_HASHCODE_H_ */
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashCode.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashMap.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashMap.cpp?rev=1362280&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashMap.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashMap.cpp Mon Jul 16 21:53:02 2012
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "HashMap.h"
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashMap.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashMap.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashMap.h?rev=1362280&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashMap.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashMap.h Mon Jul 16 21:53:02 2012
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_UTIL_HASHMAP_H_
+#define _DECAF_UTIL_HASHMAP_H_
+
+#include <decaf/util/Config.h>
+
+namespace decaf {
+namespace util {
+
+ class HashMap {
+ public:
+
+ HashMap() {}
+
+ virtual ~HashMap() {}
+ };
+
+}}
+
+#endif /* _DECAF_UTIL_HASHMAP_H_ */
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashMap.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LRUCache.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LRUCache.cpp?rev=1362280&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LRUCache.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LRUCache.cpp Mon Jul 16 21:53:02 2012
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "LRUCache.h"
+
+using namespace decaf;
+using namespace decaf::util;
+
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LRUCache.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LRUCache.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LRUCache.h?rev=1362280&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LRUCache.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LRUCache.h Mon Jul 16 21:53:02 2012
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_UTIL_LRUCACHE_H_
+#define _DECAF_UTIL_LRUCACHE_H_
+
+#include <decaf/util/Config.h>
+
+#include <decaf/util/AbstractMap.h>
+#include <decaf/lang/exceptions/IllegalArgumentException.h>
+
+namespace decaf {
+namespace util {
+
+ /**
+ * A Basic Least Recently Used (LRU) Cache Map.
+ *
+ * @since 1.0
+ */
+ template<typename K, typename V, typename COMPARATOR = std::less<K> >
+ class LRUCache : decaf::util::AbstractMap<K, V, COMPARATOR> {
+ protected:
+
+ int maxCacheSize;
+
+ public:
+
+ LRUCache() : maxCacheSize(1024) {}
+
+ virtual ~LRUCache() {}
+
+ /**
+ * Gets the currently configured Max Cache Size setting.
+ *
+ * @returns the current max cache size value.
+ */
+ int getMaxCacheSize() const {
+ return maxCacheSize;
+ }
+
+ /**
+ * Sets the maximum size allowed for this LRU Cache.
+ *
+ * @param size
+ * The new maximum cache size setting.
+ *
+ * @throws IllegalArgumentException is size is less than or equal to zero.
+ */
+ void setMaxCacheSize(int size) {
+ if (size <= 0) {
+ throw decaf::lang::exceptions::IllegalArgumentException(
+ __FILE__, __LINE__, "Cache size must be greater than zero.");
+ }
+
+ this->maxCacheSize = size;
+ }
+
+ protected:
+
+ virtual bool removeEldestEntry(const typename Map<K,V>::Entry & entry) {
+ return false;
+ }
+
+ };
+
+}}
+
+#endif /* _DECAF_UTIL_LRUCACHE_H_ */
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LRUCache.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/ConcurrentHashMap.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/ConcurrentHashMap.cpp?rev=1362280&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/ConcurrentHashMap.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/ConcurrentHashMap.cpp Mon Jul 16 21:53:02 2012
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ConcurrentHashMap.h"
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/ConcurrentHashMap.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/ConcurrentHashMap.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/ConcurrentHashMap.h?rev=1362280&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/ConcurrentHashMap.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/ConcurrentHashMap.h Mon Jul 16 21:53:02 2012
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_UTIL_CONCURRENT_CONCURRENTHASHMAP_H_
+#define _DECAF_UTIL_CONCURRENT_CONCURRENTHASHMAP_H_
+
+#include <decaf/util/Config.h>
+
+namespace decaf {
+namespace util {
+namespace concurrent {
+
+ class ConcurrentHashMap {
+ public:
+
+ ConcurrentHashMap() {}
+ virtual ~ConcurrentHashMap() {}
+
+ };
+
+}}}
+
+#endif /* _DECAF_UTIL_CONCURRENT_CONCURRENTHASHMAP_H_ */
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/ConcurrentHashMap.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am?rev=1362280&r1=1362279&r2=1362280&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am Mon Jul 16 21:53:02 2012
@@ -196,6 +196,9 @@ cc_sources = \
decaf/util/BitSetTest.cpp \
decaf/util/DateTest.cpp \
decaf/util/Endian.cpp \
+ decaf/util/HashCodeTest.cpp \
+ decaf/util/HashMapTest.cpp \
+ decaf/util/LRUCacheTest.cpp \
decaf/util/LinkedListTest.cpp \
decaf/util/ListTest.cpp \
decaf/util/PriorityQueueTest.cpp \
@@ -208,6 +211,7 @@ cc_sources = \
decaf/util/TimerTest.cpp \
decaf/util/UUIDTest.cpp \
decaf/util/concurrent/AbstractExecutorServiceTest.cpp \
+ decaf/util/concurrent/ConcurrentHashMapTest.cpp \
decaf/util/concurrent/ConcurrentStlMapTest.cpp \
decaf/util/concurrent/CopyOnWriteArrayListTest.cpp \
decaf/util/concurrent/CopyOnWriteArraySetTest.cpp \
@@ -430,6 +434,9 @@ h_sources = \
decaf/util/BitSetTest.h \
decaf/util/DateTest.h \
decaf/util/Endian.h \
+ decaf/util/HashCodeTest.h \
+ decaf/util/HashMapTest.h \
+ decaf/util/LRUCacheTest.h \
decaf/util/LinkedListTest.h \
decaf/util/ListTest.h \
decaf/util/PriorityQueueTest.h \
@@ -442,6 +449,7 @@ h_sources = \
decaf/util/TimerTest.h \
decaf/util/UUIDTest.h \
decaf/util/concurrent/AbstractExecutorServiceTest.h \
+ decaf/util/concurrent/ConcurrentHashMapTest.h \
decaf/util/concurrent/ConcurrentStlMapTest.h \
decaf/util/concurrent/CopyOnWriteArrayListTest.h \
decaf/util/concurrent/CopyOnWriteArraySetTest.h \
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashCodeTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashCodeTest.cpp?rev=1362280&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashCodeTest.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashCodeTest.cpp Mon Jul 16 21:53:02 2012
@@ -0,0 +1,316 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "HashCodeTest.h"
+
+#include <decaf/lang/Integer.h>
+#include <decaf/util/HashCode.h>
+
+using namespace decaf;
+using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
+using namespace decaf::util;
+
+////////////////////////////////////////////////////////////////////////////////
+HashCodeTest::HashCodeTest() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+HashCodeTest::~HashCodeTest() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void HashCodeTest::testHashPointerT() {
+
+ Pointer<std::string> value1(new std::string("This is value1 and value2"));
+ Pointer<std::string> value2(new std::string("This is value1 and value2"));
+ Pointer<std::string> value3(new std::string("This is not value1 or value2"));
+
+ int hashCode1 = HashCode< Pointer<std::string> >()(value1);
+ int hashCode2 = HashCode< Pointer<std::string> >()(value2);
+ int hashCode3 = HashCode< Pointer<std::string> >()(value3);
+
+ CPPUNIT_ASSERT(hashCode1 != 0);
+ CPPUNIT_ASSERT(hashCode2 != 0);
+ CPPUNIT_ASSERT(hashCode3 != 0);
+
+ CPPUNIT_ASSERT_MESSAGE("Values one and two should have equal hash", hashCode1 == hashCode2);
+ CPPUNIT_ASSERT_MESSAGE("Values one and three should have equal hash", hashCode1 != hashCode3);
+ CPPUNIT_ASSERT_MESSAGE("Values two and three should have equal hash", hashCode2 != hashCode3);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void HashCodeTest::testHashString() {
+
+ std::string value1 = "This is value1 and value2";
+ std::string value2 = "This is value1 and value2";
+ std::string value3 = "This is not value1 or value2";
+
+ int hashCode1 = HashCode<std::string>()(value1);
+ int hashCode2 = HashCode<std::string>()(value2);
+ int hashCode3 = HashCode<std::string>()(value3);
+
+ CPPUNIT_ASSERT(hashCode1 != 0);
+ CPPUNIT_ASSERT(hashCode2 != 0);
+ CPPUNIT_ASSERT(hashCode3 != 0);
+
+ CPPUNIT_ASSERT_MESSAGE("Values one and two should have equal hash", hashCode1 == hashCode2);
+ CPPUNIT_ASSERT_MESSAGE("Values one and three should have equal hash", hashCode1 != hashCode3);
+ CPPUNIT_ASSERT_MESSAGE("Values two and three should have equal hash", hashCode2 != hashCode3);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void HashCodeTest::testHashBool() {
+
+ bool value1 = true;
+ bool value2 = true;
+ bool value3 = false;
+ bool value4 = false;
+
+ int hashCode1 = HashCode<bool>()(value1);
+ int hashCode2 = HashCode<bool>()(value2);
+ int hashCode3 = HashCode<bool>()(value3);
+ int hashCode4 = HashCode<bool>()(value4);
+
+ CPPUNIT_ASSERT(hashCode1 != 0);
+ CPPUNIT_ASSERT(hashCode2 != 0);
+ CPPUNIT_ASSERT(hashCode3 != 0);
+ CPPUNIT_ASSERT(hashCode4 != 0);
+
+ CPPUNIT_ASSERT_MESSAGE("Values one and two should have equal hash", hashCode1 == hashCode2);
+ CPPUNIT_ASSERT_MESSAGE("Values one and three shouldn't have equal hash", hashCode1 != hashCode3);
+ CPPUNIT_ASSERT_MESSAGE("Values two and three shouldn't have equal hash", hashCode2 != hashCode3);
+ CPPUNIT_ASSERT_MESSAGE("Values three and four should have equal hash", hashCode3 == hashCode4);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void HashCodeTest::testHashChar() {
+
+ {
+ char value1 = 'a';
+ char value2 = 'a';
+ char value3 = 'b';
+
+ int hashCode1 = HashCode<char>()(value1);
+ int hashCode2 = HashCode<char>()(value2);
+ int hashCode3 = HashCode<char>()(value3);
+
+ CPPUNIT_ASSERT(hashCode1 != 0);
+ CPPUNIT_ASSERT(hashCode2 != 0);
+ CPPUNIT_ASSERT(hashCode3 != 0);
+
+ CPPUNIT_ASSERT_MESSAGE("Values one and two should have equal hash", hashCode1 == hashCode2);
+ CPPUNIT_ASSERT_MESSAGE("Values one and three shouldn't have equal hash", hashCode1 != hashCode3);
+ CPPUNIT_ASSERT_MESSAGE("Values two and three shouldn't have equal hash", hashCode2 != hashCode3);
+ }
+
+ {
+ unsigned char value1 = 'a';
+ unsigned char value2 = 'a';
+ unsigned char value3 = 'b';
+
+ int hashCode1 = HashCode<unsigned char>()(value1);
+ int hashCode2 = HashCode<unsigned char>()(value2);
+ int hashCode3 = HashCode<unsigned char>()(value3);
+
+ CPPUNIT_ASSERT(hashCode1 != 0);
+ CPPUNIT_ASSERT(hashCode2 != 0);
+ CPPUNIT_ASSERT(hashCode3 != 0);
+
+ CPPUNIT_ASSERT_MESSAGE("Values one and two should have equal hash", hashCode1 == hashCode2);
+ CPPUNIT_ASSERT_MESSAGE("Values one and three shouldn't have equal hash", hashCode1 != hashCode3);
+ CPPUNIT_ASSERT_MESSAGE("Values two and three shouldn't have equal hash", hashCode2 != hashCode3);
+ }
+
+ {
+ wchar_t value1 = 'a';
+ wchar_t value2 = 'a';
+ wchar_t value3 = 'b';
+
+ int hashCode1 = HashCode<wchar_t>()(value1);
+ int hashCode2 = HashCode<wchar_t>()(value2);
+ int hashCode3 = HashCode<wchar_t>()(value3);
+
+ CPPUNIT_ASSERT(hashCode1 != 0);
+ CPPUNIT_ASSERT(hashCode2 != 0);
+ CPPUNIT_ASSERT(hashCode3 != 0);
+
+ CPPUNIT_ASSERT_MESSAGE("Values one and two should have equal hash", hashCode1 == hashCode2);
+ CPPUNIT_ASSERT_MESSAGE("Values one and three shouldn't have equal hash", hashCode1 != hashCode3);
+ CPPUNIT_ASSERT_MESSAGE("Values two and three shouldn't have equal hash", hashCode2 != hashCode3);
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void HashCodeTest::testHashShort() {
+
+ {
+ short value1 = 1024;
+ short value2 = 1024;
+ short value3 = 8192;
+
+ int hashCode1 = HashCode<short>()(value1);
+ int hashCode2 = HashCode<short>()(value2);
+ int hashCode3 = HashCode<short>()(value3);
+
+ CPPUNIT_ASSERT(hashCode1 != 0);
+ CPPUNIT_ASSERT(hashCode2 != 0);
+ CPPUNIT_ASSERT(hashCode3 != 0);
+
+ CPPUNIT_ASSERT_MESSAGE("Values one and two should have equal hash", hashCode1 == hashCode2);
+ CPPUNIT_ASSERT_MESSAGE("Values one and three shouldn't have equal hash", hashCode1 != hashCode3);
+ CPPUNIT_ASSERT_MESSAGE("Values two and three shouldn't have equal hash", hashCode2 != hashCode3);
+ }
+
+ {
+ unsigned short value1 = 1024;
+ unsigned short value2 = 1024;
+ unsigned short value3 = 8192;
+
+ int hashCode1 = HashCode<unsigned short>()(value1);
+ int hashCode2 = HashCode<unsigned short>()(value2);
+ int hashCode3 = HashCode<unsigned short>()(value3);
+
+ CPPUNIT_ASSERT(hashCode1 != 0);
+ CPPUNIT_ASSERT(hashCode2 != 0);
+ CPPUNIT_ASSERT(hashCode3 != 0);
+
+ CPPUNIT_ASSERT_MESSAGE("Values one and two should have equal hash", hashCode1 == hashCode2);
+ CPPUNIT_ASSERT_MESSAGE("Values one and three shouldn't have equal hash", hashCode1 != hashCode3);
+ CPPUNIT_ASSERT_MESSAGE("Values two and three shouldn't have equal hash", hashCode2 != hashCode3);
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void HashCodeTest::testHashInteger() {
+
+ {
+ int value1 = 1024;
+ int value2 = 1024;
+ int value3 = 8192;
+
+ int hashCode1 = HashCode<int>()(value1);
+ int hashCode2 = HashCode<int>()(value2);
+ int hashCode3 = HashCode<int>()(value3);
+
+ CPPUNIT_ASSERT(hashCode1 != 0);
+ CPPUNIT_ASSERT(hashCode2 != 0);
+ CPPUNIT_ASSERT(hashCode3 != 0);
+
+ CPPUNIT_ASSERT_MESSAGE("Values one and two should have equal hash", hashCode1 == hashCode2);
+ CPPUNIT_ASSERT_MESSAGE("Values one and three shouldn't have equal hash", hashCode1 != hashCode3);
+ CPPUNIT_ASSERT_MESSAGE("Values two and three shouldn't have equal hash", hashCode2 != hashCode3);
+ }
+
+ {
+ unsigned int value1 = 1024;
+ unsigned int value2 = 1024;
+ unsigned int value3 = 8192;
+
+ int hashCode1 = HashCode<unsigned int>()(value1);
+ int hashCode2 = HashCode<unsigned int>()(value2);
+ int hashCode3 = HashCode<unsigned int>()(value3);
+
+ CPPUNIT_ASSERT(hashCode1 != 0);
+ CPPUNIT_ASSERT(hashCode2 != 0);
+ CPPUNIT_ASSERT(hashCode3 != 0);
+
+ CPPUNIT_ASSERT_MESSAGE("Values one and two should have equal hash", hashCode1 == hashCode2);
+ CPPUNIT_ASSERT_MESSAGE("Values one and three shouldn't have equal hash", hashCode1 != hashCode3);
+ CPPUNIT_ASSERT_MESSAGE("Values two and three shouldn't have equal hash", hashCode2 != hashCode3);
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void HashCodeTest::testHashLong() {
+
+ {
+ long long value1 = 1024000LL;
+ long long value2 = 1024000LL;
+ long long value3 = 8192000LL;
+
+ int hashCode1 = HashCode<long long>()(value1);
+ int hashCode2 = HashCode<long long>()(value2);
+ int hashCode3 = HashCode<long long>()(value3);
+
+ CPPUNIT_ASSERT(hashCode1 != 0);
+ CPPUNIT_ASSERT(hashCode2 != 0);
+ CPPUNIT_ASSERT(hashCode3 != 0);
+
+ CPPUNIT_ASSERT_MESSAGE("Values one and two should have equal hash", hashCode1 == hashCode2);
+ CPPUNIT_ASSERT_MESSAGE("Values one and three shouldn't have equal hash", hashCode1 != hashCode3);
+ CPPUNIT_ASSERT_MESSAGE("Values two and three shouldn't have equal hash", hashCode2 != hashCode3);
+ }
+
+ {
+ unsigned long long value1 = 1024000ULL;
+ unsigned long long value2 = 1024000ULL;
+ unsigned long long value3 = 8192000ULL;
+
+ int hashCode1 = HashCode<unsigned long long>()(value1);
+ int hashCode2 = HashCode<unsigned long long>()(value2);
+ int hashCode3 = HashCode<unsigned long long>()(value3);
+
+ CPPUNIT_ASSERT(hashCode1 != 0);
+ CPPUNIT_ASSERT(hashCode2 != 0);
+ CPPUNIT_ASSERT(hashCode3 != 0);
+
+ CPPUNIT_ASSERT_MESSAGE("Values one and two should have equal hash", hashCode1 == hashCode2);
+ CPPUNIT_ASSERT_MESSAGE("Values one and three shouldn't have equal hash", hashCode1 != hashCode3);
+ CPPUNIT_ASSERT_MESSAGE("Values two and three shouldn't have equal hash", hashCode2 != hashCode3);
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void HashCodeTest::testHashFloat() {
+
+ float value1 = 4.4f;
+ float value2 = 4.4f;
+ float value3 = 10.0f;
+
+ int hashCode1 = HashCode<float>()(value1);
+ int hashCode2 = HashCode<float>()(value2);
+ int hashCode3 = HashCode<float>()(value3);
+
+ CPPUNIT_ASSERT(hashCode1 != 0);
+ CPPUNIT_ASSERT(hashCode2 != 0);
+ CPPUNIT_ASSERT(hashCode3 != 0);
+
+ CPPUNIT_ASSERT_MESSAGE("Values one and two should have equal hash", hashCode1 == hashCode2);
+ CPPUNIT_ASSERT_MESSAGE("Values one and three shouldn't have equal hash", hashCode1 != hashCode3);
+ CPPUNIT_ASSERT_MESSAGE("Values two and three shouldn't have equal hash", hashCode2 != hashCode3);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void HashCodeTest::testHashDouble() {
+
+ double value1 = 4.413;
+ double value2 = 4.413;
+ double value3 = 10.0025;
+
+ int hashCode1 = HashCode<double>()(value1);
+ int hashCode2 = HashCode<double>()(value2);
+ int hashCode3 = HashCode<double>()(value3);
+
+ CPPUNIT_ASSERT(hashCode1 != 0);
+ CPPUNIT_ASSERT(hashCode2 != 0);
+ CPPUNIT_ASSERT(hashCode3 != 0);
+
+ CPPUNIT_ASSERT_MESSAGE("Values one and two should have equal hash", hashCode1 == hashCode2);
+ CPPUNIT_ASSERT_MESSAGE("Values one and three shouldn't have equal hash", hashCode1 != hashCode3);
+ CPPUNIT_ASSERT_MESSAGE("Values two and three shouldn't have equal hash", hashCode2 != hashCode3);
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashCodeTest.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashCodeTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashCodeTest.h?rev=1362280&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashCodeTest.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashCodeTest.h Mon Jul 16 21:53:02 2012
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_UTIL_HASHCODETEST_H_
+#define _DECAF_UTIL_HASHCODETEST_H_
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+namespace decaf {
+namespace util {
+
+ class HashCodeTest : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE( HashCodeTest );
+ CPPUNIT_TEST( testHashPointerT );
+ CPPUNIT_TEST( testHashString );
+ CPPUNIT_TEST( testHashBool );
+ CPPUNIT_TEST( testHashChar );
+ CPPUNIT_TEST( testHashShort );
+ CPPUNIT_TEST( testHashInteger );
+ CPPUNIT_TEST( testHashLong );
+ CPPUNIT_TEST( testHashFloat );
+ CPPUNIT_TEST( testHashDouble );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ HashCodeTest();
+
+ virtual ~HashCodeTest();
+
+ void testHashPointerT();
+ void testHashString();
+ void testHashBool();
+ void testHashChar();
+ void testHashShort();
+ void testHashInteger();
+ void testHashLong();
+ void testHashFloat();
+ void testHashDouble();
+
+ };
+
+}}
+
+#endif /* _DECAF_UTIL_HASHCODETEST_H_ */
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashCodeTest.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashMapTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashMapTest.cpp?rev=1362280&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashMapTest.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashMapTest.cpp Mon Jul 16 21:53:02 2012
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "HashMapTest.h"
+
+using namespace std;
+using namespace decaf;
+using namespace decaf::util;
+
+////////////////////////////////////////////////////////////////////////////////
+HashMapTest::HashMapTest() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+HashMapTest::~HashMapTest() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void HashMapTest::testConstructor() {
+
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashMapTest.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashMapTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashMapTest.h?rev=1362280&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashMapTest.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashMapTest.h Mon Jul 16 21:53:02 2012
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_UTIL_HASHMAPTEST_H_
+#define _DECAF_UTIL_HASHMAPTEST_H_
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+namespace decaf {
+namespace util {
+
+ class HashMapTest : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE( HashMapTest );
+ CPPUNIT_TEST( testConstructor );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ HashMapTest();
+ virtual ~HashMapTest();
+
+ void testConstructor();
+
+ };
+
+}}
+
+#endif /* _DECAF_UTIL_HASHMAPTEST_H_ */
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/HashMapTest.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/LRUCacheTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/LRUCacheTest.cpp?rev=1362280&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/LRUCacheTest.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/LRUCacheTest.cpp Mon Jul 16 21:53:02 2012
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "LRUCacheTest.h"
+
+#include <decaf/util/LRUCache.h>
+
+#include <string>
+
+using namespace std;
+using namespace decaf;
+using namespace decaf::util;
+
+////////////////////////////////////////////////////////////////////////////////
+LRUCacheTest::LRUCacheTest() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+LRUCacheTest::~LRUCacheTest() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void LRUCacheTest::testConstructor() {
+
+ //LRUCache<string, string> lruCache;
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/LRUCacheTest.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/LRUCacheTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/LRUCacheTest.h?rev=1362280&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/LRUCacheTest.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/LRUCacheTest.h Mon Jul 16 21:53:02 2012
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_UTIL_LRUCACHETEST_H_
+#define _DECAF_UTIL_LRUCACHETEST_H_
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+namespace decaf {
+namespace util {
+
+ class LRUCacheTest : public CppUnit::TestFixture
+ {
+ CPPUNIT_TEST_SUITE( LRUCacheTest );
+ CPPUNIT_TEST( testConstructor );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ LRUCacheTest();
+ virtual ~LRUCacheTest();
+
+ void testConstructor();
+
+ };
+
+}}
+
+#endif /*_DECAF_UTIL_LRUCACHETEST_H_*/
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/LRUCacheTest.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ConcurrentHashMapTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ConcurrentHashMapTest.cpp?rev=1362280&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ConcurrentHashMapTest.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ConcurrentHashMapTest.cpp Mon Jul 16 21:53:02 2012
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ConcurrentHashMapTest.h"
+
+using namespace std;
+using namespace decaf;
+using namespace decaf::util;
+using namespace decaf::util::concurrent;
+
+////////////////////////////////////////////////////////////////////////////////
+ConcurrentHashMapTest::ConcurrentHashMapTest() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ConcurrentHashMapTest::~ConcurrentHashMapTest() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ConcurrentHashMapTest::testConstructor() {
+
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ConcurrentHashMapTest.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ConcurrentHashMapTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ConcurrentHashMapTest.h?rev=1362280&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ConcurrentHashMapTest.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ConcurrentHashMapTest.h Mon Jul 16 21:53:02 2012
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_UTIL_CONCURRENT_CONCURRENTHASHMAPTEST_H_
+#define _DECAF_UTIL_CONCURRENT_CONCURRENTHASHMAPTEST_H_
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+namespace decaf {
+namespace util {
+namespace concurrent {
+
+ class ConcurrentHashMapTest : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE( ConcurrentHashMapTest );
+ CPPUNIT_TEST( testConstructor );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ ConcurrentHashMapTest();
+ virtual ~ConcurrentHashMapTest();
+
+ void testConstructor();
+ };
+
+}}}
+
+#endif /* _DECAF_UTIL_CONCURRENT_CONCURRENTHASHMAPTEST_H_ */
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ConcurrentHashMapTest.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp?rev=1362280&r1=1362279&r2=1362280&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp Mon Jul 16 21:53:02 2012
@@ -293,6 +293,8 @@ CPPUNIT_TEST_SUITE_REGISTRATION( decaf::
CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::FutureTaskTest );
#include <decaf/util/concurrent/AbstractExecutorServiceTest.h>
CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::AbstractExecutorServiceTest );
+#include <decaf/util/concurrent/ConcurrentHashMapTest.h>
+CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::ConcurrentHashMapTest );
#include <decaf/util/concurrent/atomic/AtomicBooleanTest.h>
CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::atomic::AtomicBooleanTest );
@@ -310,6 +312,10 @@ CPPUNIT_TEST_SUITE_REGISTRATION( decaf::
#include <decaf/util/concurrent/locks/ReentrantReadWriteLockTest.h>
CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::locks::ReentrantReadWriteLockTest );
+#include <decaf/util/HashCodeTest.h>
+CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::HashCodeTest );
+#include <decaf/util/HashMapTest.h>
+CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::HashMapTest );
#include <decaf/util/AbstractCollectionTest.h>
CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::AbstractCollectionTest );
#include <decaf/util/AbstractListTest.h>