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.jackrabbit.core.cluster.DbClusterTestJCR3162.java

public void tearDown() throws Exception {
    // revert change to system property
    if (prevClusterId == null) {
        System.clearProperty(ClusterNode.SYSTEM_PROPERTY_NODE_ID);
    } else {/*  w w  w .  java  2s.c o m*/
        System.setProperty(ClusterNode.SYSTEM_PROPERTY_NODE_ID, prevClusterId);
    }

    try {
        rep1.shutdown();
        if (rep2 != null) {
            rep2.shutdown();
        }
    } finally {
        deleteAll();
    }
}

From source file:org.springframework.cloud.stream.app.cassandra.sink.CassandraSinkIntegrationTests.java

@AfterClass
public static void cleanup() {
    System.clearProperty("cassandra.cluster.port");
}

From source file:org.apache.solr.client.solrj.embedded.AbstractEmbeddedSolrServerTestCase.java

@Override
@After// ww  w.  j  a va2s .c  o  m
public void tearDown() throws Exception {
    if (cores != null)
        cores.shutdown();

    System.clearProperty("dataDir1");
    System.clearProperty("dataDir2");
    System.clearProperty("tests.shardhandler.randomSeed");

    deleteAdditionalFiles();

    super.tearDown();
}

From source file:org.apache.atlas.web.filters.MetadataAuthenticationSimpleFilterIT.java

@Test(enabled = false)
public void testSimpleLogin() throws Exception {
    String originalConf = System.getProperty("metadata.conf");
    System.setProperty("metadata.conf", System.getProperty("user.dir"));
    generateSimpleLoginConfiguration();/*from  www .ja  va2s  . com*/

    TestEmbeddedServer server = new TestEmbeddedServer(23001, "webapp/target/apache-atlas");

    try {
        startEmbeddedServer(server.getServer());

        URL url = new URL("http://localhost:23001");
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.connect();

        try {
            Assert.assertEquals(connection.getResponseCode(), 403);
        } catch (Exception e) {
            e.printStackTrace();
        }

        url = new URL("http://localhost:23001/?user.name=testuser");
        connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.connect();

        Assert.assertEquals(connection.getResponseCode(), 200);
    } finally {
        server.getServer().stop();
        if (originalConf != null) {
            System.setProperty("metadata.conf", originalConf);
        } else {
            System.clearProperty("metadata.conf");
        }
    }

}

From source file:net.myrrix.online.factorizer.als.AlternatingLeastSquaresTest.java

@Override
@After/*w  w w .j  a v a 2 s  .  com*/
public void tearDown() throws Exception {
    System.clearProperty("model.reconstructRMatrix");
    super.tearDown();
}

From source file:org.nuxeo.launcher.connect.TestConnectBroker.java

@After
public void tearDown() {
    // clear system properties
    System.clearProperty(Environment.NUXEO_HOME);
    System.clearProperty(TomcatConfigurator.TOMCAT_HOME);
}

From source file:org.settings4j.helper.web.Log4jConfigurationLoaderTest.java

@After
public void tearDown() throws Exception {
    System.clearProperty(LOG4J_CONFIG_KEY);
    System.clearProperty(LOG4J_DOCUMENT_BUILDER_FACTORY);
    DOMConfigurator.configure(Loader.getResource("log4j.xml"));
    InMemoryLog4jAppender.linesClear();/*from w  w w . ja va 2  s.  com*/
}

From source file:com.evolveum.midpoint.init.ConfigurationLoadTest.java

@Test
public void t02directoryAndExtractionTest() {
    LOGGER.info("---------------- directoryAndExtractionTest -----------------");

    File f = new File("target/midPointHome");
    System.setProperty("midpoint.home", "target/midPointHome/");
    StartupConfiguration sc = new StartupConfiguration();
    assertNotNull(sc);/*  w  ww.  j  av  a2s.c o  m*/
    sc.init();

    assertNotNull(f);
    assertTrue(f.exists(), "existence");
    assertTrue(f.isDirectory(), "type directory");

    f = new File("target/midPointHome/config.xml");
    assertTrue(f.exists(), "existence");
    assertTrue(f.isFile(), "type file");

    //cleanup
    System.clearProperty("midpoint.home");

}

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

@BeforeMethod(groups = { "ut" })
public void init() {
    PowerMockito.mockStatic(System.class);
    PowerMockito.when(System.getProperty(anyString())).thenCallRealMethod();
    PowerMockito.when(System.setProperty(anyString(), anyString())).thenCallRealMethod();
    PowerMockito.when(System.clearProperty(anyString())).thenCallRealMethod();
    PowerMockito.when(System.getProperty("os.name")).thenReturn("Windows 10");

    Map<BrowserType, List<BrowserInfo>> browserInfos = new HashMap<>();
    browserInfos.put(BrowserType.EDGE, Arrays.asList(new BrowserInfo(BrowserType.EDGE, "14393", "", false)));

    PowerMockito.mockStatic(OSUtility.class);
    PowerMockito.when(OSUtility.getInstalledBrowsersWithVersion()).thenReturn(browserInfos);
    PowerMockito.when(OSUtility.getCurrentPlatorm()).thenReturn(Platform.WINDOWS);

    PowerMockito.mockStatic(OSUtilityFactory.class);
    PowerMockito.when(OSUtilityFactory.getInstance()).thenReturn(osUtility);

    Mockito.when(config.getDebug()).thenReturn(Arrays.asList(DebugMode.NONE));
    Mockito.when(config.getPageLoadStrategy()).thenReturn(PageLoadStrategy.NORMAL);

    when(osUtility.getProgramExtension()).thenReturn(".exe");
}

From source file:com.kylinolap.query.test.KylinQueryTest.java

protected static void clean() {
    if (cubeConnection != null)
        closeConnection(cubeConnection);
    if (h2Connection != null)
        closeConnection(h2Connection);

    System.clearProperty(KylinConfig.KYLIN_CONF);
    KylinConfig.destoryInstance();//from  w w  w  . jav a 2s . c  o m
    CoprocessorEnabler.forceCoprocessorUnset();
}