Package ch.inftec.ju.util

Examples of ch.inftec.ju.util.SystemPropertyTempSetter


    Assert.assertEquals("String", props.get("encProperty"));
  }
 
  @Test
  public void canExport_property_toSystemProperties() throws Exception {
    try (SystemPropertyTempSetter ts = new SystemPropertyTempSetter()) {
      ts.setProperty("propYesSysYes", "p1");
      ts.setProperty("propYesSysNo", "p2");
      ts.setProperty("propNoSysYes", "p3");
      ts.setProperty("propNoSysNo", "p4");
     
      PropertiesMojo propertiesMojo = (PropertiesMojo) rule.configureMojo(new PropertiesMojo(), "ju-maven-plugin", new File("src/test/resources/test-poms/propertiesMojoTest-exportSystemProperty/pom.xml"));
      propertiesMojo.execute();
     
      // Check maven property export
View Full Code Here


    }
  }
 
  @Test
  public void canSet_andInterpolate_properties() throws Exception {
    try (SystemPropertyTempSetter ts = new SystemPropertyTempSetter()) {
      ts.setProperty("propSys", "p1");
      ts.setProperty("propMav", "p2");
      ts.setProperty("myKey", "p3");
     
      PropertiesMojo propertiesMojo = (PropertiesMojo) rule.configureMojo(new PropertiesMojo(), "ju-maven-plugin", new File("src/test/resources/test-poms/propertiesMojoTest-setAndInterpolateProperty/pom.xml"));
      propertiesMojo.execute();
     
      // Check maven property export
View Full Code Here

    }
  }
 
  @Test
  public void canSet_properties_inPomOnly() throws Exception {
    try (SystemPropertyTempSetter ts = new SystemPropertyTempSetter()) {
      // Make sure the property doesn't get overwritten by a System Property unless we want to
      ts.setProperty("myProp", "sysVal");
     
      PropertiesMojo propertiesMojo = (PropertiesMojo) rule.configureMojo(new PropertiesMojo(), "ju-maven-plugin", new File("src/test/resources/test-poms/propertiesMojoTest-setPropertiesInPomOnly/pom.xml"));
      propertiesMojo.execute();
       
      // Check maven property export
View Full Code Here

    }
  }
 
  @Test
  public void canSpecify_systemPropertyChainElment() throws Exception {
    try (SystemPropertyTempSetter ts = new SystemPropertyTempSetter()) {
      // Make sure the property doesn't get overwritten by a System Property unless we want to
      ts.setProperty("myProp", "sysVal");
     
      PropertiesMojo propertiesMojo = (PropertiesMojo) rule.configureMojo(new PropertiesMojo(), "ju-maven-plugin", new File("src/test/resources/test-poms/propertiesMojoTest-systemPropertyChainElement/pom.xml"));
      propertiesMojo.execute();
       
      // Check maven property export
View Full Code Here

TOP

Related Classes of ch.inftec.ju.util.SystemPropertyTempSetter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.