Package org.jboss.internal.soa.esb.couriers

Examples of org.jboss.internal.soa.esb.couriers.MockCourier


  @BeforeClass
  public static void classSetup() throws EmbeddableException, ConfigurationException, GatewayException, RegistryException, MalformedURLException
  {
        MockCourierFactory.install();
        MockRegistry.install();
        MockRegistry.register(RemoteGatewayListenerUnitTest.SERVICE_CATEGORY, RemoteGatewayListenerUnitTest.SERVICE_NAME, new MockCourier(true));
       
        ftpServer = createFtpServer();
    ftpServer.start();
   
    createWorkDirectories();
View Full Code Here


    public void setUp() throws Exception {
        MockCourierFactory.install();
        MockRegistry.install();
       
        EPR epr2 = new EPR(new URI("2"));
        courier1 = new MockCourier(false); // Will fail
        courier2 = new MockCourier(true)// Will work
        MockRegistry.register("cat", "servicex", courier1);
        MockRegistry.register("cat", "servicex", epr2, courier2);
     }
View Full Code Here

{

    protected void setUp() throws Exception {
        MockCourierFactory.install();
        MockRegistry.install();
        MockRegistry.register("Example", "Test", new MockCourier(true));
    }
View Full Code Here

        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 ;

        MockRegistry.register("test", "deliver", deliverEPR, deliverCourier);
        MockRegistry.register("test", "fail", failEPR, failCourier);
View Full Code Here

 
  @BeforeClass
  public static void classSetup() throws EmbeddableException, ConfigurationException, GatewayException, RegistryException, MalformedURLException, MessageDeliverException {
        MockCourierFactory.install();
        MockRegistry.install();
        MockRegistry.register(RemoteGatewayListenerUnitTest.SERVICE_CATEGORY, RemoteGatewayListenerUnitTest.SERVICE_NAME, new MockCourier(true));

    ftpServer = createFtpServer();
    ftpServer.start();
   
    createWorkDirectories();
View Full Code Here

        MockRegistry.install();

        epr1 = new EPR(new URI("test1"));
        epr2 = new EPR(new URI("test2"));
        epr3 = new EPR(new URI("DLS"));
        courier1 = new MockCourier(true);
        courier2 = new MockCourier(true);
        courier3 = new MockCourier(true);

        MockRegistry.register("test", "java", epr1, courier1);
        MockRegistry.register("test", "xml", epr2, courier2);
        MockRegistry.register("test", "aggregator", epr3, courier3);
View Full Code Here

        epr1 = new EPR(new URI("1"));
        epr2 = new EPR(new URI("2"));
        epr3 = new EPR(new URI("3"));
        epr4 = new EPR(new URI("4"));
        courier1 = new MockCourier(false);
        courier2 = new MockCourier(new CourierException(""));
        courier3 = new MockCourier(new MalformedEPRException(""));
        courier4 = new MockCourier(true);

        MockRegistry.register("cat", "service", epr1, courier1);
        MockRegistry.register("cat", "service", epr2, courier2);
        MockRegistry.register("cat", "service", epr3, courier3);
        MockRegistry.register("cat", "service", epr4, courier4);
View Full Code Here

  protected final void setUp() throws Exception
  {
    MockCourierFactory.install() ;
    MockRegistry.install() ;
    timeoutEPR = new EPR(new URI("timeout")) ;
    MockRegistry.register("timeout", "service", timeoutEPR, new MockCourier(true)) ;
    final PropertyManager propertyManager = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE) ;
    if (propertyManager != null)
    {
      redeliverDlsServiceOn = propertyManager.getProperty(Environment.REDELIVER_DLS_SERVICE_ON) ;
      propertyManager.setProperty(Environment.REDELIVER_DLS_SERVICE_ON, "false") ;
View Full Code Here

    {
    }

    final EPR epr = new EPR(new URI(category + name));

    MockRegistry.register(category, name, epr, new MockCourier(true)) ;

    {
      ServiceInvoker invoker = new ServiceInvoker(category, name);
      invoker.deliverAsync(message);
    }
View Full Code Here

    public void securityContextPropagation()
        throws Exception
    {
        final String category = "test" ;
        final String service = "securityContextPropagation" ;
        final MockCourier mockCourier = new PropagationMockCourier() ;
        MockRegistry.register(category, service, mockCourier) ;
       
        final ServiceInvoker si = new ServiceInvoker(category, service) ;
        final Message message = MessageFactory.getInstance().getMessage() ;
       
        assertNull("securityContext", SecurityContext.getSecurityContext()) ;
        assertNull("message context", message.getContext().getContext(SecurityService.CONTEXT)) ;
       
        final SealedObject securityContext = SecurityContext.encryptContext(new SecurityContext()) ;
        SecurityContext.setSecurityContext(securityContext) ;
       
        assertNotNull("securityContext", SecurityContext.getSecurityContext()) ;
       
        si.deliverAsync(message) ;
       
        assertNotSame("messages", message, mockCourier.message) ;
        assertNull("message context", message.getContext().getContext(SecurityService.CONTEXT)) ;
        assertNotNull("delivered message context", mockCourier.message.getContext().getContext(SecurityService.CONTEXT)) ;
        assertNotNull("securityContext", SecurityContext.getSecurityContext()) ;
       
        mockCourier.reset();
        si.deliverAsync(message) ;
       
        assertNotSame("messages", message, mockCourier.message) ;
        assertNull("message context", message.getContext().getContext(SecurityService.CONTEXT)) ;
        assertNotNull("delivered message context", mockCourier.message.getContext().getContext(SecurityService.CONTEXT)) ;
View Full Code Here

TOP

Related Classes of org.jboss.internal.soa.esb.couriers.MockCourier

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.