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.logging.log4j.core.util.ClockFactoryTest.java

@Test
public void testDefaultIsSystemClock() {
    System.clearProperty(ClockFactory.PROPERTY_NAME);
    assertSame(SystemClock.class, ClockFactory.getClock().getClass());
}

From source file:com.thoughtworks.go.agent.bootstrapper.AgentBootstrapperTest.java

@After
public void tearDown() throws Exception {
    System.clearProperty(AgentBootstrapper.WAIT_TIME_BEFORE_RELAUNCH_IN_MS);
    FileUtils.deleteQuietly(new File(Downloader.AGENT_LAUNCHER));
}

From source file:org.artificer.repository.jcr.AbstractJCRPersistenceTest.java

@AfterClass
public static void cleanup() {
    persistenceManager.shutdown();
    System.clearProperty(ArtificerConstants.ARTIFICER_CONFIG_AUDITING);
}

From source file:org.apache.juddi.keygen.KeyGeneratorTest.java

@Test()
public void testNonExisitingKeyGeneratorClass() {
    System.setProperty(Property.JUDDI_KEYGENERATOR, "org.apache.juddi.keygen.FooGenerator");
    try {/* w  w  w  .j a  v  a2 s.  co  m*/
        KeyGenerator keyGenerator = KeyGeneratorFactory.forceNewKeyGenerator();
        System.out.println("Generator = " + keyGenerator.getClass());
        if (!keyGenerator.getClass().getCanonicalName().equals(KeyGeneratorFactory.DEFAULT_IMPL))
            Assert.fail("This should have thrown an exception because this class does not exist.");
    } catch (Exception e) {
        String message = e.getMessage();
        Assert.assertEquals(
                "The specified Key Generator class 'org.apache.juddi.keygen.FooGenerator' was not found on classpath.",
                message);
    }
    System.clearProperty(Property.JUDDI_KEYGENERATOR);
}

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

@Before
public void setUp() throws Exception {
    System.clearProperty(EnvUtil.ENV_APPENGINE_RUNTIME);
    authenticator = new EndpointsPeerAuthenticator(jwtAuthenticator);
    request = new MockHttpServletRequest();
    request.setRemoteAddr("8.8.8.8");
}

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

@AfterClass
public static void afterClass() throws InterruptedException, IOException {
    System.clearProperty("solrcloud.skip.autorecovery");
    System.clearProperty("genericCoreNodeNames");
    if (solrHomeDirectory.exists()) {
        FileUtils.deleteDirectory(solrHomeDirectory);
    }//from   w w w.jav a2s .c o  m
}

From source file:org.apache.tinkerpop.gremlin.util.SystemUtilTest.java

@Test
public void shouldLoadSystemProperties() {
    System.setProperty("blah.aa", "1");
    System.setProperty("blah.b", "true");
    System.setProperty("blah.c", "three");
    System.setProperty("bleep.d", "false");
    Configuration configuration = SystemUtil.getSystemPropertiesConfiguration("blah", false);
    assertEquals(3, IteratorUtils.count(configuration.getKeys()));
    assertEquals(1, configuration.getInt("blah.aa"));
    assertTrue(configuration.getBoolean("blah.b"));
    assertEquals("three", configuration.getProperty("blah.c"));
    assertFalse(configuration.containsKey("d") || configuration.containsKey("bleep.d"));
    System.clearProperty("blah.aa");
    System.clearProperty("blah.b");
    System.clearProperty("blah.c");
    System.clearProperty("bleep.d");
}

From source file:android.net.http.AbstractProxyTest.java

@Override
protected void tearDown() throws Exception {
    System.clearProperty("proxyHost");
    System.clearProperty("proxyPort");
    System.clearProperty("http.proxyHost");
    System.clearProperty("http.proxyPort");
    System.clearProperty("https.proxyHost");
    System.clearProperty("https.proxyPort");

    server.shutdown();/*from  w  w w.  j ava 2  s.  c  om*/
    super.tearDown();
}

From source file:net.krotscheck.jersey2.configuration.Jersey2ToolkitConfigTest.java

/**
 * Assert that the system properties override the text properties.
 *///from   w  ww  .j a  va  2s  .  c  o  m
@Test
public void testSystemOverride() {
    // Override a property in jersey2-toolkit.properties
    System.setProperty("property1", "override1");
    // Add a new system property.
    System.setProperty("property3", "override3");

    Configuration config = new Jersey2ToolkitConfig();

    Assert.assertEquals("override1", config.getProperty("property1"));
    Assert.assertEquals("value2", config.getProperty("property2"));
    Assert.assertEquals("override3", config.getProperty("property3"));

    System.clearProperty("property1");
    System.clearProperty("property3");
}

From source file:org.janusgraph.diskstorage.solr.SolrRunner.java

public static void stop() throws Exception {
    System.clearProperty("solr.solrxml.location");
    System.clearProperty("zkHost");
    miniSolrCloudCluster.shutdown();//  ww w.jav  a2s.  c  om
}