Author: ataylor
Date: 2011-04-12 06:17:50 -0400 (Tue, 12 Apr 2011)
New Revision: 10481
Added:
trunk/tests/timing-tests/
trunk/tests/timing-tests/pom.xml
trunk/tests/timing-tests/src/
trunk/tests/timing-tests/src/test/
trunk/tests/timing-tests/src/test/java/
trunk/tests/timing-tests/src/test/java/org/
trunk/tests/timing-tests/src/test/java/org/hornetq/
trunk/tests/timing-tests/src/test/java/org/hornetq/tests/
trunk/tests/timing-tests/src/test/java/org/hornetq/tests/timing/
Removed:
trunk/tests/src/org/hornetq/tests/timing/
Modified:
trunk/tests/hornetq-tests.iml
trunk/tests/pom.xml
trunk/tests/timing-tests/src/test/java/org/hornetq/tests/timing/util/UUIDTest.java
Log:
mavenised timing tests
Modified: trunk/tests/hornetq-tests.iml
===================================================================
--- trunk/tests/hornetq-tests.iml 2011-04-12 10:12:15 UTC (rev 10480)
+++ trunk/tests/hornetq-tests.iml 2011-04-12 10:17:50 UTC (rev 10481)
@@ -10,6 +10,7 @@
<sourceFolder
url="file://$MODULE_DIR$/integration-tests/src/main/java"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/soak-tests/src/test/java"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/stress-tests/src/test/java"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/timing-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" />
Modified: trunk/tests/pom.xml
===================================================================
--- trunk/tests/pom.xml 2011-04-12 10:12:15 UTC (rev 10480)
+++ trunk/tests/pom.xml 2011-04-12 10:17:50 UTC (rev 10481)
@@ -30,5 +30,6 @@
<module>joram-tests</module>
<module>soak-tests</module>
<module>stress-tests</module>
+ <module>timing-tests</module>
</modules>
</project>
Copied: trunk/tests/timing-tests/pom.xml (from rev 10480,
trunk/tests/stress-tests/pom.xml)
===================================================================
--- trunk/tests/timing-tests/pom.xml (rev 0)
+++ trunk/tests/timing-tests/pom.xml 2011-04-12 10:17:50 UTC (rev 10481)
@@ -0,0 +1,140 @@
+<!--
+ ~ 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.
+ -->
+
+<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.tests</groupId>
+ <artifactId>hornetq-tests-pom</artifactId>
+ <version>2.2.3-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.hornetq.tests</groupId>
+ <artifactId>timing-tests</artifactId>
+ <packaging>jar</packaging>
+ <name>HornetQ timing Tests</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.hornetq.tests</groupId>
+ <artifactId>unit-tests</artifactId>
+ <version>${project.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hornetq.tests</groupId>
+ <artifactId>integration-tests</artifactId>
+ <version>${project.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hornetq.tests</groupId>
+ <artifactId>jms-tests</artifactId>
+ <version>${project.version}</version>
+ <scope>compile</scope>
+ </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>
+ <dependency>
+ <groupId>org.jboss.naming</groupId>
+ <artifactId>jnpserver</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jboss.jbossts</groupId>
+ <artifactId>jbossts-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>apache-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-transaction-api</artifactId>
+ </dependency>
+ <!--this specifically for the JMS Bridge-->
+ <dependency>
+ <groupId>org.jboss.integration</groupId>
+ <artifactId>jboss-transaction-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-jaspi-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-jms-api</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>
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ </configuration>
+ </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/timing-tests/src/test/java/org/hornetq/tests/timing/util/UUIDTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/timing/util/UUIDTest.java 2011-04-11 12:47:21 UTC
(rev 10475)
+++
trunk/tests/timing-tests/src/test/java/org/hornetq/tests/timing/util/UUIDTest.java 2011-04-12
10:17:50 UTC (rev 10481)
@@ -13,12 +13,19 @@
package org.hornetq.tests.timing.util;
+import junit.framework.Assert;
+import org.hornetq.tests.util.UnitTestCase;
+import org.hornetq.utils.UUIDGenerator;
+
+import java.util.HashSet;
+import java.util.Set;
+
/**
*
* @author <a href="mailto:clebert.suconic@jboss.com">Clebert
Suconic</a>
*
*/
-public class UUIDTest extends org.hornetq.tests.unit.util.UUIDTest
+public class UUIDTest extends UnitTestCase
{
// Constants -----------------------------------------------------
@@ -31,11 +38,34 @@
// Public --------------------------------------------------------
+ public void testManyUUIDs() throws Exception
+ {
+ final int MANY_TIMES = getTimes();
+ Set<String> uuidsSet = new HashSet<String>();
+
+ UUIDGenerator gen = UUIDGenerator.getInstance();
+ for (int i = 0; i < MANY_TIMES; i++)
+ {
+ uuidsSet.add(gen.generateStringUUID());
+ }
+
+ // we put them in a set to check duplicates
+ Assert.assertEquals(MANY_TIMES, uuidsSet.size());
+ }
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
- @Override
protected int getTimes()
{
return 1000000;