Package org.hornetq.tests.unit.util

Examples of org.hornetq.tests.unit.util.InVMContext$NamingEnumerationImpl


      config.setJournalSyncNonTransactional(false);

      HornetQServer server = createServer(true, config, -1, -1, AddressFullMessagePolicy.BLOCK, new HashMap<String, AddressSettings>());

      JMSServerManagerImpl jmsServer = new JMSServerManagerImpl(server);
      InVMContext context = new InVMContext();
      jmsServer.setContext(context);
      jmsServer.start();

      server.getHornetQServerControl().addAddressSettings("jms.queue.Q1",
                                                          "DLQ",
                                                          "DLQ",
                                                          false,
                                                          5,
                                                          100 * 1024,
                                                          10 * 1024,
                                                          5,
                                                          5,
                                                          0,
                                                          false,
                                                          "PAGE");

      jmsServer.createQueue(true, "Q1", null, true, "/queue/Q1");

      HornetQJMSConnectionFactory cf = (HornetQJMSConnectionFactory)HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF,
                                                                                                                      new TransportConfiguration(INVM_CONNECTOR_FACTORY));

      Connection conn = cf.createConnection();
      conn.setClientID("tst");
      Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      javax.jms.Queue queue = (javax.jms.Queue)context.lookup("/queue/Q1");
     
      MessageProducer prod = sess.createProducer(queue);
      prod.setDeliveryMode(DeliveryMode.PERSISTENT);
      BytesMessage bmt = sess.createBytesMessage();
     
      bmt.writeBytes(new byte[1024]);
     
      for (int i = 0 ; i < 500; i++)
      {
         prod.send(bmt);
      }
     
      PagingStore store = server.getPagingManager().getPageStore(new SimpleString("jms.queue.Q1"));

      assertEquals(100 * 1024, store.getMaxSize());
      assertEquals(10 * 1024, store.getPageSizeBytes());
      assertEquals(AddressFullMessagePolicy.PAGE, store.getAddressFullMessagePolicy());

      jmsServer.stop();

      server = createServer(true, config, -1, -1, AddressFullMessagePolicy.BLOCK, new HashMap<String, AddressSettings>());

      jmsServer = new JMSServerManagerImpl(server);
      context = new InVMContext();
      jmsServer.setContext(context);
      jmsServer.start();

      AddressSettings settings = server.getAddressSettingsRepository().getMatch("jms.queue.Q1");

View Full Code Here


   @Override
   protected void setUp() throws Exception
   {
      super.setUp();
      backupJmsServer = new JMSServerManagerImpl(backupServer.getServer());
      context = new InVMContext();
      backupJmsServer.setContext(context);
      backupJmsServer.start();
   }
View Full Code Here

      server = HornetQServers.newHornetQServer(conf, mbeanServer, false);
      server.start();

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

      clientID = RandomUtil.randomString();
      subscriptionName = RandomUtil.randomString();
View Full Code Here

      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);
View Full Code Here

      conf0.setSecurityEnabled(false);
      conf0.getAcceptorConfigurations()
           .add(new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory"));
      server0 = HornetQServers.newHornetQServer(conf0, false);

      context0 = new InVMContext();
      jmsServer0 = new JMSServerManagerImpl(server0);
      jmsServer0.setContext(context0);
      jmsServer0.start();

      Configuration conf1 = createBasicConfig();
      conf1.setSecurityEnabled(false);
      conf1.setJournalDirectory(getJournalDir(1, false));
      conf1.setBindingsDirectory(getBindingsDir(1, false));
      params1 = new HashMap<String, Object>();
      params1.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
      conf1.getAcceptorConfigurations()
           .add(new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory", params1));

      server1 = HornetQServers.newHornetQServer(conf1, false);

      context1 = new InVMContext();

      jmsServer1 = new JMSServerManagerImpl(server1);
      jmsServer1.setContext(context1);
      jmsServer1.start();
View Full Code Here

      JMSConfiguration jmsConfig = new JMSConfigurationImpl();
      jmsConfig.getQueueConfigurations()
               .add(new JMSQueueConfigurationImpl(getQueueName(), null, false, getQueueName()));
      jmsConfig.getTopicConfigurations().add(new TopicConfigurationImpl(getTopicName(), getTopicName()));
      server = new JMSServerManagerImpl(hornetQServer, jmsConfig);
      server.setContext(new InVMContext());
      return server;
   }
View Full Code Here

      conf.getConnectorConfigurations().put("netty", new TransportConfiguration(NettyConnectorFactory.class.getName()));

      server = HornetQServers.newHornetQServer(conf, usePersistence());

      jmsServer = new JMSServerManagerImpl(server);
      context = new InVMContext();
      jmsServer.setContext(context);
      jmsServer.start();

      registerConnectionFactory();
   }
View Full Code Here

   protected void restartServer() throws Exception
   {
      jmsServer.start();
      jmsServer.activated();
      context = new InVMContext();
      jmsServer.setContext(context);
      registerConnectionFactory();
   }
View Full Code Here

      //jmsconfig.getTopicConfigurations().add(new TopicConfigurationImpl("t1", "topic/t1"));
     

      server2 = HornetQServers.newHornetQServer(conf2, false);
      jmsServer2 = new JMSServerManagerImpl(server2, jmsconfig);
      context2 = new InVMContext();
      jmsServer2.setContext(context2);
   }
View Full Code Here

      JMSConfigurationImpl jmsconfig = new JMSConfigurationImpl();
      //jmsconfig.getTopicConfigurations().add(new TopicConfigurationImpl("t1", "topic/t1"));
     
      server1 = HornetQServers.newHornetQServer(conf1, false);
      jmsServer1 = new JMSServerManagerImpl(server1, jmsconfig);
      context1 = new InVMContext();
      jmsServer1.setContext(context1);
   }
View Full Code Here

TOP

Related Classes of org.hornetq.tests.unit.util.InVMContext$NamingEnumerationImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.