@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)));
  }
Ejemplo n.º 2
0
 protected void restartServer() throws Exception {
   namingContext = new InVMNamingContext();
   jmsServer.setRegistry(new JndiBindingRegistry(namingContext));
   jmsServer.start();
   jmsServer.activated();
   registerConnectionFactory();
 }