Search in sources :

Example 1 with InvokerProperties

use of org.apache.maven.plugins.invoker.InvokerProperties in project maven-plugins by apache.

the class InvokerPropertiesTest method testIsExpectedResult.

public void testIsExpectedResult() throws Exception {
    Properties props = new Properties();
    InvokerProperties facade = new InvokerProperties(props);
    assertTrue(facade.isExpectedResult(0, 0));
    assertFalse(facade.isExpectedResult(1, 0));
    props.setProperty("invoker.buildResult", "success");
    assertTrue(facade.isExpectedResult(0, 0));
    assertFalse(facade.isExpectedResult(1, 0));
    props.setProperty("invoker.buildResult", "failure");
    assertFalse(facade.isExpectedResult(0, 0));
    assertTrue(facade.isExpectedResult(1, 0));
}
Also used : InvokerProperties(org.apache.maven.plugins.invoker.InvokerProperties) InvokerProperties(org.apache.maven.plugins.invoker.InvokerProperties) Properties(java.util.Properties)

Example 2 with InvokerProperties

use of org.apache.maven.plugins.invoker.InvokerProperties in project maven-plugins by apache.

the class InvokerPropertiesTest method testConstructorNullSafe.

public void testConstructorNullSafe() throws Exception {
    InvokerProperties facade = new InvokerProperties(null);
    assertNotNull(facade.getProperties());
}
Also used : InvokerProperties(org.apache.maven.plugins.invoker.InvokerProperties)

Example 3 with InvokerProperties

use of org.apache.maven.plugins.invoker.InvokerProperties in project maven-plugins by apache.

the class InvokerPropertiesTest method testIsSelectedDefined.

public void testIsSelectedDefined() {
    Properties props = new Properties();
    InvokerProperties facade = new InvokerProperties(props);
    assertFalse(facade.isSelectorDefined(1));
    props.setProperty("invoker.java.version", "1.6+");
    props.setProperty("invoker.maven.version", "3.0+");
    props.setProperty("invoker.os.family", "windows");
    assertFalse(facade.isSelectorDefined(1));
    props.setProperty("selector.2.java.version", "1.6+");
    props.setProperty("selector.3.maven.version", "3.0+");
    props.setProperty("selector.4.os.family", "windows");
    assertFalse(facade.isSelectorDefined(1));
    assertTrue(facade.isSelectorDefined(2));
    assertTrue(facade.isSelectorDefined(3));
    assertTrue(facade.isSelectorDefined(4));
    assertFalse(facade.isSelectorDefined(5));
}
Also used : InvokerProperties(org.apache.maven.plugins.invoker.InvokerProperties) InvokerProperties(org.apache.maven.plugins.invoker.InvokerProperties) Properties(java.util.Properties)

Example 4 with InvokerProperties

use of org.apache.maven.plugins.invoker.InvokerProperties in project maven-plugins by apache.

the class InvokerPropertiesTest method testConfigureRequestMavenOpts.

public void testConfigureRequestMavenOpts() throws Exception {
    Properties props = new Properties();
    InvokerProperties facade = new InvokerProperties(props);
    InvocationRequest request = new DefaultInvocationRequest();
    request.setMavenOpts("default");
    facade.configureInvocation(request, 0);
    assertEquals("default", request.getMavenOpts());
    props.setProperty("invoker.mavenOpts", "-Xmx512m");
    facade.configureInvocation(request, 0);
    assertEquals("-Xmx512m", request.getMavenOpts());
}
Also used : InvokerProperties(org.apache.maven.plugins.invoker.InvokerProperties) DefaultInvocationRequest(org.apache.maven.shared.invoker.DefaultInvocationRequest) InvocationRequest(org.apache.maven.shared.invoker.InvocationRequest) DefaultInvocationRequest(org.apache.maven.shared.invoker.DefaultInvocationRequest) InvokerProperties(org.apache.maven.plugins.invoker.InvokerProperties) Properties(java.util.Properties)

Example 5 with InvokerProperties

use of org.apache.maven.plugins.invoker.InvokerProperties in project maven-plugins by apache.

the class InvokerPropertiesTest method testGetInvokerProperty.

public void testGetInvokerProperty() throws Exception {
    Properties props = new Properties();
    InvokerProperties facade = new InvokerProperties(props);
    assertNull(facade.get("undefined-key", 0));
    props.setProperty("key", "value");
    assertEquals("value", facade.get("key", 1));
    props.setProperty("key.1", "another-value");
    assertEquals("another-value", facade.get("key", 1));
    assertEquals("value", facade.get("key", 2));
}
Also used : InvokerProperties(org.apache.maven.plugins.invoker.InvokerProperties) InvokerProperties(org.apache.maven.plugins.invoker.InvokerProperties) Properties(java.util.Properties)

Aggregations

InvokerProperties (org.apache.maven.plugins.invoker.InvokerProperties)16 Properties (java.util.Properties)15 DefaultInvocationRequest (org.apache.maven.shared.invoker.DefaultInvocationRequest)7 InvocationRequest (org.apache.maven.shared.invoker.InvocationRequest)7 Selector (org.apache.maven.plugins.invoker.Selector)3 Test (org.junit.Test)3 File (java.io.File)1