!******************************************************************************!
! Test case description/purpose: i.e. NeXtMidas interactive test macro template
!
! Arguments: None
!
! Note1: The standard Window (X,Y) position should be set to (25,25) in the .mmp
!        configuration file. (TODO: REMOVE this note before checkin)
!
! @bug      <JIRA_ISSUE> <brief_issue_title>
! @since    <NXM-VERSION>
! @author:  First Last Name / Additional Author
!******************************************************************************!
startmacro
  switch INTERACTIVE interAct GET DEF=TRUE  SDEF=TRUE  ! for normal interactive test(s)
  switch BASELINE    baseline GET DEF=FALSE SDEF=TRUE  ! for defects or more obscure test case(s)

  if interAct then
    pipe on
      panel/jsetup="nxm.sys.test.test_jnuanes"/controls=gc
      plot/id=map1 world.shp view=latloncontinuous

      ! TODO: other GConrols, Graphical Commands, Commands, etc. (otherwise remove this line)
    pipe off

  endif
endmacro

!******************************************************************************!
! Main process message for this macro. Should be right after the ENDMACRO.
!******************************************************************************!
procedure processMessage m:msg
  if msg.name eqs "MAIN" then
    assert/text="^reg.main.name: User indicated tests" msg.data eqss "PASS"
    pipe stop
  elseif msg.name eqs "PASS" then
    pipe stop
  elseif msg.name eqs "FAIL" then
    assert/text="^reg.main.name: User indicated tests" msg.data eqss "PASS"
    pipe stop
  elseif msg.name eqs "WINDOW"
    pipe stop
  endif
return
!******************************************************************************!
! If an unexpected exception is caught, mark test as failed, unless it is expected
!******************************************************************************!
procedure processException m:emsg
  if expectedException REXISTS then
    assert/text="^reg.main.name: Expected ERROR starts with: ^{expectedException}" expectedException EQSS emsg.data.message
    remove expectedException
  else
    assert/text="^reg.main.name: Caught unexpected exception ^{emsg.data}" "FALSE" isTrue
    if "Trace" SUBS ENV.DEBUG then invoke ,, emsg.data.printStackTrace()
  endif
return
