Author: ataylor
Date: 2011-04-08 08:18:13 -0400 (Fri, 08 Apr 2011)
New Revision: 10469
Added:
trunk/tests/pom.xml
trunk/tests/unit-tests/
trunk/tests/unit-tests/pom.xml
trunk/tests/unit-tests/src/
trunk/tests/unit-tests/src/test/
trunk/tests/unit-tests/src/test/java/
trunk/tests/unit-tests/src/test/java/org/
trunk/tests/unit-tests/src/test/java/org/hornetq/
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/RandomUtil.java
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/ServiceTestBase.java
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/UnitTestCase.java
Removed:
trunk/tests/src/org/hornetq/tests/unit/
trunk/tests/src/org/hornetq/tests/util/RandomUtil.java
trunk/tests/src/org/hornetq/tests/util/ServiceTestBase.java
trunk/tests/src/org/hornetq/tests/util/UnitTestCase.java
Modified:
trunk/hornetq.iml
trunk/pom.xml
trunk/tests/hornetq-tests.iml
trunk/tests/src/org/hornetq/tests/integration/DuplicateDetectionTest.java
trunk/tests/src/org/hornetq/tests/integration/InterceptorTest.java
trunk/tests/src/org/hornetq/tests/integration/String64KLimitTest.java
trunk/tests/src/org/hornetq/tests/integration/client/AckBatchSizeTest.java
trunk/tests/src/org/hornetq/tests/integration/client/AcknowledgeTest.java
trunk/tests/src/org/hornetq/tests/integration/client/AddressSettingsTest.java
trunk/tests/src/org/hornetq/tests/integration/client/AutogroupIdTest.java
trunk/tests/src/org/hornetq/tests/integration/client/BlockingSendTest.java
trunk/tests/src/org/hornetq/tests/integration/client/CommitRollbackTest.java
trunk/tests/src/org/hornetq/tests/integration/client/ConsumerCloseTest.java
trunk/tests/src/org/hornetq/tests/integration/client/ConsumerFilterTest.java
trunk/tests/src/org/hornetq/tests/integration/client/ConsumerRoundRobinTest.java
trunk/tests/src/org/hornetq/tests/integration/client/ConsumerTest.java
trunk/tests/src/org/hornetq/tests/integration/client/ConsumerWindowSizeTest.java
trunk/tests/src/org/hornetq/tests/integration/client/CoreClientTest.java
trunk/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java
trunk/tests/src/org/hornetq/tests/integration/client/DeliveryOrderTest.java
trunk/tests/src/org/hornetq/tests/integration/client/DurableQueueTest.java
trunk/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java
trunk/tests/src/org/hornetq/tests/integration/client/FailureDeadlockTest.java
trunk/tests/src/org/hornetq/tests/integration/client/HeuristicXATest.java
trunk/tests/src/org/hornetq/tests/integration/client/HornetQCrashTest.java
trunk/tests/src/org/hornetq/tests/integration/client/InVMNonPersistentMessageBufferTest.java
trunk/tests/src/org/hornetq/tests/integration/client/IncompatibleVersionTest.java
trunk/tests/src/org/hornetq/tests/integration/client/JournalCrashTest.java
trunk/tests/src/org/hornetq/tests/integration/client/MessageConcurrencyTest.java
trunk/tests/src/org/hornetq/tests/integration/client/MessageCounterTest.java
trunk/tests/src/org/hornetq/tests/integration/client/MessageDurabilityTest.java
trunk/tests/src/org/hornetq/tests/integration/client/MessageExpirationTest.java
trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java
trunk/tests/src/org/hornetq/tests/integration/client/MessageHandlerTest.java
trunk/tests/src/org/hornetq/tests/integration/client/MessagePriorityTest.java
trunk/tests/src/org/hornetq/tests/integration/client/MessageRateTest.java
trunk/tests/src/org/hornetq/tests/integration/client/OrderTest.java
trunk/tests/src/org/hornetq/tests/integration/client/PagingOrderTest.java
trunk/tests/src/org/hornetq/tests/integration/client/PagingSyncTest.java
trunk/tests/src/org/hornetq/tests/integration/client/PagingTest.java
trunk/tests/src/org/hornetq/tests/integration/client/ProducerCloseTest.java
trunk/tests/src/org/hornetq/tests/integration/client/ProducerFlowControlTest.java
trunk/tests/src/org/hornetq/tests/integration/client/ProducerTest.java
trunk/tests/src/org/hornetq/tests/integration/client/QueueBrowserTest.java
trunk/tests/src/org/hornetq/tests/integration/client/ReceiveImmediateTest.java
trunk/tests/src/org/hornetq/tests/integration/client/ReceiveTest.java
trunk/tests/src/org/hornetq/tests/integration/client/RedeliveryConsumerTest.java
trunk/tests/src/org/hornetq/tests/integration/client/RoutingTest.java
trunk/tests/src/org/hornetq/tests/integration/client/SelfExpandingBufferTest.java
trunk/tests/src/org/hornetq/tests/integration/client/ServerLocatorConnectTest.java
trunk/tests/src/org/hornetq/tests/integration/client/SessionCloseOnGCTest.java
trunk/tests/src/org/hornetq/tests/integration/client/SessionCreateAndDeleteQueueTest.java
trunk/tests/src/org/hornetq/tests/integration/client/SessionCreateConsumerTest.java
trunk/tests/src/org/hornetq/tests/integration/client/SessionCreateProducerTest.java
trunk/tests/src/org/hornetq/tests/integration/client/SessionFactoryTest.java
trunk/tests/src/org/hornetq/tests/integration/client/SessionSendAcknowledgementHandlerTest.java
trunk/tests/src/org/hornetq/tests/integration/client/SessionStopStartTest.java
trunk/tests/src/org/hornetq/tests/integration/client/SessionTest.java
trunk/tests/src/org/hornetq/tests/integration/client/SimpleSendMultipleQueues.java
trunk/tests/src/org/hornetq/tests/integration/client/TemporaryQueueTest.java
trunk/tests/src/org/hornetq/tests/integration/client/TransactionDurabilityTest.java
trunk/tests/src/org/hornetq/tests/integration/client/TransactionalSendTest.java
trunk/tests/src/org/hornetq/tests/integration/clientcrash/ClientTestBase.java
trunk/tests/src/org/hornetq/tests/integration/cluster/NodeManagerTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeStartTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeWithDiscoveryGroupStartTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverReplicationTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverSharedServerTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadReattachSupport.java
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/OrderReattachTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/RandomReattachTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/ReattachTest.java
trunk/tests/src/org/hornetq/tests/integration/core/deployers/impl/QueueDeployerTest.java
trunk/tests/src/org/hornetq/tests/integration/divert/DivertTest.java
trunk/tests/src/org/hornetq/tests/integration/divert/PersistentDivertTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerDeployerTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerStartStopTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/config/JMSConfigurationTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/config/JMSServerConfigParserTest.java
trunk/tests/src/org/hornetq/tests/integration/largemessage/LargeMessageTestBase.java
trunk/tests/src/org/hornetq/tests/integration/largemessage/ServerLargeMessageTest.java
trunk/tests/src/org/hornetq/tests/integration/logging/LogDelegateTest.java
trunk/tests/src/org/hornetq/tests/integration/management/ManagementTestBase.java
trunk/tests/src/org/hornetq/tests/integration/paging/PagingCounterTest.java
trunk/tests/src/org/hornetq/tests/integration/paging/PagingSendTest.java
trunk/tests/src/org/hornetq/tests/integration/persistence/DeleteQueueRestartTest.java
trunk/tests/src/org/hornetq/tests/integration/persistence/ExportFormatTest.java
trunk/tests/src/org/hornetq/tests/integration/persistence/RestartSMTest.java
trunk/tests/src/org/hornetq/tests/integration/persistence/StorageManagerTestBase.java
trunk/tests/src/org/hornetq/tests/integration/ra/HornetQRATestBase.java
trunk/tests/src/org/hornetq/tests/integration/remoting/BatchDelayTest.java
trunk/tests/src/org/hornetq/tests/integration/remoting/DestroyConsumerTest.java
trunk/tests/src/org/hornetq/tests/integration/remoting/DirectDeliverTest.java
trunk/tests/src/org/hornetq/tests/integration/remoting/NetworkAddressTestBase.java
trunk/tests/src/org/hornetq/tests/integration/remoting/PingTest.java
trunk/tests/src/org/hornetq/tests/integration/remoting/ReconnectTest.java
trunk/tests/src/org/hornetq/tests/integration/remoting/SynchronousCloseTest.java
trunk/tests/src/org/hornetq/tests/integration/replication/ReplicationTest.java
trunk/tests/src/org/hornetq/tests/integration/scheduling/DelayedMessageTest.java
trunk/tests/src/org/hornetq/tests/integration/scheduling/ScheduledMessageTest.java
trunk/tests/src/org/hornetq/tests/integration/security/SecurityTest.java
trunk/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java
trunk/tests/src/org/hornetq/tests/integration/server/LVQRecoveryTest.java
trunk/tests/src/org/hornetq/tests/integration/server/LVQTest.java
trunk/tests/src/org/hornetq/tests/integration/server/PredefinedQueueTest.java
trunk/tests/src/org/hornetq/tests/integration/twitter/TwitterTest.java
trunk/tests/src/org/hornetq/tests/integration/xa/BasicXaRecoveryTest.java
trunk/tests/src/org/hornetq/tests/integration/xa/BasicXaTest.java
trunk/tests/src/org/hornetq/tests/performance/paging/MeasurePagingMultiThreadTest.java
trunk/tests/src/org/hornetq/tests/soak/client/ClientNonDivertedSoakTest.java
trunk/tests/src/org/hornetq/tests/soak/client/ClientSoakTest.java
trunk/tests/src/org/hornetq/tests/soak/client/SimpleSendReceiveSoakTest.java
trunk/tests/src/org/hornetq/tests/stress/client/SendStressTest.java
trunk/tests/src/org/hornetq/tests/stress/journal/CompactingStressTest.java
trunk/tests/src/org/hornetq/tests/stress/journal/JournalCleanupCompactStressTest.java
trunk/tests/src/org/hornetq/tests/stress/journal/JournalRestartStressTest.java
trunk/tests/src/org/hornetq/tests/stress/journal/LargeJournalStressTest.java
trunk/tests/src/org/hornetq/tests/stress/journal/MultiThreadConsumerStressTest.java
trunk/tests/src/org/hornetq/tests/stress/journal/NIOMultiThreadCompactorStressTest.java
trunk/tests/src/org/hornetq/tests/stress/paging/PageCursorStressTest.java
trunk/tests/src/org/hornetq/tests/stress/paging/PageStressTest.java
trunk/tests/src/org/hornetq/tests/stress/remote/PingStressTest.java
trunk/tests/src/org/hornetq/tests/util/JMSClusteredTestBase.java
trunk/tests/src/org/hornetq/tests/util/JMSTestBase.java
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/deployers/impl/FileDeploymentManagerTest.java
Log:
mavenised unit tests
Modified: trunk/hornetq.iml
===================================================================
--- trunk/hornetq.iml 2011-04-08 10:24:03 UTC (rev 10468)
+++ trunk/hornetq.iml 2011-04-08 12:18:13 UTC (rev 10469)
@@ -15,6 +15,7 @@
<sourceFolder url="file://$MODULE_DIR$/hornetq-jms/src/main/java"
isTestSource="false" />
<sourceFolder
url="file://$MODULE_DIR$/hornetq-service-sar/src/main/java"
isTestSource="false" />
<sourceFolder
url="file://$MODULE_DIR$/hornetq-ra/hornetq-ra-jar/src/main/java"
isTestSource="false" />
+ <excludeFolder url="file://$MODULE_DIR$/ObjectStore" />
<excludeFolder url="file://$MODULE_DIR$/build/api" />
<excludeFolder url="file://$MODULE_DIR$/build/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/jars" />
@@ -31,6 +32,7 @@
<excludeFolder url="file://$MODULE_DIR$/examples/jms/common/build"
/>
<excludeFolder url="file://$MODULE_DIR$/examples/jms/queue/build"
/>
<excludeFolder url="file://$MODULE_DIR$/journal-test" />
+ <excludeFolder url="file://$MODULE_DIR$/logs" />
<excludeFolder url="file://$MODULE_DIR$/output" />
<excludeFolder url="file://$MODULE_DIR$/output/classes" />
<excludeFolder url="file://$MODULE_DIR$/output/etc" />
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-04-08 10:24:03 UTC (rev 10468)
+++ trunk/pom.xml 2011-04-08 12:18:13 UTC (rev 10469)
@@ -38,6 +38,7 @@
<HornetQ-Version>${hornetq.version.majorVersion}.${hornetq.version.minorVersion}.${hornetq.version.microVersion}.${hornetq.version.versionSuffix}
(${hornetq.version.versionName},
${hornetq.version.incrementingVersion})</HornetQ-Version>
<
HornetQ-SVN-URL>https://svn.jboss.org/repos/hornetq/trunk</HornetQ-...
<resteasy.version>2.1.0.GA</resteasy.version>
+ <skipTests>true</skipTests>
</properties>
<scm>
@@ -105,7 +106,7 @@
<module>hornetq-jboss-as-integration</module>
<module>hornetq-twitter-integration</module>
<module>hornetq-service-sar</module>
- <!--<module>tests</module>-->
+ <module>tests</module>
</modules>
<dependencyManagement>
@@ -399,6 +400,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>${skipTests}</skipTests>
+ </configuration>
<version>2.4</version>
</plugin>
<plugin>
Modified: trunk/tests/hornetq-tests.iml
===================================================================
--- trunk/tests/hornetq-tests.iml 2011-04-08 10:24:03 UTC (rev 10468)
+++ trunk/tests/hornetq-tests.iml 2011-04-08 12:18:13 UTC (rev 10469)
@@ -4,6 +4,7 @@
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/unit-tests/src/test/java"
isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/jms-tests" />
<excludeFolder url="file://$MODULE_DIR$/joram-tests" />
<excludeFolder url="file://$MODULE_DIR$/logs" />
Added: trunk/tests/pom.xml
===================================================================
--- trunk/tests/pom.xml (rev 0)
+++ trunk/tests/pom.xml 2011-04-08 12:18:13 UTC (rev 10469)
@@ -0,0 +1,30 @@
+<project>
+ <parent>
+ <groupId>org.hornetq</groupId>
+ <artifactId>hornetq-pom</artifactId>
+ <version>2.2.3-SNAPSHOT</version>
+ </parent>
+ <name>HornetQ Tests POM</name>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.hornetq.tests</groupId>
+ <artifactId>hornetq-tests-pom</artifactId>
+ <packaging>pom</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <modules>
+ <module>unit-tests</module>
+ <!--<module>jms-tests</module>-->
+ </modules>
+</project>
Modified: trunk/tests/src/org/hornetq/tests/integration/DuplicateDetectionTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/DuplicateDetectionTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/DuplicateDetectionTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -29,7 +29,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
import org.hornetq.core.transaction.impl.XidImpl;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.utils.UUIDGenerator;
/**
Modified: trunk/tests/src/org/hornetq/tests/integration/InterceptorTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/InterceptorTest.java 2011-04-08 10:24:03
UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/InterceptorTest.java 2011-04-08 12:18:13
UTC (rev 10469)
@@ -27,7 +27,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.ServerMessage;
import org.hornetq.spi.core.protocol.RemotingConnection;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
*
Modified: trunk/tests/src/org/hornetq/tests/integration/String64KLimitTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/String64KLimitTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/String64KLimitTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -19,13 +19,11 @@
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.*;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
-import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified: trunk/tests/src/org/hornetq/tests/integration/client/AckBatchSizeTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/AckBatchSizeTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/AckBatchSizeTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -19,7 +19,7 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.Queue;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified: trunk/tests/src/org/hornetq/tests/integration/client/AcknowledgeTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/AcknowledgeTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/AcknowledgeTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -23,7 +23,7 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.Queue;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified: trunk/tests/src/org/hornetq/tests/integration/client/AddressSettingsTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/AddressSettingsTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/AddressSettingsTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -19,7 +19,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.settings.HierarchicalRepository;
import org.hornetq.core.settings.impl.AddressSettings;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified: trunk/tests/src/org/hornetq/tests/integration/client/AutogroupIdTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/AutogroupIdTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/AutogroupIdTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -21,7 +21,7 @@
import org.hornetq.api.core.client.*;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified: trunk/tests/src/org/hornetq/tests/integration/client/BlockingSendTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/BlockingSendTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/BlockingSendTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -17,7 +17,7 @@
import org.hornetq.api.core.client.*;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A BlockingSendTest
Modified: trunk/tests/src/org/hornetq/tests/integration/client/CommitRollbackTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/CommitRollbackTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/CommitRollbackTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -22,7 +22,7 @@
import org.hornetq.api.core.client.*;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.Queue;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified: trunk/tests/src/org/hornetq/tests/integration/client/ConsumerCloseTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/ConsumerCloseTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/ConsumerCloseTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -30,8 +30,8 @@
import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified: trunk/tests/src/org/hornetq/tests/integration/client/ConsumerFilterTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/ConsumerFilterTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/ConsumerFilterTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -21,7 +21,7 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.impl.QueueImpl;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
*
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/ConsumerRoundRobinTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/ConsumerRoundRobinTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/ConsumerRoundRobinTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -18,7 +18,7 @@
import org.hornetq.api.core.client.*;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified: trunk/tests/src/org/hornetq/tests/integration/client/ConsumerTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/ConsumerTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/ConsumerTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -27,7 +27,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.Queue;
import org.hornetq.spi.core.protocol.RemotingConnection;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/ConsumerWindowSizeTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/ConsumerWindowSizeTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/ConsumerWindowSizeTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -37,7 +37,7 @@
import org.hornetq.core.server.Consumer;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.impl.ServerConsumerImpl;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified: trunk/tests/src/org/hornetq/tests/integration/client/CoreClientTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/CoreClientTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/CoreClientTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -26,12 +26,11 @@
import org.hornetq.api.core.client.HornetQClient;
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
import org.hornetq.jms.client.HornetQTextMessage;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
public class CoreClientTest extends ServiceTestBase
{
Modified: trunk/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -38,7 +38,7 @@
import org.hornetq.core.server.Queue;
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified: trunk/tests/src/org/hornetq/tests/integration/client/DeliveryOrderTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/DeliveryOrderTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/DeliveryOrderTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -22,7 +22,7 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.client.*;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified: trunk/tests/src/org/hornetq/tests/integration/client/DurableQueueTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/DurableQueueTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/DurableQueueTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -16,11 +16,10 @@
import junit.framework.Assert;
import org.hornetq.api.core.SimpleString;
-import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.*;
import org.hornetq.core.server.HornetQServer;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
/**
* A TemporaryQueueTest
Modified: trunk/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -20,13 +20,12 @@
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.*;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
import org.hornetq.core.settings.impl.AddressSettings;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified: trunk/tests/src/org/hornetq/tests/integration/client/FailureDeadlockTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/FailureDeadlockTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/FailureDeadlockTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -23,7 +23,6 @@
import org.hornetq.api.jms.JMSFactoryType;
import org.hornetq.core.client.impl.ClientSessionInternal;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
@@ -32,8 +31,7 @@
import org.hornetq.jms.server.impl.JMSServerManagerImpl;
import org.hornetq.spi.core.protocol.RemotingConnection;
import org.hornetq.tests.integration.jms.server.management.NullInitialContext;
-import org.hornetq.tests.util.ServiceTestBase;
-import org.hornetq.tests.util.UnitTestCase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
*
Modified: trunk/tests/src/org/hornetq/tests/integration/client/HeuristicXATest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/HeuristicXATest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/HeuristicXATest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -32,7 +32,7 @@
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.core.transaction.impl.XidImpl;
import org.hornetq.tests.integration.management.ManagementControlHelper;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A HeuristicXATest
Modified: trunk/tests/src/org/hornetq/tests/integration/client/HornetQCrashTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/HornetQCrashTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/HornetQCrashTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -21,7 +21,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
import org.hornetq.spi.core.protocol.RemotingConnection;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/InVMNonPersistentMessageBufferTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/InVMNonPersistentMessageBufferTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/InVMNonPersistentMessageBufferTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -18,8 +18,8 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.protocol.core.impl.PacketImpl;
import org.hornetq.core.server.HornetQServer;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.utils.DataConstants;
public class InVMNonPersistentMessageBufferTest extends ServiceTestBase
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/IncompatibleVersionTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/IncompatibleVersionTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/IncompatibleVersionTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -14,14 +14,13 @@
package org.hornetq.tests.integration.client;
import static org.hornetq.tests.util.RandomUtil.randomString;
+
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.SpawnedVMSupport;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.Properties;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.TransportConfiguration;
@@ -37,12 +36,10 @@
import org.hornetq.core.protocol.core.Packet;
import org.hornetq.core.protocol.core.impl.wireformat.CreateSessionMessage;
import org.hornetq.core.protocol.core.impl.wireformat.CreateSessionResponseMessage;
-import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
import org.hornetq.core.remoting.server.impl.RemotingServiceImpl;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
import org.hornetq.core.version.impl.VersionImpl;
-import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.utils.VersionLoader;
/**
Modified: trunk/tests/src/org/hornetq/tests/integration/client/JournalCrashTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/JournalCrashTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/JournalCrashTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -26,7 +26,7 @@
import org.hornetq.core.journal.impl.JournalImpl;
import org.hornetq.core.journal.impl.NIOSequentialFileFactory;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.SpawnedVMSupport;
/**
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/MessageConcurrencyTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/MessageConcurrencyTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/MessageConcurrencyTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -21,8 +21,8 @@
import org.hornetq.api.core.client.*;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
/**
*
Modified: trunk/tests/src/org/hornetq/tests/integration/client/MessageCounterTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/MessageCounterTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/MessageCounterTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -18,7 +18,7 @@
import org.hornetq.api.core.client.*;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified: trunk/tests/src/org/hornetq/tests/integration/client/MessageDurabilityTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/MessageDurabilityTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/MessageDurabilityTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -19,8 +19,8 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.client.*;
import org.hornetq.core.server.HornetQServer;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified: trunk/tests/src/org/hornetq/tests/integration/client/MessageExpirationTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/MessageExpirationTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/MessageExpirationTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -22,7 +22,7 @@
import org.hornetq.core.server.Queue;
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A MessageExpirationTest
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingConnectionFactoryTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -23,11 +23,10 @@
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.*;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified: trunk/tests/src/org/hornetq/tests/integration/client/MessageHandlerTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/MessageHandlerTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/MessageHandlerTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -21,7 +21,7 @@
import org.hornetq.api.core.client.*;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified: trunk/tests/src/org/hornetq/tests/integration/client/MessagePriorityTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/MessagePriorityTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/MessagePriorityTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -19,14 +19,12 @@
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.*;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
-import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified: trunk/tests/src/org/hornetq/tests/integration/client/MessageRateTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/MessageRateTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/MessageRateTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -22,7 +22,7 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.client.*;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A MessageRateTest
Modified: trunk/tests/src/org/hornetq/tests/integration/client/OrderTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/OrderTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/OrderTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -24,7 +24,7 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.settings.impl.AddressSettings;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A OrderTest
Modified: trunk/tests/src/org/hornetq/tests/integration/client/PagingOrderTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/PagingOrderTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/PagingOrderTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -36,24 +36,21 @@
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.api.jms.HornetQJMSClient;
import org.hornetq.api.jms.JMSFactoryType;
-import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.paging.PagingStore;
-import org.hornetq.core.persistence.impl.journal.OperationContextImpl;
import org.hornetq.core.postoffice.Binding;
import org.hornetq.core.postoffice.Bindings;
import org.hornetq.core.postoffice.impl.LocalQueueBinding;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.Queue;
-import org.hornetq.core.server.ServerSession;
import org.hornetq.core.server.impl.QueueImpl;
import org.hornetq.core.settings.impl.AddressFullMessagePolicy;
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.jms.client.HornetQJMSConnectionFactory;
import org.hornetq.jms.server.impl.JMSServerManagerImpl;
import org.hornetq.tests.unit.util.InVMContext;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A PagingOrderTest.
Modified: trunk/tests/src/org/hornetq/tests/integration/client/PagingSyncTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/PagingSyncTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/PagingSyncTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -15,45 +15,20 @@
import java.nio.ByteBuffer;
import java.util.HashMap;
-import java.util.concurrent.atomic.AtomicInteger;
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.DeliveryMode;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-
import org.hornetq.api.core.HornetQBuffer;
import org.hornetq.api.core.SimpleString;
-import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.api.core.client.ClientConsumer;
import org.hornetq.api.core.client.ClientMessage;
import org.hornetq.api.core.client.ClientProducer;
import org.hornetq.api.core.client.ClientSession;
import org.hornetq.api.core.client.ClientSessionFactory;
import org.hornetq.api.core.client.ServerLocator;
-import org.hornetq.api.jms.HornetQJMSClient;
-import org.hornetq.api.jms.JMSFactoryType;
-import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.logging.Logger;
-import org.hornetq.core.paging.PagingStore;
-import org.hornetq.core.persistence.impl.journal.OperationContextImpl;
-import org.hornetq.core.postoffice.Binding;
-import org.hornetq.core.postoffice.Bindings;
-import org.hornetq.core.postoffice.impl.LocalQueueBinding;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.Queue;
-import org.hornetq.core.server.ServerSession;
-import org.hornetq.core.server.impl.QueueImpl;
-import org.hornetq.core.settings.impl.AddressFullMessagePolicy;
import org.hornetq.core.settings.impl.AddressSettings;
-import org.hornetq.jms.client.HornetQJMSConnectionFactory;
-import org.hornetq.jms.server.impl.JMSServerManagerImpl;
-import org.hornetq.tests.unit.util.InVMContext;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A PagingOrderTest.
Modified: trunk/tests/src/org/hornetq/tests/integration/client/PagingTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/PagingTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/PagingTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -53,7 +53,7 @@
import org.hornetq.core.server.impl.HornetQServerImpl;
import org.hornetq.core.settings.impl.AddressFullMessagePolicy;
import org.hornetq.core.settings.impl.AddressSettings;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified: trunk/tests/src/org/hornetq/tests/integration/client/ProducerCloseTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/ProducerCloseTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/ProducerCloseTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -18,13 +18,11 @@
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.*;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
-import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/ProducerFlowControlTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/ProducerFlowControlTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/ProducerFlowControlTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -38,8 +38,8 @@
import org.hornetq.core.settings.HierarchicalRepository;
import org.hornetq.core.settings.impl.AddressFullMessagePolicy;
import org.hornetq.core.settings.impl.AddressSettings;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified: trunk/tests/src/org/hornetq/tests/integration/client/ProducerTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/ProducerTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/ProducerTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -26,7 +26,7 @@
import org.hornetq.core.protocol.core.impl.PacketImpl;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.spi.core.protocol.RemotingConnection;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified: trunk/tests/src/org/hornetq/tests/integration/client/QueueBrowserTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/QueueBrowserTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/QueueBrowserTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -15,12 +15,11 @@
import junit.framework.Assert;
import org.hornetq.api.core.SimpleString;
-import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.*;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.Queue;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified: trunk/tests/src/org/hornetq/tests/integration/client/ReceiveImmediateTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/ReceiveImmediateTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/ReceiveImmediateTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -29,7 +29,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
import org.hornetq.core.server.Queue;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified: trunk/tests/src/org/hornetq/tests/integration/client/ReceiveTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/ReceiveTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/ReceiveTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -18,7 +18,7 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.client.*;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/RedeliveryConsumerTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/RedeliveryConsumerTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/RedeliveryConsumerTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -35,7 +35,7 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.persistence.impl.journal.JournalStorageManager;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A RedeliveryConsumerTest
Modified: trunk/tests/src/org/hornetq/tests/integration/client/RoutingTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/RoutingTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/RoutingTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -17,7 +17,7 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.client.*;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/SelfExpandingBufferTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/SelfExpandingBufferTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/SelfExpandingBufferTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -20,8 +20,8 @@
import org.hornetq.api.core.client.*;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/ServerLocatorConnectTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/ServerLocatorConnectTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/ServerLocatorConnectTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -21,7 +21,7 @@
import org.hornetq.core.client.impl.ServerLocatorInternal;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
Modified: trunk/tests/src/org/hornetq/tests/integration/client/SessionCloseOnGCTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/SessionCloseOnGCTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/SessionCloseOnGCTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -22,7 +22,7 @@
import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/SessionCreateAndDeleteQueueTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/SessionCreateAndDeleteQueueTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/SessionCreateAndDeleteQueueTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -23,7 +23,7 @@
import org.hornetq.core.server.Queue;
import org.hornetq.core.server.impl.LastValueQueue;
import org.hornetq.core.settings.impl.AddressSettings;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/SessionCreateConsumerTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/SessionCreateConsumerTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/SessionCreateConsumerTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -20,7 +20,7 @@
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.client.impl.ClientSessionInternal;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/SessionCreateProducerTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/SessionCreateProducerTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/SessionCreateProducerTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -20,7 +20,7 @@
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.client.impl.ClientSessionInternal;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified: trunk/tests/src/org/hornetq/tests/integration/client/SessionFactoryTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/SessionFactoryTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/SessionFactoryTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -34,8 +34,8 @@
import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
import org.hornetq.core.server.HornetQServer;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
/**
*
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/SessionSendAcknowledgementHandlerTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/SessionSendAcknowledgementHandlerTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/SessionSendAcknowledgementHandlerTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -23,7 +23,7 @@
import org.hornetq.api.core.client.*;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A SendAcknowledgementsTest
Modified: trunk/tests/src/org/hornetq/tests/integration/client/SessionStopStartTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/SessionStopStartTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/SessionStopStartTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -21,7 +21,7 @@
import org.hornetq.api.core.client.*;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified: trunk/tests/src/org/hornetq/tests/integration/client/SessionTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/SessionTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/client/SessionTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -27,7 +27,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.Queue;
import org.hornetq.spi.core.protocol.RemotingConnection;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* This test covers the API for ClientSession altho XA tests are tested seperately.
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/SimpleSendMultipleQueues.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/SimpleSendMultipleQueues.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/SimpleSendMultipleQueues.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -18,7 +18,7 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
*
Modified: trunk/tests/src/org/hornetq/tests/integration/client/TemporaryQueueTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/TemporaryQueueTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/TemporaryQueueTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -31,12 +31,11 @@
import org.hornetq.core.protocol.core.impl.PacketImpl;
import org.hornetq.core.protocol.core.impl.RemotingConnectionImpl;
import org.hornetq.core.remoting.CloseListener;
-import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
import org.hornetq.core.remoting.server.impl.RemotingServiceImpl;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.spi.core.protocol.RemotingConnection;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/TransactionDurabilityTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/TransactionDurabilityTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/TransactionDurabilityTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -20,7 +20,7 @@
import org.hornetq.core.config.Configuration;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
*
Modified: trunk/tests/src/org/hornetq/tests/integration/client/TransactionalSendTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/TransactionalSendTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/client/TransactionalSendTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -21,7 +21,7 @@
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.Queue;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified: trunk/tests/src/org/hornetq/tests/integration/clientcrash/ClientTestBase.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/clientcrash/ClientTestBase.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/clientcrash/ClientTestBase.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -17,7 +17,7 @@
import org.hornetq.core.config.Configuration;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A ClientTestBase
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/NodeManagerTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/NodeManagerTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/NodeManagerTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -15,7 +15,7 @@
import org.hornetq.core.server.NodeManager;
import org.hornetq.core.server.impl.InVMNodeManager;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import java.util.ArrayList;
import java.util.List;
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeStartTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeStartTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeStartTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -20,7 +20,6 @@
import junit.framework.Assert;
-import org.hornetq.api.core.Pair;
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.*;
@@ -32,7 +31,7 @@
import org.hornetq.core.remoting.impl.netty.NettyConnectorFactory;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.cluster.Bridge;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A BridgeStartTest
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -42,7 +42,7 @@
import org.hornetq.core.server.Queue;
import org.hornetq.core.server.cluster.impl.BridgeImpl;
import org.hornetq.core.transaction.impl.TransactionImpl;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
import org.hornetq.utils.LinkedListIterator;
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeWithDiscoveryGroupStartTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeWithDiscoveryGroupStartTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeWithDiscoveryGroupStartTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -39,7 +39,7 @@
import org.hornetq.core.remoting.impl.netty.TransportConstants;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.cluster.Bridge;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A BridgeWithDiscoveryGroupStartTest
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -38,7 +38,6 @@
import org.hornetq.core.config.BroadcastGroupConfiguration;
import org.hornetq.core.config.ClusterConnectionConfiguration;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.postoffice.Binding;
import org.hornetq.core.postoffice.Bindings;
@@ -55,7 +54,7 @@
import org.hornetq.core.server.group.GroupingHandler;
import org.hornetq.core.server.group.impl.GroupingHandlerConfiguration;
import org.hornetq.core.server.impl.InVMNodeManager;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -32,7 +32,7 @@
import org.hornetq.core.server.cluster.impl.ClusterManagerImpl;
import org.hornetq.spi.core.protocol.RemotingConnection;
import org.hornetq.tests.integration.cluster.distribution.ClusterTestBase;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
*
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -44,7 +44,7 @@
import org.hornetq.core.server.impl.InVMNodeManager;
import org.hornetq.tests.integration.cluster.util.SameProcessHornetQServer;
import org.hornetq.tests.integration.cluster.util.TestableServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A FailoverTestBase
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverReplicationTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverReplicationTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverReplicationTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -12,17 +12,6 @@
*/
package org.hornetq.tests.integration.cluster.failover;
-import java.util.Map;
-
-import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.server.HornetQServer;
-import org.hornetq.core.server.HornetQServers;
-import org.hornetq.core.server.JournalType;
-import org.hornetq.tests.util.ServiceTestBase;
-
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
* Created Oct 26, 2009
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverSharedServerTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverSharedServerTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverSharedServerTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -12,16 +12,6 @@
*/
package org.hornetq.tests.integration.cluster.failover;
-import java.util.Map;
-
-import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
-import org.hornetq.core.server.HornetQServer;
-import org.hornetq.core.server.HornetQServers;
-import org.hornetq.core.server.impl.InVMNodeManager;
-import org.hornetq.tests.util.ServiceTestBase;
-
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
* Created Oct 26, 2009
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -36,7 +36,7 @@
import org.hornetq.core.client.impl.ServerLocatorInternal;
import org.hornetq.jms.client.HornetQTextMessage;
import org.hornetq.tests.integration.cluster.util.TestableServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A MultipleBackupsFailoverTestBase
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadReattachSupport.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadReattachSupport.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/MultiThreadReattachSupport.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -29,7 +29,7 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.protocol.core.impl.RemotingConnectionImpl;
import org.hornetq.core.remoting.impl.invm.InVMConnector;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/OrderReattachTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/OrderReattachTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/OrderReattachTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -30,7 +30,7 @@
import org.hornetq.core.protocol.core.impl.RemotingConnectionImpl;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.jms.client.HornetQTextMessage;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A OrderReattachTest
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/RandomReattachTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/RandomReattachTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/RandomReattachTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -31,13 +31,12 @@
import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
import org.hornetq.core.client.impl.ClientSessionInternal;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.remoting.impl.invm.InVMRegistry;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
import org.hornetq.jms.client.HornetQTextMessage;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/ReattachTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/ReattachTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/ReattachTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -30,7 +30,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.jms.client.HornetQTextMessage;
import org.hornetq.spi.core.protocol.RemotingConnection;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
*
Modified:
trunk/tests/src/org/hornetq/tests/integration/core/deployers/impl/QueueDeployerTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/core/deployers/impl/QueueDeployerTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/core/deployers/impl/QueueDeployerTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -14,7 +14,6 @@
package org.hornetq.tests.integration.core.deployers.impl;
import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.deployers.DeploymentManager;
import org.hornetq.core.deployers.impl.FileDeploymentManager;
import org.hornetq.core.deployers.impl.QueueDeployer;
@@ -22,9 +21,7 @@
import org.hornetq.core.postoffice.Bindings;
import org.hornetq.core.postoffice.impl.LocalQueueBinding;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.core.server.impl.HornetQServerImpl;
-import org.hornetq.tests.util.ServiceTestBase;
-import org.hornetq.tests.util.UnitTestCase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
Modified: trunk/tests/src/org/hornetq/tests/integration/divert/DivertTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/divert/DivertTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/divert/DivertTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -26,7 +26,7 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified: trunk/tests/src/org/hornetq/tests/integration/divert/PersistentDivertTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/divert/PersistentDivertTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/divert/PersistentDivertTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -26,7 +26,7 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -40,7 +40,6 @@
import org.hornetq.core.client.impl.ClientSessionInternal;
import org.hornetq.core.config.ClusterConnectionConfiguration;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.remoting.impl.invm.InVMRegistry;
import org.hornetq.core.remoting.impl.invm.TransportConstants;
@@ -58,7 +57,7 @@
import org.hornetq.tests.integration.jms.server.management.JMSUtil;
import org.hornetq.tests.unit.util.InVMContext;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
*
Modified:
trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerDeployerTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerDeployerTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerDeployerTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -24,7 +24,6 @@
import org.hornetq.api.core.DiscoveryGroupConfiguration;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.deployers.DeploymentManager;
import org.hornetq.core.deployers.impl.FileDeploymentManager;
import org.hornetq.core.logging.Logger;
@@ -35,7 +34,7 @@
import org.hornetq.jms.server.impl.JMSServerDeployer;
import org.hornetq.jms.server.impl.JMSServerManagerImpl;
import org.hornetq.tests.unit.util.InVMContext;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
import org.w3c.dom.Element;
Modified:
trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerStartStopTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerStartStopTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerStartStopTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -35,7 +35,6 @@
import org.hornetq.jms.server.impl.JMSServerManagerImpl;
import org.hornetq.spi.core.security.HornetQSecurityManager;
import org.hornetq.spi.core.security.HornetQSecurityManagerImpl;
-import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified:
trunk/tests/src/org/hornetq/tests/integration/jms/server/config/JMSConfigurationTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/jms/server/config/JMSConfigurationTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/jms/server/config/JMSConfigurationTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -36,8 +36,8 @@
import org.hornetq.jms.server.config.impl.TopicConfigurationImpl;
import org.hornetq.jms.server.impl.JMSServerManagerImpl;
import org.hornetq.tests.unit.util.InVMContext;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
import java.util.ArrayList;
import java.util.List;
Modified:
trunk/tests/src/org/hornetq/tests/integration/jms/server/config/JMSServerConfigParserTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/jms/server/config/JMSServerConfigParserTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/jms/server/config/JMSServerConfigParserTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -24,7 +24,7 @@
import org.hornetq.jms.server.config.JMSQueueConfiguration;
import org.hornetq.jms.server.config.TopicConfiguration;
import org.hornetq.jms.server.impl.JMSServerConfigParserImpl;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A JMSServerConfigParserTest
Modified:
trunk/tests/src/org/hornetq/tests/integration/largemessage/LargeMessageTestBase.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/largemessage/LargeMessageTestBase.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/largemessage/LargeMessageTestBase.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -35,7 +35,7 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.Queue;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
import org.hornetq.utils.DataConstants;
Modified:
trunk/tests/src/org/hornetq/tests/integration/largemessage/ServerLargeMessageTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/largemessage/ServerLargeMessageTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/largemessage/ServerLargeMessageTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -26,7 +26,7 @@
import org.hornetq.core.persistence.impl.journal.JournalStorageManager;
import org.hornetq.core.persistence.impl.journal.LargeServerMessageImpl;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified: trunk/tests/src/org/hornetq/tests/integration/logging/LogDelegateTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/logging/LogDelegateTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/logging/LogDelegateTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -16,14 +16,13 @@
import junit.framework.Assert;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.logging.impl.JULLogDelegate;
import org.hornetq.core.logging.impl.JULLogDelegateFactory;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.integration.logging.Log4jLogDelegate;
import org.hornetq.integration.logging.Log4jLogDelegateFactory;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A LogDelegateTest
Modified:
trunk/tests/src/org/hornetq/tests/integration/management/ManagementTestBase.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/management/ManagementTestBase.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/management/ManagementTestBase.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -23,7 +23,7 @@
import org.hornetq.api.core.client.ClientConsumer;
import org.hornetq.api.core.client.ClientMessage;
import org.hornetq.api.core.client.ClientSession;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A ManagementTestBase
Modified: trunk/tests/src/org/hornetq/tests/integration/paging/PagingCounterTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/paging/PagingCounterTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/paging/PagingCounterTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -29,7 +29,7 @@
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.core.transaction.Transaction;
import org.hornetq.core.transaction.impl.TransactionImpl;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A PagingCounterTest
Modified: trunk/tests/src/org/hornetq/tests/integration/paging/PagingSendTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/paging/PagingSendTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/paging/PagingSendTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -28,7 +28,7 @@
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.settings.impl.AddressSettings;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A SendTest
Modified:
trunk/tests/src/org/hornetq/tests/integration/persistence/DeleteQueueRestartTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/persistence/DeleteQueueRestartTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/persistence/DeleteQueueRestartTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -21,7 +21,7 @@
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.client.*;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A DeleteMessagesRestartTest
Modified: trunk/tests/src/org/hornetq/tests/integration/persistence/ExportFormatTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/persistence/ExportFormatTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/persistence/ExportFormatTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -24,7 +24,7 @@
import org.hornetq.core.journal.impl.ExportJournal;
import org.hornetq.core.journal.impl.ImportJournal;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A ExportFormatTest
Modified: trunk/tests/src/org/hornetq/tests/integration/persistence/RestartSMTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/persistence/RestartSMTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/persistence/RestartSMTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -27,10 +27,9 @@
import org.hornetq.core.persistence.QueueBindingInfo;
import org.hornetq.core.persistence.impl.journal.JournalStorageManager;
import org.hornetq.core.postoffice.PostOffice;
-import org.hornetq.core.server.JournalType;
import org.hornetq.core.server.Queue;
import org.hornetq.tests.unit.core.server.impl.fakes.FakePostOffice;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.utils.ExecutorFactory;
import org.hornetq.utils.OrderedExecutorFactory;
Modified:
trunk/tests/src/org/hornetq/tests/integration/persistence/StorageManagerTestBase.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/persistence/StorageManagerTestBase.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/persistence/StorageManagerTestBase.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -28,7 +28,7 @@
import org.hornetq.jms.persistence.JMSStorageManager;
import org.hornetq.jms.persistence.impl.journal.JMSJournalStorageManagerImpl;
import org.hornetq.tests.unit.core.server.impl.fakes.FakePostOffice;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.utils.ExecutorFactory;
import org.hornetq.utils.OrderedExecutorFactory;
import org.hornetq.utils.TimeAndCounterIDGenerator;
Modified: trunk/tests/src/org/hornetq/tests/integration/ra/HornetQRATestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/ra/HornetQRATestBase.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/ra/HornetQRATestBase.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -17,7 +17,7 @@
import org.hornetq.core.config.Configuration;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.jms.client.HornetQMessage;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import javax.jms.Message;
import javax.jms.MessageListener;
Modified: trunk/tests/src/org/hornetq/tests/integration/remoting/BatchDelayTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/remoting/BatchDelayTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/remoting/BatchDelayTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -19,13 +19,11 @@
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.*;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory;
-import org.hornetq.core.remoting.impl.netty.NettyConnectorFactory;
import org.hornetq.core.remoting.impl.netty.TransportConstants;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
*
Modified: trunk/tests/src/org/hornetq/tests/integration/remoting/DestroyConsumerTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/remoting/DestroyConsumerTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/remoting/DestroyConsumerTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -13,7 +13,7 @@
package org.hornetq.tests.integration.remoting;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
public class DestroyConsumerTest extends ServiceTestBase
{
Modified: trunk/tests/src/org/hornetq/tests/integration/remoting/DirectDeliverTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/remoting/DirectDeliverTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/remoting/DirectDeliverTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -26,7 +26,6 @@
import org.hornetq.api.core.client.HornetQClient;
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.postoffice.Binding;
import org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory;
@@ -35,7 +34,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.Queue;
import org.hornetq.core.server.impl.QueueImpl;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
*
Modified:
trunk/tests/src/org/hornetq/tests/integration/remoting/NetworkAddressTestBase.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/remoting/NetworkAddressTestBase.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/remoting/NetworkAddressTestBase.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -27,14 +27,12 @@
import junit.framework.Assert;
import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.api.core.client.ClientSession;
import org.hornetq.api.core.client.ClientSessionFactory;
import org.hornetq.api.core.client.HornetQClient;
import org.hornetq.api.core.client.ServerLocator;
-import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A NetworkAddressTest
Modified: trunk/tests/src/org/hornetq/tests/integration/remoting/PingTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/remoting/PingTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/remoting/PingTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -34,7 +34,7 @@
import org.hornetq.core.remoting.server.impl.RemotingServiceImpl;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.spi.core.protocol.RemotingConnection;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
Modified: trunk/tests/src/org/hornetq/tests/integration/remoting/ReconnectTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/remoting/ReconnectTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/remoting/ReconnectTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -26,7 +26,7 @@
import org.hornetq.core.client.impl.ClientSessionInternal;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A ReconnectSimpleTest
Modified:
trunk/tests/src/org/hornetq/tests/integration/remoting/SynchronousCloseTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/remoting/SynchronousCloseTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/remoting/SynchronousCloseTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -22,10 +22,8 @@
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
-import org.hornetq.core.remoting.impl.netty.NettyConnectorFactory;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
*
Modified: trunk/tests/src/org/hornetq/tests/integration/replication/ReplicationTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/replication/ReplicationTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/replication/ReplicationTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -66,7 +66,7 @@
import org.hornetq.core.settings.HierarchicalRepository;
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.spi.core.protocol.RemotingConnection;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.utils.ExecutorFactory;
import org.hornetq.utils.HornetQThreadFactory;
import org.hornetq.utils.OrderedExecutorFactory;
Modified:
trunk/tests/src/org/hornetq/tests/integration/scheduling/DelayedMessageTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/scheduling/DelayedMessageTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/scheduling/DelayedMessageTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -20,7 +20,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.jms.client.HornetQTextMessage;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified:
trunk/tests/src/org/hornetq/tests/integration/scheduling/ScheduledMessageTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/scheduling/ScheduledMessageTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/scheduling/ScheduledMessageTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -26,7 +26,7 @@
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.core.transaction.impl.XidImpl;
import org.hornetq.jms.client.HornetQTextMessage;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
import org.hornetq.utils.UUIDGenerator;
Modified: trunk/tests/src/org/hornetq/tests/integration/security/SecurityTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/security/SecurityTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/security/SecurityTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -41,7 +41,7 @@
import org.hornetq.core.settings.HierarchicalRepository;
import org.hornetq.spi.core.security.HornetQSecurityManager;
import org.hornetq.spi.core.security.JAASSecurityManager;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.jboss.security.SimpleGroup;
/**
Modified: trunk/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/server/ExpiryRunnerTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -31,7 +31,7 @@
import org.hornetq.core.server.HornetQServers;
import org.hornetq.core.server.Queue;
import org.hornetq.core.settings.impl.AddressSettings;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified: trunk/tests/src/org/hornetq/tests/integration/server/LVQRecoveryTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/server/LVQRecoveryTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/server/LVQRecoveryTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -26,7 +26,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.core.transaction.impl.XidImpl;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
Modified: trunk/tests/src/org/hornetq/tests/integration/server/LVQTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/server/LVQTest.java 2011-04-08 10:24:03
UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/server/LVQTest.java 2011-04-08 12:18:13
UTC (rev 10469)
@@ -24,7 +24,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
import org.hornetq.core.settings.impl.AddressSettings;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
/**
Modified: trunk/tests/src/org/hornetq/tests/integration/server/PredefinedQueueTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/server/PredefinedQueueTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/integration/server/PredefinedQueueTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -28,7 +28,7 @@
import org.hornetq.core.postoffice.Bindings;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
*
Modified: trunk/tests/src/org/hornetq/tests/integration/twitter/TwitterTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/twitter/TwitterTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/twitter/TwitterTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -36,7 +36,7 @@
import org.hornetq.integration.twitter.TwitterConstants;
import org.hornetq.integration.twitter.TwitterIncomingConnectorServiceFactory;
import org.hornetq.integration.twitter.TwitterOutgoingConnectorServiceFactory;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
import twitter4j.*;
import twitter4j.http.AccessToken;
Modified: trunk/tests/src/org/hornetq/tests/integration/xa/BasicXaRecoveryTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/xa/BasicXaRecoveryTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/xa/BasicXaRecoveryTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -35,7 +35,7 @@
import org.hornetq.jms.client.HornetQBytesMessage;
import org.hornetq.jms.client.HornetQTextMessage;
import org.hornetq.tests.integration.management.ManagementControlHelper;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.UnitTestCase;
import org.hornetq.utils.UUIDGenerator;
Modified: trunk/tests/src/org/hornetq/tests/integration/xa/BasicXaTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/xa/BasicXaTest.java 2011-04-08 10:24:03
UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/integration/xa/BasicXaTest.java 2011-04-08 12:18:13
UTC (rev 10469)
@@ -31,7 +31,7 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.core.transaction.impl.XidImpl;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.utils.UUIDGenerator;
/**
Modified:
trunk/tests/src/org/hornetq/tests/performance/paging/MeasurePagingMultiThreadTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/performance/paging/MeasurePagingMultiThreadTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/performance/paging/MeasurePagingMultiThreadTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -22,7 +22,7 @@
import org.hornetq.core.config.Configuration;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.settings.impl.AddressSettings;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A MeasurePagingMultiThreadTest
Modified: trunk/tests/src/org/hornetq/tests/soak/client/ClientNonDivertedSoakTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/soak/client/ClientNonDivertedSoakTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/soak/client/ClientNonDivertedSoakTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -25,7 +25,7 @@
import org.hornetq.core.config.Configuration;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.settings.impl.AddressSettings;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A ClientSoakTest
Modified: trunk/tests/src/org/hornetq/tests/soak/client/ClientSoakTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/soak/client/ClientSoakTest.java 2011-04-08 10:24:03
UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/soak/client/ClientSoakTest.java 2011-04-08 12:18:13
UTC (rev 10469)
@@ -27,7 +27,7 @@
import org.hornetq.core.config.DivertConfiguration;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.settings.impl.AddressSettings;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A ClientSoakTest
Modified: trunk/tests/src/org/hornetq/tests/soak/client/SimpleSendReceiveSoakTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/soak/client/SimpleSendReceiveSoakTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/soak/client/SimpleSendReceiveSoakTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -25,7 +25,7 @@
import org.hornetq.core.config.Configuration;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.settings.impl.AddressSettings;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A ClientSoakTest
Modified: trunk/tests/src/org/hornetq/tests/stress/client/SendStressTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/stress/client/SendStressTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/stress/client/SendStressTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -17,7 +17,7 @@
import org.hornetq.api.core.client.*;
import org.hornetq.core.server.HornetQServer;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A SendStressTest
Modified: trunk/tests/src/org/hornetq/tests/stress/journal/CompactingStressTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/stress/journal/CompactingStressTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/stress/journal/CompactingStressTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -26,7 +26,7 @@
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.JournalType;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A CompactingTest
Modified:
trunk/tests/src/org/hornetq/tests/stress/journal/JournalCleanupCompactStressTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/stress/journal/JournalCleanupCompactStressTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/stress/journal/JournalCleanupCompactStressTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -40,8 +40,8 @@
import org.hornetq.core.journal.impl.JournalImpl;
import org.hornetq.core.journal.impl.NIOSequentialFileFactory;
import org.hornetq.core.persistence.impl.journal.OperationContextImpl;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.utils.HornetQThreadFactory;
import org.hornetq.utils.OrderedExecutorFactory;
import org.hornetq.utils.SimpleIDGenerator;
Modified: trunk/tests/src/org/hornetq/tests/stress/journal/JournalRestartStressTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/stress/journal/JournalRestartStressTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/stress/journal/JournalRestartStressTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -25,7 +25,7 @@
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* Simulates the journal being updated, compacted cleared up,
Modified: trunk/tests/src/org/hornetq/tests/stress/journal/LargeJournalStressTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/stress/journal/LargeJournalStressTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/stress/journal/LargeJournalStressTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -24,7 +24,7 @@
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.JournalType;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A LargeJournalStressTest
Modified:
trunk/tests/src/org/hornetq/tests/stress/journal/MultiThreadConsumerStressTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/stress/journal/MultiThreadConsumerStressTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/stress/journal/MultiThreadConsumerStressTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -25,7 +25,7 @@
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.JournalType;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A MultiThreadConsumerStressTest
Modified:
trunk/tests/src/org/hornetq/tests/stress/journal/NIOMultiThreadCompactorStressTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/stress/journal/NIOMultiThreadCompactorStressTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++
trunk/tests/src/org/hornetq/tests/stress/journal/NIOMultiThreadCompactorStressTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -35,7 +35,7 @@
import org.hornetq.core.journal.impl.NIOSequentialFileFactory;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.JournalType;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A MultiThreadConsumerStressTest
Modified: trunk/tests/src/org/hornetq/tests/stress/paging/PageCursorStressTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/stress/paging/PageCursorStressTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/stress/paging/PageCursorStressTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -50,7 +50,7 @@
import org.hornetq.core.transaction.impl.TransactionImpl;
import org.hornetq.tests.unit.core.postoffice.impl.FakeQueue;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
import org.hornetq.utils.LinkedListIterator;
/**
Modified: trunk/tests/src/org/hornetq/tests/stress/paging/PageStressTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/stress/paging/PageStressTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/stress/paging/PageStressTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -28,7 +28,7 @@
import org.hornetq.core.config.Configuration;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.settings.impl.AddressSettings;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* This is an integration-tests that will take some time to run.
Modified: trunk/tests/src/org/hornetq/tests/stress/remote/PingStressTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/stress/remote/PingStressTest.java 2011-04-08
10:24:03 UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/stress/remote/PingStressTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -23,7 +23,6 @@
import org.hornetq.api.core.client.ClientSessionFactory;
import org.hornetq.api.core.client.HornetQClient;
import org.hornetq.api.core.client.ServerLocator;
-import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.protocol.core.Packet;
@@ -32,7 +31,7 @@
import org.hornetq.spi.core.protocol.RemotingConnection;
import org.hornetq.tests.integration.remoting.PingTest;
import org.hornetq.tests.util.RandomUtil;
-import org.hornetq.tests.util.ServiceTestBase;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* @author <a href="mailto:clebert.suconic@jboss.com">Clebert
Suconic</a>
Modified: trunk/tests/src/org/hornetq/tests/util/JMSClusteredTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/util/JMSClusteredTestBase.java 2011-04-08 10:24:03
UTC (rev 10468)
+++ trunk/tests/src/org/hornetq/tests/util/JMSClusteredTestBase.java 2011-04-08 12:18:13
UTC (rev 10469)
@@ -38,6 +38,7 @@
import org.hornetq.jms.server.impl.JMSServerManagerImpl;
import org.hornetq.tests.integration.cluster.distribution.ClusterTestBase;
import org.hornetq.tests.unit.util.InVMContext;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A JMSBaseTest
Modified: trunk/tests/src/org/hornetq/tests/util/JMSTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/util/JMSTestBase.java 2011-04-08 10:24:03 UTC (rev
10468)
+++ trunk/tests/src/org/hornetq/tests/util/JMSTestBase.java 2011-04-08 12:18:13 UTC (rev
10469)
@@ -31,6 +31,7 @@
import org.hornetq.core.server.HornetQServers;
import org.hornetq.jms.server.impl.JMSServerManagerImpl;
import org.hornetq.tests.unit.util.InVMContext;
+import org.hornetq.tests.unit.util.ServiceTestBase;
/**
* A JMSBaseTest
Deleted: trunk/tests/src/org/hornetq/tests/util/RandomUtil.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/util/RandomUtil.java 2011-04-08 10:24:03 UTC (rev
10468)
+++ trunk/tests/src/org/hornetq/tests/util/RandomUtil.java 2011-04-08 12:18:13 UTC (rev
10469)
@@ -1,176 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat 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.
- */
-
-package org.hornetq.tests.util;
-
-import java.util.Random;
-import java.util.UUID;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.HornetQBuffers;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.transaction.impl.XidImpl;
-
-/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public class RandomUtil
-{
- // Constants -----------------------------------------------------
-
- private static final Random random = new Random(System.currentTimeMillis());
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- public static String randomString()
- {
- return UUID.randomUUID().toString();
- }
-
- public static SimpleString randomSimpleString()
- {
- return new SimpleString(RandomUtil.randomString());
- }
-
- public static char randomChar()
- {
- return RandomUtil.randomString().charAt(0);
- }
-
- public static long randomLong()
- {
- return RandomUtil.random.nextLong();
- }
-
- public static long randomPositiveLong()
- {
- return Math.abs(RandomUtil.randomLong());
- }
-
- public static int randomInt()
- {
- return RandomUtil.random.nextInt();
- }
-
- public static int randomPositiveInt()
- {
- return Math.abs(RandomUtil.randomInt());
- }
-
-
- public static HornetQBuffer randomBuffer(final int size, final long... data)
- {
- HornetQBuffer buffer = HornetQBuffers.fixedBuffer(size + 8 * data.length);
-
- for (long d : data)
- {
- buffer.writeLong(d);
- }
-
- for (int i = 0 ; i < size; i++)
- {
- buffer.writeByte((byte)randomByte());
- }
-
- return buffer;
- }
-
-
-
-
- public static int randomInterval(final int min, final int max)
- {
- return min + randomMax(max - min);
- }
-
- public static int randomMax(int max)
- {
- int value = randomPositiveInt() % max;
-
- if (value == 0)
- {
- value = max;
- }
-
- return value;
- }
-
- public static int randomPort()
- {
- return RandomUtil.random.nextInt(65536);
- }
-
- public static short randomShort()
- {
- return (short)RandomUtil.random.nextInt(Short.MAX_VALUE);
- }
-
- public static byte randomByte()
- {
- return Integer.valueOf(RandomUtil.random.nextInt()).byteValue();
- }
-
- public static boolean randomBoolean()
- {
- return RandomUtil.random.nextBoolean();
- }
-
- public static byte[] randomBytes()
- {
- return RandomUtil.randomString().getBytes();
- }
-
- public static byte[] randomBytes(final int length)
- {
- byte[] bytes = new byte[length];
- for (int i = 0; i < bytes.length; i++)
- {
- bytes[i] = RandomUtil.randomByte();
- }
- return bytes;
- }
-
- public static double randomDouble()
- {
- return RandomUtil.random.nextDouble();
- }
-
- public static float randomFloat()
- {
- return RandomUtil.random.nextFloat();
- }
-
- public static Xid randomXid()
- {
- return new XidImpl(RandomUtil.randomBytes(), RandomUtil.randomInt(),
RandomUtil.randomBytes());
- }
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted: trunk/tests/src/org/hornetq/tests/util/ServiceTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/util/ServiceTestBase.java 2011-04-08 10:24:03 UTC
(rev 10468)
+++ trunk/tests/src/org/hornetq/tests/util/ServiceTestBase.java 2011-04-08 12:18:13 UTC
(rev 10469)
@@ -1,572 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat 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.
- */
-
-package org.hornetq.tests.util;
-
-import java.io.File;
-import java.lang.management.ManagementFactory;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.management.MBeanServer;
-
-import junit.framework.Assert;
-
-import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.api.core.client.ClientMessage;
-import org.hornetq.api.core.client.ClientSession;
-import org.hornetq.api.core.client.ClientSessionFactory;
-import org.hornetq.api.core.client.HornetQClient;
-import org.hornetq.api.core.client.ServerLocator;
-import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
-import org.hornetq.core.config.Configuration;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
-import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
-import org.hornetq.core.remoting.impl.invm.InVMRegistry;
-import org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory;
-import org.hornetq.core.remoting.impl.netty.NettyConnectorFactory;
-import org.hornetq.core.server.HornetQServer;
-import org.hornetq.core.server.HornetQServers;
-import org.hornetq.core.server.NodeManager;
-import org.hornetq.core.server.impl.HornetQServerImpl;
-import org.hornetq.core.settings.impl.AddressFullMessagePolicy;
-import org.hornetq.core.settings.impl.AddressSettings;
-import org.hornetq.jms.client.HornetQBytesMessage;
-import org.hornetq.jms.client.HornetQTextMessage;
-import org.hornetq.spi.core.security.HornetQSecurityManager;
-import org.hornetq.spi.core.security.HornetQSecurityManagerImpl;
-
-/**
- *
- * Base class with basic utilities on starting up a basic server
- *
- * @author <a href="mailto:clebert.suconic@jboss.com">Clebert
Suconic</a>
- *
- */
-public abstract class ServiceTestBase extends UnitTestCase
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- protected static final String INVM_ACCEPTOR_FACTORY =
InVMAcceptorFactory.class.getCanonicalName();
-
- public static final String INVM_CONNECTOR_FACTORY =
InVMConnectorFactory.class.getCanonicalName();
-
- protected static final String NETTY_ACCEPTOR_FACTORY =
NettyAcceptorFactory.class.getCanonicalName();
-
- protected static final String NETTY_CONNECTOR_FACTORY =
NettyConnectorFactory.class.getCanonicalName();
-
- private List<ServerLocator> locators = new ArrayList<ServerLocator>();
-
- @Override
- protected void tearDown() throws Exception
- {
- for (ServerLocator locator : locators)
- {
- try
- {
- locator.close();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- locators.clear();
- super.tearDown();
- checkFreePort(5445);
- checkFreePort(5446);
- checkFreePort(5447);
- if (InVMRegistry.instance.size() > 0)
- {
- fail("InVMREgistry size > 0");
- }
- }
-
- protected static Map<String, Object> generateParams(final int node, final
boolean netty)
- {
- Map<String, Object> params = new HashMap<String, Object>();
-
- if (netty)
- {
-
params.put(org.hornetq.core.remoting.impl.netty.TransportConstants.PORT_PROP_NAME,
- org.hornetq.core.remoting.impl.netty.TransportConstants.DEFAULT_PORT
+ node);
- }
- else
- {
-
params.put(org.hornetq.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME,
node);
- }
-
- return params;
- }
-
- protected static TransportConfiguration createTransportConfiguration(boolean netty,
- boolean
acceptor,
- Map<String,
Object> params)
- {
- String className;
- if (netty)
- {
- if (acceptor)
- {
- className = NettyAcceptorFactory.class.getName();
- }
- else
- {
- className = NettyConnectorFactory.class.getName();
- }
- }
- else
- {
- if (acceptor)
- {
- className = InVMAcceptorFactory.class.getName();
- }
- else
- {
- className = InVMConnectorFactory.class.getName();
- }
- }
- return new TransportConfiguration(className, params);
- }
-
- // Static --------------------------------------------------------
- private final Logger log = Logger.getLogger(this.getClass());
-
- // Constructors --------------------------------------------------
-
- public ServiceTestBase()
- {
- super();
- }
-
- public ServiceTestBase(final String name)
- {
- super(name);
- }
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- protected HornetQServer createServer(final boolean realFiles,
- final Configuration configuration,
- final int pageSize,
- final int maxAddressSize,
- final Map<String, AddressSettings>
settings,
- final MBeanServer mbeanServer)
- {
- HornetQServer server;
-
- if (realFiles)
- {
- server = HornetQServers.newHornetQServer(configuration, mbeanServer, true);
- }
- else
- {
- server = HornetQServers.newHornetQServer(configuration, mbeanServer, false);
- }
-
- for (Map.Entry<String, AddressSettings> setting : settings.entrySet())
- {
- server.getAddressSettingsRepository().addMatch(setting.getKey(),
setting.getValue());
- }
-
- AddressSettings defaultSetting = new AddressSettings();
- defaultSetting.setPageSizeBytes(pageSize);
- defaultSetting.setMaxSizeBytes(maxAddressSize);
-
- server.getAddressSettingsRepository().addMatch("#", defaultSetting);
-
- return server;
- }
-
- protected HornetQServer createServer(final boolean realFiles,
- final Configuration configuration,
- final int pageSize,
- final int maxAddressSize,
- final Map<String, AddressSettings>
settings)
- {
- return createServer(realFiles, configuration, pageSize, maxAddressSize,
AddressFullMessagePolicy.PAGE, settings);
- }
-
- protected HornetQServer createServer(final boolean realFiles,
- final Configuration configuration,
- final int pageSize,
- final int maxAddressSize,
- final AddressFullMessagePolicy fullPolicy,
- final Map<String, AddressSettings>
settings)
- {
- HornetQServer server;
-
- if (realFiles)
- {
- server = HornetQServers.newHornetQServer(configuration);
- }
- else
- {
- server = HornetQServers.newHornetQServer(configuration, false);
- }
-
- for (Map.Entry<String, AddressSettings> setting : settings.entrySet())
- {
- server.getAddressSettingsRepository().addMatch(setting.getKey(),
setting.getValue());
- }
-
- AddressSettings defaultSetting = new AddressSettings();
- defaultSetting.setPageSizeBytes(pageSize);
- defaultSetting.setMaxSizeBytes(maxAddressSize);
- defaultSetting.setAddressFullMessagePolicy(fullPolicy);
-
- server.getAddressSettingsRepository().addMatch("#", defaultSetting);
-
- return server;
- }
-
- protected HornetQServer createServer(final boolean realFiles,
- final Configuration configuration,
- final MBeanServer mbeanServer,
- final Map<String, AddressSettings>
settings)
- {
- HornetQServer server;
-
- if (realFiles)
- {
- server = HornetQServers.newHornetQServer(configuration, mbeanServer);
- }
- else
- {
- server = HornetQServers.newHornetQServer(configuration, mbeanServer, false);
- }
-
- for (Map.Entry<String, AddressSettings> setting : settings.entrySet())
- {
- server.getAddressSettingsRepository().addMatch(setting.getKey(),
setting.getValue());
- }
-
- AddressSettings defaultSetting = new AddressSettings();
- server.getAddressSettingsRepository().addMatch("#", defaultSetting);
-
- return server;
- }
-
- protected HornetQServer createServer(final boolean realFiles)
- {
- return createServer(realFiles, false);
- }
-
- protected HornetQServer createServer(final boolean realFiles, final boolean netty)
- {
- return createServer(realFiles, createDefaultConfig(netty), -1, -1, new
HashMap<String, AddressSettings>());
- }
-
- protected HornetQServer createServer(final boolean realFiles, final Configuration
configuration)
- {
- return createServer(realFiles, configuration, -1, -1, new HashMap<String,
AddressSettings>());
- }
-
- protected HornetQServer createInVMFailoverServer(final boolean realFiles,
- final Configuration configuration,
- NodeManager nodeManager)
- {
- return createInVMFailoverServer(realFiles,
- configuration,
- -1,
- -1,
- new HashMap<String, AddressSettings>(),
- nodeManager);
- }
-
- protected HornetQServer createInVMFailoverServer(final boolean realFiles,
- final Configuration configuration,
- final int pageSize,
- final int maxAddressSize,
- final Map<String,
AddressSettings> settings,
- NodeManager nodeManager)
- {
- HornetQServer server;
- HornetQSecurityManager securityManager = new HornetQSecurityManagerImpl();
- configuration.setPersistenceEnabled(realFiles);
- server = new InVMNodeManagerServer(configuration,
- ManagementFactory.getPlatformMBeanServer(),
- securityManager,
- nodeManager);
-
- for (Map.Entry<String, AddressSettings> setting : settings.entrySet())
- {
- server.getAddressSettingsRepository().addMatch(setting.getKey(),
setting.getValue());
- }
-
- AddressSettings defaultSetting = new AddressSettings();
- defaultSetting.setPageSizeBytes(pageSize);
- defaultSetting.setMaxSizeBytes(maxAddressSize);
-
- server.getAddressSettingsRepository().addMatch("#", defaultSetting);
-
- return server;
- }
-
- protected HornetQServer createServer(final boolean realFiles,
- final Configuration configuration,
- final HornetQSecurityManager securityManager)
- {
- HornetQServer server;
-
- if (realFiles)
- {
- server = HornetQServers.newHornetQServer(configuration,
-
ManagementFactory.getPlatformMBeanServer(),
- securityManager);
- }
- else
- {
- server = HornetQServers.newHornetQServer(configuration,
-
ManagementFactory.getPlatformMBeanServer(),
- securityManager,
- false);
- }
-
- Map<String, AddressSettings> settings = new HashMap<String,
AddressSettings>();
-
- for (Map.Entry<String, AddressSettings> setting : settings.entrySet())
- {
- server.getAddressSettingsRepository().addMatch(setting.getKey(),
setting.getValue());
- }
-
- AddressSettings defaultSetting = new AddressSettings();
-
- server.getAddressSettingsRepository().addMatch("#", defaultSetting);
-
- return server;
- }
-
- protected HornetQServer createClusteredServerWithParams(final boolean isNetty,
- final int index,
- final boolean realFiles,
- final Map<String,
Object> params)
- {
- if (isNetty)
- {
- return createServer(realFiles,
- createClusteredDefaultConfig(index, params,
NETTY_ACCEPTOR_FACTORY),
- -1,
- -1,
- new HashMap<String, AddressSettings>());
- }
- else
- {
- return createServer(realFiles,
- createClusteredDefaultConfig(index, params,
INVM_ACCEPTOR_FACTORY),
- -1,
- -1,
- new HashMap<String, AddressSettings>());
- }
- }
-
- protected HornetQServer createClusteredServerWithParams(final boolean isNetty,
- final int index,
- final boolean realFiles,
- final int pageSize,
- final int maxAddressSize,
- final Map<String,
Object> params)
- {
- if (isNetty)
- {
- return createServer(realFiles,
- createClusteredDefaultConfig(index, params,
NETTY_ACCEPTOR_FACTORY),
- pageSize,
- maxAddressSize,
- new HashMap<String, AddressSettings>());
- }
- else
- {
- return createServer(realFiles,
- createClusteredDefaultConfig(index, params,
INVM_ACCEPTOR_FACTORY),
- -1,
- -1,
- new HashMap<String, AddressSettings>());
- }
- }
-
- protected ServerLocator createFactory(final boolean isNetty) throws Exception
- {
- if (isNetty)
- {
- return createNettyNonHALocator();
- }
- else
- {
- return createInVMNonHALocator();
- }
- }
-
- protected void createQueue(String address, String queue) throws Exception
- {
- ServerLocator locator = createInVMNonHALocator();
- ClientSessionFactory sf = locator.createSessionFactory();
- ClientSession session = sf.createSession();
- session.createQueue(address, queue);
- session.close();
- sf.close();
- locator.close();
- }
-
- protected ServerLocator createInVMNonHALocator()
- {
- return createNonHALocator(false);
- }
-
- protected ServerLocator createNettyNonHALocator()
- {
- return createNonHALocator(true);
- }
-
- protected ServerLocator createNonHALocator(final boolean isNetty)
- {
- ServerLocator locatorWithoutHA = isNetty ?
HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(NETTY_CONNECTOR_FACTORY))
- :
HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(INVM_CONNECTOR_FACTORY));
- locators.add(locatorWithoutHA);
- return locatorWithoutHA;
- }
-
- protected ClientSessionFactoryImpl createFactory(final String connectorClass) throws
Exception
- {
- ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(connectorClass));
- return (ClientSessionFactoryImpl)locator.createSessionFactory();
-
- }
-
- protected ClientMessage createTextMessage(final ClientSession session, final String
s)
- {
- return createTextMessage(session, s, true);
- }
-
- public String getTextMessage(final ClientMessage m)
- {
- m.getBodyBuffer().resetReaderIndex();
- return m.getBodyBuffer().readString();
- }
-
- protected ClientMessage createTextMessage(final ClientSession session, final String s,
final boolean durable)
- {
- ClientMessage message = session.createMessage(HornetQTextMessage.TYPE,
- durable,
- 0,
- System.currentTimeMillis(),
- (byte)1);
- message.getBodyBuffer().writeString(s);
- return message;
- }
-
- protected ClientMessage createBytesMessage(final ClientSession session, final byte[]
b, final boolean durable)
- {
- ClientMessage message = session.createMessage(HornetQBytesMessage.TYPE,
- durable,
- 0,
- System.currentTimeMillis(),
- (byte)1);
- message.getBodyBuffer().writeBytes(b);
- return message;
- }
-
- /**
- * Deleting a file on LargeDire is an asynchronous process. Wee need to keep looking
for a while if the file hasn't been deleted yet
- */
- protected void validateNoFilesOnLargeDir(final int expect) throws Exception
- {
- File largeMessagesFileDir = new File(getLargeMessagesDir());
-
- // Deleting the file is async... we keep looking for a period of the time until the
file is really gone
- long timeout = System.currentTimeMillis() + 5000;
- while (timeout > System.currentTimeMillis() &&
largeMessagesFileDir.listFiles().length != expect)
- {
- Thread.sleep(100);
- }
-
-
- if (expect != largeMessagesFileDir.listFiles().length)
- {
- for (File file : largeMessagesFileDir.listFiles())
- {
- System.out.println("File " + file + " still on ");
- }
- }
-
- Assert.assertEquals(expect, largeMessagesFileDir.listFiles().length);
- }
-
- /**
- * Deleting a file on LargeDire is an asynchronous process. Wee need to keep looking
for a while if the file hasn't been deleted yet
- */
- protected void validateNoFilesOnLargeDir() throws Exception
- {
- validateNoFilesOnLargeDir(0);
- }
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
- class InVMNodeManagerServer extends HornetQServerImpl
- {
- final NodeManager nodeManager;
-
- public InVMNodeManagerServer(NodeManager nodeManager)
- {
- super();
- this.nodeManager = nodeManager;
- }
-
- public InVMNodeManagerServer(Configuration configuration, NodeManager nodeManager)
- {
- super(configuration);
- this.nodeManager = nodeManager;
- }
-
- public InVMNodeManagerServer(Configuration configuration, MBeanServer mbeanServer,
NodeManager nodeManager)
- {
- super(configuration, mbeanServer);
- this.nodeManager = nodeManager;
- }
-
- public InVMNodeManagerServer(Configuration configuration,
- HornetQSecurityManager securityManager,
- NodeManager nodeManager)
- {
- super(configuration, securityManager);
- this.nodeManager = nodeManager;
- }
-
- public InVMNodeManagerServer(Configuration configuration,
- MBeanServer mbeanServer,
- HornetQSecurityManager securityManager,
- NodeManager nodeManager)
- {
- super(configuration, mbeanServer, securityManager);
- this.nodeManager = nodeManager;
- }
-
- @Override
- protected NodeManager createNodeManager(String directory)
- {
- return nodeManager;
- }
-
- }
-}
Deleted: trunk/tests/src/org/hornetq/tests/util/UnitTestCase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-04-08 10:24:03 UTC (rev
10468)
+++ trunk/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-04-08 12:18:13 UTC (rev
10469)
@@ -1,1245 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat 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.
- */
-
-package org.hornetq.tests.util;
-
-import java.beans.BeanInfo;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.lang.ref.Reference;
-import java.lang.ref.WeakReference;
-import java.net.ServerSocket;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-
-import javax.naming.Context;
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.Xid;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.HornetQException;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.api.core.client.ClientMessage;
-import org.hornetq.api.core.client.ClientSession;
-import org.hornetq.core.asyncio.impl.AsynchronousFileImpl;
-import org.hornetq.core.client.impl.ServerLocatorImpl;
-import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
-import org.hornetq.core.journal.impl.AIOSequentialFileFactory;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.persistence.impl.journal.OperationContextImpl;
-import org.hornetq.core.postoffice.Binding;
-import org.hornetq.core.postoffice.Bindings;
-import org.hornetq.core.postoffice.PostOffice;
-import org.hornetq.core.postoffice.QueueBinding;
-import org.hornetq.core.postoffice.impl.LocalQueueBinding;
-import org.hornetq.core.remoting.impl.invm.InVMRegistry;
-import org.hornetq.core.server.HornetQServer;
-import org.hornetq.core.server.JournalType;
-import org.hornetq.core.server.MessageReference;
-import org.hornetq.core.server.Queue;
-import org.hornetq.core.server.ServerMessage;
-import org.hornetq.core.server.impl.ServerMessageImpl;
-import org.hornetq.core.transaction.impl.XidImpl;
-import org.hornetq.jms.client.HornetQTextMessage;
-import org.hornetq.utils.UUIDGenerator;
-
-/**
- *
- * Helper base class for our unit tests
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:csuconic@redhat.com">Clebert</a>
- *
- */
-public class UnitTestCase extends TestCase
-{
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(UnitTestCase.class);
-
- public static final String INVM_ACCEPTOR_FACTORY =
"org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory";
-
- public static final String INVM_CONNECTOR_FACTORY =
"org.hornetq.core.remoting.impl.invm.InVMConnectorFactory";
-
- public static final String NETTY_ACCEPTOR_FACTORY =
"org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory";
-
- public static final String NETTY_CONNECTOR_FACTORY =
"org.hornetq.core.remoting.impl.netty.NettyConnectorFactory";
-
- // Attributes ----------------------------------------------------
-
- private static final String testDir = System.getProperty("java.io.tmpdir",
"/tmp") + "/hornetq-unit-test";
-
- // There is a verification about thread leakages. We only fail a single thread when
this happens
- private static Set<Thread> alreadyFailedThread = new HashSet<Thread>();
-
- // Static --------------------------------------------------------
-
- protected Configuration createDefaultConfig()
- {
- return createDefaultConfig(false);
- }
-
- protected Configuration createDefaultConfig(final boolean netty)
- {
- if (netty)
- {
- return createDefaultConfig(new HashMap<String, Object>(),
INVM_ACCEPTOR_FACTORY, NETTY_ACCEPTOR_FACTORY);
- }
- else
- {
- return createDefaultConfig(new HashMap<String, Object>(),
INVM_ACCEPTOR_FACTORY);
- }
- }
-
- protected static Configuration createClusteredDefaultConfig(final int index,
- final Map<String,
Object> params,
- final String...
acceptors)
- {
- Configuration config = createDefaultConfig(index, params, acceptors);
-
- config.setClustered(true);
-
- return config;
- }
-
- protected static Configuration createDefaultConfig(final int index,
- final Map<String, Object>
params,
- final String... acceptors)
- {
- Configuration configuration = createBasicConfig(index);
-
- configuration.getAcceptorConfigurations().clear();
-
- for (String acceptor : acceptors)
- {
- TransportConfiguration transportConfig = new TransportConfiguration(acceptor,
params);
- configuration.getAcceptorConfigurations().add(transportConfig);
- }
-
- return configuration;
- }
-
- protected static ConfigurationImpl createBasicConfig()
- {
- return createBasicConfig(0);
- }
-
- /**
- * @param serverID
- * @return
- */
- protected static ConfigurationImpl createBasicConfig(final int serverID)
- {
- ConfigurationImpl configuration = new ConfigurationImpl();
- configuration.setSecurityEnabled(false);
- configuration.setBindingsDirectory(getBindingsDir(serverID, false));
- configuration.setJournalMinFiles(2);
- configuration.setJournalDirectory(getJournalDir(serverID, false));
- configuration.setJournalFileSize(100 * 1024);
- configuration.setJournalType(getDefaultJournalType());
- configuration.setPagingDirectory(getPageDir(serverID, false));
- configuration.setLargeMessagesDirectory(getLargeMessagesDir(serverID, false));
- configuration.setJournalCompactMinFiles(0);
- configuration.setJournalCompactPercentage(0);
- return configuration;
- }
-
- protected static Configuration createDefaultConfig(final Map<String, Object>
params, final String... acceptors)
- {
- Configuration configuration = new ConfigurationImpl();
- configuration.setSecurityEnabled(false);
- configuration.setJMXManagementEnabled(false);
- configuration.setBindingsDirectory(getBindingsDir());
- configuration.setJournalMinFiles(2);
- configuration.setJournalDirectory(getJournalDir());
- configuration.setJournalFileSize(100 * 1024);
- configuration.setPagingDirectory(getPageDir());
- configuration.setLargeMessagesDirectory(getLargeMessagesDir());
- configuration.setJournalCompactMinFiles(0);
- configuration.setJournalCompactPercentage(0);
-
- configuration.setFileDeploymentEnabled(false);
-
- configuration.setJournalType(getDefaultJournalType());
-
- configuration.getAcceptorConfigurations().clear();
-
- for (String acceptor : acceptors)
- {
- TransportConfiguration transportConfig = new TransportConfiguration(acceptor,
params);
- configuration.getAcceptorConfigurations().add(transportConfig);
- }
-
- return configuration;
- }
-
- protected static String getUDPDiscoveryAddress()
- {
- return System.getProperty("TEST-UDP-ADDRESS", "230.1.2.3");
- }
-
- protected static String getUDPDiscoveryAddress(int variant)
- {
- String value = getUDPDiscoveryAddress();
-
- int posPoint = value.lastIndexOf('.');
-
- int last = Integer.valueOf(value.substring(posPoint + 1));
-
- return value.substring(0, posPoint + 1) + (last + variant);
- }
-
- public static int getUDPDiscoveryPort()
- {
- return Integer.parseInt(System.getProperty("TEST-UDP-PORT",
"6750"));
- }
-
- public static int getUDPDiscoveryPort(final int variant)
- {
- return getUDPDiscoveryPort() + variant;
- }
-
- protected static JournalType getDefaultJournalType()
- {
- if (AsynchronousFileImpl.isLoaded())
- {
- return JournalType.ASYNCIO;
- }
- else
- {
- return JournalType.NIO;
- }
- }
-
- /**
- * @param name
- */
- public UnitTestCase(final String name)
- {
- super(name);
- }
-
- public UnitTestCase()
- {
- super();
- }
-
- public static void forceGC()
- {
- WeakReference<Object> dumbReference = new WeakReference<Object>(new
Object());
- // A loop that will wait GC, using the minimal time as possible
- while (dumbReference.get() != null)
- {
- System.gc();
- try
- {
- Thread.sleep(500);
- }
- catch (InterruptedException e)
- {
- }
- }
- }
-
- public static void forceGC(Reference<?> ref, long timeout)
- {
- long waitUntil = System.currentTimeMillis() + timeout;
- // A loop that will wait GC, using the minimal time as possible
- while (ref.get() != null && System.currentTimeMillis() < waitUntil)
- {
- ArrayList<String> list = new ArrayList<String>();
- for (int i = 0; i < 1000; i++)
- {
- list.add("Some string with garbage with concatenation " + i);
- }
- list.clear();
- list = null;
- System.gc();
- try
- {
- Thread.sleep(500);
- }
- catch (InterruptedException e)
- {
- }
- }
- }
-
- // verify if these weak references are released after a few GCs
- public static void checkWeakReferences(final WeakReference<?>... references)
- {
-
- int i = 0;
- boolean hasValue = false;
-
- do
- {
- hasValue = false;
-
- if (i > 0)
- {
- UnitTestCase.forceGC();
- }
-
- for (WeakReference<?> ref : references)
- {
- if (ref.get() != null)
- {
- hasValue = true;
- }
- }
- }
- while (i++ <= 30 && hasValue);
-
- for (WeakReference<?> ref : references)
- {
- Assert.assertNull(ref.get());
- }
- }
-
- public static String threadDump(final String msg)
- {
- StringWriter str = new StringWriter();
- PrintWriter out = new PrintWriter(str);
-
- Map<Thread, StackTraceElement[]> stackTrace = Thread.getAllStackTraces();
-
-
out.println("*******************************************************************************");
- out.println("Complete Thread dump " + msg);
-
- for (Map.Entry<Thread, StackTraceElement[]> el : stackTrace.entrySet())
- {
-
out.println("===============================================================================");
- out.println("Thread " + el.getKey() +
- " name = " +
- el.getKey().getName() +
- " id = " +
- el.getKey().getId() +
- " group = " +
- el.getKey().getThreadGroup());
- out.println();
- for (StackTraceElement traceEl : el.getValue())
- {
- out.println(traceEl);
- }
- }
-
-
out.println("===============================================================================");
- out.println("End Thread dump " + msg);
-
out.println("*******************************************************************************");
-
- return str.toString();
- }
-
- protected static TestSuite createAIOTestSuite(final Class<?> clazz)
- {
- TestSuite suite = new TestSuite(clazz.getName() + " testsuite");
-
- if (AIOSequentialFileFactory.isSupported())
- {
- suite.addTestSuite(clazz);
- }
- else
- {
- // System.out goes towards JUnit report
- System.out.println("Test " + clazz.getName() + " ignored as AIO
is not available");
- }
-
- return suite;
- }
-
- public static String dumpBytes(final byte[] bytes)
- {
- StringBuffer buff = new StringBuffer();
-
- buff.append(System.identityHashCode(bytes) + ", size: " + bytes.length +
" [");
-
- for (int i = 0; i < bytes.length; i++)
- {
- buff.append(bytes[i]);
-
- if (i != bytes.length - 1)
- {
- buff.append(", ");
- }
- }
-
- buff.append("]");
-
- return buff.toString();
- }
-
- public static String dumbBytesHex(final byte[] buffer, final int bytesPerLine)
- {
-
- StringBuffer buff = new StringBuffer();
-
- buff.append("[");
-
- for (int i = 0; i < buffer.length; i++)
- {
- buff.append(String.format("%1$2X", buffer[i]));
- if (i + 1 < buffer.length)
- {
- buff.append(", ");
- }
- if ((i + 1) % bytesPerLine == 0)
- {
- buff.append("\n ");
- }
- }
- buff.append("]");
-
- return buff.toString();
- }
-
- public static void assertEqualsByteArrays(final byte[] expected, final byte[] actual)
- {
- // assertEquals(expected.length, actual.length);
- for (int i = 0; i < expected.length; i++)
- {
- Assert.assertEquals("byte at index " + i, expected[i], actual[i]);
- }
- }
-
- public static void assertEqualsTransportConfigurations(final TransportConfiguration[]
expected,
- final TransportConfiguration[]
actual)
- {
- assertEquals(expected.length, actual.length);
- for (int i = 0; i < expected.length; i++)
- {
- Assert.assertEquals("TransportConfiguration at index " + i,
expected[i], actual[i]);
- }
- }
-
- public static void assertEqualsBuffers(final int size, final HornetQBuffer expected,
final HornetQBuffer actual)
- {
- // assertEquals(expected.length, actual.length);
- expected.readerIndex(0);
- actual.readerIndex(0);
-
- for (int i = 0; i < size; i++)
- {
- byte b1 = expected.readByte();
- byte b2 = actual.readByte();
- Assert.assertEquals("byte at index " + i, b1, b2);
- }
- expected.resetReaderIndex();
- actual.resetReaderIndex();
- }
-
- public static void assertEqualsByteArrays(final int length, final byte[] expected,
final byte[] actual)
- {
- // we check only for the given length (the arrays might be
- // larger)
- Assert.assertTrue(expected.length >= length);
- Assert.assertTrue(actual.length >= length);
- for (int i = 0; i < length; i++)
- {
- Assert.assertEquals("byte at index " + i, expected[i], actual[i]);
- }
- }
-
- public static void assertSameXids(final List<Xid> expected, final
List<Xid> actual)
- {
- Assert.assertNotNull(expected);
- Assert.assertNotNull(actual);
- Assert.assertEquals(expected.size(), actual.size());
-
- for (int i = 0; i < expected.size(); i++)
- {
- Xid expectedXid = expected.get(i);
- Xid actualXid = actual.get(i);
- UnitTestCase.assertEqualsByteArrays(expectedXid.getBranchQualifier(),
actualXid.getBranchQualifier());
- Assert.assertEquals(expectedXid.getFormatId(), actualXid.getFormatId());
- UnitTestCase.assertEqualsByteArrays(expectedXid.getGlobalTransactionId(),
actualXid.getGlobalTransactionId());
- }
- }
-
- protected static void checkNoBinding(final Context context, final String binding)
- {
- try
- {
- context.lookup(binding);
- Assert.fail("there must be no resource to look up for " + binding);
- }
- catch (Exception e)
- {
- }
- }
-
- protected static Object checkBinding(final Context context, final String binding)
throws Exception
- {
- Object o = context.lookup(binding);
- Assert.assertNotNull(o);
- return o;
- }
-
- /**
- * @param connectorConfigs
- * @return
- */
- protected ArrayList<String> registerConnectors(final HornetQServer server,
- final
List<TransportConfiguration> connectorConfigs)
- {
- // The connectors need to be pre-configured at main config object but this method
is taking
- // TransportConfigurations directly
- // So this will first register them at the config and then generate a list of
objects
- ArrayList<String> connectors = new ArrayList<String>();
- for (TransportConfiguration tnsp : connectorConfigs)
- {
- String name = RandomUtil.randomString();
-
- server.getConfiguration().getConnectorConfigurations().put(name, tnsp);
-
- connectors.add(name);
- }
- return connectors;
- }
-
- protected static void checkFreePort(final int... ports)
- {
- for (int port : ports)
- {
- ServerSocket ssocket = null;
- try
- {
- ssocket = new ServerSocket(port);
- }
- catch (Exception e)
- {
- System.out.println("port " + port + " is already
bound");
- System.exit(0);
- }
- finally
- {
- if (ssocket != null)
- {
- try
- {
- ssocket.close();
- }
- catch (IOException e)
- {
- }
- }
- }
- }
- }
-
- // Constructors --------------------------------------------------
-
- // Protected -----------------------------------------------------
-
- /**
- * @return the testDir
- */
- protected String getTestDir()
- {
- return testDir;
- }
-
- protected void clearData()
- {
- clearData(getTestDir());
- }
-
- protected void clearData(final String testDir)
- {
- // Need to delete the root
-
- File file = new File(testDir);
- deleteDirectory(file);
- file.mkdirs();
-
- recreateDirectory(getJournalDir(testDir));
- recreateDirectory(getBindingsDir(testDir));
- recreateDirectory(getPageDir(testDir));
- recreateDirectory(getLargeMessagesDir(testDir));
- recreateDirectory(getClientLargeMessagesDir(testDir));
- recreateDirectory(getTemporaryDir(testDir));
-
- System.out.println("deleted " + testDir);
- }
-
- /**
- * @return the journalDir
- */
- public static String getJournalDir()
- {
- return getJournalDir(testDir);
- }
-
- protected static String getJournalDir(final String testDir)
- {
- return testDir + "/journal";
- }
-
- protected static String getJournalDir(final int index, final boolean backup)
- {
- String dir = getJournalDir(testDir) + index + "-" + (backup ?
"B" : "L");
-
- return dir;
- }
-
- /**
- * @return the bindingsDir
- */
- protected static String getBindingsDir()
- {
- return getBindingsDir(testDir);
- }
-
- /**
- * @return the bindingsDir
- */
- protected static String getBindingsDir(final String testDir)
- {
- return testDir + "/bindings";
- }
-
- /**
- * @return the bindingsDir
- */
- protected static String getBindingsDir(final int index, final boolean backup)
- {
- return getBindingsDir(testDir) + index + "-" + (backup ? "B" :
"L");
- }
-
- /**
- * @return the pageDir
- */
- protected static String getPageDir()
- {
- return getPageDir(testDir);
- }
-
- /**
- * @return the pageDir
- */
- protected static String getPageDir(final String testDir)
- {
- return testDir + "/page";
- }
-
- protected static String getPageDir(final int index, final boolean backup)
- {
- return getPageDir(testDir) + index + "-" + (backup ? "B" :
"L");
- }
-
- /**
- * @return the largeMessagesDir
- */
- protected static String getLargeMessagesDir()
- {
- return getLargeMessagesDir(testDir);
- }
-
- /**
- * @return the largeMessagesDir
- */
- protected static String getLargeMessagesDir(final String testDir)
- {
- return testDir + "/large-msg";
- }
-
- protected static String getLargeMessagesDir(final int index, final boolean backup)
- {
- return getLargeMessagesDir(testDir) + index + "-" + (backup ?
"B" : "L");
- }
-
- /**
- * @return the clientLargeMessagesDir
- */
- protected String getClientLargeMessagesDir()
- {
- return getClientLargeMessagesDir(testDir);
- }
-
- /**
- * @return the clientLargeMessagesDir
- */
- protected String getClientLargeMessagesDir(final String testDir)
- {
- return testDir + "/client-large-msg";
- }
-
- /**
- * @return the temporaryDir
- */
- protected String getTemporaryDir()
- {
- return getTemporaryDir(testDir);
- }
-
- /**
- * @return the temporaryDir
- */
- protected String getTemporaryDir(final String testDir)
- {
- return testDir + "/temp";
- }
-
- protected static void expectHornetQException(final String message, final int
errorCode, final HornetQAction action)
- {
- try
- {
- action.run();
- Assert.fail(message);
- }
- catch (Exception e)
- {
- Assert.assertTrue(e instanceof HornetQException);
- Assert.assertEquals(errorCode, ((HornetQException)e).getCode());
- }
- }
-
- protected static void expectHornetQException(final int errorCode, final HornetQAction
action)
- {
- UnitTestCase.expectHornetQException("must throw a HornetQException with the
expected errorCode: " + errorCode,
- errorCode,
- action);
- }
-
- protected static void expectXAException(final int errorCode, final HornetQAction
action)
- {
- try
- {
- action.run();
- Assert.fail("must throw a XAException with the expected errorCode: " +
errorCode);
- }
- catch (Exception e)
- {
- Assert.assertTrue(e instanceof XAException);
- Assert.assertEquals(errorCode, ((XAException)e).errorCode);
- }
- }
-
- public static byte getSamplebyte(final long position)
- {
- return (byte)('a' + position % ('z' - 'a' + 1));
- }
-
- // Creates a Fake LargeStream without using a real file
- public static InputStream createFakeLargeStream(final long size) throws Exception
- {
- return new InputStream()
- {
- private long count;
-
- private boolean closed = false;
-
- @Override
- public void close() throws IOException
- {
- super.close();
- closed = true;
- }
-
- @Override
- public int read() throws IOException
- {
- if (closed)
- {
- throw new IOException("Stream was closed");
- }
- if (count++ < size)
- {
- return UnitTestCase.getSamplebyte(count - 1);
- }
- else
- {
- return -1;
- }
- }
- };
-
- }
-
- /** It validates a Bean (POJO) using simple setters and getters with random values.
- * You can pass a list of properties to be ignored, as some properties will have a
pre-defined domain (not being possible to use random-values on them) */
- protected void validateGettersAndSetters(final Object pojo, final String...
IgnoredProperties) throws Exception
- {
- HashSet<String> ignoreSet = new HashSet<String>();
-
- for (String ignore : IgnoredProperties)
- {
- ignoreSet.add(ignore);
- }
-
- BeanInfo info = Introspector.getBeanInfo(pojo.getClass());
-
- PropertyDescriptor properties[] = info.getPropertyDescriptors();
-
- for (PropertyDescriptor prop : properties)
- {
- Object value;
-
- if (prop.getPropertyType() == String.class)
- {
- value = RandomUtil.randomString();
- }
- else if (prop.getPropertyType() == Integer.class || prop.getPropertyType() ==
Integer.TYPE)
- {
- value = RandomUtil.randomInt();
- }
- else if (prop.getPropertyType() == Long.class || prop.getPropertyType() ==
Long.TYPE)
- {
- value = RandomUtil.randomLong();
- }
- else if (prop.getPropertyType() == Boolean.class || prop.getPropertyType() ==
Boolean.TYPE)
- {
- value = RandomUtil.randomBoolean();
- }
- else if (prop.getPropertyType() == Double.class || prop.getPropertyType() ==
Double.TYPE)
- {
- value = RandomUtil.randomDouble();
- }
- else
- {
- System.out.println("Can't validate property of type " +
prop.getPropertyType() + " on " + prop.getName());
- value = null;
- }
-
- if (value != null && prop.getWriteMethod() != null &&
prop.getReadMethod() == null)
- {
- System.out.println("WriteOnly property " + prop.getName() + "
on " + pojo.getClass());
- }
- else if (value != null & prop.getWriteMethod() != null &&
- prop.getReadMethod() != null &&
- !ignoreSet.contains(prop.getName()))
- {
- System.out.println("Validating " + prop.getName() + " type =
" + prop.getPropertyType());
- prop.getWriteMethod().invoke(pojo, value);
-
- Assert.assertEquals("Property " + prop.getName(), value,
prop.getReadMethod().invoke(pojo));
- }
- }
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- Map<Thread, StackTraceElement[]> previousThreads;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- deleteDirectory(new File(getTestDir()));
-
- InVMRegistry.instance.clear();
-
- // checkFreePort(TransportConstants.DEFAULT_PORT);
-
- previousThreads = Thread.getAllStackTraces();
-
- UnitTestCase.log.info("###### starting test " + this.getClass().getName()
+ "." + getName());
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- cleanupPools();
-
- Map<Thread, StackTraceElement[]> threadMap = Thread.getAllStackTraces();
- for (Thread thread : threadMap.keySet())
- {
- StackTraceElement[] stack = threadMap.get(thread);
- for (StackTraceElement stackTraceElement : stack)
- {
- if
(stackTraceElement.getMethodName().contains("getConnectionWithRetry") &&
!alreadyFailedThread.contains(thread))
- {
- alreadyFailedThread.add(thread);
- System.out.println(threadDump(this.getName() + " has left threads
running. Look at thread " +
- thread.getName() +
- " id = " +
- thread.getId() +
- " has running locators on test "
+
- this.getName() +
- " on this following dump"));
- fail("test left serverlocator running, this could effect other
tests");
- // System.exit(0);
- }
- else if
(stackTraceElement.getMethodName().contains("BroadcastGroupImpl.run") &&
!alreadyFailedThread.contains(thread))
- {
- alreadyFailedThread.add(thread);
- System.out.println(threadDump(this.getName() + " has left threads
running. Look at thread " +
- thread.getName() +
- " id = " +
- thread.getId() +
- " is still broadcasting " +
- this.getName() +
- " on this following dump"));
- fail("test left broadcastgroupimpl running, this could effect other
tests");
- // System.exit(0);
- }
- }
- }
-
- Map<Thread, StackTraceElement[]> postThreads = Thread.getAllStackTraces();
-
- boolean failedThread = false;
- if (postThreads.size() > previousThreads.size())
- {
- StringBuffer buffer = new StringBuffer();
-
-
-
buffer.append("*********************************************************************************\n");
- buffer.append("LEAKING THREADS\n");
-
- for (Thread aliveThread : postThreads.keySet())
- {
- if (!aliveThread.getName().contains("SunPKCS11") &&
!previousThreads.containsKey(aliveThread))
- {
- failedThread = true;
-
buffer.append("=============================================================================\n");
- buffer.append("Thread " + aliveThread + " is still alive
with the following stackTrace:\n");
- StackTraceElement[] elements = postThreads.get(aliveThread);
- for (StackTraceElement el : elements)
- {
- buffer.append(el + "\n");
- }
- }
-
- }
-
buffer.append("*********************************************************************************\n");
-
- System.out.println(buffer.toString());
-
- }
-
- //assertFalse("Thread Failed", failedThread);
-
- super.tearDown();
- }
-
- /**
- *
- */
- protected void cleanupPools()
- {
- OperationContextImpl.clearContext();
-
- deleteDirectory(new File(getTestDir()));
-
- int invmSize = InVMRegistry.instance.size();
- if (invmSize > 0)
- {
- InVMRegistry.instance.clear();
- fail("invm registry still had acceptors registered");
- }
-
- if (AsynchronousFileImpl.getTotalMaxIO() != 0)
- {
- AsynchronousFileImpl.resetMaxAIO();
- Assert.fail("test did not close all its files " +
AsynchronousFileImpl.getTotalMaxIO());
- }
-
- // We shutdown the global pools to give a better isolation between tests
- ServerLocatorImpl.clearThreadPools();
- }
-
- protected byte[] autoEncode(final Object... args)
- {
-
- int size = 0;
-
- for (Object arg : args)
- {
- if (arg instanceof Byte)
- {
- size++;
- }
- else if (arg instanceof Boolean)
- {
- size++;
- }
- else if (arg instanceof Integer)
- {
- size += 4;
- }
- else if (arg instanceof Long)
- {
- size += 8;
- }
- else if (arg instanceof Float)
- {
- size += 4;
- }
- else if (arg instanceof Double)
- {
- size += 8;
- }
- else
- {
- throw new IllegalArgumentException("method autoEncode doesn't know
how to convert " + arg.getClass() +
- " yet");
- }
- }
-
- ByteBuffer buffer = ByteBuffer.allocate(size);
-
- for (Object arg : args)
- {
- if (arg instanceof Byte)
- {
- buffer.put(((Byte)arg).byteValue());
- }
- else if (arg instanceof Boolean)
- {
- Boolean b = (Boolean)arg;
- buffer.put((byte)(b.booleanValue() ? 1 : 0));
- }
- else if (arg instanceof Integer)
- {
- buffer.putInt(((Integer)arg).intValue());
- }
- else if (arg instanceof Long)
- {
- buffer.putLong(((Long)arg).longValue());
- }
- else if (arg instanceof Float)
- {
- buffer.putFloat(((Float)arg).floatValue());
- }
- else if (arg instanceof Double)
- {
- buffer.putDouble(((Double)arg).doubleValue());
- }
- else
- {
- throw new IllegalArgumentException("method autoEncode doesn't know
how to convert " + arg.getClass() +
- " yet");
- }
- }
-
- return buffer.array();
- }
-
- protected void recreateDirectory(final String directory)
- {
- File file = new File(directory);
- deleteDirectory(file);
- file.mkdirs();
- }
-
- protected boolean deleteDirectory(final File directory)
- {
- if (directory.isDirectory())
- {
- String[] files = directory.list();
-
- for (int j = 0; j < files.length; j++)
- {
- if (!deleteDirectory(new File(directory, files[j])))
- {
- return false;
- }
- }
- }
-
- return directory.delete();
- }
-
- protected void copyRecursive(final File from, final File to) throws Exception
- {
- if (from.isDirectory())
- {
- if (!to.exists())
- {
- to.mkdir();
- }
-
- String[] subs = from.list();
-
- for (String sub : subs)
- {
- copyRecursive(new File(from, sub), new File(to, sub));
- }
- }
- else
- {
- InputStream in = null;
-
- OutputStream out = null;
-
- try
- {
- in = new BufferedInputStream(new FileInputStream(from));
-
- out = new BufferedOutputStream(new FileOutputStream(to));
-
- int b;
-
- while ((b = in.read()) != -1)
- {
- out.write(b);
- }
- }
- finally
- {
- if (in != null)
- {
- in.close();
- }
-
- if (out != null)
- {
- out.close();
- }
- }
- }
- }
-
- protected void assertRefListsIdenticalRefs(final List<MessageReference> l1,
final List<MessageReference> l2)
- {
- if (l1.size() != l2.size())
- {
- Assert.fail("Lists different sizes: " + l1.size() + ", " +
l2.size());
- }
-
- Iterator<MessageReference> iter1 = l1.iterator();
- Iterator<MessageReference> iter2 = l2.iterator();
-
- while (iter1.hasNext())
- {
- MessageReference o1 = iter1.next();
- MessageReference o2 = iter2.next();
-
- Assert.assertTrue("expected " + o1 + " but was " + o2, o1 ==
o2);
- }
- }
-
- protected ServerMessage generateMessage(final long id)
- {
- ServerMessage message = new ServerMessageImpl(id, 1000);
-
- message.setMessageID(id);
-
- message.getBodyBuffer().writeString(UUID.randomUUID().toString());
-
- message.setAddress(new SimpleString("foo"));
-
- return message;
- }
-
- protected MessageReference generateReference(final Queue queue, final long id)
- {
- ServerMessage message = generateMessage(id);
-
- return message.createReference(queue);
- }
-
- protected int calculateRecordSize(final int size, final int alignment)
- {
- return (size / alignment + (size % alignment != 0 ? 1 : 0)) * alignment;
- }
-
- protected ClientMessage createTextMessage(final String s, final ClientSession
clientSession)
- {
- return createTextMessage(s, true, clientSession);
- }
-
- protected ClientMessage createTextMessage(final String s, final boolean durable, final
ClientSession clientSession)
- {
- ClientMessage message = clientSession.createMessage(HornetQTextMessage.TYPE,
- durable,
- 0,
- System.currentTimeMillis(),
- (byte)4);
- message.getBodyBuffer().writeString(s);
- return message;
- }
-
- protected XidImpl newXID()
- {
- return new XidImpl("xa1".getBytes(), 1,
UUIDGenerator.getInstance().generateStringUUID().getBytes());
- }
-
- protected int getMessageCount(final HornetQServer service, final String address)
throws Exception
- {
- return getMessageCount(service.getPostOffice(), address);
- }
-
- /**
- * @param address
- * @param postOffice
- * @return
- * @throws Exception
- */
- protected int getMessageCount(final PostOffice postOffice, final String address)
throws Exception
- {
- int messageCount = 0;
-
- List<QueueBinding> bindings = getLocalQueueBindings(postOffice, address);
-
- for (QueueBinding qBinding : bindings)
- {
- messageCount += qBinding.getQueue().getMessageCount();
- }
-
- return messageCount;
- }
-
- protected List<QueueBinding> getLocalQueueBindings(final PostOffice postOffice,
final String address) throws Exception
- {
- ArrayList<QueueBinding> bindingsFound = new ArrayList<QueueBinding>();
-
- Bindings bindings = postOffice.getBindingsForAddress(new SimpleString(address));
-
- for (Binding binding : bindings.getBindings())
- {
- if (binding instanceof LocalQueueBinding)
- {
- bindingsFound.add((QueueBinding)binding);
- }
- }
- return bindingsFound;
- }
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
- protected static interface HornetQAction
- {
- void run() throws Exception;
- }
-
-}
Added: trunk/tests/unit-tests/pom.xml
===================================================================
--- trunk/tests/unit-tests/pom.xml (rev 0)
+++ trunk/tests/unit-tests/pom.xml 2011-04-08 12:18:13 UTC (rev 10469)
@@ -0,0 +1,96 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.hornetq</groupId>
+ <artifactId>hornetq-pom</artifactId>
+ <version>2.2.3-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.hornetq.tests</groupId>
+ <artifactId>unit-tests</artifactId>
+ <packaging>jar</packaging>
+ <name>HornetQ Unit Tests</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.hornetq</groupId>
+ <artifactId>hornetq-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hornetq</groupId>
+ <artifactId>hornetq-jms</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hornetq</groupId>
+ <artifactId>hornetq-ra</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hornetq</groupId>
+ <artifactId>hornetq-bootstrap</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-jca-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jboss-security-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jbosssx</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <testResources>
+ <testResource>
+ <directory>../config</directory>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>org/hornetq/tests/util/*.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Modified:
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/deployers/impl/FileDeploymentManagerTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/unit/core/deployers/impl/FileDeploymentManagerTest.java 2011-04-08
07:26:27 UTC (rev 10466)
+++
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/deployers/impl/FileDeploymentManagerTest.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -63,7 +63,7 @@
FileDeploymentManagerTest.log.debug("Filename is " + filename);
- File file = new File("tests/tmpfiles/" + filename);
+ File file = new File("target/tmpfiles/" + filename);
FileDeploymentManagerTest.log.debug(file.getAbsoluteFile());
@@ -99,7 +99,7 @@
FileDeploymentManagerTest.log.debug("Filename is " + filename);
- File file = new File("tests/tmpfiles/" + filename);
+ File file = new File("target/tmpfiles/" + filename);
FileDeploymentManagerTest.log.debug(file.getAbsoluteFile());
@@ -134,9 +134,9 @@
String filename2 = "fdm_test_file.xml2";
String filename3 = "fdm_test_file.xml3";
- File file1 = new File("tests/tmpfiles/" + filename1);
- File file2 = new File("tests/tmpfiles/" + filename2);
- File file3 = new File("tests/tmpfiles/" + filename3);
+ File file1 = new File("target/tmpfiles/" + filename1);
+ File file2 = new File("target/tmpfiles/" + filename2);
+ File file3 = new File("target/tmpfiles/" + filename3);
file1.createNewFile();
file2.createNewFile();
@@ -231,7 +231,7 @@
String filename = "fdm_test_file.xml1";
- File file = new File("tests/tmpfiles/" + filename);
+ File file = new File("target/tmpfiles/" + filename);
file.createNewFile();
long oldLastModified = file.lastModified();
@@ -280,7 +280,7 @@
String filename = "fdm_test_file.xml1";
- File file = new File("tests/tmpfiles/" + filename);
+ File file = new File("target/tmpfiles/" + filename);
file.createNewFile();
Copied: trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/RandomUtil.java (from
rev 10466, trunk/tests/src/org/hornetq/tests/util/RandomUtil.java)
===================================================================
--- trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/RandomUtil.java
(rev 0)
+++ trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/RandomUtil.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -0,0 +1,176 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat 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.
+ */
+
+package org.hornetq.tests.util;
+
+import java.util.Random;
+import java.util.UUID;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.HornetQBuffers;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.transaction.impl.XidImpl;
+
+/**
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public class RandomUtil
+{
+ // Constants -----------------------------------------------------
+
+ private static final Random random = new Random(System.currentTimeMillis());
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ public static String randomString()
+ {
+ return UUID.randomUUID().toString();
+ }
+
+ public static SimpleString randomSimpleString()
+ {
+ return new SimpleString(RandomUtil.randomString());
+ }
+
+ public static char randomChar()
+ {
+ return RandomUtil.randomString().charAt(0);
+ }
+
+ public static long randomLong()
+ {
+ return RandomUtil.random.nextLong();
+ }
+
+ public static long randomPositiveLong()
+ {
+ return Math.abs(RandomUtil.randomLong());
+ }
+
+ public static int randomInt()
+ {
+ return RandomUtil.random.nextInt();
+ }
+
+ public static int randomPositiveInt()
+ {
+ return Math.abs(RandomUtil.randomInt());
+ }
+
+
+ public static HornetQBuffer randomBuffer(final int size, final long... data)
+ {
+ HornetQBuffer buffer = HornetQBuffers.fixedBuffer(size + 8 * data.length);
+
+ for (long d : data)
+ {
+ buffer.writeLong(d);
+ }
+
+ for (int i = 0 ; i < size; i++)
+ {
+ buffer.writeByte((byte)randomByte());
+ }
+
+ return buffer;
+ }
+
+
+
+
+ public static int randomInterval(final int min, final int max)
+ {
+ return min + randomMax(max - min);
+ }
+
+ public static int randomMax(int max)
+ {
+ int value = randomPositiveInt() % max;
+
+ if (value == 0)
+ {
+ value = max;
+ }
+
+ return value;
+ }
+
+ public static int randomPort()
+ {
+ return RandomUtil.random.nextInt(65536);
+ }
+
+ public static short randomShort()
+ {
+ return (short)RandomUtil.random.nextInt(Short.MAX_VALUE);
+ }
+
+ public static byte randomByte()
+ {
+ return Integer.valueOf(RandomUtil.random.nextInt()).byteValue();
+ }
+
+ public static boolean randomBoolean()
+ {
+ return RandomUtil.random.nextBoolean();
+ }
+
+ public static byte[] randomBytes()
+ {
+ return RandomUtil.randomString().getBytes();
+ }
+
+ public static byte[] randomBytes(final int length)
+ {
+ byte[] bytes = new byte[length];
+ for (int i = 0; i < bytes.length; i++)
+ {
+ bytes[i] = RandomUtil.randomByte();
+ }
+ return bytes;
+ }
+
+ public static double randomDouble()
+ {
+ return RandomUtil.random.nextDouble();
+ }
+
+ public static float randomFloat()
+ {
+ return RandomUtil.random.nextFloat();
+ }
+
+ public static Xid randomXid()
+ {
+ return new XidImpl(RandomUtil.randomBytes(), RandomUtil.randomInt(),
RandomUtil.randomBytes());
+ }
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Copied: trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/ServiceTestBase.java
(from rev 10466, trunk/tests/src/org/hornetq/tests/util/ServiceTestBase.java)
===================================================================
--- trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/ServiceTestBase.java
(rev 0)
+++
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/ServiceTestBase.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -0,0 +1,572 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat 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.
+ */
+
+package org.hornetq.tests.util;
+
+import java.io.File;
+import java.lang.management.ManagementFactory;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.management.MBeanServer;
+
+import junit.framework.Assert;
+
+import org.hornetq.api.core.TransportConfiguration;
+import org.hornetq.api.core.client.ClientMessage;
+import org.hornetq.api.core.client.ClientSession;
+import org.hornetq.api.core.client.ClientSessionFactory;
+import org.hornetq.api.core.client.HornetQClient;
+import org.hornetq.api.core.client.ServerLocator;
+import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
+import org.hornetq.core.config.Configuration;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
+import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
+import org.hornetq.core.remoting.impl.invm.InVMRegistry;
+import org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory;
+import org.hornetq.core.remoting.impl.netty.NettyConnectorFactory;
+import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.server.HornetQServers;
+import org.hornetq.core.server.NodeManager;
+import org.hornetq.core.server.impl.HornetQServerImpl;
+import org.hornetq.core.settings.impl.AddressFullMessagePolicy;
+import org.hornetq.core.settings.impl.AddressSettings;
+import org.hornetq.jms.client.HornetQBytesMessage;
+import org.hornetq.jms.client.HornetQTextMessage;
+import org.hornetq.spi.core.security.HornetQSecurityManager;
+import org.hornetq.spi.core.security.HornetQSecurityManagerImpl;
+
+/**
+ *
+ * Base class with basic utilities on starting up a basic server
+ *
+ * @author <a href="mailto:clebert.suconic@jboss.com">Clebert
Suconic</a>
+ *
+ */
+public abstract class ServiceTestBase extends UnitTestCase
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ protected static final String INVM_ACCEPTOR_FACTORY =
InVMAcceptorFactory.class.getCanonicalName();
+
+ public static final String INVM_CONNECTOR_FACTORY =
InVMConnectorFactory.class.getCanonicalName();
+
+ protected static final String NETTY_ACCEPTOR_FACTORY =
NettyAcceptorFactory.class.getCanonicalName();
+
+ protected static final String NETTY_CONNECTOR_FACTORY =
NettyConnectorFactory.class.getCanonicalName();
+
+ private List<ServerLocator> locators = new ArrayList<ServerLocator>();
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ for (ServerLocator locator : locators)
+ {
+ try
+ {
+ locator.close();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ locators.clear();
+ super.tearDown();
+ checkFreePort(5445);
+ checkFreePort(5446);
+ checkFreePort(5447);
+ if (InVMRegistry.instance.size() > 0)
+ {
+ fail("InVMREgistry size > 0");
+ }
+ }
+
+ protected static Map<String, Object> generateParams(final int node, final
boolean netty)
+ {
+ Map<String, Object> params = new HashMap<String, Object>();
+
+ if (netty)
+ {
+
params.put(org.hornetq.core.remoting.impl.netty.TransportConstants.PORT_PROP_NAME,
+ org.hornetq.core.remoting.impl.netty.TransportConstants.DEFAULT_PORT
+ node);
+ }
+ else
+ {
+
params.put(org.hornetq.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME,
node);
+ }
+
+ return params;
+ }
+
+ protected static TransportConfiguration createTransportConfiguration(boolean netty,
+ boolean
acceptor,
+ Map<String,
Object> params)
+ {
+ String className;
+ if (netty)
+ {
+ if (acceptor)
+ {
+ className = NettyAcceptorFactory.class.getName();
+ }
+ else
+ {
+ className = NettyConnectorFactory.class.getName();
+ }
+ }
+ else
+ {
+ if (acceptor)
+ {
+ className = InVMAcceptorFactory.class.getName();
+ }
+ else
+ {
+ className = InVMConnectorFactory.class.getName();
+ }
+ }
+ return new TransportConfiguration(className, params);
+ }
+
+ // Static --------------------------------------------------------
+ private final Logger log = Logger.getLogger(this.getClass());
+
+ // Constructors --------------------------------------------------
+
+ public ServiceTestBase()
+ {
+ super();
+ }
+
+ public ServiceTestBase(final String name)
+ {
+ super(name);
+ }
+
+ // Public --------------------------------------------------------
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ protected HornetQServer createServer(final boolean realFiles,
+ final Configuration configuration,
+ final int pageSize,
+ final int maxAddressSize,
+ final Map<String, AddressSettings>
settings,
+ final MBeanServer mbeanServer)
+ {
+ HornetQServer server;
+
+ if (realFiles)
+ {
+ server = HornetQServers.newHornetQServer(configuration, mbeanServer, true);
+ }
+ else
+ {
+ server = HornetQServers.newHornetQServer(configuration, mbeanServer, false);
+ }
+
+ for (Map.Entry<String, AddressSettings> setting : settings.entrySet())
+ {
+ server.getAddressSettingsRepository().addMatch(setting.getKey(),
setting.getValue());
+ }
+
+ AddressSettings defaultSetting = new AddressSettings();
+ defaultSetting.setPageSizeBytes(pageSize);
+ defaultSetting.setMaxSizeBytes(maxAddressSize);
+
+ server.getAddressSettingsRepository().addMatch("#", defaultSetting);
+
+ return server;
+ }
+
+ protected HornetQServer createServer(final boolean realFiles,
+ final Configuration configuration,
+ final int pageSize,
+ final int maxAddressSize,
+ final Map<String, AddressSettings>
settings)
+ {
+ return createServer(realFiles, configuration, pageSize, maxAddressSize,
AddressFullMessagePolicy.PAGE, settings);
+ }
+
+ protected HornetQServer createServer(final boolean realFiles,
+ final Configuration configuration,
+ final int pageSize,
+ final int maxAddressSize,
+ final AddressFullMessagePolicy fullPolicy,
+ final Map<String, AddressSettings>
settings)
+ {
+ HornetQServer server;
+
+ if (realFiles)
+ {
+ server = HornetQServers.newHornetQServer(configuration);
+ }
+ else
+ {
+ server = HornetQServers.newHornetQServer(configuration, false);
+ }
+
+ for (Map.Entry<String, AddressSettings> setting : settings.entrySet())
+ {
+ server.getAddressSettingsRepository().addMatch(setting.getKey(),
setting.getValue());
+ }
+
+ AddressSettings defaultSetting = new AddressSettings();
+ defaultSetting.setPageSizeBytes(pageSize);
+ defaultSetting.setMaxSizeBytes(maxAddressSize);
+ defaultSetting.setAddressFullMessagePolicy(fullPolicy);
+
+ server.getAddressSettingsRepository().addMatch("#", defaultSetting);
+
+ return server;
+ }
+
+ protected HornetQServer createServer(final boolean realFiles,
+ final Configuration configuration,
+ final MBeanServer mbeanServer,
+ final Map<String, AddressSettings>
settings)
+ {
+ HornetQServer server;
+
+ if (realFiles)
+ {
+ server = HornetQServers.newHornetQServer(configuration, mbeanServer);
+ }
+ else
+ {
+ server = HornetQServers.newHornetQServer(configuration, mbeanServer, false);
+ }
+
+ for (Map.Entry<String, AddressSettings> setting : settings.entrySet())
+ {
+ server.getAddressSettingsRepository().addMatch(setting.getKey(),
setting.getValue());
+ }
+
+ AddressSettings defaultSetting = new AddressSettings();
+ server.getAddressSettingsRepository().addMatch("#", defaultSetting);
+
+ return server;
+ }
+
+ protected HornetQServer createServer(final boolean realFiles)
+ {
+ return createServer(realFiles, false);
+ }
+
+ protected HornetQServer createServer(final boolean realFiles, final boolean netty)
+ {
+ return createServer(realFiles, createDefaultConfig(netty), -1, -1, new
HashMap<String, AddressSettings>());
+ }
+
+ protected HornetQServer createServer(final boolean realFiles, final Configuration
configuration)
+ {
+ return createServer(realFiles, configuration, -1, -1, new HashMap<String,
AddressSettings>());
+ }
+
+ protected HornetQServer createInVMFailoverServer(final boolean realFiles,
+ final Configuration configuration,
+ NodeManager nodeManager)
+ {
+ return createInVMFailoverServer(realFiles,
+ configuration,
+ -1,
+ -1,
+ new HashMap<String, AddressSettings>(),
+ nodeManager);
+ }
+
+ protected HornetQServer createInVMFailoverServer(final boolean realFiles,
+ final Configuration configuration,
+ final int pageSize,
+ final int maxAddressSize,
+ final Map<String,
AddressSettings> settings,
+ NodeManager nodeManager)
+ {
+ HornetQServer server;
+ HornetQSecurityManager securityManager = new HornetQSecurityManagerImpl();
+ configuration.setPersistenceEnabled(realFiles);
+ server = new InVMNodeManagerServer(configuration,
+ ManagementFactory.getPlatformMBeanServer(),
+ securityManager,
+ nodeManager);
+
+ for (Map.Entry<String, AddressSettings> setting : settings.entrySet())
+ {
+ server.getAddressSettingsRepository().addMatch(setting.getKey(),
setting.getValue());
+ }
+
+ AddressSettings defaultSetting = new AddressSettings();
+ defaultSetting.setPageSizeBytes(pageSize);
+ defaultSetting.setMaxSizeBytes(maxAddressSize);
+
+ server.getAddressSettingsRepository().addMatch("#", defaultSetting);
+
+ return server;
+ }
+
+ protected HornetQServer createServer(final boolean realFiles,
+ final Configuration configuration,
+ final HornetQSecurityManager securityManager)
+ {
+ HornetQServer server;
+
+ if (realFiles)
+ {
+ server = HornetQServers.newHornetQServer(configuration,
+
ManagementFactory.getPlatformMBeanServer(),
+ securityManager);
+ }
+ else
+ {
+ server = HornetQServers.newHornetQServer(configuration,
+
ManagementFactory.getPlatformMBeanServer(),
+ securityManager,
+ false);
+ }
+
+ Map<String, AddressSettings> settings = new HashMap<String,
AddressSettings>();
+
+ for (Map.Entry<String, AddressSettings> setting : settings.entrySet())
+ {
+ server.getAddressSettingsRepository().addMatch(setting.getKey(),
setting.getValue());
+ }
+
+ AddressSettings defaultSetting = new AddressSettings();
+
+ server.getAddressSettingsRepository().addMatch("#", defaultSetting);
+
+ return server;
+ }
+
+ protected HornetQServer createClusteredServerWithParams(final boolean isNetty,
+ final int index,
+ final boolean realFiles,
+ final Map<String,
Object> params)
+ {
+ if (isNetty)
+ {
+ return createServer(realFiles,
+ createClusteredDefaultConfig(index, params,
NETTY_ACCEPTOR_FACTORY),
+ -1,
+ -1,
+ new HashMap<String, AddressSettings>());
+ }
+ else
+ {
+ return createServer(realFiles,
+ createClusteredDefaultConfig(index, params,
INVM_ACCEPTOR_FACTORY),
+ -1,
+ -1,
+ new HashMap<String, AddressSettings>());
+ }
+ }
+
+ protected HornetQServer createClusteredServerWithParams(final boolean isNetty,
+ final int index,
+ final boolean realFiles,
+ final int pageSize,
+ final int maxAddressSize,
+ final Map<String,
Object> params)
+ {
+ if (isNetty)
+ {
+ return createServer(realFiles,
+ createClusteredDefaultConfig(index, params,
NETTY_ACCEPTOR_FACTORY),
+ pageSize,
+ maxAddressSize,
+ new HashMap<String, AddressSettings>());
+ }
+ else
+ {
+ return createServer(realFiles,
+ createClusteredDefaultConfig(index, params,
INVM_ACCEPTOR_FACTORY),
+ -1,
+ -1,
+ new HashMap<String, AddressSettings>());
+ }
+ }
+
+ protected ServerLocator createFactory(final boolean isNetty) throws Exception
+ {
+ if (isNetty)
+ {
+ return createNettyNonHALocator();
+ }
+ else
+ {
+ return createInVMNonHALocator();
+ }
+ }
+
+ protected void createQueue(String address, String queue) throws Exception
+ {
+ ServerLocator locator = createInVMNonHALocator();
+ ClientSessionFactory sf = locator.createSessionFactory();
+ ClientSession session = sf.createSession();
+ session.createQueue(address, queue);
+ session.close();
+ sf.close();
+ locator.close();
+ }
+
+ protected ServerLocator createInVMNonHALocator()
+ {
+ return createNonHALocator(false);
+ }
+
+ protected ServerLocator createNettyNonHALocator()
+ {
+ return createNonHALocator(true);
+ }
+
+ protected ServerLocator createNonHALocator(final boolean isNetty)
+ {
+ ServerLocator locatorWithoutHA = isNetty ?
HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(NETTY_CONNECTOR_FACTORY))
+ :
HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(INVM_CONNECTOR_FACTORY));
+ locators.add(locatorWithoutHA);
+ return locatorWithoutHA;
+ }
+
+ protected ClientSessionFactoryImpl createFactory(final String connectorClass) throws
Exception
+ {
+ ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(new
TransportConfiguration(connectorClass));
+ return (ClientSessionFactoryImpl)locator.createSessionFactory();
+
+ }
+
+ protected ClientMessage createTextMessage(final ClientSession session, final String
s)
+ {
+ return createTextMessage(session, s, true);
+ }
+
+ public String getTextMessage(final ClientMessage m)
+ {
+ m.getBodyBuffer().resetReaderIndex();
+ return m.getBodyBuffer().readString();
+ }
+
+ protected ClientMessage createTextMessage(final ClientSession session, final String s,
final boolean durable)
+ {
+ ClientMessage message = session.createMessage(HornetQTextMessage.TYPE,
+ durable,
+ 0,
+ System.currentTimeMillis(),
+ (byte)1);
+ message.getBodyBuffer().writeString(s);
+ return message;
+ }
+
+ protected ClientMessage createBytesMessage(final ClientSession session, final byte[]
b, final boolean durable)
+ {
+ ClientMessage message = session.createMessage(HornetQBytesMessage.TYPE,
+ durable,
+ 0,
+ System.currentTimeMillis(),
+ (byte)1);
+ message.getBodyBuffer().writeBytes(b);
+ return message;
+ }
+
+ /**
+ * Deleting a file on LargeDire is an asynchronous process. Wee need to keep looking
for a while if the file hasn't been deleted yet
+ */
+ protected void validateNoFilesOnLargeDir(final int expect) throws Exception
+ {
+ File largeMessagesFileDir = new File(getLargeMessagesDir());
+
+ // Deleting the file is async... we keep looking for a period of the time until the
file is really gone
+ long timeout = System.currentTimeMillis() + 5000;
+ while (timeout > System.currentTimeMillis() &&
largeMessagesFileDir.listFiles().length != expect)
+ {
+ Thread.sleep(100);
+ }
+
+
+ if (expect != largeMessagesFileDir.listFiles().length)
+ {
+ for (File file : largeMessagesFileDir.listFiles())
+ {
+ System.out.println("File " + file + " still on ");
+ }
+ }
+
+ Assert.assertEquals(expect, largeMessagesFileDir.listFiles().length);
+ }
+
+ /**
+ * Deleting a file on LargeDire is an asynchronous process. Wee need to keep looking
for a while if the file hasn't been deleted yet
+ */
+ protected void validateNoFilesOnLargeDir() throws Exception
+ {
+ validateNoFilesOnLargeDir(0);
+ }
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+ class InVMNodeManagerServer extends HornetQServerImpl
+ {
+ final NodeManager nodeManager;
+
+ public InVMNodeManagerServer(NodeManager nodeManager)
+ {
+ super();
+ this.nodeManager = nodeManager;
+ }
+
+ public InVMNodeManagerServer(Configuration configuration, NodeManager nodeManager)
+ {
+ super(configuration);
+ this.nodeManager = nodeManager;
+ }
+
+ public InVMNodeManagerServer(Configuration configuration, MBeanServer mbeanServer,
NodeManager nodeManager)
+ {
+ super(configuration, mbeanServer);
+ this.nodeManager = nodeManager;
+ }
+
+ public InVMNodeManagerServer(Configuration configuration,
+ HornetQSecurityManager securityManager,
+ NodeManager nodeManager)
+ {
+ super(configuration, securityManager);
+ this.nodeManager = nodeManager;
+ }
+
+ public InVMNodeManagerServer(Configuration configuration,
+ MBeanServer mbeanServer,
+ HornetQSecurityManager securityManager,
+ NodeManager nodeManager)
+ {
+ super(configuration, mbeanServer, securityManager);
+ this.nodeManager = nodeManager;
+ }
+
+ @Override
+ protected NodeManager createNodeManager(String directory)
+ {
+ return nodeManager;
+ }
+
+ }
+}
Copied: trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/UnitTestCase.java
(from rev 10466, trunk/tests/src/org/hornetq/tests/util/UnitTestCase.java)
===================================================================
--- trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/UnitTestCase.java
(rev 0)
+++
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/UnitTestCase.java 2011-04-08
12:18:13 UTC (rev 10469)
@@ -0,0 +1,1245 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat 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.
+ */
+
+package org.hornetq.tests.util;
+
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.ref.Reference;
+import java.lang.ref.WeakReference;
+import java.net.ServerSocket;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import javax.naming.Context;
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.Xid;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.HornetQException;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.api.core.TransportConfiguration;
+import org.hornetq.api.core.client.ClientMessage;
+import org.hornetq.api.core.client.ClientSession;
+import org.hornetq.core.asyncio.impl.AsynchronousFileImpl;
+import org.hornetq.core.client.impl.ServerLocatorImpl;
+import org.hornetq.core.config.Configuration;
+import org.hornetq.core.config.impl.ConfigurationImpl;
+import org.hornetq.core.journal.impl.AIOSequentialFileFactory;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.persistence.impl.journal.OperationContextImpl;
+import org.hornetq.core.postoffice.Binding;
+import org.hornetq.core.postoffice.Bindings;
+import org.hornetq.core.postoffice.PostOffice;
+import org.hornetq.core.postoffice.QueueBinding;
+import org.hornetq.core.postoffice.impl.LocalQueueBinding;
+import org.hornetq.core.remoting.impl.invm.InVMRegistry;
+import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.server.JournalType;
+import org.hornetq.core.server.MessageReference;
+import org.hornetq.core.server.Queue;
+import org.hornetq.core.server.ServerMessage;
+import org.hornetq.core.server.impl.ServerMessageImpl;
+import org.hornetq.core.transaction.impl.XidImpl;
+import org.hornetq.jms.client.HornetQTextMessage;
+import org.hornetq.utils.UUIDGenerator;
+
+/**
+ *
+ * Helper base class for our unit tests
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:csuconic@redhat.com">Clebert</a>
+ *
+ */
+public class UnitTestCase extends TestCase
+{
+ // Constants -----------------------------------------------------
+
+ private static final Logger log = Logger.getLogger(UnitTestCase.class);
+
+ public static final String INVM_ACCEPTOR_FACTORY =
"org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory";
+
+ public static final String INVM_CONNECTOR_FACTORY =
"org.hornetq.core.remoting.impl.invm.InVMConnectorFactory";
+
+ public static final String NETTY_ACCEPTOR_FACTORY =
"org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory";
+
+ public static final String NETTY_CONNECTOR_FACTORY =
"org.hornetq.core.remoting.impl.netty.NettyConnectorFactory";
+
+ // Attributes ----------------------------------------------------
+
+ private static final String testDir = System.getProperty("java.io.tmpdir",
"/tmp") + "/hornetq-unit-test";
+
+ // There is a verification about thread leakages. We only fail a single thread when
this happens
+ private static Set<Thread> alreadyFailedThread = new HashSet<Thread>();
+
+ // Static --------------------------------------------------------
+
+ protected Configuration createDefaultConfig()
+ {
+ return createDefaultConfig(false);
+ }
+
+ protected Configuration createDefaultConfig(final boolean netty)
+ {
+ if (netty)
+ {
+ return createDefaultConfig(new HashMap<String, Object>(),
INVM_ACCEPTOR_FACTORY, NETTY_ACCEPTOR_FACTORY);
+ }
+ else
+ {
+ return createDefaultConfig(new HashMap<String, Object>(),
INVM_ACCEPTOR_FACTORY);
+ }
+ }
+
+ protected static Configuration createClusteredDefaultConfig(final int index,
+ final Map<String,
Object> params,
+ final String...
acceptors)
+ {
+ Configuration config = createDefaultConfig(index, params, acceptors);
+
+ config.setClustered(true);
+
+ return config;
+ }
+
+ protected static Configuration createDefaultConfig(final int index,
+ final Map<String, Object>
params,
+ final String... acceptors)
+ {
+ Configuration configuration = createBasicConfig(index);
+
+ configuration.getAcceptorConfigurations().clear();
+
+ for (String acceptor : acceptors)
+ {
+ TransportConfiguration transportConfig = new TransportConfiguration(acceptor,
params);
+ configuration.getAcceptorConfigurations().add(transportConfig);
+ }
+
+ return configuration;
+ }
+
+ protected static ConfigurationImpl createBasicConfig()
+ {
+ return createBasicConfig(0);
+ }
+
+ /**
+ * @param serverID
+ * @return
+ */
+ protected static ConfigurationImpl createBasicConfig(final int serverID)
+ {
+ ConfigurationImpl configuration = new ConfigurationImpl();
+ configuration.setSecurityEnabled(false);
+ configuration.setBindingsDirectory(getBindingsDir(serverID, false));
+ configuration.setJournalMinFiles(2);
+ configuration.setJournalDirectory(getJournalDir(serverID, false));
+ configuration.setJournalFileSize(100 * 1024);
+ configuration.setJournalType(getDefaultJournalType());
+ configuration.setPagingDirectory(getPageDir(serverID, false));
+ configuration.setLargeMessagesDirectory(getLargeMessagesDir(serverID, false));
+ configuration.setJournalCompactMinFiles(0);
+ configuration.setJournalCompactPercentage(0);
+ return configuration;
+ }
+
+ protected static Configuration createDefaultConfig(final Map<String, Object>
params, final String... acceptors)
+ {
+ Configuration configuration = new ConfigurationImpl();
+ configuration.setSecurityEnabled(false);
+ configuration.setJMXManagementEnabled(false);
+ configuration.setBindingsDirectory(getBindingsDir());
+ configuration.setJournalMinFiles(2);
+ configuration.setJournalDirectory(getJournalDir());
+ configuration.setJournalFileSize(100 * 1024);
+ configuration.setPagingDirectory(getPageDir());
+ configuration.setLargeMessagesDirectory(getLargeMessagesDir());
+ configuration.setJournalCompactMinFiles(0);
+ configuration.setJournalCompactPercentage(0);
+
+ configuration.setFileDeploymentEnabled(false);
+
+ configuration.setJournalType(getDefaultJournalType());
+
+ configuration.getAcceptorConfigurations().clear();
+
+ for (String acceptor : acceptors)
+ {
+ TransportConfiguration transportConfig = new TransportConfiguration(acceptor,
params);
+ configuration.getAcceptorConfigurations().add(transportConfig);
+ }
+
+ return configuration;
+ }
+
+ protected static String getUDPDiscoveryAddress()
+ {
+ return System.getProperty("TEST-UDP-ADDRESS", "230.1.2.3");
+ }
+
+ protected static String getUDPDiscoveryAddress(int variant)
+ {
+ String value = getUDPDiscoveryAddress();
+
+ int posPoint = value.lastIndexOf('.');
+
+ int last = Integer.valueOf(value.substring(posPoint + 1));
+
+ return value.substring(0, posPoint + 1) + (last + variant);
+ }
+
+ public static int getUDPDiscoveryPort()
+ {
+ return Integer.parseInt(System.getProperty("TEST-UDP-PORT",
"6750"));
+ }
+
+ public static int getUDPDiscoveryPort(final int variant)
+ {
+ return getUDPDiscoveryPort() + variant;
+ }
+
+ protected static JournalType getDefaultJournalType()
+ {
+ if (AsynchronousFileImpl.isLoaded())
+ {
+ return JournalType.ASYNCIO;
+ }
+ else
+ {
+ return JournalType.NIO;
+ }
+ }
+
+ /**
+ * @param name
+ */
+ public UnitTestCase(final String name)
+ {
+ super(name);
+ }
+
+ public UnitTestCase()
+ {
+ super();
+ }
+
+ public static void forceGC()
+ {
+ WeakReference<Object> dumbReference = new WeakReference<Object>(new
Object());
+ // A loop that will wait GC, using the minimal time as possible
+ while (dumbReference.get() != null)
+ {
+ System.gc();
+ try
+ {
+ Thread.sleep(500);
+ }
+ catch (InterruptedException e)
+ {
+ }
+ }
+ }
+
+ public static void forceGC(Reference<?> ref, long timeout)
+ {
+ long waitUntil = System.currentTimeMillis() + timeout;
+ // A loop that will wait GC, using the minimal time as possible
+ while (ref.get() != null && System.currentTimeMillis() < waitUntil)
+ {
+ ArrayList<String> list = new ArrayList<String>();
+ for (int i = 0; i < 1000; i++)
+ {
+ list.add("Some string with garbage with concatenation " + i);
+ }
+ list.clear();
+ list = null;
+ System.gc();
+ try
+ {
+ Thread.sleep(500);
+ }
+ catch (InterruptedException e)
+ {
+ }
+ }
+ }
+
+ // verify if these weak references are released after a few GCs
+ public static void checkWeakReferences(final WeakReference<?>... references)
+ {
+
+ int i = 0;
+ boolean hasValue = false;
+
+ do
+ {
+ hasValue = false;
+
+ if (i > 0)
+ {
+ UnitTestCase.forceGC();
+ }
+
+ for (WeakReference<?> ref : references)
+ {
+ if (ref.get() != null)
+ {
+ hasValue = true;
+ }
+ }
+ }
+ while (i++ <= 30 && hasValue);
+
+ for (WeakReference<?> ref : references)
+ {
+ Assert.assertNull(ref.get());
+ }
+ }
+
+ public static String threadDump(final String msg)
+ {
+ StringWriter str = new StringWriter();
+ PrintWriter out = new PrintWriter(str);
+
+ Map<Thread, StackTraceElement[]> stackTrace = Thread.getAllStackTraces();
+
+
out.println("*******************************************************************************");
+ out.println("Complete Thread dump " + msg);
+
+ for (Map.Entry<Thread, StackTraceElement[]> el : stackTrace.entrySet())
+ {
+
out.println("===============================================================================");
+ out.println("Thread " + el.getKey() +
+ " name = " +
+ el.getKey().getName() +
+ " id = " +
+ el.getKey().getId() +
+ " group = " +
+ el.getKey().getThreadGroup());
+ out.println();
+ for (StackTraceElement traceEl : el.getValue())
+ {
+ out.println(traceEl);
+ }
+ }
+
+
out.println("===============================================================================");
+ out.println("End Thread dump " + msg);
+
out.println("*******************************************************************************");
+
+ return str.toString();
+ }
+
+ protected static TestSuite createAIOTestSuite(final Class<?> clazz)
+ {
+ TestSuite suite = new TestSuite(clazz.getName() + " testsuite");
+
+ if (AIOSequentialFileFactory.isSupported())
+ {
+ suite.addTestSuite(clazz);
+ }
+ else
+ {
+ // System.out goes towards JUnit report
+ System.out.println("Test " + clazz.getName() + " ignored as AIO
is not available");
+ }
+
+ return suite;
+ }
+
+ public static String dumpBytes(final byte[] bytes)
+ {
+ StringBuffer buff = new StringBuffer();
+
+ buff.append(System.identityHashCode(bytes) + ", size: " + bytes.length +
" [");
+
+ for (int i = 0; i < bytes.length; i++)
+ {
+ buff.append(bytes[i]);
+
+ if (i != bytes.length - 1)
+ {
+ buff.append(", ");
+ }
+ }
+
+ buff.append("]");
+
+ return buff.toString();
+ }
+
+ public static String dumbBytesHex(final byte[] buffer, final int bytesPerLine)
+ {
+
+ StringBuffer buff = new StringBuffer();
+
+ buff.append("[");
+
+ for (int i = 0; i < buffer.length; i++)
+ {
+ buff.append(String.format("%1$2X", buffer[i]));
+ if (i + 1 < buffer.length)
+ {
+ buff.append(", ");
+ }
+ if ((i + 1) % bytesPerLine == 0)
+ {
+ buff.append("\n ");
+ }
+ }
+ buff.append("]");
+
+ return buff.toString();
+ }
+
+ public static void assertEqualsByteArrays(final byte[] expected, final byte[] actual)
+ {
+ // assertEquals(expected.length, actual.length);
+ for (int i = 0; i < expected.length; i++)
+ {
+ Assert.assertEquals("byte at index " + i, expected[i], actual[i]);
+ }
+ }
+
+ public static void assertEqualsTransportConfigurations(final TransportConfiguration[]
expected,
+ final TransportConfiguration[]
actual)
+ {
+ assertEquals(expected.length, actual.length);
+ for (int i = 0; i < expected.length; i++)
+ {
+ Assert.assertEquals("TransportConfiguration at index " + i,
expected[i], actual[i]);
+ }
+ }
+
+ public static void assertEqualsBuffers(final int size, final HornetQBuffer expected,
final HornetQBuffer actual)
+ {
+ // assertEquals(expected.length, actual.length);
+ expected.readerIndex(0);
+ actual.readerIndex(0);
+
+ for (int i = 0; i < size; i++)
+ {
+ byte b1 = expected.readByte();
+ byte b2 = actual.readByte();
+ Assert.assertEquals("byte at index " + i, b1, b2);
+ }
+ expected.resetReaderIndex();
+ actual.resetReaderIndex();
+ }
+
+ public static void assertEqualsByteArrays(final int length, final byte[] expected,
final byte[] actual)
+ {
+ // we check only for the given length (the arrays might be
+ // larger)
+ Assert.assertTrue(expected.length >= length);
+ Assert.assertTrue(actual.length >= length);
+ for (int i = 0; i < length; i++)
+ {
+ Assert.assertEquals("byte at index " + i, expected[i], actual[i]);
+ }
+ }
+
+ public static void assertSameXids(final List<Xid> expected, final
List<Xid> actual)
+ {
+ Assert.assertNotNull(expected);
+ Assert.assertNotNull(actual);
+ Assert.assertEquals(expected.size(), actual.size());
+
+ for (int i = 0; i < expected.size(); i++)
+ {
+ Xid expectedXid = expected.get(i);
+ Xid actualXid = actual.get(i);
+ UnitTestCase.assertEqualsByteArrays(expectedXid.getBranchQualifier(),
actualXid.getBranchQualifier());
+ Assert.assertEquals(expectedXid.getFormatId(), actualXid.getFormatId());
+ UnitTestCase.assertEqualsByteArrays(expectedXid.getGlobalTransactionId(),
actualXid.getGlobalTransactionId());
+ }
+ }
+
+ protected static void checkNoBinding(final Context context, final String binding)
+ {
+ try
+ {
+ context.lookup(binding);
+ Assert.fail("there must be no resource to look up for " + binding);
+ }
+ catch (Exception e)
+ {
+ }
+ }
+
+ protected static Object checkBinding(final Context context, final String binding)
throws Exception
+ {
+ Object o = context.lookup(binding);
+ Assert.assertNotNull(o);
+ return o;
+ }
+
+ /**
+ * @param connectorConfigs
+ * @return
+ */
+ protected ArrayList<String> registerConnectors(final HornetQServer server,
+ final
List<TransportConfiguration> connectorConfigs)
+ {
+ // The connectors need to be pre-configured at main config object but this method
is taking
+ // TransportConfigurations directly
+ // So this will first register them at the config and then generate a list of
objects
+ ArrayList<String> connectors = new ArrayList<String>();
+ for (TransportConfiguration tnsp : connectorConfigs)
+ {
+ String name = RandomUtil.randomString();
+
+ server.getConfiguration().getConnectorConfigurations().put(name, tnsp);
+
+ connectors.add(name);
+ }
+ return connectors;
+ }
+
+ protected static void checkFreePort(final int... ports)
+ {
+ for (int port : ports)
+ {
+ ServerSocket ssocket = null;
+ try
+ {
+ ssocket = new ServerSocket(port);
+ }
+ catch (Exception e)
+ {
+ System.out.println("port " + port + " is already
bound");
+ System.exit(0);
+ }
+ finally
+ {
+ if (ssocket != null)
+ {
+ try
+ {
+ ssocket.close();
+ }
+ catch (IOException e)
+ {
+ }
+ }
+ }
+ }
+ }
+
+ // Constructors --------------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ /**
+ * @return the testDir
+ */
+ protected String getTestDir()
+ {
+ return testDir;
+ }
+
+ protected void clearData()
+ {
+ clearData(getTestDir());
+ }
+
+ protected void clearData(final String testDir)
+ {
+ // Need to delete the root
+
+ File file = new File(testDir);
+ deleteDirectory(file);
+ file.mkdirs();
+
+ recreateDirectory(getJournalDir(testDir));
+ recreateDirectory(getBindingsDir(testDir));
+ recreateDirectory(getPageDir(testDir));
+ recreateDirectory(getLargeMessagesDir(testDir));
+ recreateDirectory(getClientLargeMessagesDir(testDir));
+ recreateDirectory(getTemporaryDir(testDir));
+
+ System.out.println("deleted " + testDir);
+ }
+
+ /**
+ * @return the journalDir
+ */
+ public static String getJournalDir()
+ {
+ return getJournalDir(testDir);
+ }
+
+ protected static String getJournalDir(final String testDir)
+ {
+ return testDir + "/journal";
+ }
+
+ protected static String getJournalDir(final int index, final boolean backup)
+ {
+ String dir = getJournalDir(testDir) + index + "-" + (backup ?
"B" : "L");
+
+ return dir;
+ }
+
+ /**
+ * @return the bindingsDir
+ */
+ protected static String getBindingsDir()
+ {
+ return getBindingsDir(testDir);
+ }
+
+ /**
+ * @return the bindingsDir
+ */
+ protected static String getBindingsDir(final String testDir)
+ {
+ return testDir + "/bindings";
+ }
+
+ /**
+ * @return the bindingsDir
+ */
+ protected static String getBindingsDir(final int index, final boolean backup)
+ {
+ return getBindingsDir(testDir) + index + "-" + (backup ? "B" :
"L");
+ }
+
+ /**
+ * @return the pageDir
+ */
+ protected static String getPageDir()
+ {
+ return getPageDir(testDir);
+ }
+
+ /**
+ * @return the pageDir
+ */
+ protected static String getPageDir(final String testDir)
+ {
+ return testDir + "/page";
+ }
+
+ protected static String getPageDir(final int index, final boolean backup)
+ {
+ return getPageDir(testDir) + index + "-" + (backup ? "B" :
"L");
+ }
+
+ /**
+ * @return the largeMessagesDir
+ */
+ protected static String getLargeMessagesDir()
+ {
+ return getLargeMessagesDir(testDir);
+ }
+
+ /**
+ * @return the largeMessagesDir
+ */
+ protected static String getLargeMessagesDir(final String testDir)
+ {
+ return testDir + "/large-msg";
+ }
+
+ protected static String getLargeMessagesDir(final int index, final boolean backup)
+ {
+ return getLargeMessagesDir(testDir) + index + "-" + (backup ?
"B" : "L");
+ }
+
+ /**
+ * @return the clientLargeMessagesDir
+ */
+ protected String getClientLargeMessagesDir()
+ {
+ return getClientLargeMessagesDir(testDir);
+ }
+
+ /**
+ * @return the clientLargeMessagesDir
+ */
+ protected String getClientLargeMessagesDir(final String testDir)
+ {
+ return testDir + "/client-large-msg";
+ }
+
+ /**
+ * @return the temporaryDir
+ */
+ protected String getTemporaryDir()
+ {
+ return getTemporaryDir(testDir);
+ }
+
+ /**
+ * @return the temporaryDir
+ */
+ protected String getTemporaryDir(final String testDir)
+ {
+ return testDir + "/temp";
+ }
+
+ protected static void expectHornetQException(final String message, final int
errorCode, final HornetQAction action)
+ {
+ try
+ {
+ action.run();
+ Assert.fail(message);
+ }
+ catch (Exception e)
+ {
+ Assert.assertTrue(e instanceof HornetQException);
+ Assert.assertEquals(errorCode, ((HornetQException)e).getCode());
+ }
+ }
+
+ protected static void expectHornetQException(final int errorCode, final HornetQAction
action)
+ {
+ UnitTestCase.expectHornetQException("must throw a HornetQException with the
expected errorCode: " + errorCode,
+ errorCode,
+ action);
+ }
+
+ protected static void expectXAException(final int errorCode, final HornetQAction
action)
+ {
+ try
+ {
+ action.run();
+ Assert.fail("must throw a XAException with the expected errorCode: " +
errorCode);
+ }
+ catch (Exception e)
+ {
+ Assert.assertTrue(e instanceof XAException);
+ Assert.assertEquals(errorCode, ((XAException)e).errorCode);
+ }
+ }
+
+ public static byte getSamplebyte(final long position)
+ {
+ return (byte)('a' + position % ('z' - 'a' + 1));
+ }
+
+ // Creates a Fake LargeStream without using a real file
+ public static InputStream createFakeLargeStream(final long size) throws Exception
+ {
+ return new InputStream()
+ {
+ private long count;
+
+ private boolean closed = false;
+
+ @Override
+ public void close() throws IOException
+ {
+ super.close();
+ closed = true;
+ }
+
+ @Override
+ public int read() throws IOException
+ {
+ if (closed)
+ {
+ throw new IOException("Stream was closed");
+ }
+ if (count++ < size)
+ {
+ return UnitTestCase.getSamplebyte(count - 1);
+ }
+ else
+ {
+ return -1;
+ }
+ }
+ };
+
+ }
+
+ /** It validates a Bean (POJO) using simple setters and getters with random values.
+ * You can pass a list of properties to be ignored, as some properties will have a
pre-defined domain (not being possible to use random-values on them) */
+ protected void validateGettersAndSetters(final Object pojo, final String...
IgnoredProperties) throws Exception
+ {
+ HashSet<String> ignoreSet = new HashSet<String>();
+
+ for (String ignore : IgnoredProperties)
+ {
+ ignoreSet.add(ignore);
+ }
+
+ BeanInfo info = Introspector.getBeanInfo(pojo.getClass());
+
+ PropertyDescriptor properties[] = info.getPropertyDescriptors();
+
+ for (PropertyDescriptor prop : properties)
+ {
+ Object value;
+
+ if (prop.getPropertyType() == String.class)
+ {
+ value = RandomUtil.randomString();
+ }
+ else if (prop.getPropertyType() == Integer.class || prop.getPropertyType() ==
Integer.TYPE)
+ {
+ value = RandomUtil.randomInt();
+ }
+ else if (prop.getPropertyType() == Long.class || prop.getPropertyType() ==
Long.TYPE)
+ {
+ value = RandomUtil.randomLong();
+ }
+ else if (prop.getPropertyType() == Boolean.class || prop.getPropertyType() ==
Boolean.TYPE)
+ {
+ value = RandomUtil.randomBoolean();
+ }
+ else if (prop.getPropertyType() == Double.class || prop.getPropertyType() ==
Double.TYPE)
+ {
+ value = RandomUtil.randomDouble();
+ }
+ else
+ {
+ System.out.println("Can't validate property of type " +
prop.getPropertyType() + " on " + prop.getName());
+ value = null;
+ }
+
+ if (value != null && prop.getWriteMethod() != null &&
prop.getReadMethod() == null)
+ {
+ System.out.println("WriteOnly property " + prop.getName() + "
on " + pojo.getClass());
+ }
+ else if (value != null & prop.getWriteMethod() != null &&
+ prop.getReadMethod() != null &&
+ !ignoreSet.contains(prop.getName()))
+ {
+ System.out.println("Validating " + prop.getName() + " type =
" + prop.getPropertyType());
+ prop.getWriteMethod().invoke(pojo, value);
+
+ Assert.assertEquals("Property " + prop.getName(), value,
prop.getReadMethod().invoke(pojo));
+ }
+ }
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ Map<Thread, StackTraceElement[]> previousThreads;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ deleteDirectory(new File(getTestDir()));
+
+ InVMRegistry.instance.clear();
+
+ // checkFreePort(TransportConstants.DEFAULT_PORT);
+
+ previousThreads = Thread.getAllStackTraces();
+
+ UnitTestCase.log.info("###### starting test " + this.getClass().getName()
+ "." + getName());
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ cleanupPools();
+
+ Map<Thread, StackTraceElement[]> threadMap = Thread.getAllStackTraces();
+ for (Thread thread : threadMap.keySet())
+ {
+ StackTraceElement[] stack = threadMap.get(thread);
+ for (StackTraceElement stackTraceElement : stack)
+ {
+ if
(stackTraceElement.getMethodName().contains("getConnectionWithRetry") &&
!alreadyFailedThread.contains(thread))
+ {
+ alreadyFailedThread.add(thread);
+ System.out.println(threadDump(this.getName() + " has left threads
running. Look at thread " +
+ thread.getName() +
+ " id = " +
+ thread.getId() +
+ " has running locators on test "
+
+ this.getName() +
+ " on this following dump"));
+ fail("test left serverlocator running, this could effect other
tests");
+ // System.exit(0);
+ }
+ else if
(stackTraceElement.getMethodName().contains("BroadcastGroupImpl.run") &&
!alreadyFailedThread.contains(thread))
+ {
+ alreadyFailedThread.add(thread);
+ System.out.println(threadDump(this.getName() + " has left threads
running. Look at thread " +
+ thread.getName() +
+ " id = " +
+ thread.getId() +
+ " is still broadcasting " +
+ this.getName() +
+ " on this following dump"));
+ fail("test left broadcastgroupimpl running, this could effect other
tests");
+ // System.exit(0);
+ }
+ }
+ }
+
+ Map<Thread, StackTraceElement[]> postThreads = Thread.getAllStackTraces();
+
+ boolean failedThread = false;
+ if (postThreads.size() > previousThreads.size())
+ {
+ StringBuffer buffer = new StringBuffer();
+
+
+
buffer.append("*********************************************************************************\n");
+ buffer.append("LEAKING THREADS\n");
+
+ for (Thread aliveThread : postThreads.keySet())
+ {
+ if (!aliveThread.getName().contains("SunPKCS11") &&
!previousThreads.containsKey(aliveThread))
+ {
+ failedThread = true;
+
buffer.append("=============================================================================\n");
+ buffer.append("Thread " + aliveThread + " is still alive
with the following stackTrace:\n");
+ StackTraceElement[] elements = postThreads.get(aliveThread);
+ for (StackTraceElement el : elements)
+ {
+ buffer.append(el + "\n");
+ }
+ }
+
+ }
+
buffer.append("*********************************************************************************\n");
+
+ System.out.println(buffer.toString());
+
+ }
+
+ //assertFalse("Thread Failed", failedThread);
+
+ super.tearDown();
+ }
+
+ /**
+ *
+ */
+ protected void cleanupPools()
+ {
+ OperationContextImpl.clearContext();
+
+ deleteDirectory(new File(getTestDir()));
+
+ int invmSize = InVMRegistry.instance.size();
+ if (invmSize > 0)
+ {
+ InVMRegistry.instance.clear();
+ fail("invm registry still had acceptors registered");
+ }
+
+ if (AsynchronousFileImpl.getTotalMaxIO() != 0)
+ {
+ AsynchronousFileImpl.resetMaxAIO();
+ Assert.fail("test did not close all its files " +
AsynchronousFileImpl.getTotalMaxIO());
+ }
+
+ // We shutdown the global pools to give a better isolation between tests
+ ServerLocatorImpl.clearThreadPools();
+ }
+
+ protected byte[] autoEncode(final Object... args)
+ {
+
+ int size = 0;
+
+ for (Object arg : args)
+ {
+ if (arg instanceof Byte)
+ {
+ size++;
+ }
+ else if (arg instanceof Boolean)
+ {
+ size++;
+ }
+ else if (arg instanceof Integer)
+ {
+ size += 4;
+ }
+ else if (arg instanceof Long)
+ {
+ size += 8;
+ }
+ else if (arg instanceof Float)
+ {
+ size += 4;
+ }
+ else if (arg instanceof Double)
+ {
+ size += 8;
+ }
+ else
+ {
+ throw new IllegalArgumentException("method autoEncode doesn't know
how to convert " + arg.getClass() +
+ " yet");
+ }
+ }
+
+ ByteBuffer buffer = ByteBuffer.allocate(size);
+
+ for (Object arg : args)
+ {
+ if (arg instanceof Byte)
+ {
+ buffer.put(((Byte)arg).byteValue());
+ }
+ else if (arg instanceof Boolean)
+ {
+ Boolean b = (Boolean)arg;
+ buffer.put((byte)(b.booleanValue() ? 1 : 0));
+ }
+ else if (arg instanceof Integer)
+ {
+ buffer.putInt(((Integer)arg).intValue());
+ }
+ else if (arg instanceof Long)
+ {
+ buffer.putLong(((Long)arg).longValue());
+ }
+ else if (arg instanceof Float)
+ {
+ buffer.putFloat(((Float)arg).floatValue());
+ }
+ else if (arg instanceof Double)
+ {
+ buffer.putDouble(((Double)arg).doubleValue());
+ }
+ else
+ {
+ throw new IllegalArgumentException("method autoEncode doesn't know
how to convert " + arg.getClass() +
+ " yet");
+ }
+ }
+
+ return buffer.array();
+ }
+
+ protected void recreateDirectory(final String directory)
+ {
+ File file = new File(directory);
+ deleteDirectory(file);
+ file.mkdirs();
+ }
+
+ protected boolean deleteDirectory(final File directory)
+ {
+ if (directory.isDirectory())
+ {
+ String[] files = directory.list();
+
+ for (int j = 0; j < files.length; j++)
+ {
+ if (!deleteDirectory(new File(directory, files[j])))
+ {
+ return false;
+ }
+ }
+ }
+
+ return directory.delete();
+ }
+
+ protected void copyRecursive(final File from, final File to) throws Exception
+ {
+ if (from.isDirectory())
+ {
+ if (!to.exists())
+ {
+ to.mkdir();
+ }
+
+ String[] subs = from.list();
+
+ for (String sub : subs)
+ {
+ copyRecursive(new File(from, sub), new File(to, sub));
+ }
+ }
+ else
+ {
+ InputStream in = null;
+
+ OutputStream out = null;
+
+ try
+ {
+ in = new BufferedInputStream(new FileInputStream(from));
+
+ out = new BufferedOutputStream(new FileOutputStream(to));
+
+ int b;
+
+ while ((b = in.read()) != -1)
+ {
+ out.write(b);
+ }
+ }
+ finally
+ {
+ if (in != null)
+ {
+ in.close();
+ }
+
+ if (out != null)
+ {
+ out.close();
+ }
+ }
+ }
+ }
+
+ protected void assertRefListsIdenticalRefs(final List<MessageReference> l1,
final List<MessageReference> l2)
+ {
+ if (l1.size() != l2.size())
+ {
+ Assert.fail("Lists different sizes: " + l1.size() + ", " +
l2.size());
+ }
+
+ Iterator<MessageReference> iter1 = l1.iterator();
+ Iterator<MessageReference> iter2 = l2.iterator();
+
+ while (iter1.hasNext())
+ {
+ MessageReference o1 = iter1.next();
+ MessageReference o2 = iter2.next();
+
+ Assert.assertTrue("expected " + o1 + " but was " + o2, o1 ==
o2);
+ }
+ }
+
+ protected ServerMessage generateMessage(final long id)
+ {
+ ServerMessage message = new ServerMessageImpl(id, 1000);
+
+ message.setMessageID(id);
+
+ message.getBodyBuffer().writeString(UUID.randomUUID().toString());
+
+ message.setAddress(new SimpleString("foo"));
+
+ return message;
+ }
+
+ protected MessageReference generateReference(final Queue queue, final long id)
+ {
+ ServerMessage message = generateMessage(id);
+
+ return message.createReference(queue);
+ }
+
+ protected int calculateRecordSize(final int size, final int alignment)
+ {
+ return (size / alignment + (size % alignment != 0 ? 1 : 0)) * alignment;
+ }
+
+ protected ClientMessage createTextMessage(final String s, final ClientSession
clientSession)
+ {
+ return createTextMessage(s, true, clientSession);
+ }
+
+ protected ClientMessage createTextMessage(final String s, final boolean durable, final
ClientSession clientSession)
+ {
+ ClientMessage message = clientSession.createMessage(HornetQTextMessage.TYPE,
+ durable,
+ 0,
+ System.currentTimeMillis(),
+ (byte)4);
+ message.getBodyBuffer().writeString(s);
+ return message;
+ }
+
+ protected XidImpl newXID()
+ {
+ return new XidImpl("xa1".getBytes(), 1,
UUIDGenerator.getInstance().generateStringUUID().getBytes());
+ }
+
+ protected int getMessageCount(final HornetQServer service, final String address)
throws Exception
+ {
+ return getMessageCount(service.getPostOffice(), address);
+ }
+
+ /**
+ * @param address
+ * @param postOffice
+ * @return
+ * @throws Exception
+ */
+ protected int getMessageCount(final PostOffice postOffice, final String address)
throws Exception
+ {
+ int messageCount = 0;
+
+ List<QueueBinding> bindings = getLocalQueueBindings(postOffice, address);
+
+ for (QueueBinding qBinding : bindings)
+ {
+ messageCount += qBinding.getQueue().getMessageCount();
+ }
+
+ return messageCount;
+ }
+
+ protected List<QueueBinding> getLocalQueueBindings(final PostOffice postOffice,
final String address) throws Exception
+ {
+ ArrayList<QueueBinding> bindingsFound = new ArrayList<QueueBinding>();
+
+ Bindings bindings = postOffice.getBindingsForAddress(new SimpleString(address));
+
+ for (Binding binding : bindings.getBindings())
+ {
+ if (binding instanceof LocalQueueBinding)
+ {
+ bindingsFound.add((QueueBinding)binding);
+ }
+ }
+ return bindingsFound;
+ }
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+ protected static interface HornetQAction
+ {
+ void run() throws Exception;
+ }
+
+}