Example usage for java.lang System setProperty

List of usage examples for java.lang System setProperty

Introduction

In this page you can find the example usage for java.lang System setProperty.

Prototype

public static String setProperty(String key, String value) 

Source Link

Document

Sets the system property indicated by the specified key.

Usage

From source file:com.newrelic.agent.Deployments.java

static int recordDeployment(CommandLine cmd)/*  27:    */ throws Exception
/*  28:    */ {//from  ww  w .  j ava  2s .co m
    /*  29: 27 */ if (cmd.hasOption("environment")) {
        /*  30: 28 */ System.setProperty("newrelic.environment", cmd.getOptionValue("environment"));
        /*  31:    */ }
    /*  32: 30 */ AgentConfig config = ConfigServiceFactory.createConfigService().getDefaultAgentConfig();
    /*  33: 31 */ return recordDeployment(cmd, config);
    /*  34:    */ }

From source file:gov.nih.nci.cacis.transform.SourceTransformerTest.java

@BeforeClass
public static void setupEnv() throws URISyntaxException {
    System.setProperty("cacis-pco.transformer.xml2rdf.xsl", "sampleXSLv2.xsl");
    final File smplxsl = new File(
            SourceTransformerTest.class.getClassLoader().getResource("xsl2/sampleXSLv2.xsl").toURI());
    System.setProperty("cacis-pco.transformer.xsl.baseClassPath", smplxsl.getParent() + "/");
}

From source file:com.github.drbookings.DrBookingsApplicationUITest.java

@BeforeClass
public static void setUpClass() throws Exception {

    Files.createDirectories(USER_HOME.toPath());
    System.setProperty("user.home", USER_HOME.getAbsolutePath());
}

From source file:com.hp.autonomy.frontend.find.idol.configuration.IdolFindConfigFileServiceTest.java

@BeforeClass
public static void init() {
    System.setProperty("hp.find.home", TEST_DIR);
}

From source file:be.redlab.examples.databasetesting.AbstractDaoTest.java

/**
 * Force location for h2's db files this way they are removed on clean. ( so not really in memory h?)
 *//*from   w ww.  j av a2s.  co m*/
@BeforeClass
public static final void before() {
    System.setProperty("h2.baseDir", "./target/");
}

From source file:net.erdfelt.android.sdkfido.logging.Logging.java

public static void config() {
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    URL url = cl.getResource("logging.properties");
    if (url != null) {
        InputStream in = null;/*  w  w w  .jav  a 2 s  .  co m*/
        try {
            in = url.openStream();
            LogManager.getLogManager().readConfiguration(in);
        } catch (IOException e) {
            e.printStackTrace(System.err);
        } finally {
            IOUtils.closeQuietly(in);
        }
    }

    System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.Jdk14Logger");
}

From source file:org.apache.camel.example.cxf.jaxrs.JAXRSClientServerTest.java

@BeforeClass
public static void setupPorts() {
    System.setProperty("soapEndpointPort", String.valueOf(AvailablePortFinder.getNextAvailable()));
    System.setProperty("restEndpointPort", String.valueOf(AvailablePortFinder.getNextAvailable()));
}

From source file:ar.edu.unlp.sedici.sedici2003.service.SeDiCI2003Manager.java

private static void initializeApplicationContext(String propertiesPath) {
    if (propertiesPath != null)
        System.setProperty("sedici2003_config", propertiesPath);

    SeDiCI2003Manager.applicationContext = new ClassPathXmlApplicationContext(APP_CONTEXT_CONFIG_LOCATION);
}

From source file:eu.riscoss.RemoteRiskAnalyserMain.java

static void loadJSmile() throws Exception {
    File dir = new File(FileUtils.getTempDirectory(), "jnativelibs-" + RandomStringUtils.randomAlphabetic(30));
    if (!dir.mkdir()) {
        throw new Exception("failed to make dir");
    }/*from   w  ww  . j  a va2s.co m*/
    File jsmile = new File(dir, "libjsmile.so");
    URL jsmURL = Thread.currentThread().getContextClassLoader().getResource("libjsmile.so");
    FileUtils.copyURLToFile(jsmURL, jsmile);
    System.setProperty("java.library.path",
            System.getProperty("java.library.path") + ":" + dir.getAbsolutePath());

    // flush the library paths
    Field sysPathsField = ClassLoader.class.getDeclaredField("sys_paths");
    sysPathsField.setAccessible(true);
    sysPathsField.set(null, null);

    // Check that it works...
    System.loadLibrary("jsmile");

    dir.deleteOnExit();
    jsmile.deleteOnExit();
}

From source file:net.cnmconsulting.spring.config.BasicJasyptTest.java

@BeforeClass
public static void setupEnvVar() {
    System.setProperty("APP_PASS", "151987thisismysalt!!");
}