Package org.milyn.container

Examples of org.milyn.container.MockApplicationContext


    public void test_Config_And_Context_Setting() {
        SmooksResourceConfiguration config = new SmooksResourceConfiguration();
        MyContentDeliveryUnit3 cdu = new MyContentDeliveryUnit3();

        Configurator.configure(cdu, config, new MockApplicationContext());
        assertNotNull(cdu.config);
        assertNotNull(cdu.appContext);
    }
View Full Code Here


  public void test_multi_threaded() throws InterruptedException {

    final int parties = 50;

    final AtomicBoolean exceptionsThrown = new AtomicBoolean(false);
    final MockApplicationContext appContext = new MockApplicationContext();
    final CyclicBarrier barrier = new CyclicBarrier(parties);
    final CountDownLatch countDownLatch = new CountDownLatch(parties);

    Runnable runnable = new Runnable() {
View Full Code Here

  @Test( groups = "integration", expectedExceptions = SmooksConfigurationException.class)
  public void configureWithMissingDestinationType()
  {
      SmooksResourceConfiguration config = new SmooksResourceConfiguration(selector, JMSRouter.class.getName());
        Configurator.configure( new JMSRouter(), config, new MockApplicationContext() );
  }
View Full Code Here

    private File file3 = new File("target/config-01-test/3/3.xml");
 
  @Before
    public void setUp() throws Exception {
        config = createConfig( resourceName, fileNamePattern, destinationDirectory, listFileName);
        Configurator.configure( resource, config, new MockApplicationContext() );
        deleteFiles();
    }
View Full Code Here

      SmooksResourceConfiguration config = new SmooksResourceConfiguration(selector, JMSRouter.class.getName());
        config.setParameter( "destinationName", queueName );
        config.setParameter( "beanId", beanId );
        final JMSRouter router = new JMSRouter();
        Configurator.configure( router, config, new MockApplicationContext() );

        router.visitAfter( (SAXElement)null, executionContext );

        final Message message = queue.getMessage();
        assertTrue ( "Message in queue should have been of type TextMessage",
View Full Code Here

        config.setParameter( "destinationName", queueName );
        config.setParameter( "beanId", beanId );
        config.setParameter( "highWaterMark", "3" );
        config.setParameter( "highWaterMarkPollFrequency", "200" );
        final JMSRouter router = new JMSRouter();
        Configurator.configure( router, config, new MockApplicationContext() );

        int numMessages = 10;
        ConsumeThread consumeThread = new ConsumeThread(queue, numMessages);
        consumeThread.start();
View Full Code Here

        config.setParameter( "beanId", beanId );
        config.setParameter( "highWaterMark", "3" );
        config.setParameter( "highWaterMarkTimeout", "3000" );
        config.setParameter( "highWaterMarkPollFrequency", "200" );
        final JMSRouter router = new JMSRouter();
        Configurator.configure( router, config, new MockApplicationContext() );

        router.visitAfter( (SAXElement)null, executionContext );
        router.visitAfter( (SAXElement)null, executionContext );
        router.visitAfter( (SAXElement)null, executionContext );
View Full Code Here

    final String contextFactory = MockContextFactory.class.getName();
      SmooksResourceConfiguration config = new SmooksResourceConfiguration(selector, JMSRouter.class.getName());
    setManadatoryProperties( config );
        config.setParameter( "jndiContextFactory", contextFactory );
        final JMSRouter router = new JMSRouter();
        Configurator.configure( router, config, new MockApplicationContext() );

        assertEquals( "ContextFactory did not match the one set on the Router",
            contextFactory, router.getJndiContextFactory() );
  }
View Full Code Here

    final String providerUrl = "jnp://localhost:1099";
      SmooksResourceConfiguration config = new SmooksResourceConfiguration(selector, JMSRouter.class.getName());
    setManadatoryProperties( config );
        config.setParameter( "jndiProviderUrl", providerUrl );
        final JMSRouter router = new JMSRouter();
        Configurator.configure( router, config, new MockApplicationContext() );

        assertEquals( "ProviderURL did not match the one set on the Router",
            providerUrl, router.getJndiProviderUrl() );
  }
View Full Code Here

      SmooksResourceConfiguration config = new SmooksResourceConfiguration(selector, JMSRouter.class.getName());
    setManadatoryProperties( config );
        config.setParameter( "jndiNamingFactoryUrl", namingFactoryUrlPkgs );
        final JMSRouter router = new JMSRouter();
        Configurator.configure( router, config, new MockApplicationContext() );

        assertEquals( "NamingFactoryUrlPkg did not match the one set on the Router",
            namingFactoryUrlPkgs, router.getJndiNamingFactoryUrl() );
  }
View Full Code Here

TOP

Related Classes of org.milyn.container.MockApplicationContext

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.