@Test public void testSelectorMatch() { Selector selector = new Selector( "3.2.5", "1.7" ); Properties props = new Properties(); props.setProperty( "selector.1.maven.version", "3.0+" ); InvokerProperties invokerProperties = new InvokerProperties( props ); assertEquals( 0, selector.getSelection( invokerProperties ) ); props.setProperty( "selector.1.maven.version", "3.3.1+" ); assertEquals( Selector.SELECTOR_MULTI, selector.getSelection( invokerProperties ) ); }
public int getSelection( InvokerProperties invokerProperties ) { if ( !invokerProperties.isSelectorDefined( 1 ) ) { return getGlobal( invokerProperties ); } for ( int selectorIndex = 1;; selectorIndex++ ) { if ( selectorIndex > 1 && !invokerProperties.isSelectorDefined( selectorIndex ) ) { break; } int selection = 0; if ( !SelectorUtils.isMavenVersion( invokerProperties.getMavenVersion( selectorIndex ), actualMavenVersion ) ) { selection |= SELECTOR_MAVENVERSION; } if ( !SelectorUtils.isJreVersion( invokerProperties.getJreVersion( selectorIndex ), actualJavaVersion ) ) { selection |= SELECTOR_JREVERSION; } if ( !SelectorUtils.isOsFamily( invokerProperties.getOsFamily( selectorIndex ) ) ) { selection |= SELECTOR_OSFAMILY; } if ( selection == 0 ) { return 0; } } return SELECTOR_MULTI; }
Selector { public int getSelection( InvokerProperties invokerProperties ) { if ( !invokerProperties.isSelectorDefined( 1 ) ) { return getGlobal( invokerProperties ); } for ( int selectorIndex = 1;; selectorIndex++ ) { if ( selectorIndex > 1 && !invokerProperties.isSelectorDefined( selectorIndex ) ) { break; } int selection = 0; if ( !SelectorUtils.isMavenVersion( invokerProperties.getMavenVersion( selectorIndex ), actualMavenVersion ) ) { selection |= SELECTOR_MAVENVERSION; } if ( !SelectorUtils.isJreVersion( invokerProperties.getJreVersion( selectorIndex ), actualJavaVersion ) ) { selection |= SELECTOR_JREVERSION; } if ( !SelectorUtils.isOsFamily( invokerProperties.getOsFamily( selectorIndex ) ) ) { selection |= SELECTOR_OSFAMILY; } if ( selection == 0 ) { return 0; } } return SELECTOR_MULTI; } }
Selector { public int getSelection( InvokerProperties invokerProperties ) { if ( !invokerProperties.isSelectorDefined( 1 ) ) { return getGlobal( invokerProperties ); } for ( int selectorIndex = 1;; selectorIndex++ ) { if ( selectorIndex > 1 && !invokerProperties.isSelectorDefined( selectorIndex ) ) { break; } int selection = 0; if ( !SelectorUtils.isMavenVersion( invokerProperties.getMavenVersion( selectorIndex ), actualMavenVersion ) ) { selection |= SELECTOR_MAVENVERSION; } if ( !SelectorUtils.isJreVersion( invokerProperties.getJreVersion( selectorIndex ), actualJavaVersion ) ) { selection |= SELECTOR_JREVERSION; } if ( !SelectorUtils.isOsFamily( invokerProperties.getOsFamily( selectorIndex ) ) ) { selection |= SELECTOR_OSFAMILY; } if ( selection == 0 ) { return 0; } } return SELECTOR_MULTI; } Selector( String actualMavenVersion, String actualJavaVersion ); }
Selector { public int getSelection( InvokerProperties invokerProperties ) { if ( !invokerProperties.isSelectorDefined( 1 ) ) { return getGlobal( invokerProperties ); } for ( int selectorIndex = 1;; selectorIndex++ ) { if ( selectorIndex > 1 && !invokerProperties.isSelectorDefined( selectorIndex ) ) { break; } int selection = 0; if ( !SelectorUtils.isMavenVersion( invokerProperties.getMavenVersion( selectorIndex ), actualMavenVersion ) ) { selection |= SELECTOR_MAVENVERSION; } if ( !SelectorUtils.isJreVersion( invokerProperties.getJreVersion( selectorIndex ), actualJavaVersion ) ) { selection |= SELECTOR_JREVERSION; } if ( !SelectorUtils.isOsFamily( invokerProperties.getOsFamily( selectorIndex ) ) ) { selection |= SELECTOR_OSFAMILY; } if ( selection == 0 ) { return 0; } } return SELECTOR_MULTI; } Selector( String actualMavenVersion, String actualJavaVersion ); int getSelection( InvokerProperties invokerProperties ); }
Selector { public int getSelection( InvokerProperties invokerProperties ) { if ( !invokerProperties.isSelectorDefined( 1 ) ) { return getGlobal( invokerProperties ); } for ( int selectorIndex = 1;; selectorIndex++ ) { if ( selectorIndex > 1 && !invokerProperties.isSelectorDefined( selectorIndex ) ) { break; } int selection = 0; if ( !SelectorUtils.isMavenVersion( invokerProperties.getMavenVersion( selectorIndex ), actualMavenVersion ) ) { selection |= SELECTOR_MAVENVERSION; } if ( !SelectorUtils.isJreVersion( invokerProperties.getJreVersion( selectorIndex ), actualJavaVersion ) ) { selection |= SELECTOR_JREVERSION; } if ( !SelectorUtils.isOsFamily( invokerProperties.getOsFamily( selectorIndex ) ) ) { selection |= SELECTOR_OSFAMILY; } if ( selection == 0 ) { return 0; } } return SELECTOR_MULTI; } Selector( String actualMavenVersion, String actualJavaVersion ); int getSelection( InvokerProperties invokerProperties );  }