Package org.eclipse.sapphire

Examples of org.eclipse.sapphire.VersionConstraint


    {
        final TestElement element = TestElement.TYPE.instantiate();
       
        element.setVersionConstraint( "[1.2.3-2.0)" );
       
        final VersionConstraint constraint = element.getVersionConstraint().content();
       
        assertNotNull( constraint );
        assertTrue( constraint.check( "1.2.3" ) );
        assertTrue( constraint.check( "1.5" ) );
        assertFalse( constraint.check( "2.0" ) );
        assertFalse( constraint.check( "55.0" ) );
    }
View Full Code Here


{
    @Test
   
    public void testSingleVersionConstraint()
    {
        final VersionConstraint constraint = new VersionConstraint( "1.2.3" );
       
        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.4" ) ) );
        assertFalse( constraint.check( new Version( "1.2.3.4" ) ) );
    }
View Full Code Here

   
    @Test
   
    public void testClosedRangeVersionConstraint1()
    {
        final VersionConstraint constraint = new VersionConstraint( "[1.2.3-1.3)" );
       
        assertTrue( constraint.check( new Version( "1.2.3" ) ) );
        assertTrue( constraint.check( new Version( "1.2.3.0.0" ) ) );
        assertTrue( constraint.check( new Version( "1.2.5" ) ) );
        assertFalse( constraint.check( new Version( "1.3" ) ) );
        assertFalse( constraint.check( new Version( "1.3.0" ) ) );
    }
View Full Code Here

   
    @Test
   
    public void testClosedRangeVersionConstraint2()
    {
        final VersionConstraint constraint = new VersionConstraint( "[1.2.3-1.3]" );
       
        assertTrue( constraint.check( new Version( "1.2.3" ) ) );
        assertTrue( 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( "1.3.0" ) ) );
        assertFalse( constraint.check( new Version( "1.3.1" ) ) );
    }
View Full Code Here

   
    @Test

    public void testClosedRangeVersionConstraint3()
    {
        final VersionConstraint constraint = new VersionConstraint( "(1.2.3-1.3]" );
       
        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( "1.3.0" ) ) );
        assertFalse( constraint.check( new Version( "1.3.1" ) ) );
    }
View Full Code Here

   
    @Test

    public void testOpenRangeVersionConstraint1()
    {
        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" ) ) );
        assertTrue( constraint.check( new Version( "1.2.3" ) ) );
        assertTrue( 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

    {
        final Version version = Sapphire.version();
       
        assertNotNull( version );
       
        final VersionConstraint constraint = new VersionConstraint( EXPECTED_VERSION_CONSTRAINT );
       
        assertTrue( constraint.check( version ) );
    }
View Full Code Here

   
    @Test

    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

   
    @Test
   
    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

   
    @Test
   
    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

TOP

Related Classes of org.eclipse.sapphire.VersionConstraint

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.