Repository: falcon Updated Branches: refs/heads/master fc74b9d9a -> a819b5b56
FALCON-2318 Unit tests in JMSMessageConsumerTest are failing when run⦠â¦ning multiple times without clean Change-Id: I75bf58029c783384e8ff6f0f864218581cb3c9fa Author: Denes Bodo <[email protected]> Reviewers: @pallavi-rao Closes #392 from dionusos/FALCON-2318 Project: http://git-wip-us.apache.org/repos/asf/falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/a819b5b5 Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/a819b5b5 Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/a819b5b5 Branch: refs/heads/master Commit: a819b5b56717399b53e14a5f5a8ea017279bb204 Parents: fc74b9d Author: Denes Bodo <[email protected]> Authored: Wed Feb 21 14:17:17 2018 +0530 Committer: Pallavi Nagesha Rao <[email protected]> Committed: Wed Feb 21 14:17:17 2018 +0530 ---------------------------------------------------------------------- .../org/apache/falcon/messaging/JMSMessageConsumerTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/falcon/blob/a819b5b5/messaging/src/test/java/org/apache/falcon/messaging/JMSMessageConsumerTest.java ---------------------------------------------------------------------- diff --git a/messaging/src/test/java/org/apache/falcon/messaging/JMSMessageConsumerTest.java b/messaging/src/test/java/org/apache/falcon/messaging/JMSMessageConsumerTest.java index 6237bdf..31d58cb 100644 --- a/messaging/src/test/java/org/apache/falcon/messaging/JMSMessageConsumerTest.java +++ b/messaging/src/test/java/org/apache/falcon/messaging/JMSMessageConsumerTest.java @@ -18,9 +18,11 @@ package org.apache.falcon.messaging; +import java.io.File; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.jmx.BrokerView; +import org.apache.commons.io.FileUtils; import org.apache.falcon.FalconException; import org.apache.falcon.entity.store.ConfigurationStore; import org.apache.falcon.entity.v0.EntityType; @@ -58,6 +60,7 @@ public class JMSMessageConsumerTest { private static final String BROKER_IMPL_CLASS = "org.apache.activemq.ActiveMQConnectionFactory"; private static final String TOPIC_NAME = "FALCON.ENTITY.TOPIC"; private static final String SECONDARY_TOPIC_NAME = "FALCON.ENTITY.SEC.TOPIC"; + private static final String DATA_DIRECTORY = "target/activemq"; private BrokerService broker; private JMSMessageConsumer subscriber; @@ -65,9 +68,10 @@ public class JMSMessageConsumerTest { @BeforeMethod public void setup() throws Exception { + FileUtils.deleteDirectory(new File(DATA_DIRECTORY)); broker = new BrokerService(); broker.addConnector(BROKER_URL); - broker.setDataDirectory("target/activemq"); + broker.setDataDirectory(DATA_DIRECTORY); broker.setBrokerName("localhost"); jobEndService = Mockito.mock(WorkflowJobEndNotificationService.class); broker.start(); @@ -291,6 +295,7 @@ public class JMSMessageConsumerTest { ConfigurationStore.get().remove(EntityType.PROCESS, "process1"); broker.stop(); subscriber.closeSubscriber(); + FileUtils.deleteDirectory(new File(DATA_DIRECTORY)); } @Test
