Package com.consol.citrus.context

Examples of com.consol.citrus.context.TestContext


    }
   
    @Test
    public void testJavaBuilderWithClass() throws InstantiationException, IllegalAccessException, ClassNotFoundException {
        final List<Object> methodArgs = new ArrayList<Object>();
        methodArgs.add(new TestContext());
       
        MockBuilder builder = new MockBuilder(applicationContext) {
            @Override
            public void configure() {
                java(EchoAction.class)
View Full Code Here


    }
   
    @Test
    public void testJavaBuilderWithObjectInstance() throws InstantiationException, IllegalAccessException, ClassNotFoundException {
        final List<Object> methodArgs = new ArrayList<Object>();
        methodArgs.add(new TestContext());
       
        MockBuilder builder = new MockBuilder(applicationContext) {
            @Override
            public void configure() {
                java(new EchoAction())
View Full Code Here

    /**
     * Executes the test case.
     * @param testContext the test context.
     */
    protected void executeTest(ITestContext testContext) {
        TestContext ctx = prepareTestContext(createTestContext());

        TestCase testCase = getTestCase(ctx);
        if (citrusDataProviderParameters != null) {
            handleTestParameters(Reporter.getCurrentTestResult().getMethod(), testCase,
                    citrusDataProviderParameters[Reporter.getCurrentTestResult().getMethod().getCurrentInvocationCount()]);
View Full Code Here

        validators.add(new DomXmlMessageValidator());
        validators.add(new GroovyXmlMessageValidator());
       
        MessageValidatorRegistry messageValidatorRegistry = new MessageValidatorRegistry();
        messageValidatorRegistry.setMessageValidators(validators);
        TestContext newContext = createTestContext();
        newContext.setMessageValidatorRegistry(messageValidatorRegistry);
       
        validationContexts = new ArrayList<ValidationContext>();
        validationContexts.add(validationContext);
        ScriptValidationContext scriptValidationContext = new ScriptValidationContext(CitrusConstants.DEFAULT_MESSAGE_TYPE);
        validationContexts.add(scriptValidationContext);
View Full Code Here

    public void testResolveDirectEndpoint() throws Exception {
        reset(applicationContext);
        expect(applicationContext.getBean("myEndpoint", Endpoint.class)).andReturn(EasyMock.createMock(Endpoint.class)).once();
        replay(applicationContext);

        TestContext context = new TestContext();
        context.setApplicationContext(applicationContext);

        DefaultEndpointFactory factory = new DefaultEndpointFactory();
        Endpoint endpoint = factory.create("myEndpoint", context);

        Assert.assertNotNull(endpoint);
View Full Code Here

        expect(applicationContext.getBeansOfType(EndpointComponent.class)).andReturn(Collections.<String, EndpointComponent>emptyMap()).once();
        expect(applicationContext.getBean(IntegrationContextUtils.INTEGRATION_HEADER_CHANNEL_REGISTRY_BEAN_NAME, HeaderChannelRegistry.class))
                .andThrow(new NoSuchBeanDefinitionException(IntegrationContextUtils.INTEGRATION_HEADER_CHANNEL_REGISTRY_BEAN_NAME)).once();
        replay(applicationContext);

        TestContext context = new TestContext();
        context.setApplicationContext(applicationContext);

        DefaultEndpointFactory factory = new DefaultEndpointFactory();
        Endpoint endpoint = factory.create("channel:channel.name", context);

        Assert.assertEquals(endpoint.getClass(), ChannelEndpoint.class);
View Full Code Here

        expect(applicationContext.getBeansOfType(EndpointComponent.class)).andReturn(components).once();
        expect(applicationContext.getBean(IntegrationContextUtils.INTEGRATION_HEADER_CHANNEL_REGISTRY_BEAN_NAME, HeaderChannelRegistry.class))
                .andThrow(new NoSuchBeanDefinitionException(IntegrationContextUtils.INTEGRATION_HEADER_CHANNEL_REGISTRY_BEAN_NAME)).once();
        replay(applicationContext);

        TestContext context = new TestContext();
        context.setApplicationContext(applicationContext);

        DefaultEndpointFactory factory = new DefaultEndpointFactory();
        Endpoint endpoint = factory.create("custom:custom.channel", context);

        Assert.assertEquals(endpoint.getClass(), ChannelEndpoint.class);
View Full Code Here

        expect(applicationContext.getBeansOfType(EndpointComponent.class)).andReturn(components).once();
        expect(applicationContext.getBean(IntegrationContextUtils.INTEGRATION_HEADER_CHANNEL_REGISTRY_BEAN_NAME, HeaderChannelRegistry.class))
                .andThrow(new NoSuchBeanDefinitionException(IntegrationContextUtils.INTEGRATION_HEADER_CHANNEL_REGISTRY_BEAN_NAME)).once();
        replay(applicationContext);

        TestContext context = new TestContext();
        context.setApplicationContext(applicationContext);

        DefaultEndpointFactory factory = new DefaultEndpointFactory();
        Endpoint endpoint = factory.create("jms:custom.channel", context);

        Assert.assertEquals(endpoint.getClass(), ChannelEndpoint.class);
View Full Code Here

    public void testResolveUnknownEndpointComponent() throws Exception {
        reset(applicationContext);
        expect(applicationContext.getBeansOfType(EndpointComponent.class)).andReturn(Collections.<String, EndpointComponent>emptyMap()).once();
        replay(applicationContext);

        TestContext context = new TestContext();
        context.setApplicationContext(applicationContext);

        DefaultEndpointFactory factory = new DefaultEndpointFactory();
        try {
            factory.create("unknown:unknown", context);
            Assert.fail("Missing exception due to unknown endpoint component");
View Full Code Here

    @Test
    public void testResolveInvalidEndpointUri() throws Exception {
        reset(applicationContext);
        replay(applicationContext);

        TestContext context = new TestContext();
        context.setApplicationContext(applicationContext);

        DefaultEndpointFactory factory = new DefaultEndpointFactory();
        try {
            factory.create("jms:", context);
            Assert.fail("Missing exception due to invalid endpoint uri");
View Full Code Here

TOP

Related Classes of com.consol.citrus.context.TestContext

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.