Created
September 17, 2021 14:00
-
-
Save davsclaus/e0ac176a778e671908566bbae2d74a11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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