activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r790336 - in /activemq/activemq-cpp/trunk/activemq-cpp/src: examples/ main/activemq/commands/ main/activemq/core/ main/decaf/lang/ main/decaf/util/ test-benchmarks/benchmark/ test-integration/activemq/test/ test/ test/activemq/core/
Date Wed, 01 Jul 2009 19:28:02 GMT
Author: tabish
Date: Wed Jul  1 19:28:01 2009
New Revision: 790336

URL: http://svn.apache.org/viewvc?rev=790336&view=rev
Log:
Working on: http://issues.apache.org/activemq/browse/AMQCPP-250

Some refactoring to start getting the Decaf APIs needed to add timers etc for use in implementing
the inactivity monitor.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/examples/main.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQProducer.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/System.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Date.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Date.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/benchmark/PerformanceTimer.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/SlowListenerTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.maven
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQSessionTest.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/examples/main.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/examples/main.cpp?rev=790336&r1=790335&r2=790336&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/examples/main.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/examples/main.cpp Wed Jul  1 19:28:01 2009
@@ -22,7 +22,7 @@
 #include <decaf/lang/Runnable.h>
 #include <decaf/util/concurrent/CountDownLatch.h>
 #include <decaf/lang/Integer.h>
-#include <decaf/util/Date.h>
+#include <decaf/lang/System.h>
 #include <activemq/core/ActiveMQConnectionFactory.h>
 #include <activemq/util/Config.h>
 #include <cms/Connection.h>
@@ -375,7 +375,7 @@
     bool sessionTransacted = false;
     int numMessages = 2000;
 
-    long long startTime = Date::getCurrentTimeMilliseconds();
+    long long startTime = System::currentTimeMillis();
 
     HelloWorldProducer producer( brokerURI, numMessages, useTopics );
     HelloWorldConsumer consumer( brokerURI, numMessages, useTopics, sessionTransacted );
@@ -395,7 +395,7 @@
     producerThread.join();
     consumerThread.join();
 
-    long long endTime = Date::getCurrentTimeMilliseconds();
+    long long endTime = System::currentTimeMillis();
     double totalTime = (endTime - startTime) / 1000.0;
 
     std::cout << "Time to completion = " << totalTime << " seconds." <<
std::endl;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.cpp?rev=790336&r1=790335&r2=790336&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.cpp Wed Jul
 1 19:28:01 2009
@@ -20,6 +20,7 @@
 #include <activemq/state/CommandVisitor.h>
 #include <activemq/wireformat/openwire/marshal/BaseDataStreamMarshaller.h>
 #include <activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.h>
+#include <decaf/lang/System.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 
 using namespace std;
@@ -800,6 +801,17 @@
 
     return visitor->processMessage( this );
 }
