test_send_terminate Subroutine

public subroutine test_send_terminate()

Arguments

None

Calls

proc~~test_send_terminate~2~~CallsGraph proc~test_send_terminate~2 test_send_terminate assertequal assertequal proc~test_send_terminate~2->assertequal get_type_id get_type_id proc~test_send_terminate~2->get_type_id none~get_connection BaseThread%get_connection proc~test_send_terminate~2->none~get_connection none~send~3 SimpleSocket%send proc~test_send_terminate~2->none~send~3 none~set_connection BaseThread%set_connection proc~test_send_terminate~2->none~set_connection none~set_visitor SimpleSocket%set_visitor proc~test_send_terminate~2->none~set_visitor receive receive proc~test_send_terminate~2->receive interface~mapl_assert MAPL_Assert none~get_connection->interface~mapl_assert proc~mapl_return MAPL_Return none~get_connection->proc~mapl_return none~send~3->none~get_connection dispatch dispatch none~send~3->dispatch none~send~3->interface~mapl_assert none~send~3->proc~mapl_return proc~mapl_verify MAPL_Verify none~send~3->proc~mapl_verify none~set_connection->proc~mapl_return 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

Source Code

   subroutine test_send_terminate()
      type (SimpleSocket) :: client_connection
      type (MockServerThread), target :: s
      type (SimpleSocket),target :: server_connection
      class(BaseThread), pointer :: visitor
      class(AbstractSocket), pointer :: connection
      class(AbstractMessage), allocatable:: msg
     
      server_connection = SimpleSocket()
      call s%set_connection(server_connection)
      call client_connection%set_visitor(s)
      call client_connection%send(TerminateMessage())
      @assertEqual('handle_Terminate()', s%log)
      visitor =>client_connection%visitor
      connection=>visitor%get_connection()
      call connection%receive(msg)
      @assertEqual(TERMINATE_ID,msg%get_type_id())
   end subroutine test_send_terminate