Package org.eclipse.sapphire

Examples of org.eclipse.sapphire.VersionConstraint$Range


   
    @Test( expected = IllegalArgumentException.class )

    public void testVersionConstraintErrorHandling19()
    {
        new VersionConstraint( "1 2.3" );
    }
View Full Code Here


   
    @Test( expected = IllegalArgumentException.class )

    public void testVersionConstraintErrorHandling20()
    {
        new VersionConstraint( "1.2.3.v20120702" );
    }
View Full Code Here

            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 );
                }
               
                return result;
            }
        };
View Full Code Here

    public void testStringToVersionConstraint() throws Exception
    {
        final MasterConversionService service = Sapphire.service( MasterConversionService.class );
       
        assertEquals( new VersionConstraint( "1" ), service.convert( "1", VersionConstraint.class ) );
        assertEquals( new VersionConstraint( "1.2" ), service.convert( "1.2", VersionConstraint.class ) );
        assertEquals( new VersionConstraint( "1.2,3.4,5.6" ), service.convert( "1.2,3.4,5.6", VersionConstraint.class ) );
        assertEquals( new VersionConstraint( "[1.2-3.4)" ), service.convert( "[1.2-3.4)", VersionConstraint.class ) );
        assertEquals( new VersionConstraint( "[1.2-3.4),[5.6" ), service.convert( "[1.2-3.4),[5.6", VersionConstraint.class ) );
       
        assertNull( service.convert( "[1.2--3", VersionConstraint.class ) );
        assertNull( service.convert( "[1.2-3.4}", VersionConstraint.class ) );
    }
View Full Code Here

   
    public void testVersionConstraintToString() throws Exception
    {
        final MasterConversionService service = Sapphire.service( MasterConversionService.class );
       
        assertEquals( "1", service.convert( new VersionConstraint( "1" ), String.class ) );
        assertEquals( "1.2", service.convert( new VersionConstraint( "1.2" ), String.class ) );
        assertEquals( "1.2,3.4,5.6", service.convert( new VersionConstraint( "1.2,3.4,5.6" ), String.class ) );
        assertEquals( "[1.2-3.4)", service.convert( new VersionConstraint( "[1.2-3.4)" ), String.class ) );
        assertEquals( "[1.2-3.4),[5.6", service.convert( new VersionConstraint( "[1.2-3.4),[5.6" ), String.class ) );
    }
View Full Code Here

               
                final Version version = cast( operand( 0 ), Version.class );
               
                if( version != null )
                {
                    final VersionConstraint constraint = cast( operand( 1 ), VersionConstraint.class );
                   
                    if( constraint != null )
                    {
                        result = constraint.check( version );
                    }
                }
               
                return result;
            }
View Full Code Here

        final Version version = this.versionCompatibilityTargetService.version();
        final String versioned = this.versionCompatibilityTargetService.versioned();
       
        boolean compatible = false;
       
        final VersionConstraint constraint = (VersionConstraint) this.functionResult.value();
       
        if( constraint != null && version != null )
        {
            compatible = constraint.check( version );
        }
       
        return new Data( versioned, version, constraint, compatible );
    }
View Full Code Here

        final DeclarativeVersionCompatibilityService service = findDeclarativeVersionCompatibilityService( context( Property.class ) );
       
        if( service != null )
        {
            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();
                    final VersionConstraint.Range.Limit max = range.max();
                   
                    if( min != null && min.inclusive() && max == null )
                    {
View Full Code Here

    }

    @Override
    public VersionConstraint convert( final String string )
    {
        VersionConstraint result = null;
       
        try
        {
            result = new VersionConstraint( string );
        }
        catch( IllegalArgumentException e )
        {
            // Intentionally ignored.
        }
View Full Code Here

        Array dataArray = Array.factory(DataType.FLOAT, section.getShape());
        GradsVariable gradsVar = findVar(v2);

        // Canonical ordering is ens, time, level, lat, lon
        int           rangeIdx  = 0;
        Range         ensRange  = (gradsDDF.getEnsembleDimension() != null)
                                  ? section.getRange(rangeIdx++)
                                  : new Range(0, 0);
        Range         timeRange = (section.getRank() > 2)
                                  ? section.getRange(rangeIdx++)
                                  : new Range(0, 0);
        Range         levRange  = (gradsVar.getNumLevels() > 0)
                                  ? section.getRange(rangeIdx++)
                                  : new Range(0, 0);
        Range         yRange    = section.getRange(rangeIdx++);
        Range         xRange    = section.getRange(rangeIdx);

        IndexIterator ii        = dataArray.getIndexIterator();

        // loop over ens
        for (int ensIdx = ensRange.first(); ensIdx <= ensRange.last();
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.VersionConstraint$Range

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.