#BUGFIX by sr
authorsr
Thu, 23 Jan 2020 14:44:41 +0100
changeset 2535 557ae1c822d3
parent 2534 d0c5f5e7472c
child 2536 658e75e2049d
#BUGFIX by sr class: RegressionTests::WebSocketTest::DemoWebSocketService removed: #_process: class: WebSocketTest added: #testCommunicationByteArray100 class: WebSocketTest::DemoWebSocketService added: #_process: changed: #startServingWebSocket:
RegressionTests__WebSocketTest.st
--- a/RegressionTests__WebSocketTest.st	Thu Jan 23 14:24:47 2020 +0100
+++ b/RegressionTests__WebSocketTest.st	Thu Jan 23 14:44:41 2020 +0100
@@ -5,17 +5,17 @@
 "{ NameSpace: RegressionTests }"
 
 TestCase subclass:#WebSocketTest
-	instanceVariableNames:''
-	classVariableNames:'ServerWebSocket ClientWebSocket'
-	poolDictionaries:''
-	category:'tests-Regression-Web'
+        instanceVariableNames:''
+        classVariableNames:'ServerWebSocket ClientWebSocket'
+        poolDictionaries:''
+        category:'tests-Regression-Web'
 !
 
 HTTPService subclass:#DemoWebSocketService
-	instanceVariableNames:'webSocketCreationCallback'
-	classVariableNames:''
-	poolDictionaries:''
-	privateIn:WebSocketTest
+        instanceVariableNames:'webSocketCreationCallback'
+        classVariableNames:''
+        poolDictionaries:''
+        privateIn:WebSocketTest
 !
 
 !WebSocketTest class methodsFor:'documentation'!
@@ -457,6 +457,29 @@
     "Modified (comment): / 23-01-2020 / 11:59:52 / Stefan Reise"
 !
 
+testCommunicationByteArray100
+    "
+        !! call the following method in case the sockets did get corrupted !!
+        self resetServerAndClientWebsocket              
+
+        WebSocketStream verbose:true.
+        WebSocketStream verboseProtocol:true.
+
+        WebSocketStream verbose:false.
+        WebSocketStream verboseProtocol:false.
+
+        WebSocketStream maxBytesPerFrame:1024. 
+        WebSocketStream maxBytesPerFrame:nil.      
+    "
+
+    self 
+        communicationWithData:self byteArray100
+        doAssert:true.
+
+    "Created: / 22-01-2020 / 17:45:53 / Stefan Reise"
+    "Modified (comment): / 23-01-2020 / 11:59:55 / Stefan Reise"
+!
+
 testCommunicationByteArray500
     "
         !! call the following method in case the sockets did get corrupted !!
@@ -834,7 +857,12 @@
     "to be redefined in subclasses (services) which do handle webSockets;
      close here, in case it was not redefined"
 
-    webSocketCreationCallback value:webSocket.
+    |callback|
+
+    callback := webSocketCreationCallback.
+    callback notNil ifTrue:[
+        callback value:webSocket.
+    ].
 
     "Created: / 13-11-2019 / 14:42:43 / Stefan Reise"
     "Modified: / 17-01-2020 / 13:19:52 / Stefan Reise"