IncludeURLTest

class = IncludeURLTest, module= Testing.IncludeURLTest

Test includeURL redirection.

This test will test out the callMethodOfServlet and includeURL redirection. The forward() method works similar to these but is not tested here. The following operations are performed:

The form fields are displayed, as seen by this servlet.

The request environment of this servlet is displayed.

The writeStatus method on the servlet IncludeURLTest2 which is found in the Dir subdirectory under Testing is called.

The title method is called on several other servlets to demonstrate calling methods on servlets in different areas relative to here.

Finally, the top level page of this context is included with includeURL.

A 'Test Complete' message is displayed at the very end.

Number of fields in the request.fields(): 0

Request Status of IncludeURLTest:

serverSidePath():        /root/instaladores_rar/Webware-andes/WebKit/Testing/IncludeURLTest.py
adapterName():           
servletPath():           
contextName():           Testing
serverSideContextPath(): /root/instaladores_rar/Webware-andes/WebKit/Testing
extraURLPath():          
urlPath():               /Testing/IncludeURLTest
previousURLPaths():      
Environment:
REQUEST_URI:             /Testing/IncludeURLTest
PATH_INFO:               /Testing/IncludeURLTest
SCRIPT_NAME:             
SCRIPT_FILENAME:         

Calling callMethodOfServlet(t, "/Testing/Dir/IncludeURLTest2", "writeStatus"):

Expect to see the status written by IncludeURLTest2 which is the same format as the above status, only relative to /Testing/Dir.

Request Status of IncludeURLTest2:

serverSidePath():        /root/instaladores_rar/Webware-andes/WebKit/Testing/Dir/IncludeURLTest2.py
adapterName():           
servletPath():           
contextName():           Testing
serverSideContextPath(): /root/instaladores_rar/Webware-andes/WebKit/Testing
extraURLPath():          
urlPath():               /Testing/Dir/IncludeURLTest2
previousURLPaths():      /Testing/IncludeURLTest
Environment:
REQUEST_URI:             /Testing/IncludeURLTest
PATH_INFO:               /Testing/IncludeURLTest
SCRIPT_NAME:             
SCRIPT_FILENAME:         

callMethodOfServlet returned nothing.

Calling callMethodOfServlet(t, "Dir/IncludeURLTest2", "serverSidePath"):

This returns the serverSide Path of the Dir/IncludeURLTest2 servlet. Notice that there is no leading '/' which means this test is relative to the current directory.

callMethodOfServlet returned '/root/instaladores_rar/Webware-andes/WebKit/Testing/Dir/IncludeURLTest2.py'.

Calling callMethodOfServlet(t, "/Testing/", "name"):

This returns the name of the module at the top of the Testing context which is 'Main'.

callMethodOfServlet returned 'Main'.

Calling callMethodOfServlet(t, "/Testing/Main", "serverSidePath"):

This returns the serverSidePath of the servlet accessed at the top of this context.

callMethodOfServlet returned '/root/instaladores_rar/Webware-andes/WebKit/Testing/Main.py'.

Calling callMethodOfServlet(t, "Main", "serverSidePath"):

This returns the serverSidePath of the servlet accessed 'Main' and should be the same as the servlet accessed through the Testing context.

callMethodOfServlet returned '/root/instaladores_rar/Webware-andes/WebKit/Testing/Main.py'.

Including Dir/IncludeURLTest2:

IncludeURLTest2

IncludeURLTest2

class = IncludeURLTest2, module= Testing.Dir.IncludeURLTest2

This is the second part of the URL test code.

It gets included into the IncludeURLTest, and calls methods on other servlets to verify the references continue to work.

Request Status of IncludeURLTest2:

serverSidePath():        /root/instaladores_rar/Webware-andes/WebKit/Testing/Dir/IncludeURLTest2.py
adapterName():           
servletPath():           
contextName():           Testing
serverSideContextPath(): /root/instaladores_rar/Webware-andes/WebKit/Testing
extraURLPath():          
urlPath():               /Testing/Dir/IncludeURLTest2
previousURLPaths():      /Testing/IncludeURLTest
Environment:
REQUEST_URI:             /Testing/IncludeURLTest
PATH_INFO:               /Testing/IncludeURLTest
SCRIPT_NAME:             
SCRIPT_FILENAME:         

Calling callMethodOfServlet(t, "/Testing/", "serverSidePath"):

Expect to see the serverSidePath of the Testing/Main module.

callMethodOfServlet returned '/root/instaladores_rar/Webware-andes/WebKit/Testing/Main.py'.

Including the Main servlet of the Testing context:

Testing
WebKit Testing

Test cases

#URLExpectation
1. /
/Welcome
/Welcome.py
/Examples/Welcome
/Examples/
/Examples/Welcome.py
Show /Examples/Welcome
2. /Admin/
/Admin/Main
Show admin pages
3. /Admin
Redirect to /Admin/
4. /Examples
Redirect to /Examples/
5. /Testing/Dir/File.html
Display the file
6. /Testing/Dir
/Testing/Dir/
Display the index file
7. /Welcome/
/Examples/Welcome/
Error 404: Not Found
if ExtraPathInfo is not set
8. /BadURL
/BadURL/
/Examples/BadURL
/Examples/BadURL/
/Examples/BadURL/MoreBad
/File.badext
/Examples/File.badext
Error 404: Not Found
or if ExtraPathInfo is set, then
the Examples/Welcome page
displays extra path info.
9. /Testing/Servlet/
/Testing/Servlet/Extra/Path/Info
/Testing/Servlet/Extra/Path/Info/
/Testing/Servlet/More/Info?
Error 404: Not Found
if ExtraPathInfo is not set,
otherwise the test servlet
displays extra path info.
10. /Testing/IncludeURLTest
IncludeURLTest test
11. /Testing/Dir/IncludeURLTest2
lower level IncludeURLTest test
12. /Testing/Forward1
Forward1Target
13. /Testing/Forward2
Dir/Forward2Target
14. /Testing/Dir/Forward3
Forward3Target
15. /Testing/SetCookie
Test of HTTPResponse.setCookie
16. /Testing/TestIMS
TestIMS passed

Notes

  • Test all links in all pages of all contexts (Examples, Admin, Testing, etc.), including links found in the headers and footers of the pages.
  • Test functionality of interactive pages, like CountVisits and ListBox.
  • Test each link more than once.
  • Test with multiple adapters (WebKit.cgi, OneShot.cgi, etc.).

IncludeURLTest complete.