pharo: Add a different test implementation
This commit is contained in:
parent
acf3dced3b
commit
54c4074b80
|
@ -188,3 +188,27 @@ SIPDigest class extend [
|
|||
nextPutAll: ha2])) hex
|
||||
]
|
||||
]
|
||||
|
||||
SIPUdpTransportTest extend [
|
||||
testSending [
|
||||
| target transp datagram read |
|
||||
[
|
||||
target := Socket newUDP.
|
||||
target setPort: 0.
|
||||
datagram := OsmoUDPDatagram new.
|
||||
datagram port: target localPort.
|
||||
datagram address: (NetNameResolver localHostAddress).
|
||||
datagram data: 'foooo'.
|
||||
transp := SIPUdpTransport startOn: '127.0.0.1'.
|
||||
transp start.
|
||||
transp queueDatagram: datagram.
|
||||
read := target next.
|
||||
self deny: read data isNil.
|
||||
self assert: read size equals: 5.
|
||||
self assert: (read data copyFrom: 1 to: 5) equals: 'foooo' asByteArray
|
||||
] ensure: [
|
||||
target closeAndDestroy.
|
||||
transp stop.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
|
Reference in New Issue