Package org.eclipse.sapphire

Examples of org.eclipse.sapphire.Version


    public void testOpenRangeVersionConstraint2()
    {
        final VersionConstraint constraint = new VersionConstraint( "(1.2.3" );
       
        assertFalse( constraint.check( new Version( "0.5.3" ) ) );
        assertFalse( constraint.check( new Version( "1.0" ) ) );
        assertFalse( constraint.check( new Version( "1.2.2" ) ) );
        assertFalse( constraint.check( new Version( "1.2.3" ) ) );
        assertFalse( constraint.check( new Version( "1.2.3.0.0" ) ) );
        assertTrue( constraint.check( new Version( "1.2.5" ) ) );
        assertTrue( constraint.check( new Version( "1.3" ) ) );
        assertTrue( constraint.check( new Version( "2.0" ) ) );
        assertTrue( constraint.check( new Version( "55.0" ) ) );
    }
View Full Code Here


   
    public void testOpenRangeVersionConstraint3()
    {
        final VersionConstraint constraint = new VersionConstraint( "1.2.3]" );
       
        assertTrue( constraint.check( new Version( "0.5.3" ) ) );
        assertTrue( constraint.check( new Version( "1.0" ) ) );
        assertTrue( constraint.check( new Version( "1.2.2" ) ) );
        assertTrue( constraint.check( new Version( "1.2.3" ) ) );
        assertTrue( constraint.check( new Version( "1.2.3.0.0" ) ) );
        assertFalse( constraint.check( new Version( "1.2.5" ) ) );
        assertFalse( constraint.check( new Version( "1.3" ) ) );
        assertFalse( constraint.check( new Version( "2.0" ) ) );
        assertFalse( constraint.check( new Version( "55.0" ) ) );
    }
View Full Code Here

   
    public void testOpenRangeVersionConstraint4()
    {
        final VersionConstraint constraint = new VersionConstraint( "1.2.3)" );
       
        assertTrue( constraint.check( new Version( "0.5.3" ) ) );
        assertTrue( constraint.check( new Version( "1.0" ) ) );
        assertTrue( constraint.check( new Version( "1.2.2" ) ) );
        assertFalse( constraint.check( new Version( "1.2.3" ) ) );
        assertFalse( constraint.check( new Version( "1.2.3.0.0" ) ) );
        assertFalse( constraint.check( new Version( "1.2.5" ) ) );
        assertFalse( constraint.check( new Version( "1.3" ) ) );
        assertFalse( constraint.check( new Version( "2.0" ) ) );
        assertFalse( constraint.check( new Version( "55.0" ) ) );
    }
View Full Code Here

    public void testComplexVersionConstraint()
    {
        final VersionConstraint constraint = new VersionConstraint( "1.2.3,3.4,[5.2-6.0),[8.3" );
       
        assertFalse( constraint.check( new Version( "1.2" ) ) );
        assertFalse( constraint.check( new Version( "1.2.1" ) ) );
        assertTrue( constraint.check( new Version( "1.2.3" ) ) );
        assertFalse( constraint.check( new Version( "1.2.4" ) ) );
        assertFalse( constraint.check( new Version( "3.3" ) ) );
        assertTrue( constraint.check( new Version( "3.4" ) ) );
        assertFalse( constraint.check( new Version( "3.4.1" ) ) );
        assertFalse( constraint.check( new Version( "3.5" ) ) );
        assertFalse( constraint.check( new Version( "5.0" ) ) );
        assertFalse( constraint.check( new Version( "5.1" ) ) );
        assertTrue( constraint.check( new Version( "5.2" ) ) );
        assertTrue( constraint.check( new Version( "5.3" ) ) );
        assertTrue( constraint.check( new Version( "5.9.9.9" ) ) );
        assertFalse( constraint.check( new Version( "6.0" ) ) );
        assertFalse( constraint.check( new Version( "6.1" ) ) );
        assertFalse( constraint.check( new Version( "7.3" ) ) );
        assertFalse( constraint.check( new Version( "8.0" ) ) );
        assertFalse( constraint.check( new Version( "8.2" ) ) );
        assertTrue( constraint.check( new Version( "8.3" ) ) );
        assertTrue( constraint.check( new Version( "8.3.4.5" ) ) );
        assertTrue( constraint.check( new Version( "8.5" ) ) );
        assertTrue( constraint.check( new Version( "9.0" ) ) );
        assertTrue( constraint.check( new Version( "55.0" ) ) );
    }
