use of org.apache.maven.plugins.invoker.Selector in project maven-plugins by apache.
the class SelectorTest method testSelectorWithGlobalMatch.
@Test
public void testSelectorWithGlobalMatch() {
Selector selector = new Selector("3.2.5", "1.7");
Properties props = new Properties();
// invoker.maven.version is used by all selectors
props.setProperty("invoker.maven.version", "3.0+");
props.setProperty("selector.1.java.version", "1.4+");
props.setProperty("selector.2.os.family", "myos");
InvokerProperties invokerProperties = new InvokerProperties(props);
assertEquals(0, selector.getSelection(invokerProperties));
props.setProperty("invoker.maven.version", "3.3.1+");
assertEquals(Selector.SELECTOR_MULTI, selector.getSelection(invokerProperties));
props.setProperty("invoker.maven.version", "3.0+");
props.setProperty("selector.1.maven.version", "3.3.1+");
assertEquals(Selector.SELECTOR_MULTI, selector.getSelection(invokerProperties));
props.setProperty("selector.2.os.family", "!myos");
assertEquals(0, selector.getSelection(invokerProperties));
}
use of org.apache.maven.plugins.invoker.Selector in project maven-plugins by apache.
the class SelectorTest method testSelectorMatch.
@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));
}
use of org.apache.maven.plugins.invoker.Selector in project maven-plugins by apache.
the class SelectorTest method testGlobalMatch.
@Test
public void testGlobalMatch() {
Selector selector = new Selector("3.2.5", "1.7");
Properties props = new Properties();
props.setProperty("invoker.maven.version", "3.0+");
InvokerProperties invokerProperties = new InvokerProperties(props);
assertEquals(0, selector.getSelection(invokerProperties));
}
Aggregations