Package org.jboss.soa.esb.addressing.eprs

Examples of org.jboss.soa.esb.addressing.eprs.JMSEpr


      System.setProperty(Environment.JNDI_SERVER_URL, JNDI_PREFIX + defaultProvider) ;
     
      final String queueName = "queueName" ;
     
      // should default address to system property
      final JMSEpr firstEpr = new JMSEpr(ONE_ONE_PROTOCOL, expectedDestinationType,
        queueName, "connection", null, null, true, null, null, null, true) ;
      assertEquals("System JNDI_SERVER_URL", "jms:" + JNDI_PREFIX + defaultProvider + "#" + queueName, firstEpr.getAddr().getAddress()) ;
     
      // should use Provider URL extension
      final Properties environment = new Properties() ;
      environment.setProperty(Context.PROVIDER_URL, JNDI_PREFIX + extensionProvider) ;
      final JMSEpr secondEpr = new JMSEpr(ONE_ONE_PROTOCOL, expectedDestinationType,
        queueName, "connection", environment, null, true, null, null, null, true) ;
      assertEquals("Extension Context.PROVIDER_URL", "jms:" + JNDI_PREFIX + extensionProvider + "#" + queueName, secondEpr.getAddr().getAddress()) ;
     
      // should use jndi-URL property
      environment.setProperty(JNDI_URL_TAG, JNDI_PREFIX + propertyJndi) ;
      final JMSEpr thirdEpr = new JMSEpr(ONE_ONE_PROTOCOL, expectedDestinationType,
        queueName, "connection", environment, null, true, null, null, null, true) ;
      assertEquals("Extension Context.PROVIDER_URL", "jms:" + JNDI_PREFIX + propertyJndi + "#" + queueName, thirdEpr.getAddr().getAddress()) ;
    }
    finally
    {
      if (jndiServerUrl != null)
      {
View Full Code Here


  }
 
  @Test
  public void contstructor_non_transacted() throws CourierException, URISyntaxException
  {
    JMSEpr jmsEpr = new JMSEpr( ONE_ONE_PROTOCOL, expectedDestinationType, expectedDestination ,
        expectedConnectionFactory,
        nullEnvironment, expectedSelector,
        NON_PERSISTENT);
   
    assertEquals( false, jmsEpr.getTransacted() );
  }
View Full Code Here

 
  @Test
  public void contstructor_transacted() throws CourierException, URISyntaxException
  {
    final boolean transacted = true;
    JMSEpr jmsEpr = new JMSEpr( ONE_ONE_PROTOCOL, expectedDestinationType, expectedDestination ,
        expectedConnectionFactory,
        nullEnvironment, expectedSelector,
        NON_PERSISTENT, transacted);
   
    assertEquals( transacted, jmsEpr.getTransacted() );
  }
View Full Code Here

    env.put(Context.INITIAL_CONTEXT_FACTORY, testInitialContextFactory) ;
    env.put(testExtension1, testExtension1Value) ;
    env.put(testExtension2, testExtension2Value) ;
    env.put("exclude.extension", "excludeValue") ;
   
    JMSEpr jmsEpr = new JMSEpr( ONE_ONE_PROTOCOL, expectedDestinationType, expectedDestination ,
        expectedConnectionFactory, env, expectedSelector, NON_PERSISTENT,
        AcknowledgeMode.CLIENT_ACKNOWLEDGE.toString());
   
    final Properties eprProperties = jmsEpr.getJndiEnvironment() ;
   
    assertEquals("JNDI property count", 5, eprProperties.size()) ;
    assertEquals("JNDI prefixes", testPrefixes, eprProperties.get(JMSEpr.JNDI_PREFIXES)) ;
    assertEquals("JNDI provider URL", testProviderURL, eprProperties.get(Context.PROVIDER_URL)) ;
    assertEquals("JNDI InitialContextFactory", testInitialContextFactory, eprProperties.get(Context.INITIAL_CONTEXT_FACTORY)) ;
View Full Code Here

        // Set the Max Sessions configs as on the epr env.  The should get translated into EPR
        // extensions, which should in turn be populated onto the JNDI Env generated from the EPR.
        env.setProperty(JMSEpr.MAX_SESSIONS_PER_CONNECTION, "3");
        env.setProperty(JMSEpr.MAX_XA_SESSIONS_PER_CONNECTION, "1");

        JMSEpr jmsEpr = new JMSEpr( ONE_ONE_PROTOCOL, expectedDestinationType, expectedDestination ,
                expectedConnectionFactory,
                env, expectedSelector, NON_PERSISTENT);

        Properties jndiEnv = jmsEpr.getJndiEnvironment();
        assertEquals("3", jndiEnv.getProperty(JMSEpr.MAX_SESSIONS_PER_CONNECTION));
        assertEquals("1", jndiEnv.getProperty(JMSEpr.MAX_XA_SESSIONS_PER_CONNECTION));
    }
