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:com.seleniumtests.it.reporter.TestCustomReporter.java

/**
 * Check information are present in summary report
 * @param testContext//from  w  ww .  j  av  a  2  s.com
 * @throws Exception
 */
@Test(groups = { "it" })
public void testDataInSummaryReport(ITestContext testContext) throws Exception {

    try {
        System.setProperty("customSummaryReports", "summaryResult::json::ti/report.summary.vm");

        executeSubTest(1, new String[] { "com.seleniumtests.it.stubclasses.StubTestClass" },
                ParallelMode.METHODS, new String[] { "testAndSubActions", "testInError", "testWithException" });

        // check content of the file. It should contains all fields with a value
        String detailedReportContent = FileUtils.readFileToString(new File(
                new File(SeleniumTestsContextManager.getGlobalContext().getOutputDirectory()).getAbsolutePath()
                        + File.separator + "summaryResult.json"));

        JSONObject json = new JSONObject(detailedReportContent);

        Assert.assertEquals(json.getInt("fail"), 2);
        Assert.assertEquals(json.getInt("pass"), 1);
        Assert.assertEquals(json.getInt("skip"), 0);
        Assert.assertEquals(json.getInt("total"), 3);
    } finally {
        System.clearProperty("customSummaryReports");
    }

}

From source file:co.cask.cdap.security.server.ExternalAuthenticationServerTestBase.java

@AfterClass
public static void afterClass() throws Exception {
    ldapServer.shutDown(true);/*from w w  w .j  av  a2s . c o m*/
    server.stopAndWait();
    // Clear any security properties for zookeeper.
    System.clearProperty(Constants.External.Zookeeper.ENV_AUTH_PROVIDER_1);
    Configuration.setConfiguration(null);
}

From source file:org.chromium.ChromeProxy.java

private void clear(final CordovaArgs args, final CallbackContext callbackContext) {
    cordova.getThreadPool().execute(new Runnable() {
        @Override//w  ww.  j a v a 2 s .  co  m
        public void run() {
            System.clearProperty("socksProxyHost");
            System.clearProperty("socksProxyPort");
            System.clearProperty("http.proxyHost");
            System.clearProperty("http.proxyPort");
            System.clearProperty("http.nonProxyHosts");
            System.clearProperty("https.proxyHost");
            System.clearProperty("https.proxyPort");
            System.clearProperty("https.nonProxyHosts");
            System.clearProperty("ftp.proxyHost");
            System.clearProperty("ftp.proxyPort");
            System.clearProperty("ftp.nonProxyHosts");
            onSettingsChanged();
        }
    });
}

From source file:net.officefloor.plugin.woof.servlet.container.ServletContainerWoofApplicationExtensionServiceTest.java

@Override
protected void tearDown() throws Exception {

    // Clear the web app location
    System.clearProperty(WoofOfficeFloorSource.PROPERTY_WEBAPP_LOCATION);

    try {/*  w w  w.j  a va2s. co m*/
        // Stop the client
        this.client.close();

    } finally {
        // Stop the server
        WoofOfficeFloorSource.stop();
    }
}

From source file:org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase.java

/**
 * Creates the {@code Cache} for this test that is not connected to other members.
 *//*from   w w  w .j  av  a  2s. c  o  m*/
public final InternalCache createLonerCache() {
    synchronized (JUnit4CacheTestCase.class) {
        try {
            System.setProperty(GEMFIRE_PREFIX + "DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE", "true");
            InternalCache newCache = (InternalCache) CacheFactory.create(getLonerSystem());
            cache = newCache;

        } catch (CacheExistsException e) {
            Assert.fail("the cache already exists", e);

        } catch (RuntimeException ex) {
            throw ex;

        } catch (Exception ex) {
            Assert.fail("Checked exception while initializing cache??", ex);

        } finally {
            System.clearProperty(GEMFIRE_PREFIX + "DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE");
        }
        return cache;
    }
}

From source file:com.streamsets.datacollector.execution.runner.cluster.TestClusterRunner.java

@After
public void tearDown() {
    System.clearProperty(RuntimeInfo.TRANSIENT_ENVIRONMENT);
    System.clearProperty("sdc.testing-mode");
    clusterProvider.submitTimesOut = false;
    clusterProvider.isRunningCommandFails = false;
    clusterProvider.isRunningTimesOut = false;
    clusterProvider.isSucceeded = false;
    clusterProvider.isRunning = true;// ww  w.j  a va 2 s  .c o  m
    FileUtils.deleteQuietly(tempDir);
    if (executorService != null) {
        executorService.shutdownNow();
    }
}

From source file:ddf.catalog.transformer.response.query.atom.AtomTransformerTest.java

@After
public void tearDown() throws Exception {
    System.clearProperty(SystemInfo.ORGANIZATION);
    System.clearProperty(SystemInfo.SITE_NAME);
    System.clearProperty(SystemInfo.VERSION);
}

From source file:com.google.api.server.spi.auth.GoogleAppEngineAuthenticatorTest.java

@Test
public void testAuthenticateNonAppEngine() {
    System.clearProperty(EnvUtil.ENV_APPENGINE_RUNTIME);
    assertNull(authenticator.authenticate(request));
}

From source file:org.alfresco.util.HttpClientHelperTest.java

private void clearHTTPSystemProperties() {
    System.clearProperty("http.proxyHost");
    System.clearProperty("http.proxyPort");
    System.clearProperty("http.proxyUser");
    System.clearProperty("http.proxyPassword");

    System.clearProperty("https.proxyHost");
    System.clearProperty("https.proxyPort");
    System.clearProperty("https.proxyUser");
    System.clearProperty("https.proxyPassword");

    System.clearProperty("http.nonProxyHosts");
}

From source file:com.seleniumtests.it.reporter.TestCustomReporter.java

@Test(groups = { "it" }, expectedExceptions = ConfigurationException.class)
public void testTestReportDoesNotExists(ITestContext testContext) throws Exception {
    try {//ww w.ja  v a  2  s . co m
        System.setProperty("customTestReports", "SUP::json::ti/report.test.nowhere.vm");

        executeSubTest(1, new String[] { "com.seleniumtests.it.stubclasses.StubTestClass" },
                ParallelMode.METHODS, new String[] { "testAndSubActions", "testInError", "testWithException" });
    } finally {
        System.clearProperty("customTestReports");
    }
}