!******************************************************************************!
! Tests popping out the panel onto a selected screen/display
! @Note: Does not work with Xinerama displays, since they count as one (large) screen.
! @author  J. Bauer
! @Bug: 2460 Plot / LayerWMS: Inconsistent results table look-up
! NOTE: The main contents of this test are in the newer test test_plot_layerwms_defaultsize
!       This test is not longer needed
!******************************************************************************!
!
! Since 3.5.3 - switched to using geoserver on port 8800 as the default map server
startmacro/msgid=main cs:url["http://nextmidas.com:8800/geoserver/ows"]
  switch INTERACTIVE interAct GET DEF=TRUE
  switch BASELINE    baseline GET DEF=FALSE

  call setDatDir

  set instructions "You should see two plots of the world, each with a WMS layer.\n\n&
                    You Should NOT see a 'file not found' alert on either plot."

  set file1 "^{datDir}.world.prm"
  set file2 "^{datDir}.cities.prm"

  ! Set a result as a Table with the WMS info
  set file3 {LT=WMS,URL="^url",LAYERS="shapePolitical,Relief,cadrg,imint"}

  ! Set the same info as a Table in String form (requires escape sequence handling to be enabled)
  set file4 "{LT=WMS,URL=\"^url\",LAYERS=\"shapePolitical,Relief,cadrg,imint\"}"

    pipe on

      panel/setup/controls=gc/msgid=main

      gcontrol label macro "MACRO"
        gcontrol menu main "Exit with Status = " "PASS,FAIL" /tleft
          set gc.main.itemColors {PASS=GREEN,FAIL=RED}

        gcontrol text idtext  "INSTRUCTIONS" "^instructions" 24 18 /title

      plot/id=top    file1|file2|file3
      plot/id=bottom file1|file2|file4

 endmacro

!******************************************************************************!
procedure processMessage m:msg
  !say "Msg ^msg.name = ^msg.data"
  if msg.name EQS "MAIN" then
    assert/text="^reg.main.name: User indicated tests" msg.data eqss "PASS"
    pipe stop
  endif

return

!******************************************************************************!
! Set the dat directory
!******************************************************************************!
procedure setDatDir
  invoke nxmMajor env.nmversion.subString(0,1)
  invoke major java.lang.Integer.valueOf(nxmMajor)
  if major GE 4 then
    invoke s:datDir           nxm.sys.test.DatLocator.getDatDirLocation()
    invoke s:datDirSlash      nxm.sys.test.DatLocator.getDatDirSlashLocation()
    invoke z:sysDatFull       nxm.sys.test.DatLocator.sysDatFull()
    invoke z:sysTestDatExists nxm.sys.test.DatLocator.sysTestDatExists()
  else
    set s:datDir           "nxm.sys.dat"
    set s:datDirSlash      "nxm/sys/dat"
    set z:sysDatFull       true
    set z:sysTestDatExists false
  endif
return
