use of org.apache.maven.plugins.invoker.InvokerProperties in project maven-plugins by apache.
the class InvokerPropertiesTest method testIsInvocationDefined.
public void testIsInvocationDefined() throws Exception {
Properties props = new Properties();
InvokerProperties facade = new InvokerProperties(props);
assertFalse(facade.isInvocationDefined(1));
props.setProperty("invoker.goals", "install");
assertFalse(facade.isInvocationDefined(1));
props.setProperty("invoker.goals.2", "install");
assertFalse(facade.isInvocationDefined(1));
assertTrue(facade.isInvocationDefined(2));
assertFalse(facade.isInvocationDefined(3));
}
use of org.apache.maven.plugins.invoker.InvokerProperties 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.InvokerProperties in project maven-plugins by apache.
the class InvokerPropertiesTest method testConfigureRequestProfiles.
public void testConfigureRequestProfiles() throws Exception {
Properties props = new Properties();
InvokerProperties facade = new InvokerProperties(props);
InvocationRequest request = new DefaultInvocationRequest();
request.setProfiles(Collections.singletonList("test"));
facade.configureInvocation(request, 0);
assertEquals(Collections.singletonList("test"), request.getProfiles());
props.setProperty("invoker.profiles", "verify");
facade.configureInvocation(request, 0);
assertEquals(Collections.singletonList("verify"), request.getProfiles());
props.setProperty("invoker.profiles", " ");
facade.configureInvocation(request, 0);
assertEquals(Arrays.asList(new String[0]), request.getProfiles());
props.setProperty("invoker.profiles", " clean , test verify ,");
facade.configureInvocation(request, 0);
assertEquals(Arrays.asList(new String[] { "clean", "test", "verify" }), request.getProfiles());
props.setProperty("invoker.profiles", "");
facade.configureInvocation(request, 0);
assertEquals(Arrays.asList(new String[0]), request.getProfiles());
}
use of org.apache.maven.plugins.invoker.InvokerProperties 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));
}
use of org.apache.maven.plugins.invoker.InvokerProperties in project maven-plugins by apache.
the class InvokerPropertiesTest method testConfigureRequestFailureBehavior.
public void testConfigureRequestFailureBehavior() throws Exception {
Properties props = new Properties();
InvokerProperties facade = new InvokerProperties(props);
InvocationRequest request = new DefaultInvocationRequest();
request.setReactorFailureBehavior(InvocationRequest.ReactorFailureBehavior.FailAtEnd);
facade.configureInvocation(request, 0);
assertEquals(InvocationRequest.ReactorFailureBehavior.FailAtEnd, request.getReactorFailureBehavior());
props.setProperty("invoker.failureBehavior", InvocationRequest.ReactorFailureBehavior.FailNever.getLongOption());
facade.configureInvocation(request, 0);
assertEquals("fail-never", request.getReactorFailureBehavior().getLongOption());
}
Aggregations