summaryrefslogtreecommitdiff
path: root/csharp/test/IceBox/admin
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/test/IceBox/admin')
-rw-r--r--csharp/test/IceBox/admin/AllTests.cs9
-rw-r--r--csharp/test/IceBox/admin/Client.cs49
-rw-r--r--csharp/test/IceBox/admin/config.admin4
-rw-r--r--csharp/test/IceBox/admin/msbuild/client/client.csproj3
-rwxr-xr-xcsharp/test/IceBox/admin/run.py24
5 files changed, 25 insertions, 64 deletions
diff --git a/csharp/test/IceBox/admin/AllTests.cs b/csharp/test/IceBox/admin/AllTests.cs
index fc0938892ae..1c870fd203f 100644
--- a/csharp/test/IceBox/admin/AllTests.cs
+++ b/csharp/test/IceBox/admin/AllTests.cs
@@ -23,8 +23,9 @@ public class AllTests
}
}
- public static void allTests(Ice.Communicator communicator)
+ public static void allTests(TestCommon.Application app)
{
+ Ice.Communicator communicator = app.communicator();
string @ref = "DemoIceBox/admin:default -p 9996 -t 10000";
Ice.ObjectPrx admin = communicator.stringToProxy(@ref);
@@ -98,7 +99,7 @@ public class AllTests
Console.Out.Write("testing metrics admin facet... ");
Console.Out.Flush();
{
- IceMX.MetricsAdminPrx ma =
+ IceMX.MetricsAdminPrx ma =
IceMX.MetricsAdminPrxHelper.checkedCast(admin, "IceBox.Service.TestService.Metrics");
Ice.PropertiesAdminPrx pa =
@@ -118,9 +119,9 @@ public class AllTests
views = ma.getMetricsViewNames(out disabledViews);
test(views.Length == 3);
-
+
// Make sure that the IceBox communicator metrics admin is a separate instance.
- test(IceMX.MetricsAdminPrxHelper.checkedCast(admin,
+ test(IceMX.MetricsAdminPrxHelper.checkedCast(admin,
"Metrics").getMetricsViewNames(out disabledViews).Length == 0);
}
Console.Out.WriteLine("ok");
diff --git a/csharp/test/IceBox/admin/Client.cs b/csharp/test/IceBox/admin/Client.cs
index 1d0a221becb..12b1c953f63 100644
--- a/csharp/test/IceBox/admin/Client.cs
+++ b/csharp/test/IceBox/admin/Client.cs
@@ -17,54 +17,31 @@ using System.Reflection;
[assembly: AssemblyDescription("Ice test")]
[assembly: AssemblyCompany("ZeroC, Inc.")]
-public class Client
+public class Client : TestCommon.Application
{
- private static int run(string[] args, Ice.Communicator communicator)
+ public override int run(string[] args)
{
- AllTests.allTests(communicator);
+ AllTests.allTests(this);
//
// Shutdown the IceBox server.
//
Ice.ProcessPrxHelper.uncheckedCast(
- communicator.stringToProxy("DemoIceBox/admin -f Process:default -p 9996")).shutdown();
+ communicator().stringToProxy("DemoIceBox/admin -f Process:default -p 9996")).shutdown();
return 0;
}
- public static int Main(string[] args)
+ protected override Ice.InitializationData getInitData(ref string[] args)
{
- int status = 0;
- Ice.Communicator communicator = null;
- Debug.Listeners.Add(new ConsoleTraceListener());
-
- try
- {
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = Ice.Util.createProperties(ref args);
- initData.properties.setProperty("Ice.Default.Host", "127.0.0.1");
- 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;
- }
- }
+ Ice.InitializationData initData = base.getInitData(ref args);
+ initData.properties.setProperty("Ice.Default.Host", "127.0.0.1");
+ return initData;
+ }
- return status;
+ public static int Main(string[] args)
+ {
+ Client app = new Client();
+ return app.runmain(args);
}
}
diff --git a/csharp/test/IceBox/admin/config.admin b/csharp/test/IceBox/admin/config.admin
new file mode 100644
index 00000000000..1baad8bea86
--- /dev/null
+++ b/csharp/test/IceBox/admin/config.admin
@@ -0,0 +1,4 @@
+#
+# Proxy to the IceBox ServiceManager:
+#
+IceBoxAdmin.ServiceManager.Proxy=DemoIceBox/admin -f IceBox.ServiceManager:default -p 9996
diff --git a/csharp/test/IceBox/admin/msbuild/client/client.csproj b/csharp/test/IceBox/admin/msbuild/client/client.csproj
index 206bea0d598..f407c8b22cb 100644
--- a/csharp/test/IceBox/admin/msbuild/client/client.csproj
+++ b/csharp/test/IceBox/admin/msbuild/client/client.csproj
@@ -34,6 +34,9 @@
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="..\..\..\..\TestCommon\TestApp.cs">
+ <Link>TestApp.cs</Link>
+ </Compile>
<Compile Include="..\..\AllTests.cs">
<Link>AllTests.cs</Link>
</Compile>
diff --git a/csharp/test/IceBox/admin/run.py b/csharp/test/IceBox/admin/run.py
deleted file mode 100755
index a92ce6141c2..00000000000
--- a/csharp/test/IceBox/admin/run.py
+++ /dev/null
@@ -1,24 +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
-
-TestUtil.clientServerTest(additionalServerOptions='--Ice.Config="%s"' % os.path.join(os.getcwd(), "config.icebox"),
- server=TestUtil.getIceBox())