A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/seleniumhq/selenium/commit/067ab3c9f337b04bd7a8277a63601875ccf7ad5e below:

[java] Remove try/catch from tests · SeleniumHQ/selenium@067ab3c · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+12

-20

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+12

-20

lines changed Original file line number Diff line number Diff line change

@@ -17,12 +17,6 @@

17 17 18 18

package com.thoughtworks.selenium;

19 19 20 -

import static org.junit.jupiter.api.Assertions.assertArrayEquals;

21 -

import static org.junit.jupiter.api.Assertions.assertEquals;

22 -

import static org.junit.jupiter.api.Assertions.fail;

23 -

import static org.mockito.Mockito.doReturn;

24 -

import static org.mockito.Mockito.spy;

25 - 26 20

import org.junit.jupiter.api.Test;

27 21 28 22

import java.io.IOException;

@@ -33,6 +27,12 @@

33 27

import java.net.HttpURLConnection;

34 28

import java.net.URL;

35 29 30 +

import static org.junit.jupiter.api.Assertions.assertArrayEquals;

31 +

import static org.junit.jupiter.api.Assertions.assertEquals;

32 +

import static org.junit.jupiter.api.Assertions.fail;

33 +

import static org.mockito.Mockito.doReturn;

34 +

import static org.mockito.Mockito.spy;

35 + 36 36

/**

37 37

* {@link com.thoughtworks.selenium.HttpCommandProcessor} unit test class.

38 38

*/

@@ -102,15 +102,12 @@ public void testResourcesClosedWhenIoeOnGetInputStream() {

102 102

}

103 103 104 104

@Test

105 -

public void testResourcesClosedWhenNoIoes() {

105 +

public void testResourcesClosedWhenNoIoes() throws IOException {

106 106

IOEThrowingHttpCommandProcessor cmdProc = new IOEThrowingHttpCommandProcessor(

107 107

"localhost", 4444, "*chrome", "http://www.google.com");

108 -

try {

109 -

cmdProc.getCommandResponseAsString("testCommand");

110 -

cmdProc.verifyClosedResources(true, true, true);

111 -

} catch (IOException ioe) {

112 -

fail();

113 -

}

108 + 109 +

cmdProc.getCommandResponseAsString("testCommand");

110 +

cmdProc.verifyClosedResources(true, true, true);

114 111

}

115 112 116 113

@Test

Original file line number Diff line number Diff line change

@@ -45,7 +45,6 @@

45 45

import static java.util.Collections.singletonList;

46 46

import static org.assertj.core.api.Assertions.assertThat;

47 47

import static org.assertj.core.api.Assertions.assertThatExceptionOfType;

48 -

import static org.junit.jupiter.api.Assertions.fail;

49 48

import static org.junit.jupiter.api.Assumptions.assumeTrue;

50 49

import static org.openqa.selenium.By.id;

51 50

import static org.openqa.selenium.testing.drivers.Browser.CHROME;

@@ -491,16 +490,12 @@ public void testShouldThrowAnExceptionWhenArgumentsWithStaleElementPassed() {

491 490 492 491

@Test

493 492

@Ignore(IE)

494 -

public void testShouldBeAbleToReturnADateObject() {

493 +

public void testShouldBeAbleToReturnADateObject() throws ParseException {

495 494

driver.get(pages.simpleTestPage);

496 495 497 496

String date = (String) executeScript("return new Date();");

498 497 499 -

try {

500 -

new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").parse(date);

501 -

} catch (ParseException e) {

502 -

fail();

503 -

}

498 +

new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").parse(date);

504 499

}

505 500 506 501

@Test

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4