当前位置: 首页>>代码示例>>Java>>正文


Java MockComponent类代码示例

本文整理汇总了Java中org.apache.camel.component.mock.MockComponent的典型用法代码示例。如果您正苦于以下问题:Java MockComponent类的具体用法?Java MockComponent怎么用?Java MockComponent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MockComponent类属于org.apache.camel.component.mock包,在下文中一共展示了MockComponent类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createRouteBuilder

import org.apache.camel.component.mock.MockComponent; //导入依赖的package包/类
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    return new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            // simulate ftp/http using mocks
            context.addComponent("ftp", new MockComponent());
            context.addComponent("http", new MockComponent());

            interceptSendToEndpoint("(ftp|http):.*")
                .to("log:intercept")
                .to("mock:intercept");

            from("direct:start")
                .recipientList(header("foo")).parallelProcessing()
                .to("mock:end");
        }
    };
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:20,代码来源:RecipientListInterceptSendToEndpointException.java

示例2: testGuice

import org.apache.camel.component.mock.MockComponent; //导入依赖的package包/类
@Test
public void testGuice() throws Exception {
    Hashtable<String, Object> env = new Hashtable<String, Object>();
    env.put(Context.PROVIDER_URL, GuiceInitialContextFactory.class.getName());
    env.put(Injectors.MODULE_CLASS_NAMES, MyModule.class.getName());

    InitialContext context = new InitialContext(env);
    Injector injector = (Injector) context.lookup(Injector.class.getName());
    assertNotNull("Found injector", injector);

    Object value = context.lookup("foo");
    assertNotNull("Should have found a value for foo!", value);

    CamelContext camelContext = injector.getInstance(CamelContext.class);
    Component component = camelContext.getComponent("foo");
    assertThat(component, is(MockComponent.class));

    Endpoint endpoint = camelContext.getEndpoint("foo:cheese");
    assertThat(endpoint, is(MockEndpoint.class));
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:21,代码来源:ComponentFoundInRegistryTest.java

示例3: createRouteBuilder

import org.apache.camel.component.mock.MockComponent; //导入依赖的package包/类
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    return new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            context.addComponent("foo", new MockComponent());

            from("direct:start")
                .to("foo:foo")
                .to("mock:result");
        }
    };
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:14,代码来源:ManagedCustomComponentNameTest.java

示例4: foo

import org.apache.camel.component.mock.MockComponent; //导入依赖的package包/类
@Provides
@JndiBind("foo")
MockComponent foo() {
    return new MockComponent();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:6,代码来源:ComponentFoundInRegistryTest.java

示例5: startUp

import org.apache.camel.component.mock.MockComponent; //导入依赖的package包/类
@Before
public void startUp() {
    _camelContext = new SwitchYardCamelContextImpl(false);
    _camelContext.addComponent("switchyard", new MockComponent());
    _configuration = mock(Configuration.class);
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:7,代码来源:InboundHandlerTestBase.java


注:本文中的org.apache.camel.component.mock.MockComponent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。