Package org.eclipse.sapphire

Examples of org.eclipse.sapphire.Version


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


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

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

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

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

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

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

   
    @Test
   
    public void testVersionFromLong()
    {
        Version version;
       
        version = new Version( 1 );

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

        version = new Version( 201206260957l );

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

       
        // Test with context version set so that no compatibility constraints match.
       
        root.setVersion( "1.0" );
       
        assertEquals( new Version( "1.0" ), rootContextVersionService.version() );
       
        assertVersionCompatibility( root, RootElement.PROP_VALUE_SINCE, false );
        assertVersionCompatibility( root, RootElement.PROP_VALUE_SINCE_DYNAMIC, false );
        assertVersionCompatibility( root, RootElement.PROP_VALUE_VERSION_COMPATIBILITY, false );
        assertVersionCompatibility( root, RootElement.PROP_VALUE_VERSION_COMPATIBILITY_DYNAMIC, false );
       
        // Test with context version set so that some compatibility constraints match.
       
        root.setVersion( "1.2" );
       
        assertEquals( new Version( "1.2" ), rootContextVersionService.version() );
       
        assertVersionCompatibility( root, RootElement.PROP_VALUE_SINCE, true );
        assertVersionCompatibility( root, RootElement.PROP_VALUE_SINCE_DYNAMIC, true );
        assertVersionCompatibility( root, RootElement.PROP_VALUE_VERSION_COMPATIBILITY, false );
        assertVersionCompatibility( root, RootElement.PROP_VALUE_VERSION_COMPATIBILITY_DYNAMIC, false );
       
        // Test with context version set so that all compatibility constraints match.
       
        root.setVersion( "1.2.3" );
       
        assertEquals( new Version( "1.2.3" ), rootContextVersionService.version() );
       
        assertVersionCompatibility( root, RootElement.PROP_VALUE_SINCE, true );
        assertVersionCompatibility( root, RootElement.PROP_VALUE_SINCE_DYNAMIC, true );
        assertVersionCompatibility( root, RootElement.PROP_VALUE_VERSION_COMPATIBILITY, true );
        assertVersionCompatibility( root, RootElement.PROP_VALUE_VERSION_COMPATIBILITY_DYNAMIC, true );
View Full Code Here

        assertNotNull( rootContextVersionService );
        assertNull( rootContextVersionService.version() );
       
        root.setVersion( "1.2.5" );
       
        assertEquals( new Version( "1.2.5" ), rootContextVersionService.version() );
       
        assertVersionCompatibility( root, RootElement.PROP_VALUE_SINCE_DYNAMIC, true );
        assertVersionCompatibility( root, RootElement.PROP_VALUE_VERSION_COMPATIBILITY_DYNAMIC, true );
       
        root.setSwitch( true );
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.