Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 89683 invoked from network); 23 Feb 2010 21:32:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Feb 2010 21:32:19 -0000 Received: (qmail 85465 invoked by uid 500); 23 Feb 2010 21:32:19 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 85405 invoked by uid 500); 23 Feb 2010 21:32:19 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 85396 invoked by uid 99); 23 Feb 2010 21:32:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Feb 2010 21:32:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Feb 2010 21:32:15 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A4E82238897D; Tue, 23 Feb 2010 21:31:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r915527 - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/ main/decaf/io/ test/ test/decaf/io/ Date: Tue, 23 Feb 2010 21:31:53 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100223213153.A4E82238897D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Tue Feb 23 21:31:53 2010 New Revision: 915527 URL: http://svn.apache.org/viewvc?rev=915527&view=rev Log: Adds PushbackInputStream and tests. Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/PushbackInputStream.cpp (with props) activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/PushbackInputStream.h (with props) activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/PushbackInputStreamTest.cpp (with props) activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/PushbackInputStreamTest.h (with props) Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/FilterInputStream.cpp 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=915527&r1=915526&r2=915527&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am Tue Feb 23 21:31:53 2010 @@ -523,6 +523,7 @@ decaf/io/InputStreamReader.cpp \ decaf/io/OutputStream.cpp \ decaf/io/OutputStreamWriter.cpp \ + decaf/io/PushbackInputStream.cpp \ decaf/io/Reader.cpp \ decaf/io/Writer.cpp \ decaf/lang/Boolean.cpp \ @@ -1180,6 +1181,7 @@ decaf/io/InterruptedIOException.h \ decaf/io/OutputStream.h \ decaf/io/OutputStreamWriter.h \ + decaf/io/PushbackInputStream.h \ decaf/io/Reader.h \ decaf/io/UTFDataFormatException.h \ decaf/io/UnsupportedEncodingException.h \ Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/FilterInputStream.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/FilterInputStream.cpp?rev=915527&r1=915526&r2=915527&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/FilterInputStream.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/FilterInputStream.cpp Tue Feb 23 21:31:53 2010 @@ -29,7 +29,7 @@ FilterInputStream::FilterInputStream( InputStream* inputStream, bool own ) { this->inputStream = inputStream; this->own = own; - this->closed = false; + this->closed = inputStream == NULL ? true : false; } //////////////////////////////////////////////////////////////////////////////// Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/PushbackInputStream.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/PushbackInputStream.cpp?rev=915527&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/PushbackInputStream.cpp (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/PushbackInputStream.cpp Tue Feb 23 21:31:53 2010 @@ -0,0 +1,248 @@ +/* + * 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 "PushbackInputStream.h" + +#include + +using namespace decaf; +using namespace decaf::io; +using namespace decaf::lang; +using namespace decaf::lang::exceptions; + +//////////////////////////////////////////////////////////////////////////////// +PushbackInputStream::PushbackInputStream( InputStream* stream, bool own ) + : FilterInputStream( stream, own ), bufferSize( 1 ), pos( 1 ) { + + this->buffer = new unsigned char[1]; +} + +//////////////////////////////////////////////////////////////////////////////// +PushbackInputStream::PushbackInputStream( InputStream* stream, std::size_t bufSize, bool own ) + : FilterInputStream( stream, own ), bufferSize( bufSize ), pos( bufSize ) { + + this->buffer = new unsigned char[bufSize]; +} + +//////////////////////////////////////////////////////////////////////////////// +PushbackInputStream::~PushbackInputStream() { + try{ + + close(); + delete [] this->buffer; + } + DECAF_CATCH_NOTHROW( Exception ) + DECAF_CATCHALL_NOTHROW() +} + +//////////////////////////////////////////////////////////////////////////////// +std::size_t PushbackInputStream::available() const throw ( decaf::io::IOException ) { + + try{ + return ( this->bufferSize - this->pos ) + inputStream->available(); + } + DECAF_CATCH_RETHROW( IOException ) + DECAF_CATCHALL_THROW( IOException ) +} + +//////////////////////////////////////////////////////////////////////////////// +std::size_t PushbackInputStream::skip( std::size_t num ) + throw ( decaf::io::IOException, + decaf::lang::exceptions::UnsupportedOperationException ) { + + try{ + + if( num == 0 ) { + return 0; + } + + if( isClosed() ) { + throw IOException( + __FILE__, __LINE__, "Stream is closed" ); + } + + std::size_t unread = bufferSize - pos; + std::size_t numSkipped = 0; + + if( unread != 0 ) { + numSkipped += ( num < unread ) ? num : unread; + pos += numSkipped; + } + + if( numSkipped < num ) { + numSkipped += inputStream->skip( num - numSkipped ); + } + + return numSkipped; + } + DECAF_CATCH_RETHROW( IOException ) + DECAF_CATCHALL_THROW( IOException ) +} + +//////////////////////////////////////////////////////////////////////////////// +void PushbackInputStream::mark( int readLimit DECAF_UNUSED ) { + // Nothing to do here. +} + +//////////////////////////////////////////////////////////////////////////////// +void PushbackInputStream::reset() throw ( decaf::io::IOException ) { + throw IOException( + __FILE__, __LINE__, "Reset is not Supported by the PushbackInputStream." ); +} + +//////////////////////////////////////////////////////////////////////////////// +void PushbackInputStream::unread( unsigned char value ) + throw( decaf::io::IOException ) { + + try{ + + if( pos == 0 ) { + throw IOException( + __FILE__, __LINE__, "No Space left in the unread buffer." ); + } + + buffer[--pos] = value; + } + DECAF_CATCH_RETHROW( IOException ) + DECAF_CATCHALL_THROW( IOException ) +} + +//////////////////////////////////////////////////////////////////////////////// +void PushbackInputStream::unread( const unsigned char* buffer, std::size_t size ) + throw( decaf::io::IOException, + decaf::lang::exceptions::NullPointerException ) { + + try{ + this->unread( buffer, size, 0, size ); + } + DECAF_CATCH_RETHROW( IOException ) + DECAF_CATCH_RETHROW( NullPointerException ) + DECAF_CATCHALL_THROW( IOException ) +} + +//////////////////////////////////////////////////////////////////////////////// +void PushbackInputStream::unread( const unsigned char* buffer, std::size_t size, + std::size_t offset, std::size_t length ) + throw( decaf::io::IOException, + decaf::lang::exceptions::IndexOutOfBoundsException, + decaf::lang::exceptions::NullPointerException ) { + + try{ + + if( length > pos ) { + throw IOException( + __FILE__, __LINE__, "No Space left in the unread buffer." ); + } + + if( offset > size || offset + length > size ) { + throw IndexOutOfBoundsException( + __FILE__, __LINE__, "Offset + length exceeds supplied buffer's size." ); + } + + if( buffer == NULL ) { + throw NullPointerException( + __FILE__, __LINE__, "Buffer pointer passed was NULL." ); + } + + System::arraycopy( buffer, offset, this->buffer, pos - length, length ); + pos = pos - length; + } + DECAF_CATCH_RETHROW( IOException ) + DECAF_CATCH_RETHROW( IndexOutOfBoundsException ) + DECAF_CATCH_RETHROW( NullPointerException ) + DECAF_CATCHALL_THROW( IOException ) +} + +//////////////////////////////////////////////////////////////////////////////// +int PushbackInputStream::doReadByte() throw ( decaf::io::IOException ) { + + try{ + + if( isClosed() ) { + throw IOException( + __FILE__, __LINE__, "Stream is closed" ); + } + + if( pos < bufferSize ) { + return buffer[pos++]; + } + + return inputStream->read(); + } + DECAF_CATCH_RETHROW( IOException ) + DECAF_CATCHALL_THROW( IOException ) +} + +//////////////////////////////////////////////////////////////////////////////// +int PushbackInputStream::doReadArrayBounded( unsigned char* buffer, std::size_t size, + std::size_t offset, std::size_t length ) + throw ( decaf::io::IOException, + decaf::lang::exceptions::IndexOutOfBoundsException, + decaf::lang::exceptions::NullPointerException ) { + + try{ + + if( isClosed() ) { + throw IOException( + __FILE__, __LINE__, "Stream is closed" ); + } + + if( buffer == NULL ) { + throw NullPointerException( + __FILE__, __LINE__, "Buffer pointer passed was NULL." ); + } + + if( offset > size || offset + length > size ) { + throw IndexOutOfBoundsException( + __FILE__, __LINE__, "Offset + length exceeds supplied buffer's size." ); + } + + std::size_t copiedBytes = 0; + std::size_t copyLength = 0; + std::size_t newOffset = offset; + + // Are there pushback bytes available? + if( pos < bufferSize ) { + copyLength = ( bufferSize - pos >= length ) ? length : bufferSize - pos; + System::arraycopy( this->buffer, pos, buffer, newOffset, copyLength ); + newOffset += copyLength; + copiedBytes += copyLength; + // Use up the bytes in the local buffer + pos += copyLength; + } + + // Have we copied enough? + if( copyLength == length ) { + return length; + } + + int inCopied = inputStream->read( buffer, size, newOffset, length - copiedBytes ); + if( inCopied > 0 ) { + return inCopied + copiedBytes; + } + + if( copiedBytes == 0 ) { + return inCopied; + } + + return copiedBytes; + } + DECAF_CATCH_RETHROW( IOException ) + DECAF_CATCH_RETHROW( IndexOutOfBoundsException ) + DECAF_CATCH_RETHROW( NullPointerException ) + DECAF_CATCHALL_THROW( IOException ) +} Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/PushbackInputStream.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/PushbackInputStream.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/PushbackInputStream.h?rev=915527&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/PushbackInputStream.h (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/PushbackInputStream.h Tue Feb 23 21:31:53 2010 @@ -0,0 +1,172 @@ +/* + * 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_IO_PUSHBACKINPUTSTREAM_H_ +#define _DECAF_IO_PUSHBACKINPUTSTREAM_H_ + +#include + +#include +#include + +namespace decaf { +namespace io { + + /** + * A PushbackInputStream adds functionality to another input stream, namely the ability to + * "push back" or "unread" one byte. This is useful in situations where it is convenient for + * a fragment of code to read an indefinite number of data bytes that are delimited by a + * particular byte value; after reading the terminating byte, the code fragment can "unread" + * it, so that the next read operation on the input stream will reread the byte that was + * pushed back. For example, bytes representing the characters constituting an identifier + * might be terminated by a byte representing an operator character; a method whose job + * is to read just an identifier can read until it sees the operator and then push the + * operator back to be re-read. + * + * @since 1.0 + */ + class PushbackInputStream : public FilterInputStream { + private: + + unsigned char* buffer; + std::size_t bufferSize; + std::size_t pos; + + public: + + /** + * + */ + PushbackInputStream( InputStream* stream, bool own = false ); + + /** + * + */ + PushbackInputStream( InputStream* stream, std::size_t bufSize, bool own = false ); + + virtual ~PushbackInputStream(); + + /** + * Pushes back the given byte, the byte is copied to the front of the pushback buffer, future + * calls to read start reading from the beginning of these pushed back byte. + * + * @param value + * The byte that is to be placed at the front of the push back buffer. + * + * @throws IOException if there is not enough space in the pushback buffer or this stream + * has already been closed. + */ + void unread( unsigned char value ) + throw( decaf::io::IOException ); + + /** + * Pushes back the given array of bytes, the bytes are copied to the front of the pushback + * buffer, future calls to read start reading from the beginning of these pushed back bytes. + * + * @param buffer + * The bytes to copy to the front of push back buffer. + * @param size + * The size of the array to be copied. + * + * @throws NullPointerException if the buffer passed is NULL. + * @throws IOException if there is not enough space in the pushback buffer or this stream + * has already been closed. + */ + void unread( const unsigned char* buffer, std::size_t size ) + throw( decaf::io::IOException, + decaf::lang::exceptions::NullPointerException ); + + /** + * Pushes back the given array of bytes, the bytes are copied to the front of the pushback + * buffer, future calls to read start reading from the beginning of these pushed back bytes. + * + * @param buffer + * The bytes to copy to the front of push back buffer. + * @param size + * The size of the array to be copied. + * @param offset + * The position in the buffer to start copying from. + * @param length + * The number of bytes to push back from the passed buffer. + * + * @throws NullPointerException if the buffer passed is NULL. + * @throws IndexOutOfBoundsException if the offset + length is greater than the buffer size. + * @throws IOException if there is not enough space in the pushback buffer or this stream + * has already been closed. + */ + void unread( const unsigned char* buffer, std::size_t size, std::size_t offset, std::size_t length ) + throw( decaf::io::IOException, + decaf::lang::exceptions::IndexOutOfBoundsException, + decaf::lang::exceptions::NullPointerException ); + + /** + * {@inheritdoc} + * + * Returns the sum of the number of pushed back bytes if any and the amount of bytes + * available in the underlying stream via a call to available. + */ + virtual std::size_t available() const throw ( decaf::io::IOException ); + + /** + * {@inheritDoc} + * + * This method first skips bytes in the local pushed back buffer before attempting to + * complete the request by calling the underlying stream skip method with the remainder + * of bytes that needs to be skipped. + */ + virtual std::size_t skip( std::size_t num ) + throw ( decaf::io::IOException, + decaf::lang::exceptions::UnsupportedOperationException ); + + /** + * {@inheritDoc} + * + * Does nothing for this class. + */ + virtual void mark( int readLimit ); + + /** + * {@inheritDoc} + * + * Does nothing except throw an IOException. + */ + virtual void reset() throw ( decaf::io::IOException ); + + /** + * {@inheritDoc} + * + * Always returns false for this class. + */ + virtual bool markSupported() const { + return false; + } + + protected: + + virtual int doReadByte() throw ( decaf::io::IOException ); + + virtual int doReadArrayBounded( unsigned char* buffer, std::size_t size, + std::size_t offset, std::size_t length ) + throw ( decaf::io::IOException, + decaf::lang::exceptions::IndexOutOfBoundsException, + decaf::lang::exceptions::NullPointerException ); + + }; + +}} + +#endif /* _DECAF_IO_PUSHBACKINPUTSTREAM_H_ */ Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/PushbackInputStream.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=915527&r1=915526&r2=915527&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am Tue Feb 23 21:31:53 2010 @@ -94,6 +94,7 @@ decaf/io/InputStreamTest.cpp \ decaf/io/OutputStreamTest.cpp \ decaf/io/OutputStreamWriterTest.cpp \ + decaf/io/PushbackInputStreamTest.cpp \ decaf/io/ReaderTest.cpp \ decaf/io/WriterTest.cpp \ decaf/lang/BooleanTest.cpp \ @@ -234,6 +235,7 @@ decaf/io/InputStreamTest.h \ decaf/io/OutputStreamTest.h \ decaf/io/OutputStreamWriterTest.h \ + decaf/io/PushbackInputStreamTest.h \ decaf/io/ReaderTest.h \ decaf/io/WriterTest.h \ decaf/lang/BooleanTest.h \ Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/PushbackInputStreamTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/PushbackInputStreamTest.cpp?rev=915527&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/PushbackInputStreamTest.cpp (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/PushbackInputStreamTest.cpp Tue Feb 23 21:31:53 2010 @@ -0,0 +1,297 @@ +/* + * 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 "PushbackInputStreamTest.h" + +#include +#include +#include + +using namespace decaf; +using namespace decaf::io; +using namespace decaf::lang; +using namespace decaf::lang::exceptions; + +//////////////////////////////////////////////////////////////////////////////// +std::string PushbackInputStreamTest::testString = + "Test_All_Tests\nTest_java_io_BufferedInputStream\nTest_java_io_BufferedOutputStream\n" + "Test_java_io_ByteArrayInputStream\nTest_java_io_ByteArrayOutputStream\nTest_java_io_DataInputStream\n" + "Test_java_io_File\nTest_java_io_FileDescriptor\nTest_java_io_FileInputStream\n" + "Test_java_io_FileNotFoundException\nTest_java_io_FileOutputStream\nTest_java_io_FilterInputStream\n" + "Test_java_io_FilterOutputStream\nTest_java_io_InputStream\nTest_java_io_IOException\n" + "Test_java_io_OutputStream\nTest_java_io_PrintStream\nTest_java_io_RandomAccessFile\n" + "Test_java_io_SyncFailedException\nTest_java_lang_AbstractMethodError\nTest_java_lang_ArithmeticException\n" + "Test_java_lang_ArrayIndexOutOfBoundsException\nTest_java_lang_ArrayStoreException\nTest_java_lang_Boolean\n" + "Test_java_lang_Byte\nTest_java_lang_Character\nTest_java_lang_Class\nTest_java_lang_ClassCastException\n" + "Test_java_lang_ClassCircularityError\nTest_java_lang_ClassFormatError\nTest_java_lang_ClassLoader\n" + "Test_java_lang_ClassNotFoundException\nTest_java_lang_CloneNotSupportedException\nTest_java_lang_Double\n" + "Test_java_lang_Error\nTest_java_lang_Exception\nTest_java_lang_ExceptionInInitializerError\n" + "Test_java_lang_Float\nTest_java_lang_IllegalAccessError\nTest_java_lang_IllegalAccessException\n" + "Test_java_lang_IllegalArgumentException\nTest_java_lang_IllegalMonitorStateException\n" + "Test_java_lang_IllegalThreadStateException\nTest_java_lang_IncompatibleClassChangeError\n" + "Test_java_lang_IndexOutOfBoundsException\nTest_java_lang_InstantiationError\n" + "Test_java_lang_InstantiationException\nTest_java_lang_Integer\nTest_java_lang_InternalError\n" + "Test_java_lang_InterruptedException\nTest_java_lang_LinkageError\nTest_java_lang_Long\n" + "Test_java_lang_Math\nTest_java_lang_NegativeArraySizeException\nTest_java_lang_NoClassDefFoundError\n" + "Test_java_lang_NoSuchFieldError\nTest_java_lang_NoSuchMethodError\nTest_java_lang_NullPointerException\n" + "Test_java_lang_Number\nTest_java_lang_NumberFormatException\nTest_java_lang_Object\n" + "Test_java_lang_OutOfMemoryError\nTest_java_lang_RuntimeException\nTest_java_lang_SecurityManager\n" + "Test_java_lang_Short\nTest_java_lang_StackOverflowError\nTest_java_lang_String\n" + "Test_java_lang_StringBuffer\nTest_java_lang_StringIndexOutOfBoundsException\nTest_java_lang_System\n" + "Test_java_lang_Thread\nTest_java_lang_ThreadDeath\nTest_java_lang_ThreadGroup\nTest_java_lang_Throwable\n" + "Test_java_lang_UnknownError\nTest_java_lang_UnsatisfiedLinkError\nTest_java_lang_VerifyError\n" + "Test_java_lang_VirtualMachineError\nTest_java_lang_vm_Image\nTest_java_lang_vm_MemorySegment\n" + "Test_java_lang_vm_ROMStoreException\nTest_java_lang_vm_VM\nTest_java_lang_Void\nTest_java_net_BindException\n" + "Test_java_net_ConnectException\nTest_java_net_DatagramPacket\nTest_java_net_DatagramSocket\n" + "Test_java_net_DatagramSocketImpl\nTest_java_net_InetAddress\nTest_java_net_NoRouteToHostException\n" + "Test_java_net_PlainDatagramSocketImpl\nTest_java_net_PlainSocketImpl\nTest_java_net_Socket\n" + "Test_java_net_SocketException\nTest_java_net_SocketImpl\nTest_java_net_SocketInputStream\n" + "Test_java_net_SocketOutputStream\nTest_java_net_UnknownHostException\nTest_java_util_ArrayEnumerator\n" + "Test_java_util_Date\nTest_java_util_EventObject\nTest_java_util_HashEnumerator\nTest_java_util_Hashtable\n" + "Test_java_util_Properties\nTest_java_util_ResourceBundle\nTest_java_util_tm\nTest_java_util_Vector\n"; + +//////////////////////////////////////////////////////////////////////////////// +PushbackInputStreamTest::PushbackInputStreamTest() { +} + +//////////////////////////////////////////////////////////////////////////////// +PushbackInputStreamTest::~PushbackInputStreamTest() { +} + +//////////////////////////////////////////////////////////////////////////////// +void PushbackInputStreamTest::testReset() { + + std::vector temp( testString.begin(), testString.end() ); + ByteArrayInputStream bais( temp ); + PushbackInputStream pb( &bais ); + + CPPUNIT_ASSERT_THROW_MESSAGE( + "Should Throw an IOException", + pb.reset(), + IOException ); +} + +//////////////////////////////////////////////////////////////////////////////// +void PushbackInputStreamTest::testMark() { + + std::vector temp( 1 ); + ByteArrayInputStream bais( temp ); + PushbackInputStream pb( &bais, (std::size_t)2 ); + + pb.mark( Integer::MAX_VALUE ); + pb.mark( 0 ); + pb.mark( Integer::MIN_VALUE ); +} + +//////////////////////////////////////////////////////////////////////////////// +void PushbackInputStreamTest::testConstructor1() { + + { + PushbackInputStream str( NULL ); + CPPUNIT_ASSERT_THROW_MESSAGE( + "Should Throw an IOException", + str.reset(), + IOException ); + } + { + std::vector temp( testString.begin(), testString.end() ); + ByteArrayInputStream bais( temp ); + PushbackInputStream pb( &bais ); + + unsigned char un[] = { 'h', 'e' }; + + CPPUNIT_ASSERT_THROW_MESSAGE( + "Should Throw an IOException", + pb.unread( un, 2 ), + IOException ); + } +} + +//////////////////////////////////////////////////////////////////////////////// +void PushbackInputStreamTest::testConstructor2() { + + std::vector temp( testString.begin(), testString.end() ); + ByteArrayInputStream bais( temp ); + PushbackInputStream pb( &bais, (std::size_t)5 ); + + unsigned char un[] = { 'h', 'e', 'l', 'l', 'o', 's' }; + + CPPUNIT_ASSERT_THROW_MESSAGE( + "Should Throw an IOException", + pb.unread( un, 6 ), + IOException ); +} + +//////////////////////////////////////////////////////////////////////////////// +void PushbackInputStreamTest::testConstructor3() { + + PushbackInputStream pb( NULL, (std::size_t)1 ); + CPPUNIT_ASSERT_THROW_MESSAGE( + "Should Throw an IOException", + pb.read(), + IOException ); +} + +//////////////////////////////////////////////////////////////////////////////// +void PushbackInputStreamTest::testAvailable() { + try { + std::vector temp( testString.begin(), testString.end() ); + ByteArrayInputStream bais( temp ); + PushbackInputStream pb( &bais ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Should have been testString.length available.", + testString.length(), pb.available() ); + } catch( IOException& e ) { + CPPUNIT_FAIL( std::string() + "Exception during available test: " + e.getMessage() ); + } +} + +//////////////////////////////////////////////////////////////////////////////// +void PushbackInputStreamTest::testMarkSupported() { + + std::vector temp( testString.begin(), testString.end() ); + ByteArrayInputStream bais( temp ); + PushbackInputStream pb( &bais ); + CPPUNIT_ASSERT_MESSAGE( "markSupported returned true", !pb.markSupported() ); +} + +//////////////////////////////////////////////////////////////////////////////// +void PushbackInputStreamTest::testRead() { + try { + std::vector temp( testString.begin(), testString.end() ); + ByteArrayInputStream bais( temp ); + PushbackInputStream pb( &bais ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Did not return the first value in testString.", + testString.at( 0 ), (char)pb.read() ); + } catch( IOException& e ) { + CPPUNIT_FAIL( std::string() + "Exception during available test: " + e.getMessage() ); + } +} + +//////////////////////////////////////////////////////////////////////////////// +void PushbackInputStreamTest::testReadBIII() { + + try { + std::vector temp( testString.begin(), testString.end() ); + ByteArrayInputStream bais( temp ); + PushbackInputStream pb( &bais ); + + unsigned char buf[100]; + pb.read( buf, 100 ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect bytes read from the testString.", + std::string( buf, buf + 100 ), testString.substr( 0, 100 ) ); + + } catch( IOException& e ) { + CPPUNIT_FAIL( std::string() + "Exception during read test : " + e.getMessage() ); + } +} + +//////////////////////////////////////////////////////////////////////////////// +void PushbackInputStreamTest::testSkip() { + + std::vector temp( testString.begin(), testString.end() ); + ByteArrayInputStream bais( temp ); + PushbackInputStream pb( &bais, (std::size_t) 65535 ); + + unsigned char buf[50]; + pb.skip( 50 ); + pb.read( buf, 50, 0, 50 ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect bytes read from the testString.", + std::string( buf, buf + 50 ), testString.substr( 50, 50 ) ); + + pb.unread( buf, 50 ); + pb.skip( 25 ); + unsigned char buf2[25]; + pb.read( buf2, 25 ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect bytes read from the testString.", + std::string( buf2, buf2 + 25 ), testString.substr( 75, 25 ) ); +} + +//////////////////////////////////////////////////////////////////////////////// +void PushbackInputStreamTest::testUnreadBI() { + try { + + std::vector temp( testString.begin(), testString.end() ); + ByteArrayInputStream bais( temp ); + PushbackInputStream pb( &bais, (std::size_t) 65535 ); + + unsigned char buf[100]; + pb.read(buf, 100, 0, 100 ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect bytes read from the testString.", + std::string( buf, buf + 100 ), testString.substr( 0, 100 ) ); + pb.unread( buf, 100 ); + pb.read( buf, 50 ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect bytes read from the testString.", + std::string( buf, buf + 50 ), testString.substr( 0, 50 ) ); + } catch( IOException& e ) { + CPPUNIT_FAIL( std::string() + "IOException during unread test : " + e.getMessage() ); + } +} + +//////////////////////////////////////////////////////////////////////////////// +void PushbackInputStreamTest::testUnreadBIII() { + + std::vector temp( testString.begin(), testString.end() ); + ByteArrayInputStream bais( temp ); + PushbackInputStream pb( &bais, (std::size_t) 65535 ); + + unsigned char buf[100]; + pb.read( buf, 100, 0, 100 ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect bytes read from the testString.", + std::string( buf, buf + 100 ), testString.substr( 0, 100 ) ); + + pb.unread( buf, 100, 50, 50 ); + pb.read( buf, 50 ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect bytes read from the testString.", + std::string( buf, buf + 50 ), testString.substr( 50, 50 ) ); + + { + std::vector temp( 2 ); + ByteArrayInputStream bais( temp ); + PushbackInputStream pb( &bais ); + + unsigned char un[] = { 'h' }; + + CPPUNIT_ASSERT_THROW_MESSAGE( + "Should Throw an IOException", + pb.unread( un, 1, 0, 5 ), + IOException ); + } +} + +//////////////////////////////////////////////////////////////////////////////// +void PushbackInputStreamTest::testUnread() { + + std::vector temp( testString.begin(), testString.end() ); + ByteArrayInputStream bais( temp ); + PushbackInputStream pb( &bais ); + + try { + + int x; + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect bytes read from the testString.", + (char)( x = pb.read() ), testString.at( 0 ) ); + + pb.unread( (char) x ); + CPPUNIT_ASSERT_MESSAGE( "Failed to unread", pb.read() == x ); + + } catch( IOException& e ) { + CPPUNIT_FAIL( std::string() + "IOException during read test : " + e.getMessage() ); + } +} Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/PushbackInputStreamTest.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/PushbackInputStreamTest.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/PushbackInputStreamTest.h?rev=915527&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/PushbackInputStreamTest.h (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/PushbackInputStreamTest.h Tue Feb 23 21:31:53 2010 @@ -0,0 +1,72 @@ +/* + * 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_IO_PUSHBACKINPUTSTREAMTEST_H_ +#define _DECAF_IO_PUSHBACKINPUTSTREAMTEST_H_ + +#include +#include + +namespace decaf { +namespace io { + + class PushbackInputStreamTest : public CppUnit::TestFixture { + + CPPUNIT_TEST_SUITE( PushbackInputStreamTest ); + CPPUNIT_TEST( testReset ); + CPPUNIT_TEST( testMark ); + CPPUNIT_TEST( testMarkSupported ); + CPPUNIT_TEST( testAvailable ); + CPPUNIT_TEST( testConstructor1 ); + CPPUNIT_TEST( testConstructor2 ); + CPPUNIT_TEST( testConstructor3 ); + CPPUNIT_TEST( testRead ); + CPPUNIT_TEST( testReadBIII ); + CPPUNIT_TEST( testSkip ); + CPPUNIT_TEST( testUnreadBI ); + CPPUNIT_TEST( testUnreadBIII ); + CPPUNIT_TEST( testUnread ); + CPPUNIT_TEST_SUITE_END(); + + private: + + static std::string testString; + + public: + + PushbackInputStreamTest(); + virtual ~PushbackInputStreamTest(); + + void testReset(); + void testMark(); + void testMarkSupported(); + void testAvailable(); + void testConstructor1(); + void testConstructor2(); + void testConstructor3(); + void testRead(); + void testReadBIII(); + void testSkip(); + void testUnreadBI(); + void testUnreadBIII(); + void testUnread(); + + }; + +}} + +#endif /* _DECAF_IO_PUSHBACKINPUTSTREAMTEST_H_ */ Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/PushbackInputStreamTest.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=915527&r1=915526&r2=915527&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp Tue Feb 23 21:31:53 2010 @@ -18,277 +18,279 @@ // All CPP Unit tests are registered in here so we can disable them and // enable them easily in one place. -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::BrokerInfoTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::BrokerIdTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQTopicTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQTextMessageTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQTempTopicTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQTempQueueTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQQueueTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQMessageTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQMapMessageTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQDestinationTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQBytesMessageTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQStreamMessageTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::openwire::marshal::BaseDataStreamMarshallerTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::openwire::marshal::PrimitiveTypesMarshallerTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::openwire::utils::BooleanStreamTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::openwire::utils::HexTableTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::openwire::utils::OpenwireStringSupportTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::openwire::utils::MessagePropertyInterceptorTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::openwire::OpenWireFormatTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::cmsutil::CmsAccessorTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::cmsutil::CmsDestinationAccessorTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::cmsutil::CmsTemplateTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::cmsutil::DynamicDestinationResolverTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::cmsutil::SessionPoolTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::core::ActiveMQConnectionFactoryTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::core::ActiveMQConnectionTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::core::ActiveMQSessionTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::core::MessageDispatchChannelTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::state::ConnectionStateTrackerTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::state::ConnectionStateTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::state::ConsumerStateTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::state::ProducerStateTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::state::SessionStateTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::state::TransactionStateTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::transport::failover::FailoverTransportTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::transport::correlator::ResponseCorrelatorTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::transport::mock::MockTransportFactoryTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::transport::inactivity::InactivityMonitorTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::transport::TransportRegistryTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::transport::IOTransportTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::exceptions::ActiveMQExceptionTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::util::LongSequenceGeneratorTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::util::PrimitiveValueNodeTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::util::PrimitiveListTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::util::PrimitiveMapTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::util::PrimitiveValueConverterTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::util::URISupportTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::util::MemoryUsageTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::threads::DedicatedTaskRunnerTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::threads::CompositeTaskRunnerTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::WireFormatRegistryTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::util::ByteArrayAdapterTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::util::TimerTaskHeapTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::nio::ByteArrayPerspectiveTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::nio::ByteArrayBufferTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::nio::BufferFactoryTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::nio::CharArrayBufferTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::nio::DoubleArrayBufferTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::nio::FloatArrayBufferTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::nio::LongArrayBufferTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::nio::IntArrayBufferTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::nio::ShortArrayBufferTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::net::URIEncoderDecoderTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::net::URIHelperTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::nio::BufferTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::InputStreamTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::OutputStreamTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::FilterInputStreamTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::FilterOutputStreamTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::BufferedInputStreamTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::BufferedOutputStreamTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::ByteArrayInputStreamTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::ByteArrayOutputStreamTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::DataInputStreamTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::DataOutputStreamTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::WriterTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::ReaderTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::OutputStreamWriterTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::InputStreamReaderTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::MathTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ByteTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::CharacterTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::BooleanTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ShortTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::IntegerTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::LongTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::FloatTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::DoubleTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ExceptionTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ThreadTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::SystemTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::PointerTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::SocketFactoryTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::SocketTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::URITest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::URISyntaxExceptionTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::URLEncoderTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::URLDecoderTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::ConcurrentStlMapTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::CountDownLatchTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::MutexTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::ThreadPoolTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::TimeUnitTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::atomic::AtomicBooleanTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::atomic::AtomicIntegerTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::atomic::AtomicReferenceTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::locks::LockSupportTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::DateTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::UUIDTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::ListTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::StlMapTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::PropertiesTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::QueueTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::RandomTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::SetTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::StringTokenizerTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::TimerTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::PriorityQueueTest ); - -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::zip::DeflaterTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::zip::InflaterTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::zip::Adler32Test ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::zip::CRC32Test ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::BrokerInfoTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::BrokerIdTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQTopicTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQTextMessageTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQTempTopicTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQTempQueueTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQQueueTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQMessageTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQMapMessageTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQDestinationTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQBytesMessageTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQStreamMessageTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::openwire::marshal::BaseDataStreamMarshallerTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::openwire::marshal::PrimitiveTypesMarshallerTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::openwire::utils::BooleanStreamTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::openwire::utils::HexTableTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::openwire::utils::OpenwireStringSupportTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::openwire::utils::MessagePropertyInterceptorTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::openwire::OpenWireFormatTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::cmsutil::CmsAccessorTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::cmsutil::CmsDestinationAccessorTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::cmsutil::CmsTemplateTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::cmsutil::DynamicDestinationResolverTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::cmsutil::SessionPoolTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::core::ActiveMQConnectionFactoryTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::core::ActiveMQConnectionTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::core::ActiveMQSessionTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::core::MessageDispatchChannelTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::state::ConnectionStateTrackerTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::state::ConnectionStateTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::state::ConsumerStateTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::state::ProducerStateTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::state::SessionStateTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::state::TransactionStateTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::transport::failover::FailoverTransportTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::transport::correlator::ResponseCorrelatorTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::transport::mock::MockTransportFactoryTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::transport::inactivity::InactivityMonitorTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::transport::TransportRegistryTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::transport::IOTransportTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::exceptions::ActiveMQExceptionTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::util::LongSequenceGeneratorTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::util::PrimitiveValueNodeTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::util::PrimitiveListTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::util::PrimitiveMapTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::util::PrimitiveValueConverterTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::util::URISupportTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::util::MemoryUsageTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::threads::DedicatedTaskRunnerTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::threads::CompositeTaskRunnerTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::WireFormatRegistryTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::util::ByteArrayAdapterTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::util::TimerTaskHeapTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::nio::ByteArrayPerspectiveTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::nio::ByteArrayBufferTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::nio::BufferFactoryTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::nio::CharArrayBufferTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::nio::DoubleArrayBufferTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::nio::FloatArrayBufferTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::nio::LongArrayBufferTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::nio::IntArrayBufferTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::nio::ShortArrayBufferTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::net::URIEncoderDecoderTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::internal::net::URIHelperTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::nio::BufferTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::InputStreamTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::OutputStreamTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::FilterInputStreamTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::FilterOutputStreamTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::BufferedInputStreamTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::BufferedOutputStreamTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::ByteArrayInputStreamTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::ByteArrayOutputStreamTest ); +#include +CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::PushbackInputStreamTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::DataInputStreamTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::DataOutputStreamTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::WriterTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::ReaderTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::OutputStreamWriterTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::InputStreamReaderTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::MathTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ByteTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::CharacterTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::BooleanTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ShortTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::IntegerTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::LongTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::FloatTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::DoubleTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ExceptionTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ThreadTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::SystemTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::PointerTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::SocketFactoryTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::SocketTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::URITest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::URISyntaxExceptionTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::URLEncoderTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::URLDecoderTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::ConcurrentStlMapTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::CountDownLatchTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::MutexTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::ThreadPoolTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::TimeUnitTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::atomic::AtomicBooleanTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::atomic::AtomicIntegerTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::atomic::AtomicReferenceTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::locks::LockSupportTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::DateTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::UUIDTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::ListTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::StlMapTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::PropertiesTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::QueueTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::RandomTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::SetTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::StringTokenizerTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::TimerTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::PriorityQueueTest ); +// +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::zip::DeflaterTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::zip::InflaterTest ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::zip::Adler32Test ); +//#include +//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::zip::CRC32Test ); //////////////////////////////////////////////////////////////////////////////////////////////////////////// // Marshaler Tests