Package org.milyn.container

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


        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

* @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

        assertNotNull(parser);
        assertEquals(BasicFactoryDefinitionParser.class, parser.getClass());
    }

    public void test_get_instance_default_alias() {
        FactoryDefinitionParser parser = FactoryDefinitionParser.FactoryDefinitionParserFactory.getInstance(FactoryDefinitionParser.FactoryDefinitionParserFactory.DEFAULT_ALIAS, new MockApplicationContext());

        assertNotNull(parser);
        assertEquals(BasicFactoryDefinitionParser.class, parser.getClass());
    }
View Full Code Here

        assertNotNull(parser);
        assertEquals(BasicFactoryDefinitionParser.class, parser.getClass());
    }

    public void test_get_instance_mvel_alias() {
        FactoryDefinitionParser parser = FactoryDefinitionParser.FactoryDefinitionParserFactory.getInstance("mvel", new MockApplicationContext());

        assertNotNull(parser);
        assertEquals(MVELFactoryDefinitionParser.class, parser.getClass());
    }
View Full Code Here

        assertNotNull(parser);
        assertEquals(MVELFactoryDefinitionParser.class, parser.getClass());
    }

    public void test_get_instance_mvel_by_classname() {
        FactoryDefinitionParser parser = FactoryDefinitionParser.FactoryDefinitionParserFactory.getInstance(MVELFactoryDefinitionParser.class.getName(), new MockApplicationContext());

        assertNotNull(parser);
        assertEquals(MVELFactoryDefinitionParser.class, parser.getClass());
    }
View Full Code Here

    private RegexProvider regexProvider;

    @Before
    public void setup()
    {
        appContext = new MockApplicationContext();
        regexProvider = new RegexProvider("/smooks-regex.properties");
    }
View Full Code Here

*/
public class RuleProviderAccessorTest {

    @Test(expected = IllegalArgumentException.class)
    public void shouldThrowIfAddingNullProvider() {
        RuleProviderAccessor.add(new MockApplicationContext(), null);
    }
View Full Code Here

        RuleProviderAccessor.add(null, new MockProvider());
    }

    @Test
    public void add() {
        final MockApplicationContext context = new MockApplicationContext();
        final MockProvider provider = new MockProvider();

        RuleProviderAccessor.add(context, provider);

        assertNotNull(RuleProviderAccessor.getRuleProviders(context));
View Full Code Here

        RuleProviderAccessor.get(null, "dummyName");
    }

    @Test(expected = SmooksException.class)
    public void shouldThrowIfTheProviderCannotBeFound() {
        RuleProviderAccessor.get(new MockApplicationContext(), "dummyName");
    }
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.