@Test public void versionCompare() { assertTrue(DocumentDiscoveryLiteService.versionPredates("1.3.5", "1.0.0")); assertTrue(DocumentDiscoveryLiteService.versionPredates("1.3.5", "1.0.10-SNAPSHOT")); assertTrue(DocumentDiscoveryLiteService.versionPredates("1.3.5", "1.3.4")); assertFalse(DocumentDiscoveryLiteService.versionPredates("1.3.5", "1.4.0")); assertFalse(DocumentDiscoveryLiteService.versionPredates("1.3.5", "1.14-SNAPSHOT")); assertFalse(DocumentDiscoveryLiteService.versionPredates("1.3.5", "1.4.0")); assertFalse(DocumentDiscoveryLiteService.versionPredates("1.3.5", "4.0.0")); }
static boolean versionPredates(String base, String compare) { Version one = Version.parseVersion(substSnapshotPrefix(compare)); Version two = Version.parseVersion(substSnapshotPrefix(base)); return two.compareTo(one) > 0; }
DocumentDiscoveryLiteService implements ClusterStateChangeListener, Observer { static boolean versionPredates(String base, String compare) { Version one = Version.parseVersion(substSnapshotPrefix(compare)); Version two = Version.parseVersion(substSnapshotPrefix(base)); return two.compareTo(one) > 0; } }
DocumentDiscoveryLiteService implements ClusterStateChangeListener, Observer { static boolean versionPredates(String base, String compare) { Version one = Version.parseVersion(substSnapshotPrefix(compare)); Version two = Version.parseVersion(substSnapshotPrefix(base)); return two.compareTo(one) > 0; }  }
DocumentDiscoveryLiteService implements ClusterStateChangeListener, Observer { static boolean versionPredates(String base, String compare) { Version one = Version.parseVersion(substSnapshotPrefix(compare)); Version two = Version.parseVersion(substSnapshotPrefix(base)); return two.compareTo(one) > 0; }  @Activate void activate(ComponentContext context); @Override void handleClusterStateChange(); @Override void contentChanged(@NotNull NodeState root,@NotNull CommitInfo info); }
DocumentDiscoveryLiteService implements ClusterStateChangeListener, Observer { static boolean versionPredates(String base, String compare) { Version one = Version.parseVersion(substSnapshotPrefix(compare)); Version two = Version.parseVersion(substSnapshotPrefix(base)); return two.compareTo(one) > 0; }  @Activate void activate(ComponentContext context); @Override void handleClusterStateChange(); @Override void contentChanged(@NotNull NodeState root,@NotNull CommitInfo info); static final String OAK_DISCOVERYLITE_CLUSTERVIEW; }