// 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 );