use of aQute.bnd.differ.Baseline in project bnd by bndtools.
the class BaselineTest method testBundleVersionBumpDifferentSymbolicNames.
// Adding a method to a ProviderType produces a MINOR bump (1.0.0 -> 1.1.0)
public void testBundleVersionBumpDifferentSymbolicNames() throws Exception {
Processor processor = new Processor();
DiffPluginImpl differ = new DiffPluginImpl();
Baseline baseline = new Baseline(processor, differ);
try (Jar older = new Jar(IO.getFile("testresources/api-orig.jar"));
Jar newer = new Jar(IO.getFile("testresources/api-providerbump.jar"))) {
newer.getManifest().getMainAttributes().putValue(BUNDLE_SYMBOLICNAME, "a.different.name");
baseline.baseline(newer, older, null);
BundleInfo bundleInfo = baseline.getBundleInfo();
assertFalse(bundleInfo.mismatch);
assertEquals(newer.getVersion(), bundleInfo.suggestedVersion.toString());
}
}
use of aQute.bnd.differ.Baseline in project bnd by bndtools.
the class BaselineTest method testMinorAndRemovedChange.
// Adding a method to an exported class and unexporting a package produces a MINOR bump (1.0.0 -> 1.1.0)
public void testMinorAndRemovedChange() throws Exception {
Processor processor = new Processor();
DiffPluginImpl differ = new DiffPluginImpl();
Baseline baseline = new Baseline(processor, differ);
try (Jar older = new Jar(IO.getFile("testresources/minor-and-removed-change-1.0.0.jar"));
Jar newer = new Jar(IO.getFile("testresources/minor-and-removed-change-1.0.1.jar"))) {
baseline.baseline(newer, older, null);
BundleInfo bundleInfo = baseline.getBundleInfo();
assertTrue(bundleInfo.mismatch);
assertEquals("2.0.0", bundleInfo.suggestedVersion.toString());
}
}
use of aQute.bnd.differ.Baseline in project bnd by bndtools.
the class BaselineTest method testProviderTypeBump.
// Adding a method to a ProviderType produces a MINOR bump (1.0.0 -> 1.1.0)
public void testProviderTypeBump() throws Exception {
Processor processor = new Processor();
DiffPluginImpl differ = new DiffPluginImpl();
Baseline baseline = new Baseline(processor, differ);
try (Jar older = new Jar(IO.getFile("testresources/api-orig.jar"));
Jar newer = new Jar(IO.getFile("testresources/api-providerbump.jar"))) {
Set<Info> infoSet = baseline.baseline(newer, older, null);
System.out.println(differ.tree(newer).get("<api>"));
assertEquals(1, infoSet.size());
Info info = infoSet.iterator().next();
assertTrue(info.mismatch);
assertEquals("dummy.api", info.packageName);
assertEquals("1.1.0", info.suggestedVersion.toString());
}
}
use of aQute.bnd.differ.Baseline in project bnd by bndtools.
the class BaselineTest method testMovePackageToBundleClassPath.
// Moving a package from the root into a jar on the Bundle-ClassPath
// should not result in DELETED
public void testMovePackageToBundleClassPath() throws Exception {
Processor processor = new Processor();
DiffPluginImpl differ = new DiffPluginImpl();
Baseline baseline = new Baseline(processor, differ);
try (Jar older = new Jar(IO.getFile("jar/baseline/com.liferay.calendar.api-2.0.5.jar"));
Jar newer = new Jar(IO.getFile("jar/baseline/com.liferay.calendar.api-2.1.0.jar"))) {
baseline.baseline(newer, older, null);
BundleInfo bundleInfo = baseline.getBundleInfo();
assertFalse(bundleInfo.mismatch);
assertEquals("2.1.0", bundleInfo.suggestedVersion.toString());
Set<Info> packageInfos = baseline.getPackageInfos();
assertEquals(12, packageInfos.size());
Info change = packageInfos.iterator().next();
assertFalse(change.mismatch);
assertEquals("com.google.ical.iter", change.packageName);
assertEquals("20110304.0.0", change.suggestedVersion.toString());
}
}
use of aQute.bnd.differ.Baseline in project bnd by bndtools.
the class BaselineTest method testBundleVersionBump.
// Adding a method to a ProviderType produces a MINOR bump (1.0.0 -> 1.1.0)
public void testBundleVersionBump() throws Exception {
Processor processor = new Processor();
DiffPluginImpl differ = new DiffPluginImpl();
Baseline baseline = new Baseline(processor, differ);
try (Jar older = new Jar(IO.getFile("testresources/api-orig.jar"));
Jar newer = new Jar(IO.getFile("testresources/api-providerbump.jar"))) {
baseline.baseline(newer, older, null);
BundleInfo bundleInfo = baseline.getBundleInfo();
assertTrue(bundleInfo.mismatch);
assertEquals("1.1.0", bundleInfo.suggestedVersion.toString());
}
}
Aggregations