test_handle_AddReadDataCollection Subroutine

public subroutine test_handle_AddReadDataCollection()

Arguments

None

Calls

proc~~test_handle_addreaddatacollection~~CallsGraph proc~test_handle_addreaddatacollection test_handle_AddReadDataCollection assertequal assertequal proc~test_handle_addreaddatacollection->assertequal none~add_message MockSocket%add_message proc~test_handle_addreaddatacollection->none~add_message none~init~10 ServerThread%init proc~test_handle_addreaddatacollection->none~init~10 none~run~22 ServerThread%run proc~test_handle_addreaddatacollection->none~run~22 none~set_rank ServerThread%set_rank proc~test_handle_addreaddatacollection->none~set_rank none~push_back~31 MessageVector%push_back none~add_message->none~push_back~31 none~set_connection BaseThread%set_connection none~init~10->none~set_connection proc~mapl_return MAPL_Return none~init~10->proc~mapl_return proc~mapl_verify MAPL_Verify none~init~10->proc~mapl_verify none~dispatch AbstractMessage%dispatch none~run~22->none~dispatch none~get_connection BaseThread%get_connection none~run~22->none~get_connection none~start~81 DistributedProfiler%start none~run~22->none~start~81 none~run~22->proc~mapl_return none~run~22->proc~mapl_verify receive receive none~run~22->receive none~dispatch->proc~mapl_return none~dispatch->proc~mapl_verify handle handle none~dispatch->handle none~get_connection->proc~mapl_return interface~mapl_assert MAPL_Assert none~get_connection->interface~mapl_assert none~capacity~181 MessageVector%capacity none~push_back~31->none~capacity~181 none~resize~62 MessageVector%resize none~push_back~31->none~resize~62 none~set_connection->proc~mapl_return none~start_self StubProfiler%start_self none~start~81->none~start_self at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception none~resize_32~18 MessageVector%resize_32 none~resize~62->none~resize_32~18 none~start_self->proc~mapl_return

Source Code

   subroutine test_handle_AddReadDataCollection()
      type (ServerThread) :: s
      character(len=:), allocatable :: expected
      type (MockSocketLog), target :: log
      type (MockSocket) :: client_socket
      type (MockServer) :: mock_server
      integer :: i

      client_socket = MockSocket(log)
      call client_socket%add_message(AddReadDataCollectionMessage('foo'))
      call client_socket%add_message(AddReadDataCollectionMessage('bar'))
      call client_socket%add_message(TerminateMessage())
      mock_server = MockServer()
      call s%init(client_socket, mock_server)
      call s%set_rank(1)

      do i = 1,3
        call s%run()
      enddo

      expected = ""
      expected = expected // "receive<AddReadDataCollection('foo')>"
      expected = expected // " :: send<Id(001)>"
      expected = expected // " :: receive<AddReadDataCollection('bar')>"
      expected = expected // " :: send<Id(002)>"
      expected = expected // " :: receive<Terminate>"

      @assertEqual(expected, log%log)

   end subroutine test_handle_AddReadDataCollection