@Override
  @Before
  public void setUp() throws Exception {
    super.setUp();

    setupServer2();
    setupServer1();

    jmsServer1.start();
    jmsServer1.activated();
    waitForServerToStart(jmsServer1.getActiveMQServer());

    jmsServer2.start();
    jmsServer2.activated();
    waitForServerToStart(jmsServer2.getActiveMQServer());

    waitForTopology(jmsServer1.getActiveMQServer(), 2);

    waitForTopology(jmsServer2.getActiveMQServer(), 2);

    cf1 =
        ActiveMQJMSClient.createConnectionFactoryWithoutHA(
            JMSFactoryType.CF,
            new TransportConfiguration(
                InVMConnectorFactory.class.getName(), generateInVMParams(1)));
    cf2 =
        ActiveMQJMSClient.createConnectionFactoryWithoutHA(
            JMSFactoryType.CF,
            new TransportConfiguration(
                InVMConnectorFactory.class.getName(), generateInVMParams(2)));
  }
Exemplo n.º 2
0
 protected void restartServer() throws Exception {
   namingContext = new InVMNamingContext();
   jmsServer.setRegistry(new JndiBindingRegistry(namingContext));
   jmsServer.start();
   jmsServer.activated();
   registerConnectionFactory();
 }
Exemplo n.º 3
0
  @Override
  @Before
  public void setUp() throws Exception {
    super.setUp();

    mbeanServer = MBeanServerFactory.createMBeanServer();

    Configuration config =
        createDefaultConfig(true)
            .setSecurityEnabled(useSecurity())
            .addConnectorConfiguration("invm", new TransportConfiguration(INVM_CONNECTOR_FACTORY))
            .setTransactionTimeoutScanPeriod(100);

    server = addServer(ActiveMQServers.newActiveMQServer(config, mbeanServer, usePersistence()));
    jmsServer = new JMSServerManagerImpl(server);
    namingContext = new InVMNamingContext();
    jmsServer.setRegistry(new JndiBindingRegistry(namingContext));
    jmsServer.start();

    registerConnectionFactory();
  }