buildAndDeployMavenProject(ClassLoader.class.getResource("/kjars-sources/container-isolation-kjar2").getFile());
}
@Test
public void testUseClassWithSameFQNInDifferentContainers() {
assertSuccess(client.createContainer("container-isolation-kjar1", new KieContainerResource("container-isolation-kjar1", kjar1)));
String payload1 = "<batch-execution lookup=\"kjar1.session\">\n" +
" <insert out-identifier=\"person\">\n" +
" <org.kie.server.testing.Person/>\n" +
" </insert>\n" +
" <fire-all-rules />\n" +
"</batch-execution>";
ServiceResponse<String> response1 = client.executeCommands("container-isolation-kjar1", payload1);
assertSuccess(response1);
String result1 = response1.getResult();
assertTrue("Person's id should be 'Person from kjar1'!. Got result: " + result1, result1.contains("<id>Person from kjar1</id>"));
// now execute the same commands, but for the second container. The rule in there should set different id
// (namely "Person from kjar2") for the inserted person
assertSuccess(client.createContainer("container-isolation-kjar2", new KieContainerResource("container-isolation-kjar2", kjar2)));
String payload2 = "<batch-execution lookup=\"kjar2.session\">\n" +
" <insert out-identifier=\"person\">\n" +
" <org.kie.server.testing.Person/>\n" +
" </insert>\n" +
" <fire-all-rules />\n" +