org.apache.wicket.protocol.ws.util.tester
Class WebSocketTester

java.lang.Object
  extended by org.apache.wicket.protocol.ws.util.tester.WebSocketTester

public class WebSocketTester
extends Object

A helper class to test WebSocket related operations.

Since:
6.0

Constructor Summary
WebSocketTester(WicketTester wicketTester, Page page)
          Constructor.
 
Method Summary
 void destroy()
           
protected  void onOutMessage(byte[] message, int offset, int length)
          A callback method which may be overritten to receive messages pushed by the server
protected  void onOutMessage(String message)
          A callback method which may be overritten to receive messages pushed by the server
 void sendMessage(byte[] message, int offset, int length)
          Sends a binary message from the client (a test case) to the server
 void sendMessage(String message)
          Sends a text message from the client (a test case) to the server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebSocketTester

public WebSocketTester(WicketTester wicketTester,
                       Page page)
Constructor. Prepares a WebSockConnection that will be used to send messages from the client (the test case) to the server.

Parameters:
page - the page that may have registered WebSocketBehavior
Method Detail

sendMessage

public void sendMessage(String message)
Sends a text message from the client (a test case) to the server

Parameters:
message - the text message to send to the server

sendMessage

public void sendMessage(byte[] message,
                        int offset,
                        int length)
Sends a binary message from the client (a test case) to the server

Parameters:
message - the binary message to send to the server
offset - the offset of the binary message to start to read from
length - the length of bytes to read from the binary message

destroy

public void destroy()

onOutMessage

protected void onOutMessage(String message)
A callback method which may be overritten to receive messages pushed by the server

Parameters:
message - the pushed text message from the server

onOutMessage

protected void onOutMessage(byte[] message,
                            int offset,
                            int length)
A callback method which may be overritten to receive messages pushed by the server

Parameters:
message - the pushed binary message from the server
offset - the offset of the binary message to start to read from
length - the length of bytes to read from the binary message


Copyright © 2006–2013 Apache Software Foundation. All rights reserved.