'Create a new L{AdoptedStreamServerEndpoint} for use by a test.
@return: A three-tuple:
- The endpoint
- A tuple of the arguments expected to be passed to the underlying
reactor method
- An IAddress object which will match the result of
L{IListeningPort.getHost} on the port returned by the endpoint.'

def createServerEndpoint(self, reactor, factory):

    fileno = 12
    addressFamily = AF_INET
    endpoint = self._createStubbedAdoptedEndpoint(reactor, fileno, addressFamily)
    address = IPv4Address('TCP', '0.0.0.0', 1234)
    return (endpoint, (fileno, addressFamily, factory), address)
