environmentvariablesconfigurationsourcetest.java

来自「sourcode about java basic」· Java 代码 · 共 38 行

JAVA
38
字号
package jsunit.java.tests_core.net.jsunit.configuration;

import junit.framework.TestCase;

public class EnvironmentVariablesConfigurationSourceTest extends TestCase {
    private EnvironmentVariablesConfigurationSource source;

    protected void setUp() throws Exception {
        super.setUp();
        source = new EnvironmentVariablesConfigurationSource();
    }

    public void testSimple() {
        System.setProperty(ConfigurationProperty.BROWSER_FILE_NAMES.getName(), "aaa");
        System.setProperty(ConfigurationProperty.CLOSE_BROWSERS_AFTER_TEST_RUNS.getName(), "bbb");
        System.setProperty(ConfigurationProperty.LOGS_DIRECTORY.getName(), "ddd");
        System.setProperty(ConfigurationProperty.PORT.getName(), "eee");
        System.setProperty(ConfigurationProperty.REMOTE_MACHINE_URLS.getName(), "fff");
        System.setProperty(ConfigurationProperty.RESOURCE_BASE.getName(), "ggg");
        System.setProperty(ConfigurationProperty.TIMEOUT_SECONDS.getName(), "hhh");
        System.setProperty(ConfigurationProperty.URL.getName(), "iii");
        assertEquals("aaa", source.browserFileNames());
        assertEquals("bbb", source.closeBrowsersAfterTestRuns());
        assertEquals("ddd", source.logsDirectory());
        assertEquals("eee", source.port());
        assertEquals("fff", source.remoteMachineURLs());
        assertEquals("ggg", source.resourceBase());
        assertEquals("hhh", source.timeoutSeconds());
        assertEquals("iii", source.url());
    }

    public void tearDown() throws Exception {
        for (ConfigurationProperty property : ConfigurationProperty.values())
            System.getProperties().remove(property.getName());
        super.tearDown();
    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?