Skip to content

Commit 8177707

Browse files
committed
Improve test reliability
1 parent b2d2428 commit 8177707

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

test/org/apache/tomcat/util/net/ocsp/TestOcspEnabled.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717
package org.apache.tomcat.util.net.ocsp;
1818

19+
import java.net.SocketException;
1920
import java.util.ArrayList;
2021
import java.util.Collection;
2122
import java.util.List;
@@ -111,7 +112,7 @@ public void test() throws Exception {
111112
if (handshakeFailureExpected) {
112113
Assert.fail("Handshake did not fail when expected to do so.");
113114
}
114-
} catch (SSLHandshakeException e) {
115+
} catch (SSLHandshakeException | SocketException e) {
115116
if (!handshakeFailureExpected) {
116117
Assert.fail("Handshake failed when not expected to do so.");
117118
}

test/org/apache/tomcat/util/net/ocsp/TestOcspSoftFailInternalError.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717
package org.apache.tomcat.util.net.ocsp;
1818

19+
import java.net.SocketException;
1920
import java.util.ArrayList;
2021
import java.util.Collection;
2122
import java.util.List;
@@ -101,7 +102,7 @@ public void test() throws Exception {
101102
if (handshakeFailureExpected) {
102103
Assert.fail("Handshake did not fail when expected to do so.");
103104
}
104-
} catch (SSLHandshakeException e) {
105+
} catch (SSLHandshakeException | SocketException e) {
105106
if (!handshakeFailureExpected) {
106107
Assert.fail("Handshake failed when not expected to do so.");
107108
}

test/org/apache/tomcat/util/net/ocsp/TestOcspSoftFailTryLater.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717
package org.apache.tomcat.util.net.ocsp;
1818

19+
import java.net.SocketException;
1920
import java.util.ArrayList;
2021
import java.util.Collection;
2122
import java.util.List;
@@ -101,7 +102,7 @@ public void test() throws Exception {
101102
if (handshakeFailureExpected) {
102103
Assert.fail("Handshake did not fail when expected to do so.");
103104
}
104-
} catch (SSLHandshakeException e) {
105+
} catch (SSLHandshakeException | SocketException e) {
105106
if (!handshakeFailureExpected) {
106107
Assert.fail("Handshake failed when not expected to do so.");
107108
}

0 commit comments

Comments
 (0)