Package org.apache.camel

Examples of org.apache.camel.Endpoint


    @Test
    public void testPullRequestCommentProducer() throws Exception {
        PullRequest pullRequest = pullRequestService.addPullRequest("testPullRequestCommentProducer");
        latestPullRequestId = pullRequest.getId();

        Endpoint commentProducerEndpoint = getMandatoryEndpoint("direct:validPullRequest");
        Exchange exchange = commentProducerEndpoint.createExchange();
        String commentText = "Pushed this comment at " + new Date();
        exchange.getIn().setBody(commentText);
        template.send(commentProducerEndpoint, exchange);

        Thread.sleep(1 * 1000);
 
View Full Code Here


        PullRequest pullRequest = pullRequestService.addPullRequest("testPullRequestCommentProducer");
        latestPullRequestId = pullRequest.getId();


        // Close it
        Endpoint closePullRequestEndpoint = getMandatoryEndpoint(PULL_REQUEST_PRODUCER_ENDPOINT);
        Exchange exchange = closePullRequestEndpoint.createExchange();
        template.send(closePullRequestEndpoint, exchange);

        Thread.sleep(1 * 1000);

        // Verify that it was closed
View Full Code Here

        reader.delete(jobId);
    }

    @Test
    public void testOut() throws InterruptedException, IOException {
        final Endpoint endpoint = context.getEndpoint("beanstalk:" + tubeName);
        final Exchange exchange = template.send(endpoint, ExchangePattern.InOut, new Processor() {
            public void process(Exchange exchange) {
                exchange.getIn().setBody(testMessage);
            }
        });
View Full Code Here

    private CamelTwitterTestSupport support = new CamelTwitterTestSupport();

    @Test
    public void testBasicAuthentication() throws Exception {
        Endpoint endpoint = context.getEndpoint("twitter:todo/todo?" + support.getUriTokens());
        assertTrue("Endpoint not a TwitterEndpoint: " + endpoint, endpoint instanceof TwitterEndpoint);
        TwitterEndpoint twitterEndpoint = (TwitterEndpoint) endpoint;

        assertTrue(!twitterEndpoint.getProperties().getConsumerKey().isEmpty());
        assertTrue(!twitterEndpoint.getProperties().getConsumerSecret().isEmpty());
View Full Code Here

        assertTrue(!twitterEndpoint.getProperties().getAccessTokenSecret().isEmpty());
    }
   
    @Test
    public void testPageSetting() throws Exception {
        Endpoint endpoint = context.getEndpoint("twitter:todo/page?count=50&numberOfPages=2");
        assertTrue("Endpoint not a TwitterEndpoint: " + endpoint, endpoint instanceof TwitterEndpoint);
        TwitterEndpoint twitterEndpoint = (TwitterEndpoint) endpoint;

        assertEquals(new Integer(50), twitterEndpoint.getProperties().getCount());
        assertEquals(new Integer(2), twitterEndpoint.getProperties().getNumberOfPages());
View Full Code Here

        assertEquals(new Integer(2), twitterEndpoint.getProperties().getNumberOfPages());
    }
   
    @Test
    public void testHttpProxySetting() throws Exception {
        Endpoint endpoint = context.getEndpoint("twitter:todo/todo?httpProxyHost=example.com&httpProxyPort=3338&httpProxyUser=test&httpProxyPassword=pwd");
        assertTrue("Endpoint not a TwitterEndpoint: " + endpoint, endpoint instanceof TwitterEndpoint);
        TwitterEndpoint twitterEndpoint = (TwitterEndpoint) endpoint;
       
        assertEquals("example.com", twitterEndpoint.getProperties().getHttpProxyHost());
        assertEquals(3338, twitterEndpoint.getProperties().getHttpProxyPort());
View Full Code Here

        configuration.setOperation(operation);
       
        // Validate URI Parameters
        DockerHelper.validateParameters(operation, parameters);
       
        Endpoint endpoint = new DockerEndpoint(uri, this, configuration);
        setProperties(configuration, parameters);
        configuration.setParameters(parameters);
               
        return endpoint;
    }
View Full Code Here

public class JIRAComponent extends DefaultComponent {

    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters)
        throws Exception {
       
        Endpoint endpoint = new JIRAEndpoint(uri, this);
        setProperties(endpoint, parameters);
        return endpoint;
    }
View Full Code Here

        }

        // check all active routes for the quartz endpoint this task matches
        // as we prefer to use the existing endpoint from the routes
        for (Route route : camelContext.getRoutes()) {
            Endpoint endpoint = route.getEndpoint();
            if (endpoint instanceof DelegateEndpoint) {
                endpoint = ((DelegateEndpoint)endpoint).getEndpoint();  
            }
            if (endpoint instanceof QuartzEndpoint) {
                QuartzEndpoint quartzEndpoint = (QuartzEndpoint) endpoint;
View Full Code Here

        LOG.debug("Looking up existing QuartzEndpoint with trigger {}.{}", targetTriggerName, targetTriggerGroup);
        try {
            // check all active routes for the quartz endpoint this task matches
            // as we prefer to use the existing endpoint from the routes
            for (Route route : camelContext.getRoutes()) {
                Endpoint endpoint = route.getEndpoint();
                if (endpoint instanceof DelegateEndpoint) {
                    endpoint = ((DelegateEndpoint)endpoint).getEndpoint();  
                }
                if (endpoint instanceof QuartzEndpoint) {
                    QuartzEndpoint quartzEndpoint = (QuartzEndpoint) endpoint;
View Full Code Here

TOP

Related Classes of org.apache.camel.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.