Examples of MockApplicationContext


Examples of org.milyn.container.MockApplicationContext

    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

Examples of org.milyn.container.MockApplicationContext

      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

Examples of org.milyn.container.MockApplicationContext

        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

Examples of org.milyn.container.MockApplicationContext

        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

Examples of org.milyn.container.MockApplicationContext

    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

Examples of org.milyn.container.MockApplicationContext

    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

Examples of org.milyn.container.MockApplicationContext

      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

Examples of org.milyn.container.MockApplicationContext

      resourceConfig.setSelector(selector);
    }
    resourceConfig.setParameter("beanId", beanId);
    resourceConfig.setParameter("toEndpoint", endpointUri);
   
    MockApplicationContext appContext = new MockApplicationContext();
    appContext.setAttribute(CamelContext.class, context);
    Configurator.configure(beanRouter, resourceConfig, appContext);
   
    return beanRouter;
  }
View Full Code Here

Examples of org.milyn.container.MockApplicationContext

        testConstructorConfigValidation(config, "Invalid Smooks bean configuration. 'beanClass' <param> not specified.");
    }

    private void testConstructorConfigValidation(SmooksResourceConfiguration config, String expected) {
        try {
            Configurator.configure(new BeanPopulator(), config, new MockApplicationContext());
            fail("Expected SmooksConfigurationException - " + expected);
        } catch(SmooksConfigurationException e) {
            Throwable t = e.getCause();
            if(t.getMessage().indexOf(expected) == -1) {
                e.printStackTrace();
View Full Code Here

Examples of org.milyn.container.MockApplicationContext

* @author <a href="mailto:maurice.zeijen@smies.com">maurice.zeijen@smies.com</a>
*/
public class FactoryDefinitionParserFactoryTest extends TestCase{

    public void test_get_instance_default() {
        FactoryDefinitionParser parser = FactoryDefinitionParser.FactoryDefinitionParserFactory.getInstance(new MockApplicationContext());

        assertNotNull(parser);
        assertEquals(BasicFactoryDefinitionParser.class, parser.getClass());
    }
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.