Pax Exam Karaf: mavenBundle configuration option works, bundle with file: URL doesn't
-
01-06-2021 - |
문제
This works with Pax Exam native container (Pax Exam 2.3.1), but not with Pax Exam Karaf container (0.5.2) for me:
@Configuration
public Option[] config() {
return options(
// karafDistributionConfiguration()
// .frameworkUrl(
// maven().groupId("org.apache.karaf")
// .artifactId("apache-karaf").type("zip"))
// .karafVersion("2.2.6").name("Apache Karaf"),
provision(bundle("reference:file:/path/to.jar")));
}
A test checking that the bundle is installed:
@Inject
BundleContext bundleContext = null;
@Test
public void sameRepositoryProvidesFBServiceAndUserService() {
for (Bundle b : bundleContext.getBundles()) {
if (b.getSymbolicName().equals(myBundleName)) {
return;
}
}
fail("Bundle " + myBundleName + " not found");
}
If I uncomment karafDistributionConfiguration
and replace bundle(url)
with mavenBundle(groupId, artifactId)
, test passes again under Pax Exam Karaf. Is it possible to fi it? I need to use bundle
to run tests against development versions of bundles in my workspace.
해결책
It turned out to be a timing issue, fixed in 0.5.3.
제휴하지 않습니다 StackOverflow