DEFINE TestLogPath "c:\logs\http_integ\"
DEFINE TestLogFile "HTTP-I-2310e.log"

LOG PATH $TestLogPath$ 
LOG FILE $TestLogFile$

// Read in basic settings

call c:\httptest\integration\settings 

// URL, define external sites 

call c:\httptest\integration\externalSites 

// Header 

DEFINE Accept "*/*"
DEFINE ContentType "*/*" 

//---------------------------------------------------------
//  start of test case

CASE HTTP-I-2310e Basic Methods using Transport framework (HTTP) over Default bearer  

//---------------------------------------------------------

// Select the specified bearer 1 from the current commdb 

DEFINE IAP 1 

CONNECT HTTP H_CON_01

TRANSACTION T_01 H_CON_01 GET $bbc$
TRANSACTION T_02 H_CON_01 GET $amazon$
TRANSACTION T_03 H_CON_01 GET $nokia$
TRANSACTION T_04 H_CON_01 GET $tomshardware$
TRANSACTION T_05 H_CON_01 GET $bbc2$
TRANSACTION T_06 H_CON_01 GET $thereg$
TRANSACTION T_07 H_CON_01 GET $symbian$
TRANSACTION T_08 H_CON_01 GET $netscape$
TRANSACTION T_09 H_CON_01 GET $google$
TRANSACTION T_10 H_CON_01 GET $pcpro$
TRANSACTION T_11 H_CON_01 GET $cdnow$
TRANSACTION T_12 H_CON_01 GET $yahoo$
TRANSACTION T_13 H_CON_01 GET $lycos$
TRANSACTION T_14 H_CON_01 GET $aol$
TRANSACTION T_15 H_CON_01 GET $infoseek$
TRANSACTION T_16 H_CON_01 GET $ft$
TRANSACTION T_17 H_CON_01 GET $guardian$
TRANSACTION T_18 H_CON_01 GET $london$
TRANSACTION T_19 H_CON_01 GET $oxfordshire$
TRANSACTION T_20 H_CON_01 GET $newsci$
TRANSACTION T_21 H_CON_01 GET $excite$
TRANSACTION T_22 H_CON_01 GET $multimap$
TRANSACTION T_23 H_CON_01 GET $times$
TRANSACTION T_24 H_CON_01 GET $itn$
TRANSACTION T_25 H_CON_01 GET $trainline$
TRANSACTION T_26 H_CON_01 GET $itv$
TRANSACTION T_27 H_CON_01 GET $cnn$
TRANSACTION T_28 H_CON_01 GET $lemonde$
TRANSACTION T_29 H_CON_01 GET $dotmusic$
TRANSACTION T_30 H_CON_01 GET $watford$
TRANSACTION T_31 H_CON_01 GET $iconbar$
TRANSACTION T_32 H_CON_01 GET $independent$

    
// ---------------------------------------------------------
// display all connectons     

connect

// ---------------------------------------------------------
// display all transactions 

transaction

hold 240

// --------------------------------------------------------
// display status 

define

// --------------------------------------------------------
// display active transactions 

showtrans 

// --------------------------------------------------------
// report results 

IF $T_01LastEvent$ == $Succeeded$

   IF $T_01HttpStatus$ == $HTTP_OK$

      PRINT Result: GET $bbc$ Passed 
   ELSE
      PRINT Result: GET $bbc$ Failed, HTTP Status $T_01HttpStatus$
   ENDIF
ELSE 
   PRINT Result: GET $bbc$ Failed, last event $T_01LastEvent$ 
ENDIF

endtrans T_01 

IF $T_02LastEvent$ == $Succeeded$

   IF $T_02HttpStatus$ == $HTTP_OK$

      PRINT Result: GET $amazon$ Passed 
   ELSE
      PRINT Result: GET $amazon$ Failed, HTTP Status $T_02HttpStatus$ 
   ENDIF
ELSE 
   PRINT Result: GET $amazon$ Failed, last event $T_02LastEvent$  
ENDIF

endtrans T_02 

IF $T_03LastEvent$ == $Succeeded$

   IF $T_03HttpStatus$ == $HTTP_OK$

      PRINT Result: GET $nokia$ Passed 
   ELSE
      PRINT Result: GET $nokia$ Failed, HTTP Status $T_03HttpStatus$ 
   ENDIF
ELSE 
   PRINT Result: GET $nokia$ Failed, last event $T_03LastEvent$  
ENDIF

endtrans T_03 

IF $T_04LastEvent$ == $Succeeded$

   IF $T_04HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $tomshardware$ Passed 
   ELSE
      PRINT Result: GET $tomshardware$ Failed, HTTP Status $T_04HttpStatus$ 
   ENDIF
