Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E273B200BAB for ; Sat, 8 Oct 2016 00:50:34 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E136F160AE9; Fri, 7 Oct 2016 22:50:34 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2A1DE160AE8 for ; Sat, 8 Oct 2016 00:50:34 +0200 (CEST) Received: (qmail 81296 invoked by uid 500); 7 Oct 2016 22:50:33 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 81285 invoked by uid 99); 7 Oct 2016 22:50:32 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Oct 2016 22:50:32 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A0FE5DFB81; Fri, 7 Oct 2016 22:50:32 +0000 (UTC) From: clebertsuconic To: dev@activemq.apache.org Reply-To: dev@activemq.apache.org References: In-Reply-To: Subject: [GitHub] activemq-artemis pull request #826: ARTEMIS-761 fix possible dup journal rec... Content-Type: text/plain Message-Id: <20161007225032.A0FE5DFB81@git1-us-west.apache.org> Date: Fri, 7 Oct 2016 22:50:32 +0000 (UTC) archived-at: Fri, 07 Oct 2016 22:50:35 -0000 Github user clebertsuconic commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/826#discussion_r82482751 --- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/DuplicateRecordIdTest.java --- @@ -0,0 +1,54 @@ +/* + * 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.artemis.tests.integration.journal; + +import org.apache.activemq.artemis.api.core.SimpleString; +import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl; +import org.apache.activemq.artemis.api.core.management.AddressSettingsInfo; +import org.apache.activemq.artemis.cli.commands.tools.PrintData; +import org.apache.activemq.artemis.core.server.ActiveMQServer; +import org.apache.activemq.artemis.core.settings.impl.AddressSettings; +import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; +import org.junit.Before; +import org.junit.Test; + +public class DuplicateRecordIdTest extends ActiveMQTestBase { + + protected ActiveMQServer server; + + @Override + @Before + public void setUp() throws Exception { + super.setUp(); + server = createServer(false, createDefaultInVMConfig().addAddressesSetting("#", new AddressSettings().setDeadLetterAddress(new SimpleString("dlq")).setExpiryAddress(new SimpleString("dlq")))); + server.getConfiguration().setPersistenceEnabled(true); + } + + @Test + public void testDuplicateRecordId() throws Exception { + for (int i = 0; i < 3; i++) { + server.start(); + ActiveMQServerControl serverControl = server.getActiveMQServerControl(); + serverControl.removeAddressSettings("q"); + AddressSettingsInfo defaultSettings = AddressSettingsInfo.from(serverControl.getAddressSettingsAsJSON("#")); + serverControl.addAddressSettings("q", "dlq", defaultSettings.getExpiryAddress(), -1, false, 1, defaultSettings.getMaxSizeBytes(), defaultSettings.getPageSizeBytes(), defaultSettings.getPageCacheMaxSize(), defaultSettings.getRedeliveryDelay(), defaultSettings.getRedeliveryMultiplier(), defaultSettings.getMaxRedeliveryDelay(), defaultSettings.getRedistributionDelay(), defaultSettings.isSendToDLAOnNoRoute(), defaultSettings.getAddressFullMessagePolicy(), defaultSettings.getSlowConsumerThreshold(), defaultSettings.getSlowConsumerCheckPeriod(), defaultSettings.getSlowConsumerPolicy(), defaultSettings.isAutoCreateJmsQueues(), defaultSettings.isAutoDeleteJmsQueues(), defaultSettings.isAutoCreateJmsTopics(), defaultSettings.isAutoDeleteJmsTopics()); + server.stop(); + PrintData.printData(server.getConfiguration().getBindingsLocation().getAbsoluteFile(), server.getConfiguration().getJournalLocation().getAbsoluteFile(), server.getConfiguration().getPagingLocation().getAbsoluteFile()); --- End diff -- actually.. just leave it ... it doesn't bother :) --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---