ApplicationServer unit test

Hi,

I’m setting up EUnit test for ApplicationServer.

I’d need to start and stop server in Setup, TearDown methods. Is it possible to programmatically do that?

Thank you,
Giovanni

Hi,

you can use something like

method RBug2558.Setup();
begin
  ServerMessage := new BinMessage();
  ServerChannel := new IpHttpServerChannel();
  ServerChannel.Dispatchers.Add(ServerMessage.DefaultDispatcherName, ServerMessage);
  ServerChannel.Active := true;
end;

method RBug2558.Done();
begin
  ServerChannel.Close();
  System.Threading.Thread.Sleep(3000); // Let it actually close itself
  ServerChannel.Dispose();
  ServerMessage := nil;
  ServerChannel := nil;
end;