 
 
 
-describe "TCP/TLS Integration Tests", ->
+describe "TCP/TLS/MLLP Integration Tests", ->
   testMessage = "This is an awesome test message!"
   mockTCPServer = null
   mockHTTPServer = null
   mockTLSServer = null
   mockTLSServerWithoutClientCert = null
+  mockMLLPServer = null
 
   channel1 = new Channel
     name: 'TCPIntegrationChannel1'

      callback "#{data}"

  before (done) ->
    channel1.save -> channel2.save -> channel3.save -> channel4.save -> channel5.save -> secureClient.save ->
      testUtils.createMockTCPServer 6000, testMessage, 'TCP OK', 'TCP Not OK', (server) ->
        mockTCPServer = server
        testUtils.createMockHTTPRespondingPostServer 6001, testMessage, 'HTTP OK', 'HTTP Not OK', (server) ->

            mockTLSServer = server
            testUtils.createMockTLSServerWithMutualAuth 6003, testMessage, 'TLS OK', 'TLS Not OK', false, (server) ->
              mockTLSServerWithoutClientCert = server
              testUtils.createMockTCPServer 6004, testMessage, 'MLLP OK' + String.fromCharCode(0o034) + '\n', 'MLLP Not OK' + String.fromCharCode(0o034) + '\n', (server) ->
                mockMLLPServer = server
                done()

  beforeEach (done) -> Transaction.remove {}, done

  after (done) ->
    Channel.remove {}, -> Transaction.remove {}, -> Client.remove {}, ->
      mockTCPServer.close -> mockHTTPServer.close -> mockTLSServer.close -> mockTLSServerWithoutClientCert.close -> mockMLLPServer.close done

  afterEach (done) -> server.stop done

