Package com.consol.citrus.endpoint

Examples of com.consol.citrus.endpoint.Endpoint


    @Test
    public void testCreateClientEndpointWithCustomParameters() throws Exception {
        HttpEndpointComponent component = new HttpEndpointComponent();

        Endpoint endpoint = component.createEndpoint("http://localhost:8088/test?requestMethod=DELETE&customParam=foo", context);

        Assert.assertEquals(endpoint.getClass(), HttpClient.class);

        Assert.assertEquals(((HttpClient)endpoint).getEndpointConfiguration().getRequestUrl(), "http://localhost:8088/test?customParam=foo");
        Assert.assertEquals(((HttpClient) endpoint).getEndpointConfiguration().getRequestMethod(), HttpMethod.DELETE);
        Assert.assertEquals(((HttpClient) endpoint).getEndpointConfiguration().getTimeout(), 5000L);
    }
View Full Code Here


    @Test
    public void testCreateEndpoint() throws Exception {
        SshEndpointComponent component = new SshEndpointComponent();

        Endpoint endpoint = component.createEndpoint("ssh://localhost:2200", context);

        Assert.assertEquals(endpoint.getClass(), SshClient.class);

        Assert.assertEquals(((SshClient)endpoint).getEndpointConfiguration().getHost(), "localhost");
        Assert.assertEquals(((SshClient)endpoint).getEndpointConfiguration().getPort(), 2200);
        Assert.assertEquals(((SshClient) endpoint).getEndpointConfiguration().getTimeout(), 5000L);
    }
View Full Code Here

    @Test
    public void testCreateEndpointWithoutPort() throws Exception {
        SshEndpointComponent component = new SshEndpointComponent();

        Endpoint endpoint = component.createEndpoint("ssh:127.0.0.1", context);

        Assert.assertEquals(endpoint.getClass(), SshClient.class);

        Assert.assertEquals(((SshClient)endpoint).getEndpointConfiguration().getHost(), "127.0.0.1");
        Assert.assertEquals(((SshClient)endpoint).getEndpointConfiguration().getPort(), 2222);
        Assert.assertEquals(((SshClient) endpoint).getEndpointConfiguration().getTimeout(), 5000L);
    }
View Full Code Here

    @Test
    public void testCreateEndpointWithParameters() throws Exception {
        SshEndpointComponent component = new SshEndpointComponent();

        Endpoint endpoint = component.createEndpoint("ssh://localhost:2200?timeout=10000&strictHostChecking=true&user=foo&password=12345678", context);

        Assert.assertEquals(endpoint.getClass(), SshClient.class);

        Assert.assertEquals(((SshClient)endpoint).getEndpointConfiguration().getHost(), "localhost");
        Assert.assertEquals(((SshClient)endpoint).getEndpointConfiguration().getPort(), 2200);
        Assert.assertEquals(((SshClient)endpoint).getEndpointConfiguration().getUser(), "foo");
        Assert.assertEquals(((SshClient)endpoint).getEndpointConfiguration().getPassword(), "12345678");
View Full Code Here

        reset(applicationContext);
        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);

        Endpoint endpoint = component.createEndpoint("channel:channelName", context);

        Assert.assertEquals(endpoint.getClass(), ChannelEndpoint.class);

        Assert.assertEquals(((ChannelEndpoint)endpoint).getEndpointConfiguration().getChannelName(), "channelName");
        Assert.assertEquals(((ChannelEndpoint) endpoint).getEndpointConfiguration().getBeanFactory(), applicationContext);
        Assert.assertEquals(((ChannelEndpoint) endpoint).getEndpointConfiguration().getChannelResolver().getClass(), BeanFactoryChannelResolver.class);
        Assert.assertEquals(((ChannelEndpoint) endpoint).getEndpointConfiguration().getTimeout(), 5000L);
View Full Code Here

        reset(applicationContext);
        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);

        Endpoint endpoint = component.createEndpoint("channel:sync:channelName", context);

        Assert.assertEquals(endpoint.getClass(), ChannelSyncEndpoint.class);

        Assert.assertEquals(((ChannelSyncEndpoint)endpoint).getEndpointConfiguration().getChannelName(), "channelName");
        Assert.assertEquals(((ChannelSyncEndpoint) endpoint).getEndpointConfiguration().getBeanFactory(), applicationContext);
        Assert.assertEquals(((ChannelEndpoint) endpoint).getEndpointConfiguration().getChannelResolver().getClass(), BeanFactoryChannelResolver.class);
View Full Code Here

        expect(applicationContext.getBean("myChannelResolver")).andReturn(channelResolver).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);

        Endpoint endpoint = component.createEndpoint("channel:channelName?timeout=10000&channelResolver=myChannelResolver", context);

        Assert.assertEquals(endpoint.getClass(), ChannelEndpoint.class);

        Assert.assertEquals(((ChannelEndpoint)endpoint).getEndpointConfiguration().getChannelName(), "channelName");
        Assert.assertEquals(((ChannelEndpoint) endpoint).getEndpointConfiguration().getBeanFactory(), applicationContext);
        Assert.assertEquals(((ChannelEndpoint) endpoint).getEndpointConfiguration().getChannelResolver(), channelResolver);
        Assert.assertEquals(((ChannelEndpoint) endpoint).getEndpointConfiguration().getTimeout(), 10000L);
View Full Code Here

TOP

Related Classes of com.consol.citrus.endpoint.Endpoint

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.