public class CallWebserver implements TestStep {
private static final String UTF_8 = "UTF-8";
private static final String PROTOCOL = "protocol";
private static final String HOST = "host";
private static final String PORT = "port";
private static final String URI = "uri";
private static final String REQUEST = "request";
private static final String STATUS = "status";
private static final String RESPONSE = "response";
private static final TestParameterType[] IN_PARAMETER = {
new TestParameterType(PROTOCOL, String.class, "Specifies the protocol to use and must be one of http / https. Optional, will be defaulted to http."),
new TestParameterType(HOST, String.class, "The web server host name or IP address."),
new TestParameterType(PORT, Integer.class, "The web server port number."),
new TestParameterType(URI, String.class, "The uri part of the web address."),
new TestParameterType(REQUEST, String.class, "The request to be send."),
};
private static final TestParameterType[] OUT_PARAMETER = {
new TestParameterType(STATUS, Integer.class, "The HTTP status code received."),
new TestParameterType(RESPONSE, String.class, "The response recieved."),
};
@Override
public TestParameterType[] getInParameterTypes() {
return IN_PARAMETER;
}
@Override
public TestParameterType[] getOutParameterTypes() {
return OUT_PARAMETER;
}
@Override
public String getDescription() {
return "Test step calling a web server.";
}
...
} |