use of aQute.bnd.service.diff.Tree in project bnd by bndtools.
the class DiffTest method testInheritanceII.
public void testInheritanceII() throws Exception {
Builder b = new Builder();
b.addClasspath(IO.getFile("bin"));
b.setProperty(Constants.EXPORT_PACKAGE, "test.diff.inherit");
b.build();
Tree newer = differ.tree(b);
System.out.println(newer.get("<api>"));
Tree older = differ.tree(b);
assertTrue(newer.diff(older).getDelta() == Delta.UNCHANGED);
}
use of aQute.bnd.service.diff.Tree in project bnd by bndtools.
the class DiffTest method testGuavaDiff.
/**
* The diff command reports changes on (at least) the guava bundles when
* they have not changed, even when I feed it the same file at both ends.
* Even stranger is the fact that, though always about the same class, the
* actual diff is not consistent. Tested with several versions of bnd
* (including master HEAD) as well as several versions of the guava bundles
* from maven central. Reproduced by @bnd .
*
* <pre>
* $ java -jar
* biz.aQute.bnd.jar diff guava-14.0.1.jar guava-14.0.1.jar MINOR PACKAGE
* com.google.common.collect MINOR CLASS
* com.google.common.collect.ContiguousSet MINOR METHOD
* tailSet(java.lang.Object,boolean) ADDED RETURN
* com.google.common.collect.ImmutableCollection ADDED RETURN
* com.google.common.collect.ImmutableSet ADDED RETURN
* com.google.common.collect.ImmutableSortedSet ADDED RETURN
* com.google.common.collect.ImmutableSortedSetFauxverideShim ADDED RETURN
* com.google.common.collect.SortedIterable ADDED RETURN
* java.io.Serializable ADDED RETURN java.lang.Iterable ADDED RETURN
* java.lang.Iterable ADDED RETURN java.lang.Iterable ADDED RETURN
* java.util.Collection ADDED RETURN java.util.Collection ADDED RETURN
* java.util.Set
* </pre>
*
* @throws Exception
*/
public void testGuavaDiff() throws Exception {
File guava = IO.getFile("testresources/guava-14.0.1.jar");
Tree one = differ.tree(guava);
System.out.println(one.get("<api>"));
Tree two = differ.tree(guava);
Diff diff = one.diff(two);
assertTrue(diff.getDelta() == Delta.UNCHANGED);
}
use of aQute.bnd.service.diff.Tree in project bnd by bndtools.
the class DiffTest method testBaselineDiffs.
public void testBaselineDiffs() throws Exception {
Tree newerTree = make(IO.getFile("testresources/baseline/test1.jar"));
Tree olderTree = make(IO.getFile("testresources/baseline/test2.jar"));
Diff diff = newerTree.diff(olderTree);
show(diff, 2);
assertEquals(Delta.UNCHANGED, diff.getDelta());
assertEquals(Delta.UNCHANGED, diff.get("<init>()").getDelta());
assertEquals(Delta.UNCHANGED, diff.get("putAll(java.util.List)").getDelta());
}
use of aQute.bnd.service.diff.Tree in project bnd by bndtools.
the class UsesOrderingTest method testOrdering.
public static void testOrdering() throws Exception {
Builder builder = new Builder();
builder.addClasspath(new File("bin"));
builder.setProperty(Constants.EXPORT_PACKAGE, "test.diff;uses:=\"d,c,a,b\"");
Jar a = builder.build();
String exa = (String) a.getManifest().getMainAttributes().getValue(Constants.EXPORT_PACKAGE);
builder = new Builder();
builder.addClasspath(new File("bin"));
builder.setProperty(Constants.EXPORT_PACKAGE, "test.diff;uses:=\"d,b,a,c\"");
Jar b = builder.build();
String exb = (String) b.getManifest().getMainAttributes().getValue(Constants.EXPORT_PACKAGE);
Tree newer = differ.tree(b);
Tree older = differ.tree(a);
Diff diff = newer.diff(older);
show(diff, 0);
assertEquals(Delta.UNCHANGED, diff.getDelta());
}
Aggregations