Package org.eclipse.sapphire

Examples of org.eclipse.sapphire.VersionCompatibilityTargetService


    {
        final RootElement root = RootElement.TYPE.instantiate();
       
        // Start with null context version.
       
        final VersionCompatibilityTargetService rootContextVersionService = root.service( VersionCompatibilityTargetService.class );
       
        assertNotNull( rootContextVersionService );
        assertNull( 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 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


   
    public void testDynamicVersionCompatibility() throws Exception
    {
        final RootElement root = RootElement.TYPE.instantiate();
       
        final VersionCompatibilityTargetService rootContextVersionService = root.service( VersionCompatibilityTargetService.class );
       
        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

   
    public void testCustomVersionCompatibilityService() throws Exception
    {
        final RootElement root = RootElement.TYPE.instantiate();
       
        final VersionCompatibilityTargetService rootContextVersionService = root.service( VersionCompatibilityTargetService.class );
       
        assertNotNull( rootContextVersionService );
        assertNull( rootContextVersionService.version() );

        final TestVersionCompatibilityService service
            = (TestVersionCompatibilityService) root.property( RootElement.PROP_VALUE_VERSION_COMPATIBILITY_SERVICE ).service( VersionCompatibilityService.class );
       
        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

TOP

Related Classes of org.eclipse.sapphire.VersionCompatibilityTargetService

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.