public EmbeddedActiveMQ stop() throws Exception { activeMQServer.stop(); return this; } }
public static void stopServer() throws Exception { if (server != null) { server.stop(); } server = null; }
@Override public void run() { try { server.stop(); } catch (Exception e) { e.printStackTrace(); } } });
@Override public void run() { try { server.stop(); } catch (Exception e) { e.printStackTrace(); } } }.start();
@After public void stopServer() throws Exception { try { if (server != null) { server.stop(); } } catch (Throwable e) { e.printStackTrace(); } }
@After public void teardown() { try { server.stop(); } catch (Exception e) { // Do Nothing } }
public void stopBroker() throws Exception { if (server.isStarted()) { server.stop(); server = null; } }
@Override @After public void tearDown() throws Exception { if (server != null) { server.stop(); server = null; } }
@After public void tearDown() throws Exception { if (server != null) { server.stop(); } }
@After public void tearDown() throws Exception { locator.close(); server.stop(); }
@After public void tearDown() throws Exception { locator.close(); server.stop(); }
@Override @After public void tearDown() throws Exception { server.stop(); super.tearDown(); }
@Test public void testJobsGetScheduledToSuppliedThreadPool() throws Exception { server.stop(); ScheduledThreadPoolExecutor scheduledExecutorService = (ScheduledThreadPoolExecutor) server.getScheduledPool(); Field field = server.getExecutorFactory().getClass().getDeclaredField("parent"); field.setAccessible(true); ThreadPoolExecutor threadPool = (ThreadPoolExecutor) field.get(server.getExecutorFactory()); // Check jobs are getting scheduled and executed. assertTrue(threadPool.getCompletedTaskCount() > 0); assertTrue(scheduledExecutorService.getTaskCount() > 0); } }
@Test public void testRelativePathOnDefaultConfig() throws Exception { Configuration configuration = createDefaultConfig(false); ActiveMQServer server = createServer(true, configuration, AddressSettings.DEFAULT_PAGE_SIZE, AddressSettings.DEFAULT_MAX_SIZE_BYTES, new HashMap<String, AddressSettings>()); server.start(); server.stop(); checkData(new File(configuration.getJournalDirectory()), ".amq"); checkData(new File(configuration.getBindingsDirectory()), ".bindings"); }
private void restart() throws Exception { session.close(); server.stop(); server.start(); sf = createSessionFactory(locator); session = sf.createSession(false, true, true); } // Inner classes -------------------------------------------------
@Test public void testCloseConnectionAfterServerIsShutdown() throws Exception { server.start(); jbcf = createConnectionFactory(); jbcf.setBlockOnDurableSend(true); jbcf.setBlockOnNonDurableSend(true); jbcf.setReconnectAttempts(-1); conn = jbcf.createConnection(); server.stop(); conn.close(); }
@Test public void testDuplicateIDCacheJournalRetentionForNonTemporaryQueues() throws Exception { testDuplicateIDCacheMemoryRetention(false); server.stop(); waitForServerToStop(server); server.start(); Assert.assertEquals(0, ((PostOfficeImpl) server.getPostOffice()).getDuplicateIDCaches().size()); }
@Test public void testDuplicateIDCacheJournalRetentionForTemporaryQueues() throws Exception { testDuplicateIDCacheMemoryRetention(true); server.stop(); waitForServerToStop(server); server.start(); Assert.assertEquals(0, ((PostOfficeImpl) server.getPostOffice()).getDuplicateIDCaches().size()); }