Package net.sourceforge.cruisecontrol.monitoring

Examples of net.sourceforge.cruisecontrol.monitoring.CruiseVersion


import junit.framework.TestCase;

public class TestCruiseVersion extends TestCase {

  public void testFullVersionParse() {
    CruiseVersion version = new CruiseVersion( "2.7.1-RC3" );
   
    assertEquals( "Major not correct", 2, version.getMajor() );
    assertEquals( "Minor not correct", 7, version.getMinor() );
    assertEquals( "Patch not correct", 1, version.getPatch() );
    assertEquals( "Release Candidate not correct", "RC3", version.getCandidate() );
  }
View Full Code Here


    assertEquals( "Patch not correct", 1, version.getPatch() );
    assertEquals( "Release Candidate not correct", "RC3", version.getCandidate() );
  }

  public void testParseNoReleaseCandidate() {
    CruiseVersion version = new CruiseVersion( "2.7.1" );
   
    assertEquals( "Major not correct", 2, version.getMajor() );
    assertEquals( "Minor not correct", 7, version.getMinor() );
    assertEquals( "Patch not correct", 1, version.getPatch() );
    assertEquals( "Release Candidate not correct", null, version.getCandidate() );
  }
View Full Code Here

    assertEquals( "Patch not correct", 1, version.getPatch() );
    assertEquals( "Release Candidate not correct", null, version.getCandidate() );
  }
 
  public void testParseNoMinor() {
    CruiseVersion version = new CruiseVersion( "2.7" );
   
    assertEquals( "Major not correct", 2, version.getMajor() );
    assertEquals( "Minor not correct", 7, version.getMinor() );
    assertEquals( "Patch not correct", 0, version.getPatch() );
    assertEquals( "Release Candidate not correct", null, version.getCandidate() );
  }
View Full Code Here

    assertEquals( "Patch not correct", 0, version.getPatch() );
    assertEquals( "Release Candidate not correct", null, version.getCandidate() );
  }
 
  public void testComparisons() {
    CruiseVersion version = new CruiseVersion( "2.7.1-RC3" );
   
    assertTrue( "Version is greater than 2.6", version.isEqualOrNewerThan( 2, 6, 0) );
    assertTrue( "Version is greater than 2.7", version.isEqualOrNewerThan( 2, 7, 0) );
    assertTrue( "Version equals 2.7.1", version.isEqualOrNewerThan( 2, 7, 1) );
    assertFalse( "Version is less than 2.7.2", version.isEqualOrNewerThan( 2, 7, 2) );

  }
View Full Code Here

TOP

Related Classes of net.sourceforge.cruisecontrol.monitoring.CruiseVersion

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.