test_connect Subroutine

public subroutine test_connect(this)

Arguments

Type IntentOptional Attributes Name
class(ESMF_TestMethod), intent(inout) :: this

Calls

proc~~test_connect~~CallsGraph proc~test_connect test_connect anyexceptions anyexceptions proc~test_connect->anyexceptions assert_that assert_that proc~test_connect->assert_that none~add_primary_spec StateRegistry%add_primary_spec proc~test_connect->none~add_primary_spec none~add_subregistry StateRegistry%add_subregistry proc~test_connect->none~add_subregistry none~connect SimpleConnection%connect proc~test_connect->none~connect none~get_extension_family StateRegistry%get_extension_family proc~test_connect->none~get_extension_family none~get_primary ExtensionFamily%get_primary proc~test_connect->none~get_primary none~num_variants~3 ExtensionFamily%num_variants proc~test_connect->none~num_variants~3 sourcelocation sourcelocation proc~test_connect->sourcelocation true true proc~test_connect->true none~add_family StateRegistry%add_family none~add_primary_spec->none~add_family none~back~56 StateItemExtensionVector%back none~add_primary_spec->none~back~56 none~push_back~49 StateItemExtensionVector%push_back none~add_primary_spec->none~push_back~49 proc~mapl_return MAPL_Return none~add_primary_spec->proc~mapl_return proc~mapl_verify MAPL_Verify none~add_primary_spec->proc~mapl_verify interface~mapl_assert MAPL_Assert none~add_subregistry->interface~mapl_assert none~get_name~14 StateRegistry%get_name none~add_subregistry->none~get_name~14 none~has_subregistry StateRegistry%has_subregistry none~add_subregistry->none~has_subregistry none~insert~88 RegistryPtrMap%insert none~add_subregistry->none~insert~88 none~add_subregistry->proc~mapl_return none~connect->interface~mapl_assert none~connect_sibling SimpleConnection%connect_sibling none~connect->none~connect_sibling none~get_destination SimpleConnection%get_destination none~connect->none~get_destination none~get_source SimpleConnection%get_source none~connect->none~get_source none~get_subregistry~2 StateRegistry%get_subregistry none~connect->none~get_subregistry~2 none~connect->proc~mapl_return none~connect->proc~mapl_verify none~at~112 VirtualPtFamilyMap%at none~get_extension_family->none~at~112 none~get_extension_family->proc~mapl_return none~get_extension_family->proc~mapl_verify none~get_primary->interface~mapl_assert none~front~56 StateItemExtensionPtrVector%front none~get_primary->none~front~56 none~get_primary->proc~mapl_return

Source Code

   subroutine test_connect(this)
      class(ESMF_TestMethod), intent(inout) :: this
      type(StateRegistry) :: r
      type(StateRegistry), target :: r_A, r_B ! child registries
      type(VirtualConnectionPt) :: cp_A, cp_B
      type(SimpleConnection) :: conn
      type(ExtensionFamily), pointer :: family
      integer :: status

      r = StateRegistry('P')
      r_a = StateRegistry('child_A')
      r_b = StateRegistry('child_B')
      call r%add_subregistry(r_a)
      call r%add_subregistry(r_b)

      cp_A = VirtualConnectionPt(state_intent='export', short_name='ae')
      cp_B = VirtualConnectionPt(state_intent='import', short_name='ai')

      call r_a%add_primary_spec(cp_A, MockItemSpec('AE'))
      call r_b%add_primary_spec(cp_B, MockItemSpec('AI'))

      conn = SimpleConnection(CP('child_A', cp_A), CP('child_B', cp_B))
      call conn%connect(r, _RC)

      ! Check that extension was created
      family => r_a%get_extension_family(cp_A, _RC)
      @assert_that(associated(family%get_primary()), is(true()))
      @assert_that(family%num_variants(), is(2))

      _UNUSED_DUMMY(this)
   end subroutine test_connect