Package org.eclipse.sapphire

Examples of org.eclipse.sapphire.Version


       
        assertNotNull( service );
       
        root.setVersion( "2.0" );
       
        assertEquals( new Version( "2.0" ), rootContextVersionService.version() );
       
        assertVersionCompatibility( root, RootElement.PROP_VALUE_VERSION_COMPATIBILITY_SERVICE, true );
       
        service.update( "3.0" );
       
View Full Code Here


        refresh();
    }
   
    public void update( final String min )
    {
        update( new Version( min ) );
    }
View Full Code Here

    }

    @Override
    protected Data compute()
    {
        final Version version = this.versionCompatibilityTargetService.version();
        final String versioned = this.versionCompatibilityTargetService.versioned();
        final boolean compatible;

        if( this.min == null )
        {
            compatible = true;
        }
        else
        {
            if( version == null )
            {
                compatible = false;
            }
            else
            {
                compatible = version.compareTo( this.min ) > 0;
            }
        }
       
        return new Data( compatible, version, versioned );
    }
View Full Code Here

            @Override
            protected Object evaluate()
            {
                boolean result = false;
               
                final Version version = Sapphire.version();
                final VersionConstraint constraint = cast( operand( 0 ), VersionConstraint.class );
               
                if( constraint != null )
                {
                    result = constraint.check( version );
View Full Code Here

    public void testStringToVersion() throws Exception
    {
        final MasterConversionService service = Sapphire.service( MasterConversionService.class );
       
        assertEquals( new Version( "1" ), service.convert( "1", Version.class ) );
        assertEquals( new Version( "1.2" ), service.convert( "1.2", Version.class ) );
        assertEquals( new Version( "1.2.3" ), service.convert( "1.2.3", Version.class ) );
        assertEquals( new Version( "1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20" ), service.convert( "1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20", Version.class ) );
       
        assertNull( service.convert( "1..2", Version.class ) );
        assertNull( service.convert( "1.abc", Version.class ) );
    }
View Full Code Here

    public void testVersionToString() throws Exception
    {
        final MasterConversionService service = Sapphire.service( MasterConversionService.class );
       
        assertEquals( "1", service.convert( new Version( "1" ), String.class ) );
        assertEquals( "1.2", service.convert( new Version( "1.2" ), String.class ) );
        assertEquals( "1.2.3", service.convert( new Version( "1.2.3" ), String.class ) );
        assertEquals( "1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20", service.convert( new Version( "1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20" ), String.class ) );
    }
View Full Code Here

            @Override
            protected Object evaluate()
            {
                boolean result = false;
               
                final Version version = cast( operand( 0 ), Version.class );
               
                if( version != null )
                {
                    final VersionConstraint constraint = cast( operand( 1 ), VersionConstraint.class );
                   
View Full Code Here

    }
   
    @Override
    protected Data compute()
    {
        final Version version = this.versionCompatibilityTargetService.version();
        final String versioned = this.versionCompatibilityTargetService.versioned();
       
        boolean compatible = false;
       
        final VersionConstraint constraint = (VersionConstraint) this.functionResult.value();
View Full Code Here

            final String versioned = service.versioned();
            final VersionConstraint constraint = service.constraint();
           
            if( versioned != null && constraint != null )
            {
                Version since = null;
               
                if( constraint.ranges().size() == 1 )
                {
                    final VersionConstraint.Range range = constraint.ranges().get( 0 );
                    final VersionConstraint.Range.Limit min = range.min();
View Full Code Here

    }

    @Override
    public Version convert( final String string )
    {
        Version result = null;
       
        try
        {
            result = new Version( string );
        }
        catch( IllegalArgumentException e )
        {
            // Intentionally ignored.
        }
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.