test_prefetch_data Subroutine

public subroutine test_prefetch_data()

Arguments

None

Calls

proc~~test_prefetch_data~~CallsGraph proc~test_prefetch_data test_prefetch_data add_message add_message proc~test_prefetch_data->add_message assertequal assertequal proc~test_prefetch_data->assertequal none~add_ext_collection ClientThread%add_ext_collection proc~test_prefetch_data->none~add_ext_collection none~get_connection BaseThread%get_connection proc~test_prefetch_data->none~get_connection none~prefetch_data ClientThread%prefetch_data proc~test_prefetch_data->none~prefetch_data none~set_connection BaseThread%set_connection proc~test_prefetch_data->none~set_connection none~add_ext_collection->none~get_connection interface~mapl_assert MAPL_Assert none~add_ext_collection->interface~mapl_assert proc~mapl_return MAPL_Return none~add_ext_collection->proc~mapl_return proc~mapl_verify MAPL_Verify none~add_ext_collection->proc~mapl_verify receive receive none~add_ext_collection->receive send send none~add_ext_collection->send none~get_connection->interface~mapl_assert none~get_connection->proc~mapl_return none~prefetch_data->none~get_connection get get none~prefetch_data->get none~get_unique_request_id ClientThread%get_unique_request_id none~prefetch_data->none~get_unique_request_id none~insert_requesthandle BaseThread%insert_RequestHandle none~prefetch_data->none~insert_requesthandle none~prefetch_data->proc~mapl_return none~prefetch_data->proc~mapl_verify none~prefetch_data->receive none~prefetch_data->send none~set_connection->proc~mapl_return none~insert_requesthandle->proc~mapl_return none~insert~65 IntegerRequestMap%insert none~insert_requesthandle->none~insert~65 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~insert_pair~7 IntegerRequestMap%insert_pair none~insert~65->none~insert_pair~7

Source Code

   subroutine test_prefetch_data()
      type (MockClientThread) :: c
      class (AbstractSocket), pointer :: connection
      integer :: collection_id

      integer :: request_id
      real(kind=REAL32), target :: q
      character(len=:), allocatable :: expected_log
      type (MockSocketLog), target :: log

      call c%set_connection(MockSocket(log))
      connection => c%get_connection()
      select type (connection)
      type is (MockSocket)
         call connection%add_message(IdMessage(1))
         call connection%add_message(IdMessage(2))
         connection%q1 = q
      end select

      collection_id = c%add_ext_collection(template='foo')
      request_id = c%prefetch_data(collection_id, 'foo', 'q', ArrayReference(q))

      expected_log = "send<AddExtCollection('foo')>"
      expected_log = expected_log // " :: send<PrefetchData('q')> :: get()"

      select type (connection)
      type is (MockSocket)
         @assertEqual(expected_log, log%log)
      end select
         
   end subroutine test_prefetch_data