Java 类org.apache.camel.test.junit4.CamelTestSupport 实例源码

项目:camel-c24io    文件:SpringTestHelper.java   
public static CamelContext createSpringCamelContext(CamelTestSupport test, String classpathUri) throws Exception {
    test.setUseRouteBuilder(false);

    final AbstractXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(classpathUri);
    test.setCamelContextService(new Service() {
        public void start() throws Exception {
            applicationContext.start();
        }

        public void stop() throws Exception {
            applicationContext.stop();
        }
    });

    return SpringCamelContext.springCamelContext(applicationContext);
}
项目:Camel    文件:CamelBlueprintTestSupport.java   
@AfterClass
public static void tearDownAfterClass() throws Exception {
    if (threadLocalBundleContext.get() != null) {
        CamelBlueprintHelper.disposeBundleContext(threadLocalBundleContext.get());
        threadLocalBundleContext.remove();
    }
    CamelTestSupport.tearDownAfterClass();
}
项目:Camel    文件:AbstractBoxTestSupport.java   
@AfterClass
public static void tearDownAfterClass() throws Exception {
    CamelTestSupport.tearDownAfterClass();

    // write the refresh token back to target/test-classes/test-options.properties
    final URL resource = AbstractBoxTestSupport.class.getResource(TEST_OPTIONS_PROPERTIES);
    final FileOutputStream out = new FileOutputStream(new File(resource.getPath()));
    propertyText = propertyText.replaceAll(REFRESH_TOKEN_PROPERTY + "=\\S*",
            REFRESH_TOKEN_PROPERTY + "=" + refreshToken);
    out.write(propertyText.getBytes("UTF-8"));
    out.close();
}
项目:Camel    文件:HttpProxyIntegrationTest.java   
@AfterClass
public static void tearDownAfterClass() throws Exception {
    CamelTestSupport.tearDownAfterClass();
    // stop the proxy server after component
    LOG.info("Stopping proxy server...");
    server.stop();
    LOG.info("Stopped proxy server");
}
项目:Camel    文件:AbstractGoogleDriveTestSupport.java   
@AfterClass
public static void tearDownAfterClass() throws Exception {
    CamelTestSupport.tearDownAfterClass();
}