Java 类org.apache.camel.component.facebook.config.FacebookConfiguration 实例源码

项目:wildfly-camel    文件:FacebookIntegrationTest.java   
@Test
public void testFacebookComponent() throws Exception {
    FacebookComponent component = new FacebookComponent();
    FacebookConfiguration configuration = component.getConfiguration();

    String baseURL = "http://localhost:8080/camel-facebook-tests/fake-facebook-api";
    configuration.setClientURL(baseURL);
    configuration.setOAuthAccessTokenURL(baseURL + "/oauth-token");
    configuration.setRestBaseURL(baseURL + "/rest");

    CamelContext camelctx = new DefaultCamelContext();
    camelctx.addComponent("facebook", component);

    camelctx.addRoutes(new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            from("direct:start")
            .toF("facebook://getTestUsers?oAuthAppId=%s&oAuthAppSecret=%s&appId=%s", FACEBOOK_APP_ID,
                FACEBOOK_APP_SECRET, FACEBOOK_APP_ID);
        }
    });

    camelctx.start();
    try {
        ProducerTemplate template = camelctx.createProducerTemplate();
        PagableList testUserList = template.requestBody("direct:start", null, PagableList.class);
        Assert.assertNotNull("Facebook app test user list was null", testUserList);
    } finally {
        camelctx.stop();
    }
}
项目:Camel    文件:FacebookComponent.java   
public FacebookComponent() {
    this(new FacebookConfiguration());
}
项目:Camel    文件:FacebookComponent.java   
public FacebookComponent(FacebookConfiguration configuration) {
    this(null, configuration);
}
项目:Camel    文件:FacebookComponent.java   
public FacebookComponent(CamelContext context) {
    this(context, new FacebookConfiguration());
}
项目:Camel    文件:FacebookComponent.java   
public FacebookComponent(CamelContext context, FacebookConfiguration configuration) {
    super(context, FacebookEndpoint.class);
    this.configuration = configuration;
}
项目:Camel    文件:FacebookComponent.java   
public FacebookConfiguration getConfiguration() {
    return configuration;
}
项目:Camel    文件:FacebookComponent.java   
/**
 * To use the shared configuration
 */
public void setConfiguration(FacebookConfiguration configuration) {
    this.configuration = configuration;
}
项目:Camel    文件:FacebookComponentConfiguration.java   
public FacebookConfiguration getConfiguration() {
    return configuration;
}
项目:Camel    文件:FacebookComponentConfiguration.java   
public void setConfiguration(FacebookConfiguration configuration) {
    this.configuration = configuration;
}
项目:Camel    文件:CamelFacebookTestSupport.java   
protected FacebookConfiguration getConfiguration() {
    return configuration;
}