summaryrefslogtreecommitdiff
path: root/csharp/test/Ice/echo
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/test/Ice/echo')
-rw-r--r--csharp/test/Ice/echo/Server.cs42
-rw-r--r--csharp/test/Ice/echo/msbuild/server/server.csproj3
-rwxr-xr-xcsharp/test/Ice/echo/run.py30
3 files changed, 10 insertions, 65 deletions
diff --git a/csharp/test/Ice/echo/Server.cs b/csharp/test/Ice/echo/Server.cs
index 28cd7d37aaa..871a6bc0aa3 100644
--- a/csharp/test/Ice/echo/Server.cs
+++ b/csharp/test/Ice/echo/Server.cs
@@ -16,7 +16,7 @@ using System.Reflection;
[assembly: AssemblyDescription("Ice test")]
[assembly: AssemblyCompany("ZeroC, Inc.")]
-public class Server
+public class Server : TestCommon.Application
{
private class EchoI : Test.EchoDisp_
{
@@ -43,50 +43,22 @@ public class Server
private BlobjectI _blob;
}
- public static int run(string[] args, Ice.Communicator communicator)
+ public override int run(string[] args)
{
- communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010");
- Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
+ communicator().getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0));
+ Ice.ObjectAdapter adapter = communicator().createObjectAdapter("TestAdapter");
BlobjectI blob = new BlobjectI();
adapter.addDefaultServant(blob, "");
adapter.add(new EchoI(blob), Ice.Util.stringToIdentity("__echo"));
adapter.activate();
- communicator.waitForShutdown();
+ communicator().waitForShutdown();
return 0;
}
public static int Main(string[] args)
{
- int status = 0;
- Ice.Communicator communicator = null;
-
- try
- {
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = Ice.Util.createProperties(ref args);
- communicator = Ice.Util.initialize(ref args, initData);
- status = run(args, communicator);
- }
- catch(Exception ex)
- {
- Console.Error.WriteLine(ex);
- status = 1;
- }
-
- if(communicator != null)
- {
- try
- {
- communicator.destroy();
- }
- catch(Ice.LocalException ex)
- {
- Console.Error.WriteLine(ex);
- status = 1;
- }
- }
-
- return status;
+ Server app = new Server();
+ return app.runmain(args);
}
}
diff --git a/csharp/test/Ice/echo/msbuild/server/server.csproj b/csharp/test/Ice/echo/msbuild/server/server.csproj
index 55484eb16e7..985b3cec79a 100644
--- a/csharp/test/Ice/echo/msbuild/server/server.csproj
+++ b/csharp/test/Ice/echo/msbuild/server/server.csproj
@@ -34,6 +34,9 @@
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="..\..\..\..\TestCommon\TestApp.cs">
+ <Link>TestApp.cs</Link>
+ </Compile>
<Compile Include="..\..\BlobjectI.cs">
<Link>BlobjectI.cs</Link>
</Compile>
diff --git a/csharp/test/Ice/echo/run.py b/csharp/test/Ice/echo/run.py
deleted file mode 100755
index b4443ff6130..00000000000
--- a/csharp/test/Ice/echo/run.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-sys.stdout.write("starting server... ")
-sys.stdout.flush()
-server = os.path.join(os.getcwd(), "server")
-p = TestUtil.startServer(server)
-print("ok")
-sys.stdout.flush()
-
-p.waitTestSuccess()