Package org.milyn.container

Examples of org.milyn.container.MockExecutionContext


  @BeforeMethod ( groups = "unit" )
  public void init() {

    config = new SmooksResourceConfiguration(selector, Counter.class.getName());
    executionContext = new MockExecutionContext();
    beanContext = executionContext.getBeanContext();
  }
View Full Code Here


    }

    @Test (expected = IllegalArgumentException.class )
    public void showThrowIfRuleNameIsNull()
    {
        provider.evaluate(null, "some text", new MockExecutionContext());
    }
View Full Code Here

    }

    @Test (expected = IllegalArgumentException.class )
    public void showThrowIfSelectedDataIsNull()
    {
        provider.evaluate("ruleName", null , new MockExecutionContext());
    }
View Full Code Here

  }
 
  @Test
  public void visit() throws Exception
  {
    MockExecutionContext executionContext = new MockExecutionContext();
    resource.visitBefore((Element)null, executionContext );
   
    OutputStream outputStream = AbstractOutputStreamResource.getOutputStream(resource.getResourceName(), executionContext );
    assertTrue(outputStream instanceof FileOutputStream );
   
View Full Code Here

  {
    queue.clear();
    final String beanId = "beanId";
    final TestBean bean = RouterTestHelper.createBean();

        final MockExecutionContext executionContext = RouterTestHelper.createExecutionContext( beanId, bean );

      SmooksResourceConfiguration config = new SmooksResourceConfiguration(selector, JMSRouter.class.getName());
        config.setParameter( "destinationName", queueName );
        config.setParameter( "beanId", beanId );
        final JMSRouter router = new JMSRouter();
View Full Code Here

    public void visitAfter_above_hwmark_notimeout() throws ParserConfigurationException, JMSException, SAXException, IOException
    {
        final String beanId = "beanId";
        final TestBean bean = RouterTestHelper.createBean();

        final MockExecutionContext executionContext = RouterTestHelper.createExecutionContext( beanId, bean );

      SmooksResourceConfiguration config = new SmooksResourceConfiguration(selector, JMSRouter.class.getName());
        config.setParameter( "destinationName", queueName );
        config.setParameter( "beanId", beanId );
        config.setParameter( "highWaterMark", "3" );
View Full Code Here

    public void visitAfter_above_hwmark_timeout() throws ParserConfigurationException, JMSException, SAXException, IOException
    {
        final String beanId = "beanId";
        final TestBean bean = RouterTestHelper.createBean();

        final MockExecutionContext executionContext = RouterTestHelper.createExecutionContext( beanId, bean );

      SmooksResourceConfiguration config = new SmooksResourceConfiguration(selector, JMSRouter.class.getName());
        config.setParameter( "destinationName", queueName );
        config.setParameter( "beanId", beanId );
        config.setParameter( "highWaterMark", "3" );
View Full Code Here

        beanRouter.setBeanId(beanId);
        beanRouter.setToEndpoint(ENDPOINT_URI);
        beanRouter.initialize();

        final BeanRouterObserver beanRouterObserver = new BeanRouterObserver(beanRouter, beanId);
        final MockExecutionContext smooksExecutionContext = new MockExecutionContext();
        final BeanContextLifecycleEvent event = mock(BeanContextLifecycleEvent.class);
       
        when(event.getBeanId()).thenReturn(new BeanId(null, 0, beanId));
        when(event.getLifecycle()).thenReturn(BeanLifecycle.END_FRAGMENT);
        when(event.getBean()).thenReturn(sampleBean);
View Full Code Here

  }
 
  @BeforeClass
  public void setup()
  {
    execContext = new MockExecutionContext();
  }
View Full Code Here

  @Test
  public void createJMSMessage() throws ParserConfigurationException, JMSException, SAXException, IOException
  {
    final String beanId = "123";
    final TestBean bean = RouterTestHelper.createBean();
        MockExecutionContext executionContext = RouterTestHelper.createExecutionContext( beanId, bean );

        Message message = strategy.createJMSMessage( beanId, executionContext, jmsSession ) ;

        assertTrue ( message instanceof TextMessage );
View Full Code Here

TOP

Related Classes of org.milyn.container.MockExecutionContext

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.