RegressionTests__ServerSocketTest.st
author james
Tue, 21 Sep 2004 14:32:59 +0200
changeset 248 0441d79812e8
child 260 5f3d57694265
permissions -rw-r--r--
initial checkin

"{ Package: 'exept:regression' }"

TestCase subclass:#ServerSocketTest
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Streams-External'
!

!ServerSocketTest class methodsFor:'documentation'!

documentation
"
    documentation to be added.

    [author:]
        james (james@CHANTI)

    [instance variables:]

    [class variables:]

    [see also:]

"
!

history
    "Created: / 21-09-2004 / 14:28:22 / james"
! !

!ServerSocketTest methodsFor:'initialize / release'!

setUp
    "common setup - invoked before testing."

    super setUp
!

tearDown
    "common cleanup - invoked after testing."

    super tearDown
! !

!ServerSocketTest methodsFor:'tests'!

testServerSocket
    "Tests if we can open a server socket"

    self shouldnt: [
        |sock|

        sock := Socket newTCPclientToHost:(OperatingSystem getHostName) port:9998.
        sock isNil ifTrue:[
            Transcript showCR:'nope'.
            Error raise.
        ] ifFalse:[
            sock buffered:false.
            Transcript showCR:'client: got it'.
            'can now do transfer via sock'.
            Transcript showCR:'sending <hello>'.
            sock nextPutLine:'hello'.
            sock close
        ]
 ] raise:Error.

    "
     self run:#test1
     self new test1
    "
! !

!ServerSocketTest class methodsFor:'documentation'!

version
    ^ '$Header$'
! !