Skip to content

Commit 2a3eb68

Browse files
Continue rearranging TLS tests
1 parent 3bd7c33 commit 2a3eb68

File tree

3 files changed

+35
-35
lines changed

3 files changed

+35
-35
lines changed

RMQClient.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/* Begin PBXBuildFile section */
1010
1029A0E22087A97E00C72924 /* ConnectionDeadlockTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1029A0E12087A97E00C72924 /* ConnectionDeadlockTests.swift */; };
1111
70311B0B21ED538600AE1804 /* RMQConnectionDefaults.h in Headers */ = {isa = PBXBuildFile; fileRef = 70311B0A21ED538600AE1804 /* RMQConnectionDefaults.h */; };
12-
70338A2421FBAA7C00C9069D /* CertificateAuthenticationIntegrationTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70338A2321FBAA7C00C9069D /* CertificateAuthenticationIntegrationTest.swift */; };
12+
70338A2421FBAA7C00C9069D /* TLSConnectionIntegrationTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70338A2321FBAA7C00C9069D /* TLSConnectionIntegrationTest.swift */; };
1313
705359A921D174A400CF6456 /* TestCertificates in Resources */ = {isa = PBXBuildFile; fileRef = 705359A821D174A400CF6456 /* TestCertificates */; };
1414
705359AA21D174A400CF6456 /* TestCertificates in Resources */ = {isa = PBXBuildFile; fileRef = 705359A821D174A400CF6456 /* TestCertificates */; };
1515
705359AC21D1871600CF6456 /* AtomicInteger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 705359AB21D1871600CF6456 /* AtomicInteger.swift */; };
@@ -237,7 +237,7 @@
237237
/* Begin PBXFileReference section */
238238
1029A0E12087A97E00C72924 /* ConnectionDeadlockTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConnectionDeadlockTests.swift; sourceTree = "<group>"; };
239239
70311B0A21ED538600AE1804 /* RMQConnectionDefaults.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RMQConnectionDefaults.h; sourceTree = "<group>"; };
240-
70338A2321FBAA7C00C9069D /* CertificateAuthenticationIntegrationTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CertificateAuthenticationIntegrationTest.swift; sourceTree = "<group>"; };
240+
70338A2321FBAA7C00C9069D /* TLSConnectionIntegrationTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TLSConnectionIntegrationTest.swift; sourceTree = "<group>"; };
241241
705359A821D174A400CF6456 /* TestCertificates */ = {isa = PBXFileReference; lastKnownFileType = folder; path = TestCertificates; sourceTree = SOURCE_ROOT; };
242242
705359AB21D1871600CF6456 /* AtomicInteger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AtomicInteger.swift; sourceTree = "<group>"; };
243243
705CB9CB21D253AF00996B64 /* ChannelLifecycleIntegrationTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChannelLifecycleIntegrationTest.swift; sourceTree = "<group>"; };
@@ -692,7 +692,7 @@
692692
70970AD521E68D6100E9CC8B /* Helpers */,
693693
AE607C681C3C0EAD00BE9AC4 /* OriginalIntegrationTest.swift */,
694694
705CB9CD21D258C300996B64 /* ConnectionLifecycleIntegrationTest.swift */,
695-
70338A2321FBAA7C00C9069D /* CertificateAuthenticationIntegrationTest.swift */,
695+
70338A2321FBAA7C00C9069D /* TLSConnectionIntegrationTest.swift */,
696696
AEEDB0B41CE3284200005A92 /* ConnectionRecoveryIntegrationTest.swift */,
697697
705CB9CB21D253AF00996B64 /* ChannelLifecycleIntegrationTest.swift */,
698698
70FC58B021DF4DB900BB25CB /* ChannelIntegrationTest.swift */,
@@ -1155,7 +1155,7 @@
11551155
AEA45EE21C440FFD00FE1F62 /* OriginalIntegrationTest.swift in Sources */,
11561156
AEEB8B501C7DE8D1002D3FCE /* ControlledInteractionTransport.swift in Sources */,
11571157
AE063BE11CD7565B00F90EB5 /* FakeClock.swift in Sources */,
1158-
70338A2421FBAA7C00C9069D /* CertificateAuthenticationIntegrationTest.swift in Sources */,
1158+
70338A2421FBAA7C00C9069D /* TLSConnectionIntegrationTest.swift in Sources */,
11591159
AEEDB0B51CE3284200005A92 /* ConnectionRecoveryIntegrationTest.swift in Sources */,
11601160
70970AD921E6A64700E9CC8B /* QueueIntegrationTest.swift in Sources */,
11611161
AEA8A77D1CCA734400371E38 /* FakeWaiterFactory.swift in Sources */,