View Full Code Here

        final Properties env = new Properties() ;
        env.put(Context.PROVIDER_URL, jndiURL) ;
        env.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory) ;
        env.put(Context.URL_PKG_PREFIXES, pkgPrefix) ;
                                 
        final JMSEpr jmsEpr = new JMSEpr(destinationType, destinationName, connectionFactory, env, null) ;
        assertEquals("destinationType", destinationType, jmsEpr.getDestinationType()) ;
        assertEquals("destinationName", destinationName, jmsEpr.getDestinationName()) ;
        assertEquals("connectionFactory", connectionFactory, jmsEpr.getConnectionFactory()) ;
                             
        final Properties jmsEprEnv = jmsEpr.getJndiEnvironment() ;
        assertEquals(Context.PROVIDER_URL, jndiURL, jmsEprEnv.getProperty(Context.PROVIDER_URL)) ;
        assertEquals(Context.INITIAL_CONTEXT_FACTORY, contextFactory, jmsEprEnv.getProperty(Context.INITIAL_CONTEXT_FACTORY)) ;
        assertEquals(Context.URL_PKG_PREFIXES, pkgPrefix, jmsEprEnv.getProperty(Context.URL_PKG_PREFIXES)) ;
             }
View Full Code Here

  }
 
  public void testJmsEPRType ()
  {
    Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
    JMSEpr epr = new JMSEpr(JMSEpr.TOPIC_TYPE, "foo", "bar");
   
    msg.getHeader().getCall().setTo(epr);
   
    try
    {
View Full Code Here

        throws Exception
    {
        MockCourierFactory.install() ;
        MockRegistry.install() ;

        deliverEPR = new JMSEpr(JMSEpr.QUEUE_TYPE, "test:deliver", "ConnectionFactory") ;
        failEPR = new JMSEpr(JMSEpr.QUEUE_TYPE, "test:fail", "ConnectionFactory") ;
        pickupEPR = new EPR(new URI("test:pickup")) ;
        jmsDeliverEPR = new JMSEpr(JMSEpr.QUEUE_TYPE, "deliver", "ConnectionFactory") ;

        deliverCourier = new MockCourier(true);
        failCourier = new MockCourier(false);
        responseMessage = MessageFactory.getInstance().getMessage() ;
        deliverCourier.pickupMessage = responseMessage ;
View Full Code Here

    addr = epr.getAddr().getAddress();
        if (addr.startsWith(InVMEpr.INVM_PROTOCOL))
            return new InVMCourier(new InVMEpr(epr));
    if (addr.startsWith(JMSEpr.JMS_PROTOCOL))
      return new JmsCourier(new JMSEpr(epr), pickUpOnly);
    if (addr.startsWith(JDBCEpr.JDBC_PROTOCOL))
      return new SqlTableCourier(new JDBCEpr(epr), pickUpOnly);
    // TODO magic strings
    if (addr.startsWith("file://") || addr.startsWith("ftp://")
        || addr.startsWith("sftp://") || addr.startsWith("ftps://"))
View Full Code Here

              decryptedPassword = JmsUtil.getPasswordFromFile(password);
              environment.put( JMSEpr.JMS_SECURITY_CREDENTIAL_TAG, decryptedPassword);
            }
           
            // When creating the EPR we always use the password as seen in the configuration.
            _myEpr = (null == _serviceName) ? null : new JMSEpr(JMSEpr.ONE_ONE_PROTOCOL, destType,
                jmsDestinationName, sFactClass, environment, _messageSelector, persistent, acknowledgeMode,
                username, password, transacted );
           
            // To create the connection pool we need to use the decrypted password (if applicable).
            jmsConnectionPool = JmsConnectionPoolContainer.getPool(environment, sFactClass, username, decryptedPassword);
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.addressing.eprs.JMSEpr

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.