Example usage for java.lang System clearProperty

List of usage examples for java.lang System clearProperty

Introduction

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

Prototype

public static String clearProperty(String key) 

Source Link

Document

Removes the system property indicated by the specified key.

Usage

From source file:org.apache.solr.hadoop.MorphlineBasicMiniMRTest.java

@After
public void tearDown() throws Exception {
    System.clearProperty("hadoop.log.dir");
    System.clearProperty("solr.hdfs.blockcache.enabled");

    super.tearDown();
}

From source file:org.apache.servicecomb.foundation.ssl.SSLOptionTest.java

@Test
public void testSSLOptionYamlOption2() throws Exception {
    System.setProperty("ssl.protocols", "TLSv1.2");
    ConcurrentCompositeConfiguration finalConfig = ConfigUtil.createLocalConfig();

    SSLOption option = SSLOption.buildFromYaml("server", finalConfig);

    String protocols = option.getProtocols();
    option.setProtocols(protocols);//ww w . j a v a 2s.  co  m
    Assert.assertEquals("TLSv1.2", protocols);
    System.clearProperty("ssl.protocols");
}

From source file:org.apache.solr.cloud.AbstractFullDistribZkTestBase.java

@Before
@Override/*from w w w.  j  a va2s . c  o m*/
public void setUp() throws Exception {
    super.setUp();
    // ignoreException(".*");
    if (sliceCount > 0) {
        System.setProperty("numShards", Integer.toString(sliceCount));
    } else {
        System.clearProperty("numShards");
    }
}

From source file:org.bonitasoft.web.rest.server.datastore.page.PageDatastoreTest.java

@After
public void teardown() throws Exception {
    if (StringUtil.isBlank(savedBonitaHomeProperty)) {
        System.clearProperty(WebBonitaConstants.BONITA_HOME);
    } else {//from  www  .  j  ava  2  s.  c o  m
        System.setProperty(WebBonitaConstants.BONITA_HOME, savedBonitaHomeProperty);
    }
}

From source file:com.seleniumtests.ut.browserfactory.TestEdgeCapabilityFactory.java

@Test(groups = { "ut" })
public void testCreateEdgeCapabilitiesOverrideDriverPathLocal() {
    try {//from  w  ww  . ja  v  a  2  s . c om
        Mockito.when(config.getMode()).thenReturn(DriverMode.LOCAL);
        Mockito.when(config.getEdgeDriverPath()).thenReturn("/opt/edge/driver/edgedriver");

        new EdgeCapabilitiesFactory(config).createCapabilities();

        Assert.assertEquals(
                System.getProperty(EdgeDriverService.EDGE_DRIVER_EXE_PROPERTY).replace(File.separator, "/"),
                "/opt/edge/driver/edgedriver");
    } finally {
        System.clearProperty(EdgeDriverService.EDGE_DRIVER_EXE_PROPERTY);
    }
}

From source file:org.ligoj.app.resource.plugin.CurlProcessorTest.java

@Test
public void testProxy() {
    // set proxy configuration and proxy server
    System.setProperty("https.proxyHost", "localhost");
    System.setProperty("https.proxyPort", String.valueOf(PROXY_PORT));
    final WireMockServer proxyServer = new WireMockServer(PROXY_PORT);
    proxyServer.stubFor(get(WireMock.urlMatching(".*"))
            .willReturn(aResponse().proxiedFrom("http://localhost:" + MOCK_PORT)));
    proxyServer.start();// w  ww.  j  a  v a  2  s.c o m

    // set main http server
    httpServer.stubFor(
            get(urlPathEqualTo("/")).willReturn(aResponse().withStatus(HttpStatus.SC_OK).withBody("CONTENT")));
    httpServer.start();

    // launch request
    try (final CurlProcessor processor = new CurlProcessor()) {
        final String downloadPage = processor.get("http://localhost:" + PROXY_PORT);
        Assertions.assertEquals("CONTENT", downloadPage);
        // clean proxy configuration
        System.clearProperty("https.proxyHost");
        System.clearProperty("https.proxyPort");
        proxyServer.stop();
    }
}

From source file:org.apache.solr.cloud.ClusterStateUpdateTest.java

@Override
public void tearDown() throws Exception {
    if (VERBOSE) {
        printLayout(zkServer.getZkHost());
    }/*from   w  w  w  .j  a v a 2s.co m*/
    container1.shutdown();
    container2.shutdown();
    container3.shutdown();

    zkServer.shutdown();
    super.tearDown();
    System.clearProperty("zkClientTimeout");
    System.clearProperty("zkHost");
    System.clearProperty("hostPort");
    System.clearProperty("solrcloud.update.delay");
}

From source file:com.yahoo.athenz.common.server.db.DataSourceFactoryTest.java

@Test
public void testRetrieveConfigSettingLong() {

    System.setProperty(ATHENZ_DBPOOL_PROP1, "100");
    assertEquals(DataSourceFactory.retrieveConfigSetting(ATHENZ_DBPOOL_PROP1, 20L), 100L);

    System.setProperty(ATHENZ_DBPOOL_PROP1, "0");
    assertEquals(DataSourceFactory.retrieveConfigSetting(ATHENZ_DBPOOL_PROP1, 20L), 0);

    System.setProperty(ATHENZ_DBPOOL_PROP1, "-100");
    assertEquals(DataSourceFactory.retrieveConfigSetting(ATHENZ_DBPOOL_PROP1, 20L), -100L);

    System.clearProperty(ATHENZ_DBPOOL_PROP1);
}

From source file:com.streamsets.datacollector.execution.manager.standalone.TestStandalonePipelineManager.java

@After
public void tearDown() {
    System.clearProperty(RuntimeModule.SDC_PROPERTY_PREFIX + RuntimeInfo.LIBEXEC_DIR);
    pipelineManager.stop();
    pipelineStoreTask.stop();
}

From source file:com.yahoo.athenz.common.server.db.DataSourceFactoryTest.java

@Test
public void testRetrieveConfigSettingLongNull() {
    System.clearProperty(ATHENZ_DBPOOL_PROP1);
    assertEquals(DataSourceFactory.retrieveConfigSetting(ATHENZ_DBPOOL_PROP1, 25L), 25L);
}