mirror of
https://github.com/apache/activemq-artemis.git
synced 2025-02-08 02:59:14 +00:00
This closes #203 - fixes mainly for test-suite
This commit is contained in:
commit
d9c9fc0e9e
@ -1471,12 +1471,13 @@ final class PageSubscriptionImpl implements PageSubscription
|
|||||||
public void remove()
|
public void remove()
|
||||||
{
|
{
|
||||||
deliveredCount.incrementAndGet();
|
deliveredCount.incrementAndGet();
|
||||||
if (currentDelivery != null)
|
PagedReference delivery = currentDelivery;
|
||||||
|
if (delivery != null)
|
||||||
{
|
{
|
||||||
PageCursorInfo info = PageSubscriptionImpl.this.getPageInfo(currentDelivery.getPosition());
|
PageCursorInfo info = PageSubscriptionImpl.this.getPageInfo(delivery.getPosition());
|
||||||
if (info != null)
|
if (info != null)
|
||||||
{
|
{
|
||||||
info.remove(currentDelivery.getPosition());
|
info.remove(delivery.getPosition());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,10 @@ public class TransactionImpl implements Transaction
|
|||||||
// so we reset it now
|
// so we reset it now
|
||||||
beforeRollback();
|
beforeRollback();
|
||||||
afterRollback();
|
afterRollback();
|
||||||
operations.clear();
|
if (operations != null)
|
||||||
|
{
|
||||||
|
operations.clear();
|
||||||
|
}
|
||||||
throw exception;
|
throw exception;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
2
pom.xml
2
pom.xml
@ -203,7 +203,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jboss.logging</groupId>
|
<groupId>org.jboss.logging</groupId>
|
||||||
<artifactId>jboss-logging-processor</artifactId>
|
<artifactId>jboss-logging-processor</artifactId>
|
||||||
<version>2.0.0.Alpha1</version>
|
<version>2.0.0.Alpha2</version>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
<!-- License: LGPL-->
|
<!-- License: LGPL-->
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -1245,6 +1245,7 @@ public class DuplicateDetectionTest extends ServiceTestBase
|
|||||||
}
|
}
|
||||||
catch (XAException expected)
|
catch (XAException expected)
|
||||||
{
|
{
|
||||||
|
assertTrue(expected.getCause().toString().contains("DUPLICATE_ID_REJECTED"));
|
||||||
}
|
}
|
||||||
|
|
||||||
session.rollback(xid2);
|
session.rollback(xid2);
|
||||||
|
@ -15,12 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.tests.integration.client;
|
package org.apache.activemq.tests.integration.client;
|
||||||
import org.apache.activemq.api.core.ActiveMQException;
|
import javax.management.MBeanServer;
|
||||||
import org.apache.activemq.core.server.ServerConsumer;
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.After;
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import java.lang.management.ManagementFactory;
|
import java.lang.management.ManagementFactory;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
@ -29,9 +24,7 @@ import java.util.concurrent.ScheduledExecutorService;
|
|||||||
import java.util.concurrent.Semaphore;
|
import java.util.concurrent.Semaphore;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import javax.management.MBeanServer;
|
import org.apache.activemq.api.core.ActiveMQException;
|
||||||
|
|
||||||
import org.junit.Assert;
|
|
||||||
import org.apache.activemq.api.core.Interceptor;
|
import org.apache.activemq.api.core.Interceptor;
|
||||||
import org.apache.activemq.api.core.SimpleString;
|
import org.apache.activemq.api.core.SimpleString;
|
||||||
import org.apache.activemq.api.core.client.ClientConsumer;
|
import org.apache.activemq.api.core.client.ClientConsumer;
|
||||||
@ -56,6 +49,7 @@ import org.apache.activemq.core.protocol.core.Packet;
|
|||||||
import org.apache.activemq.core.protocol.core.impl.wireformat.SessionReceiveMessage;
|
import org.apache.activemq.core.protocol.core.impl.wireformat.SessionReceiveMessage;
|
||||||
import org.apache.activemq.core.server.ActiveMQServer;
|
import org.apache.activemq.core.server.ActiveMQServer;
|
||||||
import org.apache.activemq.core.server.Queue;
|
import org.apache.activemq.core.server.Queue;
|
||||||
|
import org.apache.activemq.core.server.ServerConsumer;
|
||||||
import org.apache.activemq.core.server.ServerMessage;
|
import org.apache.activemq.core.server.ServerMessage;
|
||||||
import org.apache.activemq.core.server.ServerSessionFactory;
|
import org.apache.activemq.core.server.ServerSessionFactory;
|
||||||
import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
|
import org.apache.activemq.core.server.impl.ActiveMQServerImpl;
|
||||||
@ -72,6 +66,10 @@ import org.apache.activemq.spi.core.security.ActiveMQSecurityManagerImpl;
|
|||||||
import org.apache.activemq.tests.util.ServiceTestBase;
|
import org.apache.activemq.tests.util.ServiceTestBase;
|
||||||
import org.apache.activemq.utils.ExecutorFactory;
|
import org.apache.activemq.utils.ExecutorFactory;
|
||||||
import org.apache.activemq.utils.ReusableLatch;
|
import org.apache.activemq.utils.ReusableLatch;
|
||||||
|
import org.junit.After;
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This test will simulate a consumer hanging on the delivery packet due to unbehaved clients
|
* This test will simulate a consumer hanging on the delivery packet due to unbehaved clients
|
||||||
@ -150,8 +148,8 @@ public class HangConsumerTest extends ServiceTestBase
|
|||||||
sessionProducer.commit();
|
sessionProducer.commit();
|
||||||
|
|
||||||
// These three operations should finish without the test hanging
|
// These three operations should finish without the test hanging
|
||||||
getMessagesAdded(queue);
|
queue.getMessagesAdded();
|
||||||
getMessageCount(queue);
|
queue.getMessageCount();
|
||||||
|
|
||||||
releaseConsumers();
|
releaseConsumers();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user