Skip to content

Instantly share code, notes, and snippets.

@davsclaus
Created September 17, 2021 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davsclaus/e0ac176a778e671908566bbae2d74a11 to your computer and use it in GitHub Desktop.
Save davsclaus/e0ac176a778e671908566bbae2d74a11 to your computer and use it in GitHub Desktop.
package org.apache.camel.spring;
import org.apache.camel.CamelContext;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertNotSame;
public class TwoCamelTest {
@Test
public void testMain() throws Exception {
Main main = new Main() {
@Override
protected CamelContext createCamelContext() {
// just return 1st
return getApplicationContext().getBean("camel1", CamelContext.class);
}
};
main.setApplicationContextUri("org/apache/camel/spring/TwoCamelTest.xml");
main.start();
CamelContext camel1 = main.getApplicationContext().getBean("camel1", CamelContext.class);
CamelContext camel2 = main.getApplicationContext().getBean("camel2", CamelContext.class);
assertNotSame(camel1, camel2);
Thread.sleep(5000);
main.stop();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment