1 README 2 ====== 3 4 5 6 Contents 7 -------- 8 This directory contains resources that can be used to carry out unit testing of 9 the java.net types. The resources are separated according to the type of 10 server that will host them. 11 12 FTP 13 --- 14 The FTP folder contains a single text file (nettest.txt) which should be placed 15 in 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 17 check on the precise contents of this file. 18 19 20 HTTP 21 ---- 22 The HTTP folder contains files to be deployed on an HTTP server. 23 24 Directory cgi-bin contains a single Perl script called test.pl which should be 25 placed in the normal bin directory for your HTTP server (e.g. "cgi-bin" for the 26 Apache HTTP server). The intent is that this script can be accessed with the URL 27 "http://<your host>/cgi-bin/test.pl" . 28 29 Directory html/testres231 contains a number of text and binary resources. This 30 folder and all of its subfolders should be copied to the root directory of your 31 web server from which static documents are served (e.g. "htdocs" for the Apache 32 HTTP 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 52 The intent is that these resources can be accessed with URLs beginning 53 "http://<your host>/testres231/" . 54 55 As with the FTP resource, please do not modify these files in any way as the 56 unit test code has been written to expect specific information about these 57 files such as content and date of last modification. 58 59 60 SERVER CONFIGURATION 61 -------------------- 62 Before running the unit tests for the java.net types the following steps should 63 be taken. 64 65 1. Install the FTP and HTTP documents to their respective server locations as 66 described above. 67 2. Enable proxying capability on the HTTP server. 68 3. Start the HTTP and FTP servers. 69 4. Start up a SOCKS server. 70 71 72 73 RUNNING THE TESTS 74 ----------------- 75 The success of the java.net tests rely on a number of text values which can be 76 supplied in a properties file. These properties include the hostname of the 77 HTTP server where the testres231 files are hosted, the network location of the 78 FTP and SOCKS servers and so on. Isolating these values in a properties file 79 enables the tests to be run in any network environment without recourse to 80 updating values in the test case source code. 81 82 The location of the properties file can be specified to the running tests 83 through setting the property "test.ini.file". An example of this is available 84 in the "run-tests" target of the <EXTRACT_DIR>/Harmony/make/build-java.xml file 85 contained in this zip file. There the "test.ini.file" property holds the 86 path to the file 87 <EXTRACT_DIR>/Harmony/Harmony_Tests/src/test/resources/config/localhost.ini 88 that contains suitable property values if the HTTP, FTP and SOCKS servers were 89 all running on the local machine of the tests user. 90 91 The 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 133 If any of these properties are not set the *hard coded* defaults in the class 134 tests.support.Support_Configuration will be used (see 135 <EXTRACT_DIR>/Harmony/Harmony_Tests/src/test/java/tests/support/Support_Configuration.java 136 in this zip file). 137 138