Skip to content

Commit 4d81b3f

Browse files
committed
✅🚧 Omit 15 SSL connection tests for JRuby
1 parent aa255b2 commit 4d81b3f

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

test/net/imap/test_deprecated_client_options.rb

+4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class InitializeTests < DeprecatedClientOptionsTest
5555
end
5656

5757
test "Convert deprecated usessl (= true) and certs, with warning" do
58+
omit_if_jruby "SSL tests don't work yet"
5859
run_fake_server_in_thread(implicit_tls: true) do |server|
5960
certs = server.config.tls[:ca_file]
6061
assert_deprecated_warning(/Call Net::IMAP\.new with keyword/i) do
@@ -71,6 +72,7 @@ class InitializeTests < DeprecatedClientOptionsTest
7172
end
7273

7374
test "Convert deprecated usessl (= true) and verify (= false), with warning" do
75+
omit_if_jruby "SSL tests don't work yet"
7476
run_fake_server_in_thread(implicit_tls: true) do |server|
7577
assert_deprecated_warning(/Call Net::IMAP\.new with keyword/i) do
7678
with_client("localhost", server.port, true, nil, false) do |client|
@@ -102,6 +104,7 @@ class InitializeTests < DeprecatedClientOptionsTest
102104

103105
class StartTLSTests < DeprecatedClientOptionsTest
104106
test "Convert obsolete options hash to keywords" do
107+
omit_if_jruby "SSL tests don't work yet"
105108
with_fake_server(preauth: false) do |server, imap|
106109
imap.starttls(ca_file: server.config.tls[:ca_file], min_version: :TLS1_2)
107110
assert_equal(
@@ -114,6 +117,7 @@ class StartTLSTests < DeprecatedClientOptionsTest
114117
end
115118

116119
test "Convert deprecated certs, verify with warning" do
120+
omit_if_jruby "SSL tests don't work yet"
117121
with_fake_server(preauth: false) do |server, imap|
118122
assert_deprecated_warning(/Call Net::IMAP#starttls with keyword/i) do
119123
imap.starttls(server.config.tls[:ca_file], false)

test/net/imap/test_imap.rb

+8
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def teardown
2828

2929
if defined?(OpenSSL::SSL::SSLError)
3030
def test_imaps_unknown_ca
31+
omit_if_jruby "SSL tests don't work yet"
3132
assert_raise(OpenSSL::SSL::SSLError) do
3233
imaps_test do |port|
3334
begin
@@ -42,6 +43,7 @@ def test_imaps_unknown_ca
4243
end
4344

4445
def test_imaps_with_ca_file
46+
omit_if_jruby "SSL tests don't work yet"
4547
# Assert verified *after* the imaps_test and assert_nothing_raised blocks.
4648
# Otherwise, failures can't logout and need to wait for the timeout.
4749
verified, imap = :unknown, nil
@@ -69,6 +71,7 @@ def test_imaps_with_ca_file
6971
end
7072

7173
def test_imaps_verify_none
74+
omit_if_jruby "SSL tests don't work yet"
7275
# Assert verified *after* the imaps_test and assert_nothing_raised blocks.
7376
# Otherwise, failures can't logout and need to wait for the timeout.
7477
verified, imap = :unknown, nil
@@ -96,6 +99,7 @@ def test_imaps_verify_none
9699
end
97100

98101
def test_imaps_post_connection_check
102+
omit_if_jruby "SSL tests don't work yet"
99103
assert_raise(OpenSSL::SSL::SSLError) do
100104
imaps_test do |port|
101105
# server_addr is different from the hostname in the certificate,
@@ -110,6 +114,7 @@ def test_imaps_post_connection_check
110114

111115
if defined?(OpenSSL::SSL)
112116
def test_starttls_unknown_ca
117+
omit_if_jruby "SSL tests don't work yet"
113118
omit "This test is not working with Windows" if RUBY_PLATFORM =~ /mswin|mingw/
114119

115120
imap = nil
@@ -130,6 +135,7 @@ def test_starttls_unknown_ca
130135
end
131136

132137
def test_starttls
138+
omit_if_jruby "SSL tests don't work yet"
133139
initial_verified, initial_ctx, initial_params = :unknown, :unknown, :unknown
134140
imap = nil
135141
starttls_test do |port|
@@ -154,6 +160,7 @@ def test_starttls
154160
end
155161

156162
def test_starttls_stripping
163+
omit_if_jruby "SSL tests don't work yet"
157164
imap = nil
158165
starttls_stripping_test do |port|
159166
imap = Net::IMAP.new("localhost", :port => port)
@@ -512,6 +519,7 @@ def test_connection_closed_during_idle
512519
end
513520

514521
def test_connection_closed_without_greeting
522+
omit_if_jruby "???"
515523
server = create_tcp_server
516524
port = server.addr[1]
517525
h = {

test/net/imap/test_imap_capabilities.rb

+3
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ def teardown
139139

140140
if defined?(OpenSSL::SSL::SSLError)
141141
test "#capabilities caches greeting capabilities (implicit TLS)" do
142+
omit_if_jruby
142143
with_fake_server(preauth: false, implicit_tls: true) do |server, imap|
143144
assert imap.capabilities_cached?
144145
assert_equal %w[IMAP4REV1 AUTH=PLAIN], imap.capabilities
@@ -151,6 +152,7 @@ def teardown
151152

152153
test "#capabilities cache is cleared after #starttls" do
153154
with_fake_server(preauth: false, cleartext_auth: false) do |server, imap|
155+
omit_if_jruby
154156
assert imap.capabilities_cached?
155157
assert imap.capable? :IMAP4rev1
156158
refute imap.auth_capable? "plain"
@@ -204,6 +206,7 @@ def teardown
204206

205207
# TODO: should we warn about this?
206208
test "#capabilities cache IGNORES tagged OK response to STARTTLS" do
209+
omit_if_jruby
207210
with_fake_server(preauth: false) do |server, imap|
208211
server.on "STARTTLS" do |cmd|
209212
cmd.done_ok code: "[CAPABILITY IMAP4rev1 AUTH=PLAIN fnord]"

0 commit comments

Comments
 (0)