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

LOG PATH $TestLogPath$
LOG FILE $TestLogFile$

// Read in basic settings

call c:\httptest\integration\settings 

//  URL, set up required definitions

DEFINE wapTestURL "http://$wapTest$/"
DEFINE DeleteURL  "http://$wapTest$/upload/pic01.jpg"
DEFINE PutURL     "http://$wapTest$/upload/large.txt"
DEFINE PutFile    "c:\httptest\integration\large.txt"

// Header 

DEFINE ContentType "*/*" 

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

CASE HTTP-I-2306 Put and Delete file using Transport framework (HTTP) over Default bearer  

//---------------------------------------------------------
//
// run test http-i-2355 first to make sure the file  
// http://waptest.symbian.com/upload/pic01.jpg is created


CONNECT HTTP H_CON_01


TRANSACTION  T_01 H_CON_01 DELETE $DeleteURL$ 
TRANSACTION  T_02 H_CON_01 PUT $PutURL$ $PutFile$
    
// ---------------------------------------------------------
// display all connectons     

connect

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

transaction

//---------------------------------------------------------
//
// the test has been started, the test harness will now wait 
// for 60 seconds to allow for data transfer to completed 
//
//---------------------------------------------------------

hold 60

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

define

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

showtrans 


// Now delete the file you have put onto the server 

TRANSACTION  T_03 H_CON_01 DELETE $PutURL$ 

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

transaction

hold 60 

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

define

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

showtrans 

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

IF $T_01LastEvent$ == $Succeeded$

   IF $T_01HttpStatus$ == $HTTP_OK$
            
      PRINT Result: HTTP-I-2306 DELETE Passed
   ELSE 
      PRINT Result: HTTP-I-2306 DELETE Failed, HTTP Status $T_01HttpStatus$    
   ENDIF
ELSE 
   PRINT Result: HTTP-I-2306 PUT Failed, last event $T_01LastEvent$  
ENDIF

endtrans T_01 

IF $T_02LastEvent$ == $Succeeded$

   IF $T_02HttpStatus$ == $HTTP_OK$
            
      PRINT Result: HTTP-I-2306 PUT Passed 
   ELSE 
      PRINT Result: HTTP-I-2306 PUT Failed, HTTP Status $T_02HttpStatus$   
   ENDIF
ELSE 
   PRINT Result: HTTP-I-2306 PUT Failed, last event $T_02LastEvent$   
ENDIF

endtrans T_02 

IF $T_03LastEvent$ == $Succeeded$

   IF $T_03HttpStatus$ == $HTTP_OK$
            
      PRINT Result: HTTP-I-2306 DELETE Passed 
   ELSE 
      PRINT Result: HTTP-I-2306 DELETE Failed, HTTP Status $T_03HttpStatus$    
   ENDIF
ELSE 
   PRINT Result: HTTP-I-2306 DELETE Failed, last event $T_03LastEvent$    
ENDIF

endtrans T_03

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

DISCONNECT H_CON_01

// display state of connections, after close 

connect

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

END CASE HTTP-I-2306

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

END LOG

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