private static RestTest parseRestTest(BufferedReader reader) throws IOException {
        RestTest rval = new RestTest();

        try {
            // METHOD, Path, Username/Password
            String line = reader.readLine();
            String [] split = line.split(" ");
            rval.setRequestMethod(split[0]);
            rval.setRequestPath(split[1]);
            if (split.length >= 3) {
                String userpass = split[2];
                split = userpass.split("/");
                rval.setUsername(split[0]);
                rval.setPassword(split[1]);
            }

            // Request Headers
            line = reader.readLine();
            if (!line.trim().equals("----")) {
                while (line.trim().length() > 0) {
                    int idx = line.indexOf(':');
                    String headerName = line.substring(0, idx).trim();
                    String headerValue = line.substring(idx + 1).trim();
                    rval.getRequestHeaders().put(headerName, headerValue);
                    line = reader.readLine();
                }

                // Request payload
                StringBuilder builder = new StringBuilder();
                line = reader.readLine();
                while (!line.trim().equals("----")) {
                    builder.append(line).append("\n");
                    line = reader.readLine();
                    line = doPropertyReplacement(line);
                }
                rval.setRequestPayload(builder.toString());
            }

            // Response
            // Expected Status Code
            line = reader.readLine();
            rval.setExpectedStatusCode(Integer.parseInt(line.trim()));

            // Expected Response Headers
            line = reader.readLine();
            while (line != null && line.trim().length() > 0) {
                int idx = line.indexOf(':');
                String headerName = line.substring(0, idx).trim();
                String headerValue = line.substring(idx + 1).trim();
                rval.getExpectedResponseHeaders().put(headerName, headerValue);
                line = reader.readLine();
            }

            // Expected Response Payload
            if (line != null) {
                StringBuilder builder = new StringBuilder();
                line = reader.readLine();
                while (line != null && !line.trim().equals("----")) {
                    builder.append(line).append("\n");
                    line = reader.readLine();
                }
                rval.setExpectedResponsePayload(builder.toString());
            }
        } catch (Throwable t) {
            throw new IOException("Error while parsing Rest Test", t);
        }

        return rval;
    }
Parse a *.resttest file.  The format of a *.resttest file is:

<pre>
    METHOD /path/to/resource username/password
    Request-Header-1: value
    Request-Header-2: value

    **Request Payload**
    ----
    ResponseStatusCode
    Response-Header-1: expected-value
    Response-Header-2: expected-value

    **Response Payload**
</pre>
@param reader
@throws IOException
test/common/src/main/java/io/apiman/test/common/util/TestUtil.java