parameters.put(CLIENT_NO_CONTEXT, null);
parameters.put(SERVER_NO_CONTEXT, null);
// execute
extension = handshaker.handshakeExtension(
new WebSocketExtensionData(PERMESSAGE_DEFLATE_EXTENSION, parameters));
// test
assertNotNull(extension);
assertEquals(WebSocketClientExtension.RSV1, extension.rsv());
assertTrue(extension.newExtensionDecoder() instanceof PerMessageDeflateDecoder);
assertTrue(extension.newExtensionEncoder() instanceof PerMessageDeflateEncoder);
// initialize
parameters = new HashMap<String, String>();
parameters.put(SERVER_MAX_WINDOW, "10");
parameters.put(SERVER_NO_CONTEXT, null);
// execute
extension = handshaker.handshakeExtension(
new WebSocketExtensionData(PERMESSAGE_DEFLATE_EXTENSION, parameters));
// test
assertNotNull(extension);
assertEquals(WebSocketClientExtension.RSV1, extension.rsv());
assertTrue(extension.newExtensionDecoder() instanceof PerMessageDeflateDecoder);
assertTrue(extension.newExtensionEncoder() instanceof PerMessageDeflateEncoder);
// initialize
parameters = new HashMap<String, String>();
// execute
extension = handshaker.handshakeExtension(
new WebSocketExtensionData(PERMESSAGE_DEFLATE_EXTENSION, parameters));
// test
assertNull(extension);
}