test_send_terminate Subroutine

public subroutine test_send_terminate()

Arguments

None

Calls

proc~~test_send_terminate~~CallsGraph proc~test_send_terminate test_send_terminate assertequal assertequal proc~test_send_terminate->assertequal get_type_id get_type_id proc~test_send_terminate->get_type_id none~get_connection BaseThread%get_connection proc~test_send_terminate->none~get_connection none~send~2 SimpleSocket%send proc~test_send_terminate->none~send~2 none~set_connection BaseThread%set_connection proc~test_send_terminate->none~set_connection none~set_visitor SimpleSocket%set_visitor proc~test_send_terminate->none~set_visitor receive receive proc~test_send_terminate->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~2->none~get_connection dispatch dispatch none~send~2->dispatch none~send~2->interface~mapl_assert none~send~2->proc~mapl_return proc~mapl_verify MAPL_Verify none~send~2->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), pointer :: 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()
      msg => connection%receive()
      @assertEqual(TERMINATE_ID,msg%get_type_id())
   end subroutine test_send_terminate