ResourceIdentity identityA = ResourceIdentity.fromString("camel.core.shared");
MavenCoordinates mavenid = MavenCoordinates.parse("org.apache.camel:camel-core:jar:2.11.0");
ResourceBuilder builderA = provisioner.getMavenResourceBuilder(identityA, mavenid);
builderA.addIdentityRequirement("javax.api");
builderA.addIdentityRequirement("org.slf4j");
ResourceHandle handleA = provisioner.installSharedResource(builderA.getResource());
try {
Assert.assertSame(handleA.getModule(), runtime.getModule(identityA));
Assert.assertEquals("ACTIVE " + identityA, State.ACTIVE, handleA.getModule().getState());
ResourceIdentity identityC = ResourceIdentity.fromString(RESOURCE_C);
ResourceBuilder builderC = provisioner.getContentResourceBuilder(identityC, deployer.getDeployment(RESOURCE_C));
Map<String, Object> attsC = builderC.getMutableResource().getIdentityCapability().getAttributes();
attsC.put(ContentNamespace.CAPABILITY_RUNTIME_NAME_ATTRIBUTE, RESOURCE_C + ".war");
ResourceHandle handleC = provisioner.installResource(builderC.getResource());
try {
// Make a call to the HttpService endpoint that goes through a Camel route
String reqspec = "/service?test=Kermit";
String context = RuntimeType.getRuntimeType() == RuntimeType.KARAF ? "" : "/" + RESOURCE_C;
Assert.assertEquals("Hello Kermit", performCall(context, reqspec));
} finally {
handleC.uninstall();
}
} finally {
handleA.uninstall();
}
}