Get ready for the failure with wrong protocol to by asynchronous
authorJaroslav Tulach <jaroslav.tulach@netbeans.org>
Thu, 13 Feb 2014 22:20:19 +0100
changeset 56388fd2972bfdf
parent 560 e43da8fe7dbc
child 564 23d02a4b299e
child 565 f09184978a78
Get ready for the failure with wrong protocol to by asynchronous
json-tck/src/main/java/net/java/html/json/tests/WebSocketTest.java
     1.1 --- a/json-tck/src/main/java/net/java/html/json/tests/WebSocketTest.java	Tue Feb 11 21:18:03 2014 +0100
     1.2 +++ b/json-tck/src/main/java/net/java/html/json/tests/WebSocketTest.java	Thu Feb 13 22:20:19 2014 +0100
     1.3 @@ -124,11 +124,17 @@
     1.4      }
     1.5      
     1.6      @KOTest public void errorUsingWebSocket() throws Throwable {
     1.7 -        js = Models.bind(new WebSocketik(), newContext());
     1.8 -        js.applyBindings();
     1.9 +        if (js == null) {
    1.10 +            js = Models.bind(new WebSocketik(), newContext());
    1.11 +            js.applyBindings();
    1.12  
    1.13 -        js.setFetched(null);
    1.14 -        js.querySex("http://wrong.protocol", null);
    1.15 +            js.setFetched(null);
    1.16 +            js.querySex("http://wrong.protocol", null);
    1.17 +        }
    1.18 +
    1.19 +        if (js.getFetchedResponse() == null) {
    1.20 +            throw new InterruptedException();
    1.21 +        }
    1.22  
    1.23          assert js.getFetchedResponse() != null : "Error reported";
    1.24      }