View Full Code Here

    public void testVersionConstraintSpaceTolerance()
    {
        final VersionConstraint constraint = new VersionConstraint( "   1.2.3, 3.4  ,   [   5.2  -   6.0) ,    [  8.3    " );
       
        assertFalse( constraint.check( new Version( "1.2" ) ) );
        assertFalse( constraint.check( new Version( "1.2.1" ) ) );
        assertTrue( constraint.check( new Version( "1.2.3" ) ) );
        assertFalse( constraint.check( new Version( "1.2.4" ) ) );
        assertFalse( constraint.check( new Version( "3.3" ) ) );
        assertTrue( constraint.check( new Version( "3.4" ) ) );
        assertFalse( constraint.check( new Version( "3.4.1" ) ) );
        assertFalse( constraint.check( new Version( "3.5" ) ) );
        assertFalse( constraint.check( new Version( "5.0" ) ) );
        assertFalse( constraint.check( new Version( "5.1" ) ) );
        assertTrue( constraint.check( new Version( "5.2" ) ) );
        assertTrue( constraint.check( new Version( "5.3" ) ) );
        assertTrue( constraint.check( new Version( "5.9.9.9" ) ) );
        assertFalse( constraint.check( new Version( "6.0" ) ) );
        assertFalse( constraint.check( new Version( "6.1" ) ) );
        assertFalse( constraint.check( new Version( "7.3" ) ) );
        assertFalse( constraint.check( new Version( "8.0" ) ) );
        assertFalse( constraint.check( new Version( "8.2" ) ) );
        assertTrue( constraint.check( new Version( "8.3" ) ) );
        assertTrue( constraint.check( new Version( "8.3.4.5" ) ) );
        assertTrue( constraint.check( new Version( "8.5" ) ) );
        assertTrue( constraint.check( new Version( "9.0" ) ) );
        assertTrue( constraint.check( new Version( "55.0" ) ) );
    }
View Full Code Here

    @Test
   
    public void testSapphireVersion() throws Exception
    {
        final Version version = Sapphire.version();
       
        assertNotNull( version );
       
        final VersionConstraint constraint = new VersionConstraint( EXPECTED_VERSION_CONSTRAINT );
       
View Full Code Here

{
    @Test
   
    public void testVersionFromString_Basic()
    {
        Version version;
       
        version = new Version( "1" );
       
        assertEquals( 1, version.length() );
        assertEquals( 1l, version.segment( 0 ) );
        assertEquals( list( 1l ), version.segments() );
       
        version = new Version( "1.2" );

        assertEquals( 2, version.length() );
        assertEquals( 1l, version.segment( 0 ) );
        assertEquals( 2l, version.segment( 1 ) );
        assertEquals( list( 1l, 2l ), version.segments() );

        version = new Version( "1.2.3" );

        assertEquals( 3, version.length() );
        assertEquals( 1l, version.segment( 0 ) );
        assertEquals( 2l, version.segment( 1 ) );
        assertEquals( 3l, version.segment( 2 ) );
        assertEquals( list( 1l, 2l, 3l ), version.segments() );
    }
View Full Code Here

   
    @Test
   
    public void testVersionFromString_LongSegment()
    {
        final Version version = new Version( "1.2.3.201206260957" );

        assertEquals( 4, version.length() );
        assertEquals( 1l, version.segment( 0 ) );
        assertEquals( 2l, version.segment( 1 ) );
        assertEquals( 3l, version.segment( 2 ) );
        assertEquals( 201206260957l, version.segment( 3 ) );
        assertEquals( list( 1l, 2l, 3l, 201206260957l ), version.segments() );
    }
View Full Code Here

   
    @Test( expected = IllegalArgumentException.class )

    public void testVersionFromString_InvalidFormat_1()
    {
        new Version( null );
    }
View Full Code Here

    @Test( expected = IllegalArgumentException.class )
   
    public void testVersionFromString_InvalidFormat_2()
    {
        new Version( "" );
    }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.Version

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.