1717
1818package org .apache .activemq .store .kahadb ;
1919
20- import java .io .File ;
21- import java .io .IOException ;
22- import java .util .LinkedList ;
23- import java .util .List ;
24-
20+ import jakarta .jms .Connection ;
21+ import jakarta .jms .JMSException ;
22+ import jakarta .jms .MessageConsumer ;
23+ import jakarta .jms .MessageProducer ;
24+ import jakarta .jms .Session ;
25+ import jakarta .jms .TextMessage ;
2526import org .apache .activemq .ActiveMQConnectionFactory ;
2627import org .apache .activemq .broker .BrokerService ;
2728import org .apache .activemq .command .ActiveMQQueue ;
3031import org .apache .activemq .store .MessageRecoveryContext ;
3132import org .apache .activemq .store .MessageRecoveryListener ;
3233import org .apache .activemq .store .MessageStore ;
34+ import org .apache .activemq .util .IOHelper ;
3335import org .junit .After ;
34- import org .junit .Before ;
3536import org .junit .Rule ;
3637import org .junit .Test ;
3738import org .junit .rules .TestName ;
3839import org .slf4j .Logger ;
3940import org .slf4j .LoggerFactory ;
4041
41- import jakarta .jms .Connection ;
42- import jakarta .jms .JMSException ;
43- import jakarta .jms .MessageConsumer ;
44- import jakarta .jms .MessageProducer ;
45- import jakarta .jms .Session ;
46- import jakarta .jms .TextMessage ;
42+ import java .io .File ;
43+ import java .io .IOException ;
44+ import java .util .LinkedList ;
45+ import java .util .List ;
4746
4847import static org .junit .Assert .assertEquals ;
4948
@@ -57,16 +56,6 @@ public class KahaDBOffsetRecoveryListenerTest {
5756 @ Rule
5857 public TestName testName = new TestName ();
5958
60- protected final int PRETEST_MSG_COUNT = 17531 ;
61-
62- @ Before
63- public void beforeEach () throws Exception {
64- // Send+Recv a odd number of messages beyond cache sizes
65- // to confirm the queue's sequence number gets pushed off
66- sendMessages (PRETEST_MSG_COUNT , testName .getMethodName ());
67- assertEquals (Integer .valueOf (PRETEST_MSG_COUNT ), Integer .valueOf (receiveMessages (testName .getMethodName ())));
68- }
69-
7059 @ After
7160 public void afterEach () {
7261 brokerService = null ;
@@ -85,7 +74,7 @@ protected BrokerService createBroker(KahaDBStore kaha) throws Exception {
8574 private KahaDBStore createStore (boolean delete ) throws IOException {
8675 KahaDBStore kaha = new KahaDBStore ();
8776 kaha .setJournalMaxFileLength (1024 *100 );
88- kaha .setDirectory (new File ("target" + File . separator + "activemq-data" + File . separator + "kahadb-recovery-tests" ));
77+ kaha .setDirectory (new File (IOHelper . getDefaultDataDirectory (), "kahadb-recovery-tests" ));
8978 if ( delete ) {
9079 kaha .deleteAllMessages ();
9180 }
0 commit comments