+
+////////////////////////////////////////////////////////////////////////////////
+bool Message::isExpired() const {
+    long long expireTime = this->getExpiration();
+    long long currentTime = decaf::lang::System::currentTimeMillis();
+    if( expireTime > 0 && currentTime > expireTime ) {
+        return true;
+    }
+    return false;
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 unsigned int Message::getSize() const {
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.h?rev=790336&r1=790335&r2=790336&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.h Wed Jul
 1 19:28:01 2009
@@ -34,7 +34,6 @@
 #include <activemq/util/Config.h>
 #include <activemq/util/PrimitiveMap.h>
 #include <decaf/lang/Pointer.h>
-#include <decaf/util/Date.h>
 #include <string>
 #include <vector>
 
@@ -214,14 +213,7 @@
          * Expiration time has elapsed.
          * @returns true if message is expired.
          */
-        virtual bool isExpired() const {
-            long long expireTime = this->getExpiration();
-            long long currentTime = decaf::util::Date::getCurrentTimeMilliseconds();
-            if( expireTime > 0 && currentTime > expireTime ) {
-                return true;
-            }
-            return false;
-        }
+        virtual bool isExpired() const;
 
         /**
          * Gets a reference to the Message's Properties object, allows the derived

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp?rev=790336&r1=790335&r2=790336&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp Wed
Jul  1 19:28:01 2009
@@ -270,7 +270,7 @@
         // Calculate the deadline
         long long deadline = 0;
         if( timeout > 0 ) {
-            deadline = Date::getCurrentTimeMilliseconds() + timeout;
+            deadline = System::currentTimeMillis() + timeout;
         }
 
         // Loop until the time is up or we get a non-expired message

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQProducer.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQProducer.cpp?rev=790336&r1=790335&r2=790336&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQProducer.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQProducer.cpp Wed
Jul  1 19:28:01 2009
@@ -21,7 +21,7 @@
 #include <decaf/lang/exceptions/NullPointerException.h>
 #include <decaf/lang/exceptions/InvalidStateException.h>
 #include <decaf/lang/exceptions/IllegalArgumentException.h>
-#include <decaf/util/Date.h>
+#include <decaf/lang/System.h>
 
 using namespace std;
 using namespace activemq;
@@ -159,7 +159,7 @@
         long long expiration = 0LL;
 
         if( !disableTimestamps ) {
-            long long timeStamp = Date::getCurrentTimeMilliseconds();
+            long long timeStamp = System::currentTimeMillis();
             message->setCMSTimestamp( timeStamp );
             if( timeToLive > 0LL ) {
                 expiration = timeToLive + timeStamp;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/System.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/System.cpp?rev=790336&r1=790335&r2=790336&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/System.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/System.cpp Wed Jul  1 19:28:01
2009
@@ -26,6 +26,7 @@
 #include <apr.h>
 #include <apr_errno.h>
 #include <apr_env.h>
+#include <apr_time.h>
 
 #if APR_HAVE_UNISTD_H
 #include <unistd.h>
@@ -123,7 +124,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 long long System::currentTimeMillis() {
-    return Date::getCurrentTimeMilliseconds();
+    return apr_time_now() / 1000;
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Date.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Date.cpp?rev=790336&r1=790335&r2=790336&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Date.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Date.cpp Wed Jul  1 19:28:01
2009
@@ -18,17 +18,17 @@
 #include <decaf/util/Date.h>
 #include <decaf/util/Config.h>
 #include <decaf/lang/exceptions/UnsupportedOperationException.h>
-
-#include <apr_time.h>
+#include <decaf/lang/System.h>
 
 using namespace std;
 using namespace decaf;
 using namespace decaf::util;
+using namespace decaf::lang;
 using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
 Date::Date(){
-    time = getCurrentTimeMilliseconds();
+    time = System::currentTimeMillis();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -46,6 +46,54 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-long long Date::getCurrentTimeMilliseconds(){
-    return apr_time_now() / 1000;
+long long Date::getTime() const{
+    return time;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void Date::setTime( long long milliseconds ){
+    this->time = milliseconds;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool Date::after( const Date& when ) const {
+    return time > when.time;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool Date::before( const Date& when ) const {
+    return time < when.time;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+Date& Date::operator= ( const Date& source ) {
+    this->time = source.time;
+    return *this;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool Date::equals( const Date& when ) const {
+    return time == when.time;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+int Date::compareTo( const Date& value ) const {
+
+    if( this->time < value.time ) {
+        return -1;
+    } else if( this->time > value.time ) {
+        return 1;
+    }
+
+    return 0;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool Date::operator==( const Date& value ) const {
+    return ( this->time == value.time );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool Date::operator<( const Date& value ) const {
+    return ( this->time < value.time );
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Date.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Date.h?rev=790336&r1=790335&r2=790336&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Date.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Date.h Wed Jul  1 19:28:01
2009
@@ -19,6 +19,7 @@
 #define _DECAF_UTIL_DATE_H_
 
 #include <decaf/util/Config.h>
+#include <decaf/lang/Comparable.h>
 
 namespace decaf{
 namespace util{
@@ -29,7 +30,7 @@
      *
      * @since 1.0
      */
-    class DECAF_API Date {
+    class DECAF_API Date : public lang::Comparable<Date> {
     private:
 
         /**
@@ -40,7 +41,8 @@
     public:
 
         /**
-         * Default constructor - sets time to now.
+         * Default constructor - sets time to the current System time, rounded to the
+         * nearest millisecond.
          */
         Date();
 
@@ -56,69 +58,81 @@
          */
         Date( const Date& source );
 
+        /**
+         * Assigns the value of one Date object to another.
+         *
+         * @param value
+         *      The value to be copied into this Date object.
+         *
+         * @return reference to this object with the newly assigned value.
+         */
+        Date& operator= ( const Date& value );
+
         virtual ~Date();
 
         /**
          * Gets the underlying time.
          * @return The underlying time value in milliseconds.
          */
-        long long getTime() const{
-            return time;
-        }
+        long long getTime() const;
 
         /**
          * Sets the underlying time.
          * @param milliseconds The underlying time value in
          * milliseconds.
          */
-        void setTime( long long milliseconds ){
-            this->time = milliseconds;
-        }
+        void setTime( long long milliseconds );
 
         /**
-         * Determines wether or not this date falls after the
+         * Determines whether or not this date falls after the
          * specified time.
          * @param when The date to compare
          * @return true if this date falls after when.
          */
-        bool after( Date& when ) const{
-            return time > when.time;
-        }
+        bool after( const Date& when ) const;
 
         /**
-         * Determines wether or not this date falls before the
+         * Determines whether or not this date falls before the
          * specified time.
          * @param when The date to compare
          * @return true if this date falls before when.
          */
-        bool before( Date& when ) const{
-            return time < when.time;
-        }
+        bool before( const Date& when ) const;
+
+    public:  // Comparable
 
         /**
-         * Determines wether or not this date is equal to the
-         * specified time.
-         * @param when The date to compare
-         * @return true if this date is equal to when.
+         * Compares this Data object to the one given.
+         *
+         * @param value
+         *      The Date value to compare to this one.
+         *
+         * @returns zero if the Date values are equal, a value less than zero if this
+         *          Data value is earlier than argument value, and a value greater than
+         *          zero if this Date object is later than the argument Date value.
          */
-        bool equals( Date& when ) const{
-            return time == when.time;
-        }
+        virtual int compareTo( const Date& value ) const;
 
         /**
-         * Assignment operator.
+         * @return true if this value is considered equal to the passed value.
          */
-        Date& operator =( const Date& source ){
-            this->time = source.time;
-            return *this;
-        }
+        virtual bool equals( const Date& value ) const;
 
         /**
-         * Returns the current time in milliseconds.  Comparable
-         * to Java's System.currentTimeMillis method.
-         * @return The current time in milliseconds.
+         * Compares equality between this object and the one passed.
+         * @param value - the value to be compared to this one.
+         * @return true if this object is equal to the one passed.
          */
-        static long long getCurrentTimeMilliseconds();
+        virtual bool operator==( const Date& value ) const;
+
+        /**
+         * Compares this object to another and returns true if this object
+         * is considered to be less than the one passed.  This
+         * @param value - the value to be compared to this one.
+         * @return true if this object is equal to the one passed.
+         */
+        virtual bool operator<( const Date& value ) const;
+
     };
 
 }}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.cpp?rev=790336&r1=790335&r2=790336&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.cpp Wed Jul  1 19:28:01
2009
@@ -17,7 +17,7 @@
 
 #include "Random.h"
 
-#include <decaf/util/Date.h>
+#include <decaf/lang/System.h>
 
 using namespace decaf;
 using namespace decaf::util;
@@ -27,38 +27,37 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 Random::Random() {
-    setSeed(Date::getCurrentTimeMilliseconds());
+    setSeed( System::currentTimeMillis() );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 Random::Random( unsigned long long seed ) {
-    setSeed(seed);
+    setSeed( seed );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 bool Random::nextBoolean() {
-    return next(1) != 0;
+    return next( 1 ) != 0;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void Random::nextBytes( std::vector<unsigned char>& buf ) {
     int rand = 0;
     std::size_t count = 0, loop = 0;
-    while (count < buf.size()) {
-        if (loop == 0) {
+    while( count < buf.size() ) {
+        if( loop == 0 ) {
             rand = nextInt();
             loop = 3;
         } else {
             loop--;
         }
-        buf[count++] = (unsigned char) rand;
+        buf[count++] = (unsigned char)rand;
         rand >>= 8;
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 double Random::nextDouble() {
-    // was: return ((((long long) next(26) << 27) + next(27)) / (double) (1L <<
53));
     long long divisor = 1LL;
     divisor <<= 31;
     divisor <<= 22;
@@ -67,12 +66,13 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 float Random::nextFloat() {
-    return (next(24) / 16777216.0f);
+    return ( next(24) / 16777216.0f );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 double Random::nextGaussian() {
-    if (haveNextNextGaussian) {
+
+    if( haveNextNextGaussian ) {
         // if X1 has been returned, return the second Gaussian
         haveNextNextGaussian = false;
         return nextNextGaussian;
@@ -84,8 +84,8 @@
         v1 = 2 * nextDouble() - 1;
         v2 = 2 * nextDouble() - 1;
         s = v1 * v1 + v2 * v2;
-    } while (s >= 1);
-    double norm = std::sqrt(-2 * std::log(s) / s);
+    } while( s >= 1 );
+    double norm = std::sqrt( -2 * std::log(s) / s );
     // should that not be norm instead of multiplier ?
     nextNextGaussian = v2 * norm;
     haveNextNextGaussian = true;
@@ -95,47 +95,53 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 int Random::nextInt() {
-    return next(32);
+    return next( 32 );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 int Random::nextInt( int n ) throw( exceptions::IllegalArgumentException ) {
-    if (n > 0) {
-        if ((n & -n) == n) {
-            return (int) ((n * (long long) next(31)) >> 31);
+
+    if( n > 0 ) {
+
+        if( ( n & -n ) == n ) {
+            return (int)( ( n * (long long)next( 31 ) ) >> 31 );
         }
+
         int bits, val;
+
         do {
-            bits = next(31);
+            bits = next( 31 );
             val = bits % n;
-        } while (bits - val + (n - 1) < 0);
+        } while( bits - val + ( n - 1 ) < 0 );
+
         return val;
     }
-    throw exceptions::IllegalArgumentException();
+
+    throw exceptions::IllegalArgumentException(
+        __FILE__, __LINE__,
+        "Value passed cannot be less than or equal to zero." );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 long long Random::nextLong() {
-    return ((long long) next(32) << 32) + next(32);
+    return ( (long long) next(32) << 32 ) + next(32);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void Random::setSeed( unsigned long long seed ) {
-    // was this->seed = (seed ^ multiplier) & ((1L << 48) - 1);
     unsigned long long mask = 1ULL;
     mask <<= 31;
     mask <<= 17;
-    this->seed = (seed ^ multiplier) & (mask - 1);
+    this->seed = ( seed ^ multiplier ) & ( mask - 1 );
     haveNextNextGaussian = false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 int Random::next( int bits ) {
-    // was: seed = (seed * multiplier + 0xbL) & ((1L << 48) - 1);
     long long mask = 1L;
     mask <<= 31;
     mask <<= 17;
-    seed = (seed * multiplier + 0xbL) & (mask - 1);
+    seed = ( seed * multiplier + 0xbL ) & ( mask - 1 );
     // was: return (int) (seed >>> (48 - bits));
-    return (int) (seed >> (48 - bits));
+    return (int)( seed >> (48 - bits) );
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/benchmark/PerformanceTimer.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/benchmark/PerformanceTimer.cpp?rev=790336&r1=790335&r2=790336&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/benchmark/PerformanceTimer.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/benchmark/PerformanceTimer.cpp
Wed Jul  1 19:28:01 2009
@@ -17,11 +17,11 @@
 
 #include "PerformanceTimer.h"
 
-#include <decaf/util/Date.h>
+#include <decaf/lang/System.h>
 
 using namespace std;
 using namespace benchmark;
-using namespace decaf::util;
+using namespace decaf::lang;
 
 ////////////////////////////////////////////////////////////////////////////////
 PerformanceTimer::PerformanceTimer(){
@@ -34,13 +34,13 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void PerformanceTimer::start(){
-    this->startTime = Date::getCurrentTimeMilliseconds();
+    this->startTime = System::currentTimeMillis();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void PerformanceTimer::stop(){
 
-    this->endTime = Date::getCurrentTimeMilliseconds();
+    this->endTime = System::currentTimeMillis();
     times.push_back( endTime - startTime );
     numberOfRuns++;
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/SlowListenerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/SlowListenerTest.cpp?rev=790336&r1=790335&r2=790336&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/SlowListenerTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/SlowListenerTest.cpp
Wed Jul  1 19:28:01 2009
@@ -19,8 +19,8 @@
 
 #include <decaf/lang/Thread.h>
 #include <decaf/util/concurrent/Mutex.h>
-#include <decaf/util/Date.h>
 #include <decaf/util/StlSet.h>
+#include <decaf/lang/System.h>
 
 #include <activemq/exceptions/ActiveMQException.h>
 
@@ -113,13 +113,13 @@
 void SlowListenerTest::waitForMessages(
     unsigned int count, long long maxWaitTime, SlowListener* l ) {
 
-    long long startTime = Date::getCurrentTimeMilliseconds();
+    long long startTime = System::currentTimeMillis();
 
     synchronized( &( l->threadIds ) ) {
 
         while( l->count < count ) {
 
-            long long curTime = Date::getCurrentTimeMilliseconds();
+            long long curTime = System::currentTimeMillis();
             if( ( curTime - startTime ) >= maxWaitTime ) {
                 return;
             }

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=790336&r1=790335&r2=790336&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am Wed Jul  1 19:28:01 2009
@@ -254,7 +254,7 @@
 ## include activemq/wireformat/openwire/marshal/v3/srcmakefile.mk
 
 ## Compile this as part of make check
-check_PROGRAMS = activemq-test
+## check_PROGRAMS = activemq-test
 
 ## Also run the tests as part of make check
 TESTS = $(check_PROGRAMS)

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.maven
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.maven?rev=790336&r1=790335&r2=790336&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.maven (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.maven Wed Jul  1 19:28:01 2009
@@ -29,7 +29,7 @@
 check_PROGRAMS = activemq-test
 
 ## Also run the tests as part of make check
-TESTS = $(check_PROGRAMS)
+## TESTS = $(check_PROGRAMS)
 
 ## 
 ## Compiler/Linker Options

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQSessionTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQSessionTest.cpp?rev=790336&r1=790335&r2=790336&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQSessionTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQSessionTest.cpp
Wed Jul  1 19:28:01 2009
@@ -30,7 +30,7 @@
 #include <activemq/core/ActiveMQConsumer.h>
 #include <activemq/core/ActiveMQProducer.h>
 #include <decaf/util/Properties.h>
-#include <decaf/util/Date.h>
+#include <decaf/lang/System.h>
 #include <decaf/lang/Pointer.h>
 
 using namespace std;
@@ -555,7 +555,7 @@
     injectTextMessage( "This is a Test 1" ,
                        *topic1,
                        consumer1->getConsumerId(),
-                       decaf::util::Date::getCurrentTimeMilliseconds(),
+                       decaf::lang::System::currentTimeMillis(),
                        50 );
 
     msgListener1.asyncWaitForMessages( 1 );
@@ -565,7 +565,7 @@
     injectTextMessage( "This is a Test 2" ,
                        *topic2,
                        consumer2->getConsumerId(),
-                       decaf::util::Date::getCurrentTimeMilliseconds() - 100,
+                       decaf::lang::System::currentTimeMillis() - 100,
                        1 );
 
     msgListener2.asyncWaitForMessages( 1 );



Mime
View raw message