summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-05-14 01:07:50 +0200
committerSven Gothel <[email protected]>2014-05-14 01:07:50 +0200
commit6b0554b658d656aa2fb7d3696dd2f75ca25304d3 (patch)
tree00fe385a9aecd93b5a9ab6b6bc8fb4a05c2bc6cb
parent761667cd9bdf325431bb083d1e3178ff7b681309 (diff)
Bump semver to 9ec2e5329780214d317b026f7c0b086972a94a5c - Using Dumper.dumpFullStats(..)
-rw-r--r--make/lib/semantic-versioning/VERSION6
-rw-r--r--make/lib/semantic-versioning/semver-src.zipbin41030 -> 41840 bytes
-rw-r--r--make/lib/semantic-versioning/semver.jarbin295478 -> 297781 bytes
-rw-r--r--src/junit/com/jogamp/junit/util/VersionSemanticsUtil.java99
4 files changed, 8 insertions, 97 deletions
diff --git a/make/lib/semantic-versioning/VERSION b/make/lib/semantic-versioning/VERSION
index df65470..baf61e3 100644
--- a/make/lib/semantic-versioning/VERSION
+++ b/make/lib/semantic-versioning/VERSION
@@ -3,11 +3,11 @@ https://github.com/sgothel/semantic-versioning
0.9.25-SNAPSHOT
-commit 174953022b62681653db1f57b087581e29313f5b
+commit 9ec2e5329780214d317b026f7c0b086972a94a5c
Author: Sven Gothel <[email protected]>
-Date: Wed May 14 00:18:52 2014 +0200
+Date: Wed May 14 01:04:14 2014 +0200
- Dumper: Add dump method for sorted List<Difference> (refactored) allowing dumping separate diff-types
+ Dump: Add dumpFullStats(..) producing diff stat per-class w/ diff-type-count and dump all diffs separated by diff-type
branch jogamp
diff --git a/make/lib/semantic-versioning/semver-src.zip b/make/lib/semantic-versioning/semver-src.zip
index 68cb09b..a1a6fe2 100644
--- a/make/lib/semantic-versioning/semver-src.zip
+++ b/make/lib/semantic-versioning/semver-src.zip
Binary files differ
diff --git a/make/lib/semantic-versioning/semver.jar b/make/lib/semantic-versioning/semver.jar
index eab1cfe..1e82a32 100644
--- a/make/lib/semantic-versioning/semver.jar
+++ b/make/lib/semantic-versioning/semver.jar
Binary files differ
diff --git a/src/junit/com/jogamp/junit/util/VersionSemanticsUtil.java b/src/junit/com/jogamp/junit/util/VersionSemanticsUtil.java
index 786164e..953c795 100644
--- a/src/junit/com/jogamp/junit/util/VersionSemanticsUtil.java
+++ b/src/junit/com/jogamp/junit/util/VersionSemanticsUtil.java
@@ -31,20 +31,13 @@ import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
import java.util.Set;
import org.junit.Assert;
import org.osjava.jardiff.DiffCriteria;
import org.semver.Comparer;
import org.semver.Delta;
-import org.semver.Delta.Difference;
import org.semver.Dumper;
import com.jogamp.common.util.IOUtil;
@@ -108,82 +101,13 @@ public class VersionSemanticsUtil {
resS = "Current version "+curVersionNumber+" is not "+expectedCompatibilityType+" to previous version "+preVersionNumber+", but "+detectedCompatibilityType;
}
System.err.println(resS);
- System.err.println("--------------------------------------------------------------------------------------------------------------");
+ System.err.printf("%n%n");
- final Set<Difference> diffs = delta.getDifferences();
+ Dumper.dumpFullStats(delta, 4, System.err);
- final List<Difference> diffsAdd = new ArrayList<Difference>();
- final List<Difference> diffsChange = new ArrayList<Difference>();
- final List<Difference> diffsDeprecate = new ArrayList<Difference>();
- final List<Difference> diffsRemove = new ArrayList<Difference>();
- final Map<String, DiffCount> className2DiffCount = new HashMap<String, DiffCount>();
-
- int maxClassNameLen = 0;
-
- for(final Iterator<Difference> iter = diffs.iterator(); iter.hasNext(); ) {
- final Difference diff = iter.next();
- final String className = diff.getClassName();
- maxClassNameLen = Math.max(maxClassNameLen, className.length());
-
- DiffCount dc = className2DiffCount.get(className);
- if( null == dc ) {
- dc = new DiffCount(className);
- className2DiffCount.put(className, dc);
- }
-
- if( diff instanceof Delta.Add ) {
- diffsAdd.add(diff);
- dc.additions++;
- } else if( diff instanceof Delta.Change ) {
- diffsChange.add(diff);
- dc.changes++;
- } else if( diff instanceof Delta.Deprecate ) {
- diffsDeprecate.add(diff);
- dc.deprecates++;
- } else if( diff instanceof Delta.Remove ) {
- diffsRemove.add(diff);
- dc.removes++;
- }
- }
- Collections.sort(diffsAdd);
- Collections.sort(diffsChange);
- Collections.sort(diffsDeprecate);
- Collections.sort(diffsRemove);
-
- final List<String> classNames = new ArrayList<String>(className2DiffCount.keySet());
- Collections.sort(classNames);
-
- System.err.println("Summary: "+diffs.size()+" differences in "+classNames.size()+" classes:");
- System.err.println(" Remove "+diffsRemove.size()+
- ", Change "+diffsChange.size()+
- ", Deprecate "+diffsDeprecate.size()+
- ", Add "+diffsAdd.size());
- System.err.println("--------------------------------------------------------------------------------------------------------------");
-
- int iterI = 0;
- for(final Iterator<String> iter = classNames.iterator(); iter.hasNext(); iterI++) {
- final String className = iter.next();
- final DiffCount dc = className2DiffCount.get(className);
- System.err.printf("%4d/%4d: %-"+maxClassNameLen+"s: %s%n", iterI, classNames.size(), className, dc.format(4));
- }
-
- System.err.println("--------------------------------------------------------------------------------------------------------------");
- System.err.println("Removes");
- System.err.println("--------------------------------------------------------------------------------------------------------------");
- Dumper.dump(diffsRemove, System.err);
- System.err.println("--------------------------------------------------------------------------------------------------------------");
- System.err.println("Changes");
- System.err.println("--------------------------------------------------------------------------------------------------------------");
- Dumper.dump(diffsChange, System.err);
- System.err.println("--------------------------------------------------------------------------------------------------------------");
- System.err.println("Deprecates");
- System.err.println("--------------------------------------------------------------------------------------------------------------");
- Dumper.dump(diffsDeprecate, System.err);
- System.err.println("--------------------------------------------------------------------------------------------------------------");
- System.err.println("Additions");
- System.err.println("--------------------------------------------------------------------------------------------------------------");
- Dumper.dump(diffsAdd, System.err);
- System.err.println("==============================================================================================================");
+ // Also dump sorted by class name
+ System.err.printf("%n%nClass Order%n%n");
+ Dumper.dump(delta, System.err);
Assert.assertTrue(resS, compOK);
@@ -196,17 +120,4 @@ public class VersionSemanticsUtil {
final boolean compatible = delta.validate(previous, current);
*/
}
- static class DiffCount {
- public DiffCount(String name) { this.name = name; }
- public final String name;
- public int removes;
- public int changes;
- public int deprecates;
- public int additions;
- public String toString() { return name+": Remove "+removes+", Change "+changes+", Deprecate "+deprecates+", Add "+additions; }
- public String format(final int digits) {
- return String.format("Remove %"+digits+"d, Change %"+digits+"d, Deprecate %"+digits+"d, Add %"+digits+"d",
- removes, changes, deprecates, additions);
- }
- }
}