README.txt revision 470c1f75f26d58eb33bbaa0d7e08ed2723f25647
1README
2======
3
4
5
6Contents
7--------
8This directory contains resources that can be used to carry out unit testing of
9the java.net types. The resources are separated according to the type of 
10server that will host them. 
11
12FTP
13---
14The FTP folder contains a single text file (nettest.txt) which should be placed
15in the root or home directory of an FTP account with id "jcltest" with password
16"jclpass". Please do not modify nettest.txt as the tests have been written to 
17check on the precise contents of this file.
18
19
20HTTP
21----
22The HTTP folder contains files to be deployed on an HTTP server.
23
24Directory cgi-bin contains a single Perl script called test.pl which should be
25placed in the normal bin directory for your HTTP server (e.g. "cgi-bin" for the
26Apache HTTP server). The intent is that this script can be accessed with the URL
27"http://<your host>/cgi-bin/test.pl" .
28
29Directory html/testres231 contains a number of text and binary resources. This
30folder and all of its subfolders should be copied to the root directory of your
31web server from which static documents are served (e.g. "htdocs" for the Apache
32HTTP server)...
33
34
35<DOCUMENT_ROOT>/testres231
36       |   RESOURCE.TXT
37       |
38       +---JUC
39       |       lf.jar
40       |
41       +---subdir1
42       |       RESOURCE.TXT
43       |
44       +---UCL
45       |       UCL.jar
46       |
47       \---URLConnectionTest
48               Harmony.html
49
50
51
52The intent is that these resources can be accessed with URLs beginning
53"http://<your host>/testres231/" . 
54
55As with the FTP resource, please do not modify these files in any way as the 
56unit test code has been written to expect specific information about these
57files such as content and date of last modification.
58
59
60SERVER CONFIGURATION
61--------------------
62Before running the unit tests for the java.net types the following steps should 
63be taken. 
64
651. Install the FTP and HTTP documents to their respective server locations as
66described above. 
672. Enable proxying capability on the HTTP server.
683. Start the HTTP and FTP servers. 
694. Start up a SOCKS server.
70
71
72
73RUNNING THE TESTS
74-----------------
75The success of the java.net tests rely on a number of text values which can be 
76supplied in a properties file. These properties include the hostname of the 
77HTTP server where the testres231 files are hosted, the network location of the 
78FTP and SOCKS servers and so on. Isolating these values in a properties file
79enables the tests to be run in any network environment without recourse to 
80updating values in the test case source code. 
81
82The location of the properties file can be specified to the running tests
83through setting the property "test.ini.file". An example of this is available
84in the "run-tests" target of the <EXTRACT_DIR>/Harmony/make/build-java.xml file
85contained in this zip file. There the "test.ini.file" property holds the 
86path to the file 
87<EXTRACT_DIR>/Harmony/Harmony_Tests/src/test/resources/config/localhost.ini
88that contains suitable property values if the HTTP, FTP and SOCKS servers were
89all running on the local machine of the tests user. 
90
91The key properties required by the java.net tests are as follows ...
92
93
94* DomainAddress : The domain name of the host where the HTTP server is running.
95
96* WebName : The unqualified name of the host where the HTTP server is running.
97
98* HomeAddressResponse : the expected response returned from a successful get 
99                        from the HTTP server.
100
101* HomeAddressSoftware : the expected information about the HTTP server's
102                        software.
103                        
104* ProxyServerTestHost : the fully qualified location of the HTTP proxy host 
105                        used in the tests.
106
107* SocksServerTestHost : the fully qualified location of the SOCKS server used
108                        in the tests.
109
110* SocksServerTestPort : the test SOCKS server's port number
111
112* UnresolvedIP : an IP address that does not resolve to a host name
113
114* FTPTestAddress : a string of the form "jcltest:jclpass@<server address>" that
115                   points to the network location of the FTP resources.
116
117* URLConnectionLastModifiedString : string which gives the precise date and time
118                                    that the HTTP server resources were last
119                                    modified. If you make any changes to the
120                                    web resources this value will need to
121                                    change.
122
123* URLConnectionLastModified : the corresponding numeric equivalent of the 
124                              "URLConnectionLastModifiedString" string value. 
125                              Any changes to the web resources will affect this
126                              value. 
127
128* ResolvedNotExistingHost : an IP address that resolves to a host that is not
129                            present on the local network. This allows us to
130                            check the timeouts for socket connections.
131
132* IPv6GlobalAddressJcl4 : the IPv6 address for a host on the network. 
133
134
135
136If any of these properties are not set the *hard coded* defaults in the class 
137tests.support.Support_Configuration will be used (see
138<EXTRACT_DIR>/Harmony/Harmony_Tests/src/test/java/tests/support/Support_Configuration.java
139in this zip file).
140
141