@Test public void testCompareVersions_DiffInMinor() throws Exception { String dbVersionBigger = "785.5.3"; String dbVersion = "785.2.2"; assertEquals( 1, new MonetDbVersion( dbVersionBigger ).compareTo( new MonetDbVersion( dbVersion ) ) ); }
@Override public int compareTo( MonetDbVersion mDbVersion ) { int result = majorVersion.compareTo( mDbVersion.majorVersion ); if ( result != 0 ) { return result; } result = minorVersion.compareTo( mDbVersion.minorVersion ); if ( result != 0 ) { return result; } result = patchVersion.compareTo( mDbVersion.patchVersion ); if ( result != 0 ) { return result; } return result; }
MonetDbVersion implements Comparable<MonetDbVersion> { @Override public int compareTo( MonetDbVersion mDbVersion ) { int result = majorVersion.compareTo( mDbVersion.majorVersion ); if ( result != 0 ) { return result; } result = minorVersion.compareTo( mDbVersion.minorVersion ); if ( result != 0 ) { return result; } result = patchVersion.compareTo( mDbVersion.patchVersion ); if ( result != 0 ) { return result; } return result; } }
MonetDbVersion implements Comparable<MonetDbVersion> { @Override public int compareTo( MonetDbVersion mDbVersion ) { int result = majorVersion.compareTo( mDbVersion.majorVersion ); if ( result != 0 ) { return result; } result = minorVersion.compareTo( mDbVersion.minorVersion ); if ( result != 0 ) { return result; } result = patchVersion.compareTo( mDbVersion.patchVersion ); if ( result != 0 ) { return result; } return result; } MonetDbVersion();  MonetDbVersion( int majorVersion, int minorVersion, int patchVersion );  MonetDbVersion( String productVersion ); }
MonetDbVersion implements Comparable<MonetDbVersion> { @Override public int compareTo( MonetDbVersion mDbVersion ) { int result = majorVersion.compareTo( mDbVersion.majorVersion ); if ( result != 0 ) { return result; } result = minorVersion.compareTo( mDbVersion.minorVersion ); if ( result != 0 ) { return result; } result = patchVersion.compareTo( mDbVersion.patchVersion ); if ( result != 0 ) { return result; } return result; } MonetDbVersion();  MonetDbVersion( int majorVersion, int minorVersion, int patchVersion );  MonetDbVersion( String productVersion ); Integer getMinorVersion(); Integer getMajorVersion(); Integer getPatchVersion(); @Override int compareTo( MonetDbVersion mDbVersion ); @Override String toString(); }
MonetDbVersion implements Comparable<MonetDbVersion> { @Override public int compareTo( MonetDbVersion mDbVersion ) { int result = majorVersion.compareTo( mDbVersion.majorVersion ); if ( result != 0 ) { return result; } result = minorVersion.compareTo( mDbVersion.minorVersion ); if ( result != 0 ) { return result; } result = patchVersion.compareTo( mDbVersion.patchVersion ); if ( result != 0 ) { return result; } return result; } MonetDbVersion();  MonetDbVersion( int majorVersion, int minorVersion, int patchVersion );  MonetDbVersion( String productVersion ); Integer getMinorVersion(); Integer getMajorVersion(); Integer getPatchVersion(); @Override int compareTo( MonetDbVersion mDbVersion ); @Override String toString(); static final MonetDbVersion JAN_2014_SP2_DB_VERSION; }