failedtolaunchbrowserstandalonetesttest.java

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

JAVA
35
字号
package jsunit.java.tests_server.net.jsunit;

import junit.framework.TestResult;
import net.jsunit.configuration.ConfigurationSource;
import net.jsunit.model.ResultType;

public class FailedToLaunchBrowserStandaloneTestTest extends EndToEndTestCase {

    protected ConfigurationSource configurationSource() {
        return new StubConfigurationSource() {
            public String browserFileNames() {
                return "no_such_browser.exe";
            }

            public String url() {
                return "http://localhost:"+port+"/jsunit/testRunner.html?" +
                        "testPage=http://localhost:"+port+"/jsunit/tests/jsUnitUtilityTests.html" +
                        "&autoRun=true&submitresults=true&resultId=foobar";
            }
            
            public String port() {
            	return String.valueOf(port);
            }
        };
    }

    public void testFailToLaunchBrowsers() throws Exception {
        StandaloneTest test = new StandaloneTest(configurationSource());
        TestResult result = test.run();
        assertFalse(result.wasSuccessful());
        assertEquals(ResultType.FAILED_TO_LAUNCH, test.getServer().lastResult().getResultType());
    }

}

⌨️ 快捷键说明

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