ELSE 
   PRINT Result: GET $tomshardware$ Failed, last event $T_04LastEvent$  
ENDIF

endtrans T_04 

IF $T_05LastEvent$ == $Succeeded$

   IF $T_05HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $bbc2$ Passed 
   ELSE
      PRINT Result: GET $bbc2$ Failed, HTTP Status $T_05HttpStatus$ 
   ENDIF
ELSE 
   PRINT Result: GET $bbc2$ Failed, last event $T_05LastEvent$ 
ENDIF

endtrans T_05 

IF $T_06LastEvent$ == $Succeeded$

   IF $T_06HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $thereg$ Passed 
   ELSE
      PRINT Result: GET $thereg$ Failed, HTTP Status $T_06HttpStatus$ 
   ENDIF
ELSE 
   PRINT Result: GET $thereg$ Failed, last event $T_06LastEvent$  
ENDIF

endtrans T_06

IF $T_07LastEvent$ == $Succeeded$

   IF $T_07HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $symbian$ Passed 
   ELSE
      PRINT Result: GET $symbian$ Failed, HTTP Status $T_07HttpStatus$ 
   ENDIF
ELSE 
   PRINT Result: GET $symbian$ Failed, last event $T_07LastEvent$  
ENDIF

endtrans T_07

IF $T_08LastEvent$ == $Succeeded$

   IF $T_08HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $netscape$ Passed 
   ELSE
      PRINT Result: GET $netscape$ Failed, HTTP Status $T_08HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $netscape$ Failed, last event $T_08LastEvent$  
ENDIF

endtrans T_08

IF $T_09LastEvent$ == $Succeeded$

   IF $T_09HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $google$ Passed 
   ELSE
      PRINT Result: GET $google$ Failed, HTTP Status $T_09HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $google$ Failed, last event $T_09LastEvent$  
ENDIF

endtrans T_09

IF $T_10LastEvent$ == $Succeeded$

   IF $T_10HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $pcpro$  Passed 
   ELSE
      PRINT Result: GET $pcpro$ Failed, HTTP Status $T_10HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $google$ Failed, last event $T_10LastEvent$  
ENDIF

endtrans T_10

IF $T_11LastEvent$ == $Succeeded$

   IF $T_11HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $cdnow$ Passed 
   ELSE
      PRINT Result: GET $cdnow$ Failed, HTTP Status $T_11HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $cdnow$ Failed, last event $T_11LastEvent$  
ENDIF

endtrans T_11

IF $T_12LastEvent$ == $Succeeded$

   IF $T_12HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $yahoo$ Passed 
   ELSE
      PRINT Result: GET $yahoo$ Failed, HTTP Status $T_12HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $yahoo$ Failed, last event $T_12LastEvent$  
ENDIF

endtrans T_12

IF $T_13LastEvent$ == $Succeeded$

   IF $T_13HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $lycos$ Passed 
   ELSE
      PRINT Result: GET $lycos$ Failed, HTTP Status $T_13HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $lycos$ Failed, last event $T_13LastEvent$  
ENDIF

endtrans T_13

IF $T_14LastEvent$ == $Succeeded$

   IF $T_14HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $aol$ Passed 
   ELSE
      PRINT Result: GET $aol$ Failed, HTTP Status $T_14HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $aol$ Failed, last event $T_14LastEvent$  
ENDIF

endtrans T_14

IF $T_15LastEvent$ == $Succeeded$

   IF $T_15HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $infoseek$ Passed 
   ELSE
      PRINT Result: GET $infoseek$ Failed, HTTP Status $T_15HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $infoseek$ Failed, last event $T_15LastEvent$  
ENDIF

endtrans T_15

IF $T_16LastEvent$ == $Succeeded$

   IF $T_16HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $ft$ Passed 
   ELSE
      PRINT Result: GET $ft$ Failed, HTTP Status $T_16HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $ft$ Failed, last event $T_16LastEvent$  
ENDIF

endtrans T_16

IF $T_17LastEvent$ == $Succeeded$

   IF $T_17HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $guardian$ Passed 
   ELSE
      PRINT Result: GET $guardian$ Failed, HTTP Status $T_17HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $guardian$ Failed, last event $T_17LastEvent$  
ENDIF

endtrans T_17

IF $T_18LastEvent$ == $Succeeded$

   IF $T_18HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $london$ Passed 
   ELSE
      PRINT Result: GET $london$ Failed, HTTP Status $T_18HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $london$ Failed, last event $T_18LastEvent$  
ENDIF

endtrans T_18

