# ApplicationServer unit test

**URL:** https://talk.remobjects.com/t/applicationserver-unit-test/30814
**Category:** Remoting SDK
**Tags:** net, oxygene
**Created:** [September 17, 2024, 2:09pm UTC](https://talk.remobjects.com/t/applicationserver-unit-test/30814 "2024-09-17T14:09:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![techprogeticait](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/t/c89c15/32.png) [@techprogeticait](https://talk.remobjects.com/u/techprogeticait)
#### Post date: [September 17, 2024, 2:09pm UTC](https://talk.remobjects.com/t/applicationserver-unit-test/30814/1 "2024-09-17T14:09:24Z")

</div>

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

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [September 17, 2024, 2:44pm UTC](https://talk.remobjects.com/t/applicationserver-unit-test/30814/2 "2024-09-17T14:44:18Z")

</div>

Hi,

you can use something like

```auto
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;

```
