Examples of ConnectionFactoryProperties


Examples of org.hornetq.ra.ConnectionFactoryProperties

   public void testCreateConnectionFactoryOverrideDiscovery() throws Exception
   {
      HornetQResourceAdapter ra = new HornetQResourceAdapter();
      ra.setConnectorClassName(InVMConnector.class.getName());
      ConnectionFactoryProperties connectionFactoryProperties = new ConnectionFactoryProperties();
      connectionFactoryProperties.setDiscoveryAddress("myhost");
      connectionFactoryProperties.setDiscoveryPort(5678);
      connectionFactoryProperties.setDiscoveryLocalBindAddress("newAddress");
      HornetQConnectionFactory factory = ra.createHornetQConnectionFactory(connectionFactoryProperties);
      HornetQConnectionFactory defaultFactory = ra.getDefaultHornetQConnectionFactory();
      Assert.assertNotSame(factory, defaultFactory);
      Assert.assertEquals(factory.getDiscoveryGroupConfiguration().getLocalBindAddress(), "newAddress");
      Assert.assertEquals(factory.getDiscoveryGroupConfiguration().getGroupAddress(), "myhost");
View Full Code Here

Examples of org.hornetq.ra.ConnectionFactoryProperties

   public void testCreateConnectionFactoryMultipleConnectors()
   {
      HornetQResourceAdapter ra = new HornetQResourceAdapter();
      ra.setConnectorClassName(NETTY_CONNECTOR_FACTORY + "," + INVM_CONNECTOR_FACTORY + "," + NETTY_CONNECTOR_FACTORY);
      HornetQConnectionFactory factory = ra.createHornetQConnectionFactory(new ConnectionFactoryProperties());
      TransportConfiguration[] configurations = factory.getServerLocator().getStaticTransportConfigurations();
      assertNotNull(configurations);
      assertEquals(3, configurations.length);
      assertEquals(NETTY_CONNECTOR_FACTORY, configurations[0].getFactoryClassName());
      assertEquals(0, configurations[0].getParams().size());
View Full Code Here

Examples of org.hornetq.ra.ConnectionFactoryProperties

   public void testCreateConnectionFactoryMultipleConnectorsAndParams()
   {
      HornetQResourceAdapter ra = new HornetQResourceAdapter();
      ra.setConnectorClassName(NETTY_CONNECTOR_FACTORY + "," + INVM_CONNECTOR_FACTORY + "," + NETTY_CONNECTOR_FACTORY);
      ra.setConnectionParameters("host=host1;port=5445, serverid=0, host=host2;port=5446");
      HornetQConnectionFactory factory = ra.createHornetQConnectionFactory(new ConnectionFactoryProperties());
      TransportConfiguration[] configurations = factory.getServerLocator().getStaticTransportConfigurations();
      assertNotNull(configurations);
      assertEquals(3, configurations.length);
      assertEquals(NETTY_CONNECTOR_FACTORY, configurations[0].getFactoryClassName());
      assertEquals(2, configurations[0].getParams().size());
View Full Code Here

Examples of org.hornetq.ra.ConnectionFactoryProperties

   public void testCreateConnectionFactoryMultipleConnectorsOverride()
   {
      HornetQResourceAdapter ra = new HornetQResourceAdapter();
      ra.setConnectorClassName(NETTY_CONNECTOR_FACTORY + "," + INVM_CONNECTOR_FACTORY + "," + NETTY_CONNECTOR_FACTORY);
      ConnectionFactoryProperties overrideProperties = new ConnectionFactoryProperties();
      ArrayList<String> value = new ArrayList<String>();
      value.add(INVM_CONNECTOR_FACTORY);
      value.add(NETTY_CONNECTOR_FACTORY);
      value.add(INVM_CONNECTOR_FACTORY);
      overrideProperties.setParsedConnectorClassNames(value);
      HornetQConnectionFactory factory = ra.createHornetQConnectionFactory(overrideProperties);
      TransportConfiguration[] configurations = factory.getServerLocator().getStaticTransportConfigurations();
      assertNotNull(configurations);
      assertEquals(3, configurations.length);
      assertEquals(INVM_CONNECTOR_FACTORY, configurations[0].getFactoryClassName());
View Full Code Here

Examples of org.hornetq.ra.ConnectionFactoryProperties

   public void testCreateConnectionFactoryMultipleConnectorsOverrideAndParams()
   {
      HornetQResourceAdapter ra = new HornetQResourceAdapter();
      ra.setConnectorClassName(NETTY_CONNECTOR_FACTORY + "," + INVM_CONNECTOR_FACTORY + "," + NETTY_CONNECTOR_FACTORY);
      ra.setConnectionParameters("host=host1;port=5445, serverid=0, host=host2;port=5446");
      ConnectionFactoryProperties overrideProperties = new ConnectionFactoryProperties();
      ArrayList<String> value = new ArrayList<String>();
      value.add(INVM_CONNECTOR_FACTORY);
      value.add(NETTY_CONNECTOR_FACTORY);
      value.add(INVM_CONNECTOR_FACTORY);
      overrideProperties.setParsedConnectorClassNames(value);
      ArrayList<Map<String, Object>> connectionParameters = new ArrayList<Map<String, Object>>();
      Map<String, Object> map1 = new HashMap<String, Object>();
      map1.put("serverid", "0");
      connectionParameters.add(map1);
      Map<String, Object> map2 = new HashMap<String, Object>();
      map2.put("host", "myhost");
      map2.put("port", "5445");
      connectionParameters.add(map2);
      Map<String, Object> map3 = new HashMap<String, Object>();
      map3.put("serverid", "1");
      connectionParameters.add(map3);
      overrideProperties.setParsedConnectionParameters(connectionParameters);
      HornetQConnectionFactory factory = ra.createHornetQConnectionFactory(overrideProperties);
      TransportConfiguration[] configurations = factory.getServerLocator().getStaticTransportConfigurations();
      assertNotNull(configurations);
      assertEquals(3, configurations.length);
      assertEquals(INVM_CONNECTOR_FACTORY, configurations[0].getFactoryClassName());
View Full Code Here

Examples of org.hornetq.ra.ConnectionFactoryProperties

   }

   public void testCreateConnectionFactoryThrowsException() throws Exception
   {
      HornetQResourceAdapter ra = new HornetQResourceAdapter();
      ConnectionFactoryProperties connectionFactoryProperties = new ConnectionFactoryProperties();
      try
      {
         HornetQConnectionFactory factory = ra.createHornetQConnectionFactory(connectionFactoryProperties);
         Assert.fail("should throw exception");
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.