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.clearcenter.mobile_demo.mdRest.java

static private HttpsURLConnection CreateConnection(URL url) throws IOException {
    System.setProperty("http.keepAlive", "false");

    HttpsURLConnection http = (HttpsURLConnection) url.openConnection();

    http.setConnectTimeout(30 * 1000);/*w ww .  j ava  2  s.c o  m*/
    http.setReadTimeout(30 * 1000);
    http.setUseCaches(false);
    http.setDoInput(true);
    http.setDoOutput(true);
    http.setUseCaches(false);

    return http;
}

From source file:opensonata.dataDisplays.BaselineImage.java

public static void main(String[] args) throws IOException {

    // Use headless mode so can run under cron
    System.setProperty("java.awt.headless", "true");

    CmdLineOptions options = new CmdLineOptions();
    if (!options.parseCommandLineArgs(args)) {
        System.exit(1);/*w w  w.  j ava  2  s.com*/
    }

    BaselineImage baseImg = new BaselineImage();

    baseImg.processFile(options.getInFilename(), options.getOutFilename(), options.getTitle());

}

From source file:com.honnix.cheater.cli.Main.java

private static boolean setTrustStore() {
    boolean result = true;

    URL trustStoreFileURL = Main.class.getClassLoader().getResource(CheaterConstant.TRUST_STORE_FILE_NAME);

    if (trustStoreFileURL == null) {
        result = false;/*  www.j  av  a 2  s. co  m*/
    } else {
        String trustStoreFilePath = null;

        try {
            trustStoreFilePath = trustStoreFileURL.toURI().getPath();
        } catch (URISyntaxException e) {
            LOG.fatal("Failed setting trust store.", e);

            result = false;
        }

        if (trustStoreFilePath == null) {
            result = false;
        } else {
            System.setProperty(CheaterConstant.TRUST_STORE_KEY, trustStoreFilePath);
        }
    }

    return result;
}

From source file:com.github.rvesse.airline.parser.aliases.TestAliases.java

@AfterClass
public static void cleanup() {
    if (f.exists()) {
        f.delete();
    }
    System.setProperty("user.home", homeDir);
}

From source file:com.redhat.lightblue.crud.ldap.ITCaseLdapCRUDController_DataType_Test.java

@BeforeClass
public static void beforeClass() throws Exception {
    System.setProperty("ldap.host", "localhost");
    System.setProperty("ldap.port", String.valueOf(LdapServerExternalResource.DEFAULT_PORT));
    System.setProperty("ldap.database", "test");
    System.setProperty("ldap.datatype.basedn", "dc=example,dc=com");

    System.setProperty("mongo.host", "localhost");
    System.setProperty("mongo.port", String.valueOf(MongoServerExternalResource.DEFAULT_PORT));
    System.setProperty("mongo.database", "lightblue");

    initLightblueFactory("./datasources.json", "./metadata/datatype-metadata.json");
}

From source file:com.springcryptoutils.core.keystore.DefaultKeyStoreFactoryBeanTest.java

@Before
public void setup() {
    System.setProperty("javax.net.ssl.keyStore", "src/test/resources/keystore.jks");
    System.setProperty("javax.net.ssl.keyStorePassword", "password");

    ctx = new ClassPathXmlApplicationContext(
            "classpath:com/springcryptoutils/core/keystore/DefaultKeyStoreFactoryBeanTest-context.xml");
}

From source file:TestDataDistributionDaoImpl.java

public void test() throws Exception {
    System.setProperty("config.resource", "/application.local.conf");
    Config config = ConfigFactory.load();
    String eagleServiceHost = config.getString(EagleConfigConstants.EAGLE_PROPS + "."
            + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.HOST);
    Integer eagleServicePort = config.getInt(EagleConfigConstants.EAGLE_PROPS + "."
            + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PORT);
    String username = config.getString(EagleConfigConstants.EAGLE_PROPS + "."
            + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME);
    String password = config.getString(EagleConfigConstants.EAGLE_PROPS + "."
            + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD);
    String topic = config.getString("dataSourceConfig.topic");
    DataDistributionDao dao = new DataDistributionDaoImpl(eagleServiceHost, eagleServicePort, username,
            password, topic);/*from   ww w  .  ja v a  2s  .  c  o  m*/
    dao.fetchDataDistribution(System.currentTimeMillis() - 2 * DateUtils.MILLIS_PER_DAY,
            System.currentTimeMillis());
}

From source file:com.impetus.kundera.ycsb.CouchDBYCSBTest.java

/**
 * @throws java.lang.Exception//from ww w.  j ava  2  s . c  o  m
 */
@Before
public void setUp() throws Exception {
    System.setProperty("fileName", "src/main/resources/db-couch.properties");
    // in case property file name is not set as system property.
    super.setUp();
}

From source file:TestMIMAC.java

@BeforeClass
public static void setUp() {
    System.out.println("setting up");
    System.setProperty(RandomFactory.RANDOM_FACTORY_PROP_KEY, RandomFactoryOld.class.getName());
}

From source file:com.impetus.kundera.ycsb.CassandraYCSBTest.java

/**
 * @throws java.lang.Exception//  w  w w  . ja  v a  2 s. co m
 */
@Before
public void setUp() throws Exception {
    System.setProperty("fileName", "src/main/resources/db-cassandra.properties");
    // in case property file name is not set as system property.
    super.setUp();
}