@@ -0,0 +1,1636 @@
+// Copyright (c) 2008 by David Copeland%0A// Licensed under the Apache License, Version 2.0%0A// Available in LICENSE.txt with this code or%0A// at http://www.apache.org/licenses/LICENSE-2.0%0A%0Apackage com.gliffy.restunit;%0A%0Aimport java.io.*;%0Aimport java.util.*;%0A%0A/** A test for a REST endpoint.%0A * This is essentially an ordered list of %7B@link RestCall%7D objects that, when run in order, %0A * constitute a test of a REST service endpoint/resource.%0A */%0Apublic class RestTest implements Serializable%0A%7B%0A    private String itsDefaultURL;%0A    private String itsName;%0A%0A    private List%3CRestCall%3E itsCalls;%0A%0A    /** Create a RestTest. */%0A    public RestTest()%0A    %7B%0A        itsCalls = new ArrayList%3CRestCall%3E();%0A    %7D%0A%0A    /** This is the URL used by default for calls that are part of this test.%0A     * Those calls can specify a URL via %7B@link RestCall#getURL()%7D, which would override%0A     * this when the test is executed.%0A     * @param url the url, relative or absolute, depending on the test context.%0A     */%0A    public void setDefaultURL(String url) %0A    %7B%0A        itsDefaultURL = url; %0A    %7D%0A%0A    public String getDefaultURL() %0A    %7B%0A        return itsDefaultURL; %0A    %7D%0A%0A    /** Adds a call to this test.%0A     * @param call the call to add%0A     */%0A    public void addCall(RestCall call)%0A    %7B%0A        itsCalls.add(call);%0A    %7D%0A%0A    /** returns the list of calls.%0A     * @return an ordered list of RestCall objects%0A     */%0A    public List%3CRestCall%3E getCalls() %0A    %7B %0A        return itsCalls; %0A    %7D%0A%0A    public void setName(String name) %0A    %7B%0A        itsName = name; %0A    %7D%0A%0A    public String getName() %0A    %7B%0A        return itsName; %0A    %7D%0A%0A%0A%7D%0A

test of REST endpoint as a series of calls