IF $T_19LastEvent$ == $Succeeded$

   IF $T_19HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $oxfordshire$ Passed 
   ELSE
      PRINT Result: GET $oxfordshire$ Failed, HTTP Status $T_19HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $oxfordshire$ Failed, last event $T_19LastEvent$  
ENDIF

endtrans T_19

IF $T_20LastEvent$ == $Succeeded$

   IF $T_20HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $newsci$ Passed 
   ELSE
      PRINT Result: GET $newsci$ Failed, HTTP Status $T_20HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $newsci$ Failed, last event $T_20LastEvent$  
ENDIF

endtrans T_20

IF $T_21LastEvent$ == $Succeeded$

   IF $T_21HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $excite$ Passed 
   ELSE
      PRINT Result: GET $excite$ Failed, HTTP Status $T_21HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $excite$ Failed, last event $T_21LastEvent$  
ENDIF

endtrans T_21

IF $T_22LastEvent$ == $Succeeded$

   IF $T_22HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $multimap$ Passed 
   ELSE
      PRINT Result: GET $multimap$ Failed, HTTP Status $T_22HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $multimap$ Failed, last event $T_22LastEvent$ 
ENDIF

endtrans T_22

IF $T_23LastEvent$ == $Succeeded$

   IF $T_23HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $times$ from times Passed 
   ELSE
      PRINT Result: GET $times$ from times Failed, HTTP Status $T_23HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $times$ from times Failed, last event $T_23LastEvent$  
ENDIF

endtrans T_23

IF $T_24LastEvent$ == $Succeeded$

   IF $T_24HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $itn$ Passed 
   ELSE
      PRINT Result: GET $itn$ Failed, HTTP Status $T_24HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $itn$ Failed, last event $T_24LastEvent$  
ENDIF

endtrans T_24

IF $T_25LastEvent$ == $Succeeded$

   IF $T_25HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $trainline$ Passed 
   ELSE
      PRINT Result: GET $trainline$ Failed, HTTP Status $T_25HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $trainline$ Failed, last event $T_25LastEvent$  
ENDIF

endtrans T_25

IF $T_26LastEvent$ == $Succeeded$

   IF $T_26HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $itv$ Passed 
   ELSE
      PRINT Result: GET $itv$ Failed, HTTP Status $T_26HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $itv$ Failed, last event $T_26LastEvent$  
ENDIF

endtrans T_26

IF $T_27LastEvent$ == $Succeeded$

   IF $T_27HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $cnn$ Passed 
   ELSE
      PRINT Result: GET $cnn$ Failed, HTTP Status $T_27HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $cnn$ Failed, last event $T_27LastEvent$  
ENDIF

endtrans T_27

IF $T_28LastEvent$ == $Succeeded$

   IF $T_28HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $lemonde$ Passed 
   ELSE
      PRINT Result: GET $lemonde$ Failed, HTTP Status $T_28HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $lemonde$ Failed, last event $T_28LastEvent$  
ENDIF

endtrans T_28

IF $T_29LastEvent$ == $Succeeded$

   IF $T_29HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $dotmusic$ Passed 
   ELSE
      PRINT Result: GET $dotmusic$ Failed, HTTP Status $T_29HttpStatus$ 
   ENDIF
ELSE 
   PRINT Result: GET $dotmusic$ Failed, last event $T_29LastEvent$  
ENDIF

endtrans T_29

IF $T_30LastEvent$ == $Succeeded$

   IF $T_30HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $watford$ Passed 
   ELSE
      PRINT Result: GET $watford$ Failed, HTTP Status $T_30HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $watford$ Failed, last event $T_30LastEvent$  
ENDIF

endtrans T_30

IF $T_31LastEvent$ == $Succeeded$

   IF $T_31HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $iconbar$ Passed 
   ELSE
      PRINT Result: GET $iconbar$ Failed, HTTP Status $T_31HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $iconbar$ Failed, last event $T_31LastEvent$  
ENDIF

endtrans T_31

IF $T_32LastEvent$ == $Succeeded$

   IF $T_32HttpStatus$ == $HTTP_OK$ 

      PRINT Result: GET $independent$ Passed 
   ELSE
      PRINT Result: GET $independent$ Failed, HTTP Status $T_32HttpStatus$  
   ENDIF
ELSE 
   PRINT Result: GET $independent$ Failed, last event $T_32LastEvent$ 
ENDIF

endtrans T_32

// --------------------------------------------------------
// close connections 

DISCONNECT H_CON_01

// display state of connections, after close 

connect

//---------------------------------------------------------
//  end the test case

END CASE HTTP-I-2310e

//---------------------------------------------------------
//  close the log file

END LOG

//---------------------------------------------------------
//	end of test
//---------------------------------------------------------
