@@ -0,0 +1,2743 @@
+/**%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.apache.activemq;%0A%0Aimport java.util.concurrent.TimeUnit;%0Aimport javax.jms.ConnectionFactory;%0Aimport javax.jms.Session;%0Aimport javax.jms.TextMessage;%0Aimport org.apache.activemq.broker.BrokerService;%0Aimport org.apache.activemq.broker.region.policy.PolicyEntry;%0Aimport org.apache.activemq.broker.region.policy.PolicyMap;%0Aimport org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter;%0A%0A/**%0A * User: gtully%0A */%0Apublic class ExpiryHogTest extends JmsMultipleClientsTestSupport %7B%0A    boolean sleep = false;%0A%0A    int numMessages = 4;%0A%0A    public void testHog() throws Exception %7B%0A        ConnectionFactory f = createConnectionFactory();%0A        destination = createDestination();%0A        startConsumers(f, destination);%0A        sleep = true;%0A        this.startProducers(f, destination, numMessages);%0A        allMessagesList.assertMessagesReceived(numMessages);%0A    %7D%0A%0A    protected BrokerService createBroker() throws Exception %7B%0A        BrokerService bs = new BrokerService();%0A        bs.setDeleteAllMessagesOnStartup(true);%0A        PolicyMap policyMap = new PolicyMap();%0A        PolicyEntry defaultEntry = new PolicyEntry();%0A        defaultEntry.setExpireMessagesPeriod(5000);%0A        defaultEntry.setUseCache(false);%0A        policyMap.setDefaultEntry(defaultEntry);%0A        bs.setDestinationPolicy(policyMap);%0A%0A        KahaDBPersistenceAdapter ad = (KahaDBPersistenceAdapter) bs.getPersistenceAdapter();%0A        ad.setConcurrentStoreAndDispatchQueues(false);%0A        return bs;%0A    %7D%0A%0A    protected TextMessage createTextMessage(Session session, String initText) throws Exception %7B%0A        if (sleep) %7B%0A            TimeUnit.SECONDS.sleep(10);%0A        %7D%0A        TextMessage msg = super.createTextMessage(session, initText);%0A        msg.setJMSExpiration(4000);%0A        return msg;%0A    %7D%0A%0A    @Override%0A    protected void setUp() throws Exception %7B%0A        autoFail = false;%0A        persistent = true;%0A        super.setUp();%0A    %7D%0A%7D%0A

test for possible bug to colaborate on