use of aQute.bnd.service.verifier.VerifierPlugin in project bnd by bndtools.
the class VerifierPluginTest method testVerifierPluginExecution.
public static void testVerifierPluginExecution() throws Exception {
final AtomicBoolean executedCheck = new AtomicBoolean(false);
VerifierPlugin verifier = new VerifierPlugin() {
@Override
public void verify(Analyzer analyzer) throws Exception {
// the following is true only after the jar and manifest have
// been analyzed
Packages exports = analyzer.getExports();
PackageRef packageRef = analyzer.getPackageRef("test/activator");
if (exports.containsKey(packageRef)) {
executedCheck.set(true);
}
}
};
try (Builder b = new Builder()) {
b.setProperty("Bundle-SymbolicName", "p1");
b.setProperty("Bundle-Version", "1.2.3");
b.setExportPackage("test.activator");
b.addClasspath(new File("bin"));
b.getPlugins().add(verifier);
Jar jar = b.build();
}
assertTrue(executedCheck.get());
}
Aggregations