RegressionTests__WebSocketTest.st
changeset 2515 f90381bad385
parent 2507 7e942273196d
child 2516 c3e64a6f07ac
--- a/RegressionTests__WebSocketTest.st	Mon Jan 20 17:48:50 2020 +0100
+++ b/RegressionTests__WebSocketTest.st	Mon Jan 20 18:12:36 2020 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "{ Package: 'stx:goodies/regression' }"
 
 "{ NameSpace: RegressionTests }"
@@ -254,10 +256,6 @@
 
     |response|   
 
-    "verbose what happens"
-    WebSocketStream verbose:true.
-    WebSocketStream verboseProtocol:true.
-
     DemoWebSocketService start
         webSocketCreationCallback:[:newWebSocket |
             ServerWebSocket := newWebSocket.
@@ -275,7 +273,7 @@
     ClientWebSocket := response webSocket.
 
     "Created: / 17-01-2020 / 13:21:28 / Stefan Reise"
-    "Modified: / 20-01-2020 / 14:44:54 / Stefan Reise"
+    "Modified: / 20-01-2020 / 18:08:26 / Stefan Reise"
 ! !
 
 !WebSocketTest methodsFor:'queries'!
@@ -305,7 +303,16 @@
 testCommunication
     "
         call the following method in case the sockets did get corrupted
-        self resetServerAndClientWebsocket
+        self resetServerAndClientWebsocket              
+
+        WebSocketStream verbose:true.
+        WebSocketStream verboseProtocol:true.
+
+        WebSocketStream verbose:false.
+        WebSocketStream verboseProtocol:false.
+
+        WebSocketStream maxSizeInByterPerFrame:1024. 
+        WebSocketStream maxSizeInByterPerFrame:nil.      
     "
 
     self allData do:[:data |
@@ -318,41 +325,40 @@
 
     "Created: / 17-01-2020 / 13:24:24 / Stefan Reise"
     "Modified: / 20-01-2020 / 15:21:56 / Stefan Reise"
-!
-
-testCommunication2
-    "
-        call the following method in case the sockets did get corrupted
-        self resetServerAndClientWebsocket
-    "
-
-    (Array with:self dataWithLength11AndFrameHash first) do:[:data |
-        self clientWebSocket nextPut:data.
-        self assert:self serverWebSocket next = data.
-
-        self serverWebSocket nextPut:data.
-        self assert:self clientWebSocket next = data.
-    ].
-
-    "Created: / 20-01-2020 / 14:48:26 / Stefan Reise"
-    "Modified: / 20-01-2020 / 16:43:11 / Stefan Reise"
+    "Modified (comment): / 20-01-2020 / 18:09:02 / Stefan Reise"
 !
 
 testEncoding
     "
         call the following method in case the sockets did get corrupted
-        self resetServerAndClientWebsocket
+        self resetServerAndClientWebsocket           
+
+        WebSocketStream verbose:true.
+        WebSocketStream verboseProtocol:true.
+
+        WebSocketStream verbose:false.
+        WebSocketStream verboseProtocol:false.   
     "
 
-    self assertEncodingPairwiseDataAndHash:self allDataWithFrameHash
+    "set the value, which was used to record the frame hashe"
+    WebSocketStream maxSizeInByterPerFrame:512 * 1024. 
+    self assertEncodingPairwiseDataAndHash:self allDataWithFrameHash.
+    WebSocketStream maxSizeInByterPerFrame:nil.
 
     "Created: / 20-01-2020 / 13:13:50 / Stefan Reise"
+    "Modified (comment): / 20-01-2020 / 18:09:08 / Stefan Reise"
 !
 
 testMask
     "
         call the following method in case the sockets did get corrupted
-        self resetServerAndClientWebsocket
+        self resetServerAndClientWebsocket          
+
+        WebSocketStream verbose:true.
+        WebSocketStream verboseProtocol:true.
+
+        WebSocketStream verbose:false.
+        WebSocketStream verboseProtocol:false.   
     "
 
     |startTimestamp webSocket mask masked unmasked|
@@ -376,12 +382,19 @@
     Transcript showCR:(Timestamp now - startTimestamp) printString.
 
     "Created: / 20-01-2020 / 15:08:27 / Stefan Reise"
+    "Modified (comment): / 20-01-2020 / 18:09:11 / Stefan Reise"
 !
 
 testPing
     "
         call the following method in case the sockets did get corrupted
-        self resetServerAndClientWebsocket
+        self resetServerAndClientWebsocket          
+
+        WebSocketStream verbose:true.
+        WebSocketStream verboseProtocol:true.
+
+        WebSocketStream verbose:false.             
+        WebSocketStream verboseProtocol:false.   
     "
 
     |pingTimeDuration|
@@ -395,7 +408,7 @@
     self assert:pingTimeDuration notNil.
 
     "Created: / 17-01-2020 / 13:43:58 / Stefan Reise"
-    "Modified (comment): / 20-01-2020 / 12:51:54 / Stefan Reise"
+    "Modified (comment): / 20-01-2020 / 18:09:16 / Stefan Reise"
 ! !
 
 !WebSocketTest methodsFor:'zzz'!