From 4b7e5c914bae8ea80229d525780e0d47dac47cde Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Tue, 3 Jul 2007 08:21:28 +0000 Subject: [PATCH] Audit test case git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@552732 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/ActiveMQMessageAuditTest.java | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100755 activemq-core/src/test/java/org/apache/activemq/ActiveMQMessageAuditTest.java diff --git a/activemq-core/src/test/java/org/apache/activemq/ActiveMQMessageAuditTest.java b/activemq-core/src/test/java/org/apache/activemq/ActiveMQMessageAuditTest.java new file mode 100755 index 0000000000..5f25bf9ca0 --- /dev/null +++ b/activemq-core/src/test/java/org/apache/activemq/ActiveMQMessageAuditTest.java @@ -0,0 +1,94 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE + * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file + * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package org.apache.activemq; + +import java.util.ArrayList; +import java.util.List; +import junit.framework.TestCase; +import org.apache.activemq.broker.region.MessageReference; +import org.apache.activemq.command.ActiveMQMessage; +import org.apache.activemq.command.MessageId; +import org.apache.activemq.command.ProducerId; +import org.apache.activemq.util.IdGenerator; + +/** + * ActiveMQMessageAuditTest + * + * @version $Revision: 1.1.1.1 $ + */ +public class ActiveMQMessageAuditTest extends TestCase{ + + public static void main(String[] args){ + } + + protected void setUp() throws Exception{ + super.setUp(); + } + + protected void tearDown() throws Exception{ + super.tearDown(); + } + + /** + * Constructor for ActiveMQMessageAuditTest. + * + * @param arg0 + */ + public ActiveMQMessageAuditTest(String arg0){ + super(arg0); + } + + /** + * test case for isDuplicate + */ + public void testIsDuplicateString(){ + int count=10000; + ActiveMQMessageAudit audit=new ActiveMQMessageAudit(); + IdGenerator idGen=new IdGenerator(); + // add to a list + List list=new ArrayList(); + for(int i=0;i list=new ArrayList(); + for(int i=0;i