Exemplo n.º 1
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();

    setupServer2();
    setupServer1();

    jmsServer1.start();
    jmsServer1.activated();

    jmsServer2.start();
    jmsServer2.activated();

    cf1 =
        (ConnectionFactory)
            HornetQJMSClient.createConnectionFactoryWithoutHA(
                JMSFactoryType.CF,
                new TransportConfiguration(
                    InVMConnectorFactory.class.getName(), generateInVMParams(0)));
    cf2 =
        (ConnectionFactory)
            HornetQJMSClient.createConnectionFactoryWithoutHA(
                JMSFactoryType.CF,
                new TransportConfiguration(
                    InVMConnectorFactory.class.getName(), generateInVMParams(1)));
  }
  /** @throws Exception */
  protected void startServer() throws Exception {
    Configuration conf = createDefaultConfig(false);
    conf.getConnectorConfigurations()
        .put("invm", new TransportConfiguration(INVM_CONNECTOR_FACTORY));
    conf.setSecurityEnabled(false);
    conf.setJMXManagementEnabled(true);
    conf.getAcceptorConfigurations().add(new TransportConfiguration(INVM_ACCEPTOR_FACTORY));
    server = HornetQServers.newHornetQServer(conf, mbeanServer, true);
    server.start();

    serverManager = new JMSServerManagerImpl(server);
    serverManager.start();

    ctx = new InVMNamingContext();

    serverManager.setContext(ctx);
    serverManager.activated();
  }
Exemplo n.º 3
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();

    Configuration conf = new ConfigurationImpl();
    conf.setSecurityEnabled(false);
    conf.setJMXManagementEnabled(true);
    conf.getAcceptorConfigurations()
        .add(new TransportConfiguration(NettyAcceptorFactory.class.getName()));
    server = HornetQServers.newHornetQServer(conf, false);
    server.start();

    serverManager = new JMSServerManagerImpl(server);
    initialContext = new InVMContext();
    serverManager.setContext(initialContext);
    serverManager.start();
    serverManager.activated();

    serverManager.createTopic(topicName, topicName);
    registerConnectionFactory();
  }