コード例 #1
0
  @Test
  public void testBrowserStartCommandMatchWhenBrowserStringIsStarTheBrowserName() {
    final BrowserStringParser.Result result;

    result = new BrowserStringParser().parseBrowserStartCommand("firefox", "*firefox");
    assertTrue(result.match());
  }
コード例 #2
0
  @Test
  public void testBrowserStartCommandIsNullWhenThereIsNothingButSpaceAfterTheBrowserName() {
    final BrowserStringParser.Result result;

    result = new BrowserStringParser().parseBrowserStartCommand("firefox", "firefox    ");
    assertTrue(result.match());
    assertNull(result.customLauncher());
  }
コード例 #3
0
  @Test
  public void testBrowserStartCommandDoNotMatchWhenBrowsersisASubstring() {
    final BrowserStringParser.Result result;

    result = new BrowserStringParser().parseBrowserStartCommand("firefox", "*firefoxproxy");
    assertFalse(result.match());
    assertNull(result.customLauncher());
  }
コード例 #4
0
  @Test
  public void testBrowserStartCommandDoNotMatchWhenBrowsersAreWayDifferent() {
    final BrowserStringParser.Result result;

    result = new BrowserStringParser().parseBrowserStartCommand("firefox", "*safari");
    assertFalse(result.match());
    assertNull(result.customLauncher());
  }
コード例 #5
0
  @Test
  public void testBrowserStartCommandMatchPreservedSpacesWhithinCustomLauncher() {
    final BrowserStringParser.Result result;

    result =
        new BrowserStringParser()
            .parseBrowserStartCommand("hta", "*hta '/a/custom/launcher with space'   ");
    assertTrue(result.match());
    assertEquals("'/a/custom/launcher with space'", result.customLauncher());
  }
コード例 #6
0
  @Test
  public void testBrowserStartCommandMatchIgnoredTrailingSpacesWhenCustomLauncherIsProvided() {
    final BrowserStringParser.Result result;

    result =
        new BrowserStringParser()
            .parseBrowserStartCommand("iexplore", "*iexplore /a/custom/launcher   ");
    assertTrue(result.match());
    assertEquals("/a/custom/launcher", result.customLauncher());
  }
コード例 #7
0
  @Test
  public void testBrowserStartCommandMatchWhenCustomLauncherIsProvided() {
    final BrowserStringParser.Result result;

    result =
        new BrowserStringParser()
            .parseBrowserStartCommand("firefox", "*firefox /a/custom/launcher");
    assertTrue(result.match());
    assertEquals("/a/custom/launcher", result.customLauncher());
  }