RMQClientIntegrationTests/RMQTCPSocketTransportTest.swift

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -169,37 +169,6 @@ class RMQTCPSocketTransportTest: XCTestCase {
169169
doTestConnectsToHostWithoutTLS(host: "localhost")
170170
}
171171

172-
func testConnectsViaTLS() {
173-
let semaphore = DispatchSemaphore(value: 0)
174-
let tlsOptions = RMQTLSOptions(peerName: "localhost",
175-
verifyPeer: false,
176-
pkcs12: nil,
177-
pkcs12Password: "")
178-
let transport = RMQTCPSocketTransport(host: "localhost",
179-
port: 5671,
180-
tlsOptions: tlsOptions,
181-
connectTimeout: 15,
182-
readTimeout: 30,
183-
writeTimeout: 30)
184-
try! transport.connect()
185-
transport.write(RMQProtocolHeader().amqEncoded())
186-
187-
var receivedData: Data?
188-
transport.readFrame { data in
189-
receivedData = data
190-
semaphore.signal()
191-
}
192-
193-
XCTAssertEqual(.success, semaphore.wait(timeout: TestHelper.dispatchTimeFromNow(5)),
194-
"Timed out waiting for read")
195-
let parser = RMQParser(data: receivedData!)
196-
XCTAssert(RMQFrame(parser: parser).payload.isKind(of: RMQConnectionStart.self))
197-
198-
if(transport.isConnected()) {
199-
transport.close()
200-
}
201-
}
202-
203172
func testSimulatedDisconnectCausesTransportToReportAsDisconnected() {
204173
let transport = RMQTCPSocketTransport(host: "127.0.0.1",
205174
port: 5672,

RMQClientIntegrationTests/CertificateAuthenticationIntegrationTest.swift renamed to RMQClientIntegrationTests/TLSConnectionIntegrationTest.swift

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,37 @@ import XCTest
5555
// see https://github.com/rabbitmq/rabbitmq-objc-client/blob/master/CONTRIBUTING.md
5656
// to set up your system for running integration tests
5757
class CertificateAuthenticationIntegrationTest: XCTestCase {
58+
func testConnectsViaTLS() {
59+
let semaphore = DispatchSemaphore(value: 0)
60+
let tlsOptions = RMQTLSOptions(peerName: "localhost",
61+
verifyPeer: false,
62+
pkcs12: nil,
63+
pkcs12Password: "")
64+
let transport = RMQTCPSocketTransport(host: "localhost",
65+
port: 5671,
66+
tlsOptions: tlsOptions,
67+
connectTimeout: 15,
68+
readTimeout: 30,
69+
writeTimeout: 30)
70+
try! transport.connect()
71+
transport.write(RMQProtocolHeader().amqEncoded())
72+
73+
var receivedData: Data?
74+
transport.readFrame { data in
75+
receivedData = data
76+
semaphore.signal()
77+
}
78+
79+
XCTAssertEqual(.success, semaphore.wait(timeout: TestHelper.dispatchTimeFromNow(5)),
80+
"Timed out waiting for read")
81+
let parser = RMQParser(data: receivedData!)
82+
XCTAssert(RMQFrame(parser: parser).payload.isKind(of: RMQConnectionStart.self))
83+
84+
if(transport.isConnected()) {
85+
transport.close()
86+
}
87+
}
88+
5889
func testConnectsViaTLSWithClientCert() {
5990
let semaphore = DispatchSemaphore(value: 0)
6091
let tlsOptions = RMQTLSOptions(

0 commit comments

Comments
 (0)