protected static Configuration createDefaultConfig( final Map<String, Object> params, final String... acceptors) { Configuration configuration = new ConfigurationImpl(); configuration.setSecurityEnabled(false); configuration.setJMXManagementEnabled(false); configuration.setBindingsDirectory(getBindingsDir()); configuration.setJournalMinFiles(2); configuration.setJournalDirectory(getJournalDir()); configuration.setJournalFileSize(100 * 1024); configuration.setPagingDirectory(getPageDir()); configuration.setLargeMessagesDirectory(getLargeMessagesDir()); configuration.setJournalCompactMinFiles(0); configuration.setJournalCompactPercentage(0); configuration.setFileDeploymentEnabled(false); configuration.setJournalType(getDefaultJournalType()); configuration.getAcceptorConfigurations().clear(); for (String acceptor : acceptors) { TransportConfiguration transportConfig = new TransportConfiguration(acceptor, params); configuration.getAcceptorConfigurations().add(transportConfig); } return configuration; }
@Override @Before public void setUp() throws Exception { super.setUp(); Configuration config = createBasicConfig(); config.setFileDeploymentEnabled(false); config.setSecurityEnabled(false); config .getAcceptorConfigurations() .add(new TransportConfiguration(InVMAcceptorFactory.class.getName())); InVMContext context = new InVMContext(); jmsServer = new JMSServerManagerImpl(HornetQServers.newHornetQServer(config, false)); jmsServer.setContext(context); jmsServer.start(); jmsServer.createQueue( false, JMSBridgeImplTest.SOURCE, null, true, "/queue/" + JMSBridgeImplTest.SOURCE); jmsServer.createQueue( false, JMSBridgeImplTest.TARGET, null, true, "/queue/" + JMSBridgeImplTest.TARGET); }