private static boolean testedInboundRequest = false;
private static RuntimeException inboundRequestFailure = null;
public static void main(String[] args) throws Exception {
ServerEndpoint serverEndpoint = TcpServerEndpoint.getInstance(0);
System.err.println("obtained server endpoint: " + serverEndpoint);
String method = "ServerCapabilities.checkConstraints";
System.err.println("\nTesting " + method + ":");
for (Iterator i = testCases.entrySet().iterator(); i.hasNext();) {
Map.Entry entry = (Map.Entry) i.next();
InvocationConstraints c = (InvocationConstraints) entry.getKey();
System.err.println(" trying: " + c);
InvocationConstraints u = serverEndpoint.checkConstraints(c);
System.err.println("returned: " + u);
if (!entry.getValue().equals(u)) {
throw new RuntimeException(
"TEST FAILED: incorrect constraints returned by " +
method);
}
}
Endpoint endpoint =
serverEndpoint.enumerateListenEndpoints(new ListenContext() {
public ListenCookie addListenEndpoint(ListenEndpoint le)
throws IOException
{
return le.listen(new RD()).getCookie();
}