summaryrefslogtreecommitdiff
path: root/cs/test
diff options
context:
space:
mode:
Diffstat (limited to 'cs/test')
-rw-r--r--cs/test/Ice/adapterDeactivation/AllTests.cs155
-rw-r--r--cs/test/Ice/adapterDeactivation/App.xaml7
-rw-r--r--cs/test/Ice/adapterDeactivation/App.xaml.cs81
-rw-r--r--cs/test/Ice/adapterDeactivation/Makefile4
-rw-r--r--cs/test/Ice/adapterDeactivation/Makefile.mak4
-rw-r--r--cs/test/Ice/adapterDeactivation/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/adapterDeactivation/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/adapterDeactivation/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/adapterDeactivation/adapterDeactivation.csproj114
-rw-r--r--cs/test/Ice/ami/AllTests.cs126
-rw-r--r--cs/test/Ice/ami/App.xaml8
-rw-r--r--cs/test/Ice/ami/App.xaml.cs80
-rw-r--r--cs/test/Ice/ami/Makefile2
-rw-r--r--cs/test/Ice/ami/Makefile.mak2
-rw-r--r--cs/test/Ice/ami/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/ami/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/ami/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/ami/ami.csproj115
-rw-r--r--cs/test/Ice/background/Acceptor.cs2
-rw-r--r--cs/test/Ice/background/Transceiver.cs4
-rw-r--r--cs/test/Ice/binding/AllTests.cs277
-rw-r--r--cs/test/Ice/binding/App.xaml8
-rw-r--r--cs/test/Ice/binding/App.xaml.cs81
-rw-r--r--cs/test/Ice/binding/Client.cs2
-rw-r--r--cs/test/Ice/binding/Makefile2
-rw-r--r--cs/test/Ice/binding/Makefile.mak2
-rw-r--r--cs/test/Ice/binding/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/binding/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/binding/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/binding/binding.csproj115
-rw-r--r--cs/test/Ice/defaultServant/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/defaultServant/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/defaultServant/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/defaultValue/AllTests.cs38
-rw-r--r--cs/test/Ice/defaultValue/App.xaml8
-rw-r--r--cs/test/Ice/defaultValue/App.xaml.cs73
-rw-r--r--cs/test/Ice/defaultValue/Makefile3
-rw-r--r--cs/test/Ice/defaultValue/Makefile.mak3
-rw-r--r--cs/test/Ice/defaultValue/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/defaultValue/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/defaultValue/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/defaultValue/defaultValue.csproj115
-rw-r--r--cs/test/Ice/dictMapping/AllTests.cs49
-rw-r--r--cs/test/Ice/dictMapping/App.xaml8
-rw-r--r--cs/test/Ice/dictMapping/App.xaml.cs81
-rw-r--r--cs/test/Ice/dictMapping/Makefile5
-rw-r--r--cs/test/Ice/dictMapping/Makefile.mak4
-rw-r--r--cs/test/Ice/dictMapping/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/dictMapping/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/dictMapping/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/dictMapping/dictMapping.csproj118
-rw-r--r--cs/test/Ice/dispatcher/AllTests.cs46
-rw-r--r--cs/test/Ice/dispatcher/App.xaml8
-rw-r--r--cs/test/Ice/dispatcher/App.xaml.cs81
-rw-r--r--cs/test/Ice/dispatcher/Makefile2
-rw-r--r--cs/test/Ice/dispatcher/Makefile.mak2
-rw-r--r--cs/test/Ice/dispatcher/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/dispatcher/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/dispatcher/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/dispatcher/dispatcher.csproj116
-rw-r--r--cs/test/Ice/exceptions/AllTests.cs335
-rw-r--r--cs/test/Ice/exceptions/App.xaml8
-rw-r--r--cs/test/Ice/exceptions/App.xaml.cs81
-rw-r--r--cs/test/Ice/exceptions/Makefile5
-rw-r--r--cs/test/Ice/exceptions/Makefile.mak4
-rw-r--r--cs/test/Ice/exceptions/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/exceptions/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/exceptions/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/exceptions/exceptions.csproj116
-rw-r--r--cs/test/Ice/facets/AllTests.cs104
-rw-r--r--cs/test/Ice/facets/App.xaml8
-rw-r--r--cs/test/Ice/facets/App.xaml.cs82
-rw-r--r--cs/test/Ice/facets/Makefile5
-rw-r--r--cs/test/Ice/facets/Makefile.mak4
-rw-r--r--cs/test/Ice/facets/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/facets/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/facets/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/facets/facets.csproj115
-rw-r--r--cs/test/Ice/faultTolerance/AllTests.cs133
-rw-r--r--cs/test/Ice/faultTolerance/App.xaml8
-rw-r--r--cs/test/Ice/faultTolerance/App.xaml.cs81
-rw-r--r--cs/test/Ice/faultTolerance/Client.cs2
-rw-r--r--cs/test/Ice/faultTolerance/Makefile2
-rw-r--r--cs/test/Ice/faultTolerance/Makefile.mak2
-rw-r--r--cs/test/Ice/faultTolerance/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/faultTolerance/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/faultTolerance/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/faultTolerance/faultTolerance.csproj115
-rw-r--r--cs/test/Ice/hold/AllTests.cs71
-rw-r--r--cs/test/Ice/hold/App.xaml8
-rw-r--r--cs/test/Ice/hold/App.xaml.cs81
-rw-r--r--cs/test/Ice/hold/Makefile2
-rw-r--r--cs/test/Ice/hold/Makefile.mak2
-rw-r--r--cs/test/Ice/hold/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/hold/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/hold/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/hold/hold.csproj115
-rw-r--r--cs/test/Ice/info/AllTests.cs79
-rw-r--r--cs/test/Ice/info/App.xaml8
-rw-r--r--cs/test/Ice/info/App.xaml.cs81
-rw-r--r--cs/test/Ice/info/Makefile2
-rw-r--r--cs/test/Ice/info/Makefile.mak2
-rw-r--r--cs/test/Ice/info/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/info/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/info/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/info/info.csproj115
-rw-r--r--cs/test/Ice/inheritance/AllTests.cs78
-rw-r--r--cs/test/Ice/inheritance/App.xaml8
-rw-r--r--cs/test/Ice/inheritance/App.xaml.cs82
-rw-r--r--cs/test/Ice/inheritance/Makefile5
-rw-r--r--cs/test/Ice/inheritance/Makefile.mak4
-rw-r--r--cs/test/Ice/inheritance/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/inheritance/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/inheritance/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/inheritance/inheritance.csproj115
-rw-r--r--cs/test/Ice/invoke/AllTests.cs46
-rw-r--r--cs/test/Ice/invoke/App.xaml8
-rw-r--r--cs/test/Ice/invoke/App.xaml.cs81
-rw-r--r--cs/test/Ice/invoke/Makefile2
-rw-r--r--cs/test/Ice/invoke/Makefile.mak2
-rw-r--r--cs/test/Ice/invoke/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/invoke/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/invoke/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/invoke/invoke.csproj115
-rw-r--r--cs/test/Ice/location/AllTests.cs162
-rw-r--r--cs/test/Ice/location/App.xaml8
-rw-r--r--cs/test/Ice/location/App.xaml.cs81
-rw-r--r--cs/test/Ice/location/Makefile2
-rw-r--r--cs/test/Ice/location/Makefile.mak2
-rw-r--r--cs/test/Ice/location/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/location/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/location/Properties/InBrowserSettings.xml5
-rw-r--r--cs/test/Ice/location/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/location/location.csproj120
-rw-r--r--cs/test/Ice/objects/AllTests.cs174
-rw-r--r--cs/test/Ice/objects/App.xaml8
-rw-r--r--cs/test/Ice/objects/App.xaml.cs81
-rw-r--r--cs/test/Ice/objects/Client.cs57
-rw-r--r--cs/test/Ice/objects/Makefile4
-rw-r--r--cs/test/Ice/objects/Makefile.mak4
-rw-r--r--cs/test/Ice/objects/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/objects/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/objects/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/objects/objects.csproj123
-rw-r--r--cs/test/Ice/operations/AllTests.cs85
-rw-r--r--cs/test/Ice/operations/App.xaml8
-rw-r--r--cs/test/Ice/operations/App.xaml.cs81
-rw-r--r--cs/test/Ice/operations/Makefile2
-rw-r--r--cs/test/Ice/operations/Makefile.mak4
-rw-r--r--cs/test/Ice/operations/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/operations/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/operations/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/operations/operations.csproj122
-rw-r--r--cs/test/Ice/proxy/AllTests.cs88
-rw-r--r--cs/test/Ice/proxy/App.xaml8
-rw-r--r--cs/test/Ice/proxy/App.xaml.cs81
-rw-r--r--cs/test/Ice/proxy/Makefile4
-rw-r--r--cs/test/Ice/proxy/Makefile.mak4
-rw-r--r--cs/test/Ice/proxy/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/proxy/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/proxy/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/proxy/proxy.csproj115
-rw-r--r--cs/test/Ice/retry/AllTests.cs68
-rw-r--r--cs/test/Ice/retry/App.xaml8
-rw-r--r--cs/test/Ice/retry/App.xaml.cs81
-rw-r--r--cs/test/Ice/retry/Makefile2
-rw-r--r--cs/test/Ice/retry/Makefile.mak2
-rw-r--r--cs/test/Ice/retry/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/retry/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/retry/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/retry/retry.csproj115
-rw-r--r--cs/test/Ice/seqMapping/AllTests.cs49
-rw-r--r--cs/test/Ice/seqMapping/App.xaml8
-rw-r--r--cs/test/Ice/seqMapping/App.xaml.cs81
-rw-r--r--cs/test/Ice/seqMapping/Makefile5
-rw-r--r--cs/test/Ice/seqMapping/Makefile.mak4
-rw-r--r--cs/test/Ice/seqMapping/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/seqMapping/Properties/AssemblyInfo.cs35
-rw-r--r--cs/test/Ice/seqMapping/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/seqMapping/Serializable.cs3
-rw-r--r--cs/test/Ice/seqMapping/Test.ice8
-rw-r--r--cs/test/Ice/seqMapping/Twoways.cs10
-rw-r--r--cs/test/Ice/seqMapping/TwowaysAMI.cs12
-rw-r--r--cs/test/Ice/seqMapping/TwowaysNewAMI.cs12
-rw-r--r--cs/test/Ice/seqMapping/seqMapping.csproj120
-rw-r--r--cs/test/Ice/servantLocator/AllTests.cs91
-rw-r--r--cs/test/Ice/servantLocator/App.xaml8
-rw-r--r--cs/test/Ice/servantLocator/App.xaml.cs81
-rw-r--r--cs/test/Ice/servantLocator/Makefile5
-rw-r--r--cs/test/Ice/servantLocator/Makefile.mak4
-rw-r--r--cs/test/Ice/servantLocator/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/servantLocator/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/servantLocator/Properties/InBrowserSettings.xml5
-rw-r--r--cs/test/Ice/servantLocator/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/servantLocator/servantLocator.csproj120
-rw-r--r--cs/test/Ice/slicing/exceptions/AllTests.cs202
-rw-r--r--cs/test/Ice/slicing/exceptions/App.xaml8
-rw-r--r--cs/test/Ice/slicing/exceptions/App.xaml.cs81
-rw-r--r--cs/test/Ice/slicing/exceptions/Makefile2
-rw-r--r--cs/test/Ice/slicing/exceptions/Makefile.mak2
-rw-r--r--cs/test/Ice/slicing/exceptions/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/slicing/exceptions/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/slicing/exceptions/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/slicing/exceptions/exceptions.csproj115
-rw-r--r--cs/test/Ice/slicing/objects/AllTests.cs381
-rw-r--r--cs/test/Ice/slicing/objects/App.xaml8
-rw-r--r--cs/test/Ice/slicing/objects/App.xaml.cs81
-rw-r--r--cs/test/Ice/slicing/objects/Makefile2
-rw-r--r--cs/test/Ice/slicing/objects/Makefile.mak2
-rw-r--r--cs/test/Ice/slicing/objects/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/slicing/objects/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/slicing/objects/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/slicing/objects/objects.csproj119
-rw-r--r--cs/test/Ice/stream/AllTests.cs1433
-rw-r--r--cs/test/Ice/stream/App.xaml8
-rw-r--r--cs/test/Ice/stream/App.xaml.cs81
-rw-r--r--cs/test/Ice/stream/Client.cs1408
-rw-r--r--cs/test/Ice/stream/Makefile2
-rw-r--r--cs/test/Ice/stream/Makefile.mak2
-rw-r--r--cs/test/Ice/stream/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/stream/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/stream/Properties/InBrowserSettings.xml5
-rw-r--r--cs/test/Ice/stream/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/stream/Test.ice11
-rw-r--r--cs/test/Ice/stream/stream.csproj120
-rw-r--r--cs/test/Ice/timeout/AllTests.cs94
-rw-r--r--cs/test/Ice/timeout/App.xaml8
-rw-r--r--cs/test/Ice/timeout/App.xaml.cs81
-rw-r--r--cs/test/Ice/timeout/Makefile2
-rw-r--r--cs/test/Ice/timeout/Makefile.mak2
-rw-r--r--cs/test/Ice/timeout/Properties/AppManifest.xml6
-rw-r--r--cs/test/Ice/timeout/Properties/AssemblyInfo.cs44
-rw-r--r--cs/test/Ice/timeout/Properties/OutOfBrowserSettings.xml10
-rw-r--r--cs/test/Ice/timeout/timeout.csproj115
-rw-r--r--cs/test/TestCommon/Properties/AssemblyInfo.cs37
-rw-r--r--cs/test/TestCommon/TestApp.cs142
-rw-r--r--cs/test/TestCommon/TestCommon.csproj78
-rw-r--r--cs/test/testsl.sln195
238 files changed, 10116 insertions, 2810 deletions
diff --git a/cs/test/Ice/adapterDeactivation/AllTests.cs b/cs/test/Ice/adapterDeactivation/AllTests.cs
index 08fdaf74d77..e2016faf0c9 100644
--- a/cs/test/Ice/adapterDeactivation/AllTests.cs
+++ b/cs/test/Ice/adapterDeactivation/AllTests.cs
@@ -10,77 +10,90 @@
using System;
using Test;
-public class AllTests
-{
- private static void test(bool b)
- {
- if (!b)
- {
- throw new System.Exception();
- }
- }
-
+#if SILVERLIGHT
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+#endif
+
+public class AllTests : TestCommon.TestApp
+{
+
+#if SILVERLIGHT
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static TestIntfPrx allTests(Ice.Communicator communicator)
- {
- Console.Out.Write("testing stringToProxy... ");
- Console.Out.Flush();
- string @ref = "test:default -p 12010";
- Ice.ObjectPrx @base = communicator.stringToProxy(@ref);
- test(@base != null);
- Console.Out.WriteLine("ok");
-
- Console.Out.Write("testing checked cast... ");
- Console.Out.Flush();
- TestIntfPrx obj = TestIntfPrxHelper.checkedCast(@base);
- test(obj != null);
- test(obj.Equals(@base));
- Console.Out.WriteLine("ok");
-
- {
- Console.Out.Write("creating/destroying/recreating object adapter... ");
- Console.Out.Flush();
- Ice.ObjectAdapter adapter =
- communicator.createObjectAdapterWithEndpoints("TransientTestAdapter", "default");
- try
- {
- communicator.createObjectAdapterWithEndpoints("TransientTestAdapter", "default");
- test(false);
- }
- catch(Ice.AlreadyRegisteredException)
- {
- }
- adapter.destroy();
-
- //
- // Use a different port than the first adapter to avoid an "address already in use" error.
- //
- adapter = communicator.createObjectAdapterWithEndpoints("TransientTestAdapter", "default");
- adapter.destroy();
- Console.Out.WriteLine("ok");
- }
-
- Console.Out.Write("creating/activating/deactivating object adapter in one operation... ");
- Console.Out.Flush();
- obj.transient();
- Console.Out.WriteLine("ok");
-
- Console.Out.Write("deactivating object adapter in the server... ");
- Console.Out.Flush();
- obj.deactivate();
- Console.Out.WriteLine("ok");
-
- Console.Out.Write("testing whether server is gone... ");
- Console.Out.Flush();
- try
- {
- obj.ice_ping();
- throw new System.ApplicationException();
- }
- catch(Ice.LocalException)
- {
- Console.Out.WriteLine("ok");
- }
-
+#endif
+ {
+ Write("testing stringToProxy... ");
+ Flush();
+ string @ref = "test:default -p 12010";
+ Ice.ObjectPrx @base = communicator.stringToProxy(@ref);
+ test(@base != null);
+ WriteLine("ok");
+
+ Write("testing checked cast... ");
+ Flush();
+ TestIntfPrx obj = TestIntfPrxHelper.checkedCast(@base);
+ test(obj != null);
+ test(obj.Equals(@base));
+ WriteLine("ok");
+
+#if !SILVERLIGHT
+ {
+ Write("creating/destroying/recreating object adapter... ");
+ Flush();
+ Ice.ObjectAdapter adapter =
+ communicator.createObjectAdapterWithEndpoints("TransientTestAdapter", "default");
+ try
+ {
+ communicator.createObjectAdapterWithEndpoints("TransientTestAdapter", "default");
+ test(false);
+ }
+ catch (Ice.AlreadyRegisteredException)
+ {
+ }
+ adapter.destroy();
+
+ //
+ // Use a different port than the first adapter to avoid an "address already in use" error.
+ //
+ adapter = communicator.createObjectAdapterWithEndpoints("TransientTestAdapter", "default");
+ adapter.destroy();
+ Console.Out.WriteLine("ok");
+ }
+#endif
+ Write("creating/activating/deactivating object adapter in one operation... ");
+ Flush();
+ obj.transient();
+ WriteLine("ok");
+
+ Write("deactivating object adapter in the server... ");
+ Flush();
+ obj.deactivate();
+ WriteLine("ok");
+
+ Write("testing whether server is gone... ");
+ Flush();
+ try
+ {
+ obj.ice_ping();
+ test(false);
+ }
+ catch(Ice.LocalException)
+ {
+ WriteLine("ok");
+ }
+
+#if !SILVERLIGHT
return obj;
- }
+#endif
+ }
}
diff --git a/cs/test/Ice/adapterDeactivation/App.xaml b/cs/test/Ice/adapterDeactivation/App.xaml
new file mode 100644
index 00000000000..eaa4c7ed634
--- /dev/null
+++ b/cs/test/Ice/adapterDeactivation/App.xaml
@@ -0,0 +1,7 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="adapterDeactivation.App"
+ >
+ <Application.Resources>
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/adapterDeactivation/App.xaml.cs b/cs/test/Ice/adapterDeactivation/App.xaml.cs
new file mode 100644
index 00000000000..b3701975102
--- /dev/null
+++ b/cs/test/Ice/adapterDeactivation/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace adapterDeactivation
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if(!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch(Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/adapterDeactivation/Makefile b/cs/test/Ice/adapterDeactivation/Makefile
index 3a7e3021ae9..f75dacd72fc 100644
--- a/cs/test/Ice/adapterDeactivation/Makefile
+++ b/cs/test/Ice/adapterDeactivation/Makefile
@@ -11,9 +11,9 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe collocated.exe
-C_SRCS = Client.cs AllTests.cs
+C_SRCS = Client.cs AllTests.cs ../../TestCommon/TestApp.cs
S_SRCS = Server.cs CookieI.cs ServantLocatorI.cs TestI.cs
-COL_SRCS = Collocated.cs AllTests.cs CookieI.cs ServantLocatorI.cs TestI.cs
+COL_SRCS = Collocated.cs AllTests.cs CookieI.cs ServantLocatorI.cs TestI.cs ../../TestCommon/TestApp.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/adapterDeactivation/Makefile.mak b/cs/test/Ice/adapterDeactivation/Makefile.mak
index 294e57e6a63..14c9aab451c 100644
--- a/cs/test/Ice/adapterDeactivation/Makefile.mak
+++ b/cs/test/Ice/adapterDeactivation/Makefile.mak
@@ -11,9 +11,9 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe collocated.exe
-C_SRCS = Client.cs AllTests.cs
+C_SRCS = Client.cs AllTests.cs ..\..\TestCommon\TestApp.cs
S_SRCS = Server.cs CookieI.cs ServantLocatorI.cs TestI.cs
-COL_SRCS = Collocated.cs AllTests.cs CookieI.cs ServantLocatorI.cs TestI.cs
+COL_SRCS = Collocated.cs AllTests.cs CookieI.cs ServantLocatorI.cs TestI.cs ..\..\TestCommon\TestApp.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/adapterDeactivation/Properties/AppManifest.xml b/cs/test/Ice/adapterDeactivation/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/adapterDeactivation/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/adapterDeactivation/Properties/AssemblyInfo.cs b/cs/test/Ice/adapterDeactivation/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..3a590bb744e
--- /dev/null
+++ b/cs/test/Ice/adapterDeactivation/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("adapterDeactivation")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("adapterDeactivation")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("2fd7fe0f-de28-4b62-bbdb-e40fa6ba823a")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/adapterDeactivation/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/adapterDeactivation/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..4ce974c4f87
--- /dev/null
+++ b/cs/test/Ice/adapterDeactivation/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Adapter Deactivation Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Adapter Deactivation Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Adapter Deactivation Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/adapterDeactivation/adapterDeactivation.csproj b/cs/test/Ice/adapterDeactivation/adapterDeactivation.csproj
new file mode 100644
index 00000000000..01398aeabe5
--- /dev/null
+++ b/cs/test/Ice/adapterDeactivation/adapterDeactivation.csproj
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{73497706-4139-4821-B8DF-E83654E6EE55}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>adapterDeactivation</RootNamespace>
+ <AssemblyName>adapterDeactivation</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>adapterDeactivation.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>adapterDeactivation.App</SilverlightAppEntry>
+ <TestPageFileName>adapterDeactivation.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/ami/AllTests.cs b/cs/test/Ice/ami/AllTests.cs
index 90c0d474d0b..1612edd5694 100644
--- a/cs/test/Ice/ami/AllTests.cs
+++ b/cs/test/Ice/ami/AllTests.cs
@@ -12,18 +12,22 @@ using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
-using Test;
-
-public class AllTests
+using Test;
+
+#if SILVERLIGHT
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+#endif
+
+public class AllTests : TestCommon.TestApp
{
- private static void test(bool b)
- {
- if(!b)
- {
- throw new System.Exception();
- }
- }
-
private class Cookie
{
public Cookie(int i)
@@ -616,7 +620,23 @@ public class AllTests
ThrowType _t;
}
+#if SILVERLIGHT
+ public override Ice.InitializationData initData()
+ {
+ Ice.InitializationData id = new Ice.InitializationData();
+ id.properties = Ice.Util.createProperties();
+ id.properties.setProperty("Ice.Warn.AMICallback", "0");
+ id.properties.setProperty("Ice.FactoryAssemblies", "ami,version=1.0.0.0");
+ return id;
+ }
+
+
+
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static void allTests(Ice.Communicator communicator)
+#endif
{
string sref = "test:default -p 12010";
Ice.ObjectPrx obj = communicator.stringToProxy(sref);
@@ -630,8 +650,8 @@ public class AllTests
Test.TestIntfControllerPrx testController = Test.TestIntfControllerPrxHelper.uncheckedCast(obj);
- Console.Out.Write("testing begin/end invocation... ");
- Console.Out.Flush();
+ Write("testing begin/end invocation... ");
+ Flush();
{
Ice.AsyncResult result;
Dictionary<string, string> ctx = new Dictionary<string, string>();
@@ -685,10 +705,10 @@ public class AllTests
{
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing async callback... ");
- Console.Out.Flush();
+ Write("testing async callback... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
Dictionary<string, string> ctx = new Dictionary<string, string>();
@@ -758,10 +778,10 @@ public class AllTests
p.begin_opWithUE(ctx, cbWC.opWithUE, cookie);
cbWC.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing response callback... ");
- Console.Out.Flush();
+ Write("testing response callback... ");
+ Flush();
{
ResponseCallback cb = new ResponseCallback();
Dictionary<string, string> ctx = new Dictionary<string, string>();
@@ -801,10 +821,10 @@ public class AllTests
p.begin_opWithUE(ctx).whenCompleted(cb.op, cb.opWithUE);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing local exceptions... ");
- Console.Out.Flush();
+ Write("testing local exceptions... ");
+ Flush();
{
Test.TestIntfPrx indirect = Test.TestIntfPrxHelper.uncheckedCast(p.ice_adapterId("dummy"));
Ice.AsyncResult r;
@@ -849,10 +869,10 @@ public class AllTests
// Expected.
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing local exceptions with async callback... ");
- Console.Out.Flush();
+ Write("testing local exceptions with async callback... ");
+ Flush();
{
Test.TestIntfPrx i = Test.TestIntfPrxHelper.uncheckedCast(p.ice_adapterId("dummy"));
AsyncCallback cb = new AsyncCallback();
@@ -884,10 +904,10 @@ public class AllTests
i.begin_op(cbWC.opEx, cookie);
cbWC.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing local exceptions with response callback... ");
- Console.Out.Flush();
+ Write("testing local exceptions with response callback... ");
+ Flush();
{
Test.TestIntfPrx i = Test.TestIntfPrxHelper.uncheckedCast(p.ice_adapterId("dummy"));
ExceptionCallback cb = new ExceptionCallback();
@@ -907,10 +927,10 @@ public class AllTests
i.begin_op().whenCompleted(cb.op, cb.ex);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing exception callback... ");
- Console.Out.Flush();
+ Write("testing exception callback... ");
+ Flush();
{
Test.TestIntfPrx i = Test.TestIntfPrxHelper.uncheckedCast(p.ice_adapterId("dummy"));
ExceptionCallback cb = new ExceptionCallback();
@@ -936,10 +956,10 @@ public class AllTests
p.begin_opWithUE().whenCompleted(cb.opWithUE);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing sent callback... ");
- Console.Out.Flush();
+ Write("testing sent callback... ");
+ Flush();
{
SentCallback cb = new SentCallback();
@@ -988,10 +1008,10 @@ public class AllTests
cb3.check();
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing illegal arguments... ");
- Console.Out.Flush();
+ Write("testing illegal arguments... ");
+ Flush();
{
Ice.AsyncResult result;
@@ -1025,10 +1045,10 @@ public class AllTests
{
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing unexpected exceptions from callback... ");
- Console.Out.Flush();
+ Write("testing unexpected exceptions from callback... ");
+ Flush();
{
Test.TestIntfPrx q = Test.TestIntfPrxHelper.uncheckedCast(p.ice_adapterId("dummy"));
ThrowType[] throwEx = new ThrowType[]{ ThrowType.LocalException, ThrowType.UserException,
@@ -1054,10 +1074,10 @@ public class AllTests
cb.check();
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing batch requests with proxy... ");
- Console.Out.Flush();
+ Write("testing batch requests with proxy... ");
+ Flush();
{
Cookie cookie = new Cookie(5);
@@ -1131,10 +1151,10 @@ public class AllTests
test(p.opBatchCount() == 0);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing batch requests with connection... ");
- Console.Out.Flush();
+ Write("testing batch requests with connection... ");
+ Flush();
{
Cookie cookie = new Cookie(5);
@@ -1208,10 +1228,10 @@ public class AllTests
test(p.opBatchCount() == 0);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing batch requests with communicator... ");
- Console.Out.Flush();
+ Write("testing batch requests with communicator... ");
+ Flush();
{
Cookie cookie = new Cookie(5);
@@ -1422,10 +1442,10 @@ public class AllTests
test(p.opBatchCount() == 0);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing AsyncResult operations... ");
- Console.Out.Flush();
+ Write("testing AsyncResult operations... ");
+ Flush();
{
{
testController.holdAdapter();
@@ -1532,7 +1552,7 @@ public class AllTests
communicator.end_flushBatchRequests(r);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
p.shutdown();
}
diff --git a/cs/test/Ice/ami/App.xaml b/cs/test/Ice/ami/App.xaml
new file mode 100644
index 00000000000..2d0e5903511
--- /dev/null
+++ b/cs/test/Ice/ami/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="ami.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/ami/App.xaml.cs b/cs/test/Ice/ami/App.xaml.cs
new file mode 100644
index 00000000000..1bd477866bc
--- /dev/null
+++ b/cs/test/Ice/ami/App.xaml.cs
@@ -0,0 +1,80 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace ami
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if(!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch (Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/ami/Makefile b/cs/test/Ice/ami/Makefile
index 8d33a2cb93d..438720aa17b 100644
--- a/cs/test/Ice/ami/Makefile
+++ b/cs/test/Ice/ami/Makefile
@@ -11,7 +11,7 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ../../TestCommon/TestApp.cs
S_SRCS = Server.cs TestI.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/ami/Makefile.mak b/cs/test/Ice/ami/Makefile.mak
index 8081d312f40..1408373b05b 100644
--- a/cs/test/Ice/ami/Makefile.mak
+++ b/cs/test/Ice/ami/Makefile.mak
@@ -11,7 +11,7 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ..\..\TestCommon\TestApp.cs
S_SRCS = Server.cs TestI.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/ami/Properties/AppManifest.xml b/cs/test/Ice/ami/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/ami/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/ami/Properties/AssemblyInfo.cs b/cs/test/Ice/ami/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..5b9a4c59623
--- /dev/null
+++ b/cs/test/Ice/ami/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("ami")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("ami")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("b9651a78-cce8-4dcf-9d08-45fa7a88d0d6")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/ami/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/ami/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..2e7ddbf04ed
--- /dev/null
+++ b/cs/test/Ice/ami/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="AMI Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>AMI Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="AMI Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/ami/ami.csproj b/cs/test/Ice/ami/ami.csproj
new file mode 100644
index 00000000000..8b9000ca981
--- /dev/null
+++ b/cs/test/Ice/ami/ami.csproj
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{7A9447E3-31BF-46DF-A3FF-B4DF792DE86F}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>ami</RootNamespace>
+ <AssemblyName>ami</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>ami.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>ami.App</SilverlightAppEntry>
+ <TestPageFileName>amiTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/background/Acceptor.cs b/cs/test/Ice/background/Acceptor.cs
index 714be24ce04..f986a7c9bf1 100644
--- a/cs/test/Ice/background/Acceptor.cs
+++ b/cs/test/Ice/background/Acceptor.cs
@@ -22,7 +22,7 @@ internal class Acceptor : IceInternal.Acceptor
_acceptor.listen();
}
- public bool startAccept(AsyncCallback callback, object state)
+ public bool startAccept(IceInternal.AsyncCallback callback, object state)
{
return _acceptor.startAccept(callback, state);
}
diff --git a/cs/test/Ice/background/Transceiver.cs b/cs/test/Ice/background/Transceiver.cs
index a3a59cc9d07..297dc9dfd90 100644
--- a/cs/test/Ice/background/Transceiver.cs
+++ b/cs/test/Ice/background/Transceiver.cs
@@ -64,7 +64,7 @@ internal class Transceiver : IceInternal.Transceiver
return _transceiver.read(buf);
}
- public bool startRead(IceInternal.Buffer buf, AsyncCallback callback, object state)
+ public bool startRead(IceInternal.Buffer buf, IceInternal.AsyncCallback callback, object state)
{
if(_configuration.readReady())
{
@@ -79,7 +79,7 @@ internal class Transceiver : IceInternal.Transceiver
_transceiver.finishRead(buf);
}
- public bool startWrite(IceInternal.Buffer buf, AsyncCallback callback, object state, out bool completed)
+ public bool startWrite(IceInternal.Buffer buf, IceInternal.AsyncCallback callback, object state, out bool completed)
{
_configuration.checkWriteException();
return _transceiver.startWrite(buf, callback, state, out completed);
diff --git a/cs/test/Ice/binding/AllTests.cs b/cs/test/Ice/binding/AllTests.cs
index 6e1545b825d..753896bcb9b 100644
--- a/cs/test/Ice/binding/AllTests.cs
+++ b/cs/test/Ice/binding/AllTests.cs
@@ -12,18 +12,22 @@ using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
-using Test;
-
-public class AllTests
+using Test;
+
+#if SILVERLIGHT
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+#endif
+
+public class AllTests : TestCommon.TestApp
{
- private static void test(bool b)
- {
- if(!b)
- {
- throw new System.Exception();
- }
- }
-
private class GetAdapterNameCB
{
public void response(string name)
@@ -71,66 +75,70 @@ public class AllTests
GetAdapterNameCB cb = new GetAdapterNameCB();
test.begin_getAdapterName().whenCompleted(cb.response, cb.exception);
return cb.getResult();
- }
-
- private static void shuffle(ref ArrayList array)
- {
- for(int i = 0; i < array.Count - 1; ++i)
- {
- int r = rand_.Next(array.Count - i) + i;
- Debug.Assert(r >= i && r < array.Count);
- if(r != i)
- {
- object tmp = array[i];
- array[i] = array[r];
- array[r] = tmp;
- }
- }
- }
-
- private static TestIntfPrx createTestIntfPrx(ArrayList adapters)
- {
- ArrayList endpoints = new ArrayList();
- TestIntfPrx obj = null;
- IEnumerator p = adapters.GetEnumerator();
- while(p.MoveNext())
- {
- obj = ((RemoteObjectAdapterPrx)p.Current).getTestIntf();
- foreach(Ice.Endpoint e in obj.ice_getEndpoints())
- {
- endpoints.Add(e);
- }
- }
- return TestIntfPrxHelper.uncheckedCast(
- obj.ice_endpoints((Ice.Endpoint[])endpoints.ToArray(typeof(Ice.Endpoint))));
- }
-
- private static void deactivate(RemoteCommunicatorPrx communicator, ArrayList adapters)
- {
- IEnumerator p = adapters.GetEnumerator();
- while(p.MoveNext())
- {
- communicator.deactivateObjectAdapter((RemoteObjectAdapterPrx)p.Current);
- }
- }
-
- private class StringComparator : IComparer
- {
- public int Compare(object l, object r)
- {
- return ((string)l).CompareTo((string)r);
- }
- };
-
+ }
+
+ private static void shuffle(ref List<RemoteObjectAdapterPrx> array)
+ {
+ for (int i = 0; i < array.Count - 1; ++i)
+ {
+ int r = rand_.Next(array.Count - i) + i;
+ Debug.Assert(r >= i && r < array.Count);
+ if (r != i)
+ {
+ RemoteObjectAdapterPrx tmp = array[i];
+ array[i] = array[r];
+ array[r] = tmp;
+ }
+ }
+ }
+
+ private static TestIntfPrx createTestIntfPrx(List<RemoteObjectAdapterPrx> adapters)
+ {
+ List<Ice.Endpoint> endpoints = new List<Ice.Endpoint>();
+ TestIntfPrx obj = null;
+ IEnumerator<RemoteObjectAdapterPrx> p = adapters.GetEnumerator();
+ while(p.MoveNext())
+ {
+ obj = p.Current.getTestIntf();
+ foreach(Ice.Endpoint e in obj.ice_getEndpoints())
+ {
+ endpoints.Add(e);
+ }
+ }
+ return TestIntfPrxHelper.uncheckedCast(obj.ice_endpoints(endpoints.ToArray()));
+ }
+
+ private static void deactivate(RemoteCommunicatorPrx communicator, List<RemoteObjectAdapterPrx> adapters)
+ {
+ IEnumerator<RemoteObjectAdapterPrx> p = adapters.GetEnumerator();
+ while (p.MoveNext())
+ {
+ communicator.deactivateObjectAdapter(p.Current);
+ }
+ }
+
+ private class StringComparator : IComparer<String>
+ {
+ public int Compare(String l, String r)
+ {
+ return l.CompareTo(r);
+ }
+ };
+
+#if SILVERLIGHT
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static void allTests(Ice.Communicator communicator)
+#endif
{
string @ref = "communicator:default -p 12010";
RemoteCommunicatorPrx com = RemoteCommunicatorPrxHelper.uncheckedCast(communicator.stringToProxy(@ref));
System.Random rand = new System.Random(unchecked((int)System.DateTime.Now.Ticks));
- Console.Out.Write("testing binding with single endpoint... ");
- Console.Out.Flush();
+ Write("testing binding with single endpoint... ");
+ Flush();
{
RemoteObjectAdapterPrx adapter = com.createObjectAdapter("Adapter", "default");
@@ -156,12 +164,12 @@ public class AllTests
{
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing binding with multiple endpoints... ");
- Console.Out.Flush();
- {
- ArrayList adapters = new ArrayList();
+ Write("testing binding with multiple endpoints... ");
+ Flush();
+ {
+ List<RemoteObjectAdapterPrx> adapters = new List<RemoteObjectAdapterPrx>();
adapters.Add(com.createObjectAdapter("Adapter11", "default"));
adapters.Add(com.createObjectAdapter("Adapter12", "default"));
adapters.Add(com.createObjectAdapter("Adapter13", "default"));
@@ -175,8 +183,8 @@ public class AllTests
names.Add("Adapter12");
names.Add("Adapter13");
while(names.Count > 0)
- {
- ArrayList adpts = new ArrayList(adapters);
+ {
+ List<RemoteObjectAdapterPrx> adpts = new List<RemoteObjectAdapterPrx>(adapters);
TestIntfPrx test1 = createTestIntfPrx(adpts);
shuffle(ref adpts);
@@ -222,8 +230,8 @@ public class AllTests
names.Add("Adapter12");
names.Add("Adapter13");
while(names.Count > 0)
- {
- ArrayList adpts = new ArrayList(adapters);
+ {
+ List<RemoteObjectAdapterPrx> adpts = new List<RemoteObjectAdapterPrx>(adapters);
TestIntfPrx test1 = createTestIntfPrx(adpts);
shuffle(ref adpts);
@@ -248,10 +256,10 @@ public class AllTests
deactivate(com, adapters);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing binding with multiple random endpoints... ");
- Console.Out.Flush();
+ Write("testing binding with multiple random endpoints... ");
+ Flush();
{
RemoteObjectAdapterPrx[] adapters = new RemoteObjectAdapterPrx[5];
adapters[0] = com.createObjectAdapter("AdapterRandom11", "default");
@@ -305,7 +313,7 @@ public class AllTests
{
adpts[j] = adapters[rand.Next(adapters.Length)];
}
- proxies[i] = createTestIntfPrx(new ArrayList(adpts));
+ proxies[i] = createTestIntfPrx(new List<RemoteObjectAdapterPrx>(adpts));
}
for(i = 0; i < proxies.Length; i++)
@@ -321,9 +329,9 @@ public class AllTests
catch(Ice.LocalException)
{
}
- }
-
- ArrayList connections = new ArrayList();
+ }
+
+ List<Ice.Connection> connections = new List<Ice.Connection>();
for(i = 0; i < proxies.Length; i++)
{
if(proxies[i].ice_getCachedConnection() != null)
@@ -349,12 +357,12 @@ public class AllTests
}
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing binding with multiple endpoints and AMI... ");
- Console.Out.Flush();
- {
- ArrayList adapters = new ArrayList();
+ Write("testing binding with multiple endpoints and AMI... ");
+ Flush();
+ {
+ List<RemoteObjectAdapterPrx> adapters = new List<RemoteObjectAdapterPrx>();
adapters.Add(com.createObjectAdapter("AdapterAMI11", "default"));
adapters.Add(com.createObjectAdapter("AdapterAMI12", "default"));
adapters.Add(com.createObjectAdapter("AdapterAMI13", "default"));
@@ -368,8 +376,8 @@ public class AllTests
names.Add("AdapterAMI12");
names.Add("AdapterAMI13");
while(names.Count > 0)
- {
- ArrayList adpts = new ArrayList(adapters);
+ {
+ List<RemoteObjectAdapterPrx> adpts = new List<RemoteObjectAdapterPrx>(adapters);
TestIntfPrx test1 = createTestIntfPrx(adpts);
shuffle(ref adpts);
@@ -415,8 +423,8 @@ public class AllTests
names.Add("AdapterAMI12");
names.Add("AdapterAMI13");
while(names.Count > 0)
- {
- ArrayList adpts = new ArrayList(adapters);
+ {
+ List<RemoteObjectAdapterPrx> adpts = new List<RemoteObjectAdapterPrx>(adapters);
TestIntfPrx test1 = createTestIntfPrx(adpts);
shuffle(ref adpts);
@@ -441,12 +449,12 @@ public class AllTests
deactivate(com, adapters);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing random endpoint selection... ");
- Console.Out.Flush();
- {
- ArrayList adapters = new ArrayList();
+ Write("testing random endpoint selection... ");
+ Flush();
+ {
+ List<RemoteObjectAdapterPrx> adapters = new List<RemoteObjectAdapterPrx>();
adapters.Add(com.createObjectAdapter("Adapter21", "default"));
adapters.Add(com.createObjectAdapter("Adapter22", "default"));
adapters.Add(com.createObjectAdapter("Adapter23", "default"));
@@ -478,12 +486,12 @@ public class AllTests
deactivate(com, adapters);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing ordered endpoint selection... ");
- Console.Out.Flush();
- {
- ArrayList adapters = new ArrayList();
+ Write("testing ordered endpoint selection... ");
+ Flush();
+ {
+ List<RemoteObjectAdapterPrx> adapters = new List<RemoteObjectAdapterPrx>();
adapters.Add(com.createObjectAdapter("Adapter31", "default"));
adapters.Add(com.createObjectAdapter("Adapter32", "default"));
adapters.Add(com.createObjectAdapter("Adapter33", "default"));
@@ -538,10 +546,10 @@ public class AllTests
deactivate(com, adapters);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing per request binding with single endpoint... ");
- Console.Out.Flush();
+ Write("testing per request binding with single endpoint... ");
+ Flush();
{
RemoteObjectAdapterPrx adapter = com.createObjectAdapter("Adapter41", "default");
@@ -565,12 +573,12 @@ public class AllTests
{
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing per request binding with multiple endpoints... ");
- Console.Out.Flush();
- {
- ArrayList adapters = new ArrayList();
+ Write("testing per request binding with multiple endpoints... ");
+ Flush();
+ {
+ List<RemoteObjectAdapterPrx> adapters = new List<RemoteObjectAdapterPrx>();
adapters.Add(com.createObjectAdapter("Adapter51", "default"));
adapters.Add(com.createObjectAdapter("Adapter52", "default"));
adapters.Add(com.createObjectAdapter("Adapter53", "default"));
@@ -603,12 +611,12 @@ public class AllTests
deactivate(com, adapters);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing per request binding with multiple endpoints and AMI... ");
- Console.Out.Flush();
- {
- ArrayList adapters = new ArrayList();
+ Write("testing per request binding with multiple endpoints and AMI... ");
+ Flush();
+ {
+ List<RemoteObjectAdapterPrx> adapters = new List<RemoteObjectAdapterPrx>();
adapters.Add(com.createObjectAdapter("AdapterAMI51", "default"));
adapters.Add(com.createObjectAdapter("AdapterAMI52", "default"));
adapters.Add(com.createObjectAdapter("AdapterAMI53", "default"));
@@ -641,12 +649,12 @@ public class AllTests
deactivate(com, adapters);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing per request binding and ordered endpoint selection... ");
- Console.Out.Flush();
- {
- ArrayList adapters = new ArrayList();
+ Write("testing per request binding and ordered endpoint selection... ");
+ Flush();
+ {
+ List<RemoteObjectAdapterPrx> adapters = new List<RemoteObjectAdapterPrx>();
adapters.Add(com.createObjectAdapter("Adapter61", "default"));
adapters.Add(com.createObjectAdapter("Adapter62", "default"));
adapters.Add(com.createObjectAdapter("Adapter63", "default"));
@@ -701,12 +709,12 @@ public class AllTests
deactivate(com, adapters);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing per request binding and ordered endpoint selection and AMI... ");
- Console.Out.Flush();
- {
- ArrayList adapters = new ArrayList();
+ Write("testing per request binding and ordered endpoint selection and AMI... ");
+ Flush();
+ {
+ List<RemoteObjectAdapterPrx> adapters = new List<RemoteObjectAdapterPrx>();
adapters.Add(com.createObjectAdapter("AdapterAMI61", "default"));
adapters.Add(com.createObjectAdapter("AdapterAMI62", "default"));
adapters.Add(com.createObjectAdapter("AdapterAMI63", "default"));
@@ -761,12 +769,13 @@ public class AllTests
deactivate(com, adapters);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing endpoint mode filtering... ");
- Console.Out.Flush();
- {
- ArrayList adapters = new ArrayList();
+#if !SILVERLIGHT
+ Write("testing endpoint mode filtering... ");
+ Flush();
+ {
+ List<RemoteObjectAdapterPrx> adapters = new List<RemoteObjectAdapterPrx>();
adapters.Add(com.createObjectAdapter("Adapter71", "default"));
adapters.Add(com.createObjectAdapter("Adapter72", "udp"));
@@ -783,14 +792,14 @@ public class AllTests
{
}
}
- Console.Out.WriteLine("ok");
-
+ WriteLine("ok");
+#endif
if(communicator.getProperties().getProperty("Ice.Plugin.IceSSL").Length > 0)
{
- Console.Out.Write("testing unsecure vs. secure endpoints... ");
- Console.Out.Flush();
- {
- ArrayList adapters = new ArrayList();
+ Write("testing unsecure vs. secure endpoints... ");
+ Flush();
+ {
+ List<RemoteObjectAdapterPrx> adapters = new List<RemoteObjectAdapterPrx>();
adapters.Add(com.createObjectAdapter("Adapter81", "ssl"));
adapters.Add(com.createObjectAdapter("Adapter82", "tcp"));
@@ -838,7 +847,7 @@ public class AllTests
deactivate(com, adapters);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
com.shutdown();
diff --git a/cs/test/Ice/binding/App.xaml b/cs/test/Ice/binding/App.xaml
new file mode 100644
index 00000000000..3f4529dd63f
--- /dev/null
+++ b/cs/test/Ice/binding/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="binding.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/binding/App.xaml.cs b/cs/test/Ice/binding/App.xaml.cs
new file mode 100644
index 00000000000..8dd2b28bf41
--- /dev/null
+++ b/cs/test/Ice/binding/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace binding
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if(!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch(Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/binding/Client.cs b/cs/test/Ice/binding/Client.cs
index d79b48bcb42..1f682148b50 100644
--- a/cs/test/Ice/binding/Client.cs
+++ b/cs/test/Ice/binding/Client.cs
@@ -41,7 +41,7 @@ public class Client
}
catch(System.Exception ex)
{
- System.Console.Error.WriteLine(ex);
+ System.Console.Error.WriteLine(ex.ToString());
status = 1;
}
diff --git a/cs/test/Ice/binding/Makefile b/cs/test/Ice/binding/Makefile
index fb9321074c5..dfac145618b 100644
--- a/cs/test/Ice/binding/Makefile
+++ b/cs/test/Ice/binding/Makefile
@@ -11,7 +11,7 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ../../TestCommon/TestApp.cs
S_SRCS = Server.cs TestI.cs RemoteObjectAdapterI.cs RemoteCommunicatorI.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/binding/Makefile.mak b/cs/test/Ice/binding/Makefile.mak
index 26f95ac08f4..0f635a61233 100644
--- a/cs/test/Ice/binding/Makefile.mak
+++ b/cs/test/Ice/binding/Makefile.mak
@@ -11,7 +11,7 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ..\..\TestCommon\TestApp.cs
S_SRCS = Server.cs TestI.cs RemoteObjectAdapterI.cs RemoteCommunicatorI.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/binding/Properties/AppManifest.xml b/cs/test/Ice/binding/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/binding/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/binding/Properties/AssemblyInfo.cs b/cs/test/Ice/binding/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..b6da22dcc94
--- /dev/null
+++ b/cs/test/Ice/binding/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("binding")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("binding")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("6b218ca6-e358-411e-9647-de0f61d5d9bb")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/binding/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/binding/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..9b8aeaca7d0
--- /dev/null
+++ b/cs/test/Ice/binding/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Binding Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Binding Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Binding Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/binding/binding.csproj b/cs/test/Ice/binding/binding.csproj
new file mode 100644
index 00000000000..814d96ccb70
--- /dev/null
+++ b/cs/test/Ice/binding/binding.csproj
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{974F0F9B-7EB4-4566-B5C8-1313AE9218A5}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>binding</RootNamespace>
+ <AssemblyName>binding</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>binding.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>binding.App</SilverlightAppEntry>
+ <TestPageFileName>bindingTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/defaultServant/Properties/AppManifest.xml b/cs/test/Ice/defaultServant/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/defaultServant/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/defaultServant/Properties/AssemblyInfo.cs b/cs/test/Ice/defaultServant/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..a4c806a38e4
--- /dev/null
+++ b/cs/test/Ice/defaultServant/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("defaultValue")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("defaultValue")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("d18112f7-647f-489c-9a63-7d56b6ce4e7c")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/defaultServant/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/defaultServant/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..f0ec824ecad
--- /dev/null
+++ b/cs/test/Ice/defaultServant/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Default Value Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Default Value Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Default Value Test" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/defaultValue/AllTests.cs b/cs/test/Ice/defaultValue/AllTests.cs
index 45c12e92666..8272d5240c1 100644
--- a/cs/test/Ice/defaultValue/AllTests.cs
+++ b/cs/test/Ice/defaultValue/AllTests.cs
@@ -7,23 +7,31 @@
//
// **********************************************************************
-using System;
+using System;
+
+#if SILVERLIGHT
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+#endif
-public class AllTests
+public class AllTests : TestCommon.TestApp
{
- private static void test(bool b)
+#if SILVERLIGHT
+ override
+ public void run(Ice.Communicator communicator)
+#else
+ public static void allTests()
+#endif
{
- if(!b)
- {
- throw new System.Exception();
- }
- }
-
- public static void
- allTests()
- {
- Console.Out.Write("testing default values... ");
- Console.Out.Flush();
+ Write("testing default values... ");
+ Flush();
{
Test.Struct1 v = new Test.Struct1();
@@ -279,6 +287,6 @@ public class AllTests
test(v.zeroDotD == 0);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
}
diff --git a/cs/test/Ice/defaultValue/App.xaml b/cs/test/Ice/defaultValue/App.xaml
new file mode 100644
index 00000000000..b2468c1c4f5
--- /dev/null
+++ b/cs/test/Ice/defaultValue/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="defaultValue.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/defaultValue/App.xaml.cs b/cs/test/Ice/defaultValue/App.xaml.cs
new file mode 100644
index 00000000000..e19e09587be
--- /dev/null
+++ b/cs/test/Ice/defaultValue/App.xaml.cs
@@ -0,0 +1,73 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace defaultValue
+{
+ public partial class App : Application
+ {
+
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if (!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch (Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/defaultValue/Makefile b/cs/test/Ice/defaultValue/Makefile
index 004dc416124..7a28790f8a3 100644
--- a/cs/test/Ice/defaultValue/Makefile
+++ b/cs/test/Ice/defaultValue/Makefile
@@ -12,7 +12,8 @@ top_srcdir = ../../..
TARGETS = client.exe
C_SRCS = Client.cs \
- AllTests.cs
+ AllTests.cs \
+ ../../TestCommon/TestApp.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/defaultValue/Makefile.mak b/cs/test/Ice/defaultValue/Makefile.mak
index bea9e32c4ec..ef8be7cb250 100644
--- a/cs/test/Ice/defaultValue/Makefile.mak
+++ b/cs/test/Ice/defaultValue/Makefile.mak
@@ -12,7 +12,8 @@ top_srcdir = ..\..\..
TARGETS = client.exe
C_SRCS = Client.cs \
- AllTests.cs
+ AllTests.cs \
+ ..\..\TestCommon\TestApp.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/defaultValue/Properties/AppManifest.xml b/cs/test/Ice/defaultValue/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/defaultValue/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/defaultValue/Properties/AssemblyInfo.cs b/cs/test/Ice/defaultValue/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..a4c806a38e4
--- /dev/null
+++ b/cs/test/Ice/defaultValue/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("defaultValue")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("defaultValue")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("d18112f7-647f-489c-9a63-7d56b6ce4e7c")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/defaultValue/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/defaultValue/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..2f3ca9a7a35
--- /dev/null
+++ b/cs/test/Ice/defaultValue/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Default Value Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Default Value Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Default Value Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/defaultValue/defaultValue.csproj b/cs/test/Ice/defaultValue/defaultValue.csproj
new file mode 100644
index 00000000000..1f9c5099034
--- /dev/null
+++ b/cs/test/Ice/defaultValue/defaultValue.csproj
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{0858ED5B-68D1-444D-912C-6147BC4FC968}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>defaultValue</RootNamespace>
+ <AssemblyName>defaultValue</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>defaultValue.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>defaultValue.App</SilverlightAppEntry>
+ <TestPageFileName>defaultValueTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/dictMapping/AllTests.cs b/cs/test/Ice/dictMapping/AllTests.cs
index 9ceb7b4e10e..38c11e49cad 100644
--- a/cs/test/Ice/dictMapping/AllTests.cs
+++ b/cs/test/Ice/dictMapping/AllTests.cs
@@ -7,35 +7,58 @@
//
// **********************************************************************
-using System;
+using System;
+
+#if SILVERLIGHT
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+#endif
-public class AllTests
+public class AllTests : TestCommon.TestApp
{
+#if SILVERLIGHT
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static Test.MyClassPrx allTests(Ice.Communicator communicator, bool collocated)
+#endif
{
- Console.Out.Flush();
+#if SILVERLIGHT
+ bool collocated = false;
+#endif
+ Flush();
string rf = "test:default -p 12010";
Ice.ObjectPrx baseProxy = communicator.stringToProxy(rf);
Test.MyClassPrx cl = Test.MyClassPrxHelper.checkedCast(baseProxy);
- Console.Out.Write("testing twoway operations... ");
- Console.Out.Flush();
+ Write("testing twoway operations... ");
+ Flush();
Twoways.twoways(communicator, cl);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
if(!collocated)
{
- Console.Out.Write("testing twoway operations with AMI... ");
- Console.Out.Flush();
+ Write("testing twoway operations with AMI... ");
+ Flush();
TwowaysAMI.twowaysAMI(communicator, cl);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing twoway operations with new AMI mapping... ");
- Console.Out.Flush();
+ Write("testing twoway operations with new AMI mapping... ");
+ Flush();
TwowaysNewAMI.twowaysAMI(communicator, cl);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
-
+#if SILVERLIGHT
+ cl.shutdown();
+#else
return cl;
+#endif
}
}
diff --git a/cs/test/Ice/dictMapping/App.xaml b/cs/test/Ice/dictMapping/App.xaml
new file mode 100644
index 00000000000..6568b08c934
--- /dev/null
+++ b/cs/test/Ice/dictMapping/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="dictMapping.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/dictMapping/App.xaml.cs b/cs/test/Ice/dictMapping/App.xaml.cs
new file mode 100644
index 00000000000..93aaa28af63
--- /dev/null
+++ b/cs/test/Ice/dictMapping/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace dictMapping
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if (!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch (Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/dictMapping/Makefile b/cs/test/Ice/dictMapping/Makefile
index 660908e7304..1badd66a8cb 100644
--- a/cs/test/Ice/dictMapping/Makefile
+++ b/cs/test/Ice/dictMapping/Makefile
@@ -11,9 +11,10 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe collocated.exe serveramd.exe
-C_SRCS = AllTests.cs Client.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs
+C_SRCS = AllTests.cs Client.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs ../../TestCommon/TestApp.cs
S_SRCS = MyClassI.cs Server.cs
-COL_SRCS = AllTests.cs Collocated.cs MyClassI.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs
+COL_SRCS = AllTests.cs Collocated.cs MyClassI.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs \
+ ../../TestCommon/TestApp.cs
SAMD_SRCS = MyClassAMDI.cs Server.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/dictMapping/Makefile.mak b/cs/test/Ice/dictMapping/Makefile.mak
index 6f77989ad2c..9225248f7b8 100644
--- a/cs/test/Ice/dictMapping/Makefile.mak
+++ b/cs/test/Ice/dictMapping/Makefile.mak
@@ -11,9 +11,9 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe collocated.exe serveramd.exe
-C_SRCS = AllTests.cs Client.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs
+C_SRCS = AllTests.cs Client.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs ..\..\TestCommon\TestApp.cs
S_SRCS = MyClassI.cs Server.cs
-COL_SRCS = AllTests.cs Collocated.cs MyClassI.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs
+COL_SRCS = AllTests.cs Collocated.cs MyClassI.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs ..\..\TestCommon\TestApp.cs
SAMD_SRCS = MyClassAMDI.cs Server.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/dictMapping/Properties/AppManifest.xml b/cs/test/Ice/dictMapping/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/dictMapping/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/dictMapping/Properties/AssemblyInfo.cs b/cs/test/Ice/dictMapping/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..5bf9f45d74a
--- /dev/null
+++ b/cs/test/Ice/dictMapping/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("dictMapping")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("dictMapping")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("f42f249d-34fb-4181-b59f-3634b60e49fc")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/dictMapping/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/dictMapping/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..f217244251d
--- /dev/null
+++ b/cs/test/Ice/dictMapping/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Dict Mapping Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Dict Mapping Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Dict Mapping Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/dictMapping/dictMapping.csproj b/cs/test/Ice/dictMapping/dictMapping.csproj
new file mode 100644
index 00000000000..d7cc8c2307a
--- /dev/null
+++ b/cs/test/Ice/dictMapping/dictMapping.csproj
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{4F085C35-BF17-4947-BB56-E5F48C1C30E8}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>dictMapping</RootNamespace>
+ <AssemblyName>dictMapping</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>dictMapping.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>dictMapping.App</SilverlightAppEntry>
+ <TestPageFileName>dictMappingTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ <Compile Include="Twoways.cs" />
+ <Compile Include="TwowaysAMI.cs" />
+ <Compile Include="TwowaysNewAMI.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/dispatcher/AllTests.cs b/cs/test/Ice/dispatcher/AllTests.cs
index 2c507dc7a48..b2122a30ca0 100644
--- a/cs/test/Ice/dispatcher/AllTests.cs
+++ b/cs/test/Ice/dispatcher/AllTests.cs
@@ -12,18 +12,22 @@ using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
-using Test;
-
-public class AllTests
+using Test;
+
+#if SILVERLIGHT
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+#endif
+
+public class AllTests : TestCommon.TestApp
{
- private static void test(bool b)
- {
- if(!b)
- {
- throw new System.Exception();
- }
- }
-
private class Callback
{
internal Callback()
@@ -95,7 +99,21 @@ public class AllTests
private readonly IceUtilInternal.Monitor _m = new IceUtilInternal.Monitor();
}
+#if SILVERLIGHT
+ public override Ice.InitializationData initData()
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties();
+ initData.properties.setProperty("Ice.Warn.AMICallback", "0");
+ initData.dispatcher = new Dispatcher().dispatch;
+ return initData;
+ }
+
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static void allTests(Ice.Communicator communicator)
+#endif
{
string sref = "test:default -p 12010";
Ice.ObjectPrx obj = communicator.stringToProxy(sref);
@@ -109,8 +127,8 @@ public class AllTests
Test.TestIntfControllerPrx testController = Test.TestIntfControllerPrxHelper.uncheckedCast(obj);
- Console.Out.Write("testing dispatcher... ");
- Console.Out.Flush();
+ Write("testing dispatcher... ");
+ Flush();
{
p.op();
@@ -134,7 +152,7 @@ public class AllTests
testController.resumeAdapter();
r.waitForCompleted();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
p.shutdown();
}
diff --git a/cs/test/Ice/dispatcher/App.xaml b/cs/test/Ice/dispatcher/App.xaml
new file mode 100644
index 00000000000..07914fc91cc
--- /dev/null
+++ b/cs/test/Ice/dispatcher/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="dispatcher.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/dispatcher/App.xaml.cs b/cs/test/Ice/dispatcher/App.xaml.cs
new file mode 100644
index 00000000000..f5186e9a17a
--- /dev/null
+++ b/cs/test/Ice/dispatcher/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace dispatcher
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if (!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch (Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/dispatcher/Makefile b/cs/test/Ice/dispatcher/Makefile
index 7148129d904..b93dbe5ba4a 100644
--- a/cs/test/Ice/dispatcher/Makefile
+++ b/cs/test/Ice/dispatcher/Makefile
@@ -11,7 +11,7 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs Dispatcher.cs
+C_SRCS = AllTests.cs Client.cs Dispatcher.cs ../../TestCommon/TestApp.cs
S_SRCS = Server.cs TestI.cs Dispatcher.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/dispatcher/Makefile.mak b/cs/test/Ice/dispatcher/Makefile.mak
index 97fcb5894a8..d5b9c440c22 100644
--- a/cs/test/Ice/dispatcher/Makefile.mak
+++ b/cs/test/Ice/dispatcher/Makefile.mak
@@ -11,7 +11,7 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs Dispatcher.cs
+C_SRCS = AllTests.cs Client.cs Dispatcher.cs ..\..\TestCommon\TestApp.cs
S_SRCS = Server.cs TestI.cs Dispatcher.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/dispatcher/Properties/AppManifest.xml b/cs/test/Ice/dispatcher/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/dispatcher/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/dispatcher/Properties/AssemblyInfo.cs b/cs/test/Ice/dispatcher/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..d1a5cc7bb8c
--- /dev/null
+++ b/cs/test/Ice/dispatcher/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("dispatcher")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("dispatcher")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("71633122-5b1a-4fc0-b636-f893e7d28d62")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/dispatcher/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/dispatcher/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..4682bc1b9e0
--- /dev/null
+++ b/cs/test/Ice/dispatcher/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Dispatcher Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Dispatcher Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Dispatcher Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/dispatcher/dispatcher.csproj b/cs/test/Ice/dispatcher/dispatcher.csproj
new file mode 100644
index 00000000000..5ad183f44d3
--- /dev/null
+++ b/cs/test/Ice/dispatcher/dispatcher.csproj
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{E71BAF76-681E-43F5-930F-8B547F4978C3}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>dispatcher</RootNamespace>
+ <AssemblyName>dispatcher</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>dispatcher.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>dispatcher.App</SilverlightAppEntry>
+ <TestPageFileName>dispatcherTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Dispatcher.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/exceptions/AllTests.cs b/cs/test/Ice/exceptions/AllTests.cs
index c2f03a86794..b9a2cbeaea1 100644
--- a/cs/test/Ice/exceptions/AllTests.cs
+++ b/cs/test/Ice/exceptions/AllTests.cs
@@ -10,18 +10,22 @@
using System;
using System.Diagnostics;
using System.Threading;
-using Test;
-
-public class AllTests
+using Test;
+
+#if SILVERLIGHT
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+#endif
+
+public class AllTests : TestCommon.TestApp
{
- private static void test(bool b)
- {
- if(!b)
- {
- throw new System.Exception();
- }
- }
-
private class Callback
{
internal Callback()
@@ -78,7 +82,7 @@ public class AllTests
}
public override void ice_response()
{
- AllTests.test(false);
+ test(false);
}
public override void ice_exception(Ice.Exception exc)
@@ -89,11 +93,11 @@ public class AllTests
}
catch(A ex)
{
- AllTests.test(ex.aMem == 1);
+ test(ex.aMem == 1);
}
catch(Exception)
{
- AllTests.test(false);
+ test(false);
}
callback.called();
}
@@ -119,7 +123,7 @@ public class AllTests
}
public override void ice_response()
{
- AllTests.test(false);
+ test(false);
}
public override void ice_exception(Ice.Exception exc)
@@ -131,11 +135,11 @@ public class AllTests
catch(Ice.ObjectNotExistException ex)
{
Ice.Identity id = communicator.stringToIdentity("does not exist");
- AllTests.test(ex.id.Equals(id));
+ test(ex.id.Equals(id));
}
catch(Exception)
{
- AllTests.test(false);
+ test(false);
}
callback.called();
}
@@ -153,7 +157,7 @@ public class AllTests
{
public override void ice_response()
{
- AllTests.test(false);
+ test(false);
}
public override void ice_exception(Ice.Exception exc)
@@ -164,11 +168,11 @@ public class AllTests
}
catch(Ice.FacetNotExistException ex)
{
- AllTests.test(ex.facet.Equals("no such facet"));
+ test(ex.facet.Equals("no such facet"));
}
catch(Exception)
{
- AllTests.test(false);
+ test(false);
}
callback.called();
}
@@ -193,7 +197,7 @@ public class AllTests
}
public override void ice_response()
{
- AllTests.test(false);
+ test(false);
}
public override void ice_exception(Ice.Exception exc)
@@ -204,15 +208,15 @@ public class AllTests
}
catch(A ex)
{
- AllTests.test(ex.aMem == 1);
+ test(ex.aMem == 1);
}
catch(D ex)
{
- AllTests.test(ex.dMem == - 1);
+ test(ex.dMem == - 1);
}
catch(Exception)
{
- AllTests.test(false);
+ test(false);
}
callback.called();
}
@@ -237,7 +241,7 @@ public class AllTests
}
public override void ice_response()
{
- AllTests.test(false);
+ test(false);
}
public override void ice_exception(Ice.Exception exc)
@@ -248,12 +252,12 @@ public class AllTests
}
catch(B ex)
{
- AllTests.test(ex.aMem == 1);
- AllTests.test(ex.bMem == 2);
+ test(ex.aMem == 1);
+ test(ex.bMem == 2);
}
catch(Exception)
{
- AllTests.test(false);
+ test(false);
}
callback.called();
}
@@ -278,7 +282,7 @@ public class AllTests
}
public override void ice_response()
{
- AllTests.test(false);
+ test(false);
}
public override void ice_exception(Ice.Exception exc)
@@ -289,13 +293,13 @@ public class AllTests
}
catch(C ex)
{
- AllTests.test(ex.aMem == 1);
- AllTests.test(ex.bMem == 2);
- AllTests.test(ex.cMem == 3);
+ test(ex.aMem == 1);
+ test(ex.bMem == 2);
+ test(ex.cMem == 3);
}
catch(Exception)
{
- AllTests.test(false);
+ test(false);
}
callback.called();
}
@@ -320,7 +324,7 @@ public class AllTests
}
public override void ice_response()
{
- AllTests.test(false);
+ test(false);
}
public override void ice_exception(Ice.Exception exc)
@@ -331,12 +335,12 @@ public class AllTests
}
catch(B ex)
{
- AllTests.test(ex.aMem == 1);
- AllTests.test(ex.bMem == 2);
+ test(ex.aMem == 1);
+ test(ex.bMem == 2);
}
catch(Exception)
{
- AllTests.test(false);
+ test(false);
}
callback.called();
}
@@ -361,7 +365,7 @@ public class AllTests
}
public override void ice_response()
{
- AllTests.test(false);
+ test(false);
}
public override void ice_exception(Ice.Exception exc)
@@ -372,13 +376,13 @@ public class AllTests
}
catch(C ex)
{
- AllTests.test(ex.aMem == 1);
- AllTests.test(ex.bMem == 2);
- AllTests.test(ex.cMem == 3);
+ test(ex.aMem == 1);
+ test(ex.bMem == 2);
+ test(ex.cMem == 3);
}
catch(Exception)
{
- AllTests.test(false);
+ test(false);
}
callback.called();
}
@@ -403,7 +407,7 @@ public class AllTests
}
public override void ice_response()
{
- AllTests.test(false);
+ test(false);
}
public override void ice_exception(Ice.Exception exc)
@@ -414,13 +418,13 @@ public class AllTests
}
catch(C ex)
{
- AllTests.test(ex.aMem == 1);
- AllTests.test(ex.bMem == 2);
- AllTests.test(ex.cMem == 3);
+ test(ex.aMem == 1);
+ test(ex.bMem == 2);
+ test(ex.cMem == 3);
}
catch(Exception)
{
- AllTests.test(false);
+ test(false);
}
callback.called();
}
@@ -445,7 +449,7 @@ public class AllTests
}
public override void ice_response()
{
- AllTests.test(false);
+ test(false);
}
public override void ice_exception(Ice.Exception exc)
@@ -459,7 +463,7 @@ public class AllTests
}
catch(Exception)
{
- AllTests.test(false);
+ test(false);
}
callback.called();
}
@@ -484,7 +488,7 @@ public class AllTests
}
public override void ice_response()
{
- AllTests.test(false);
+ test(false);
}
public override void ice_exception(Ice.Exception exc)
@@ -498,7 +502,7 @@ public class AllTests
}
catch(Exception)
{
- AllTests.test(false);
+ test(false);
}
callback.called();
}
@@ -523,7 +527,7 @@ public class AllTests
}
public override void ice_response()
{
- AllTests.test(false);
+ test(false);
}
public override void ice_exception(Ice.Exception exc)
@@ -537,7 +541,7 @@ public class AllTests
}
catch(Exception)
{
- AllTests.test(false);
+ test(false);
}
callback.called();
}
@@ -562,7 +566,7 @@ public class AllTests
}
public override void ice_response()
{
- AllTests.test(false);
+ test(false);
}
public override void ice_exception(Ice.Exception exc)
@@ -576,7 +580,7 @@ public class AllTests
}
catch(Exception)
{
- AllTests.test(false);
+ test(false);
}
callback.called();
}
@@ -601,7 +605,7 @@ public class AllTests
}
public override void ice_response()
{
- AllTests.test(false);
+ test(false);
}
public override void ice_exception(Ice.Exception exc)
@@ -615,7 +619,7 @@ public class AllTests
}
catch(Exception)
{
- AllTests.test(false);
+ test(false);
}
callback.called();
}
@@ -640,7 +644,7 @@ public class AllTests
}
public override void ice_response()
{
- AllTests.test(false);
+ test(false);
}
public override void ice_exception(Ice.Exception exc)
@@ -651,11 +655,11 @@ public class AllTests
}
catch(Ice.OperationNotExistException ex)
{
- AllTests.test(ex.operation.Equals("noSuchOperation"));
+ test(ex.operation.Equals("noSuchOperation"));
}
catch(Exception)
{
- AllTests.test(false);
+ test(false);
}
callback.called();
}
@@ -949,10 +953,30 @@ public class AllTests
private Ice.Communicator _communicator;
}
+#if SILVERLIGHT
+ public override Ice.InitializationData initData()
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties();
+ WriteLine("setting Ice.FactoryAssemblies");
+ initData.properties.setProperty("Ice.FactoryAssemblies", "exceptions,version=1.0.0.0");
+ return initData;
+ }
+
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static ThrowerPrx allTests(Ice.Communicator communicator, bool collocated)
+#endif
{
+#if SILVERLIGHT
+ bool collocated = false;
+ WriteLine("Ice.FactoryAssemblies: " + communicator.getProperties().getProperty("Ice.FactoryAssemblies"));
+#endif
+
+#if !SILVERLIGHT
{
- Console.Write("testing object adapter registration exceptions... ");
+ Write("testing object adapter registration exceptions... ");
Ice.ObjectAdapter first;
try
{
@@ -991,11 +1015,11 @@ public class AllTests
// Expected
}
first.deactivate();
- Console.WriteLine("ok");
+ WriteLine("ok");
}
{
- Console.Write("testing servant registration exceptions... ");
+ Write("testing servant registration exceptions... ");
communicator.getProperties().setProperty("TestAdapter1.Endpoints", "default");
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter1");
Ice.Object obj = new EmptyI();
@@ -1019,11 +1043,11 @@ public class AllTests
{
}
adapter.deactivate();
- Console.WriteLine("ok");
+ WriteLine("ok");
}
{
- Console.Write("testing servant locator registration exceptions... ");
+ Write("testing servant locator registration exceptions... ");
communicator.getProperties().setProperty("TestAdapter2.Endpoints", "default");
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter2");
Ice.ServantLocator loc = new ServantLocatorI();
@@ -1038,11 +1062,11 @@ public class AllTests
}
adapter.deactivate();
- Console.WriteLine("ok");
+ WriteLine("ok");
}
-
+#endif
{
- Console.Write("testing object factory registration exception... ");
+ Write("testing object factory registration exception... ");
Ice.ObjectFactory of = new ObjectFactoryI();
communicator.addObjectFactory(of, "::x");
try
@@ -1053,25 +1077,25 @@ public class AllTests
catch(Ice.AlreadyRegisteredException)
{
}
- Console.WriteLine("ok");
+ WriteLine("ok");
}
- Console.Write("testing stringToProxy... ");
- Console.Out.Flush();
+ Write("testing stringToProxy... ");
+ Flush();
String @ref = "thrower:default -p 12010";
Ice.ObjectPrx @base = communicator.stringToProxy(@ref);
test(@base != null);
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("testing checked cast... ");
- Console.Out.Flush();
+ Write("testing checked cast... ");
+ Flush();
ThrowerPrx thrower = ThrowerPrxHelper.checkedCast(@base);
test(thrower != null);
test(thrower.Equals(@base));
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("catching exact types... ");
- Console.Out.Flush();
+ Write("catching exact types... ");
+ Flush();
try
{
@@ -1146,10 +1170,10 @@ public class AllTests
test(false);
}
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("catching base types... ");
- Console.Out.Flush();
+ Write("catching base types... ");
+ Flush();
try
{
@@ -1180,10 +1204,10 @@ public class AllTests
test(false);
}
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("catching derived types... ");
- Console.Out.Flush();
+ Write("catching derived types... ");
+ Flush();
try
{
@@ -1232,12 +1256,12 @@ public class AllTests
test(false);
}
- Console.WriteLine("ok");
+ WriteLine("ok");
if(thrower.supportsUndeclaredExceptions())
{
- Console.Write("catching unknown user exception... ");
- Console.Out.Flush();
+ Write("catching unknown user exception... ");
+ Flush();
try
{
@@ -1278,11 +1302,11 @@ public class AllTests
test(false);
}
- Console.WriteLine("ok");
+ WriteLine("ok");
}
- Console.Write("catching object not exist exception... ");
- Console.Out.Flush();
+ Write("catching object not exist exception... ");
+ Flush();
{
Ice.Identity id = communicator.stringToIdentity("does not exist");
@@ -1302,10 +1326,10 @@ public class AllTests
}
}
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("catching facet not exist exception... ");
- Console.Out.Flush();
+ Write("catching facet not exist exception... ");
+ Flush();
try
{
@@ -1325,10 +1349,10 @@ public class AllTests
test(false);
}
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("catching operation not exist exception... ");
- Console.Out.Flush();
+ Write("catching operation not exist exception... ");
+ Flush();
try
{
@@ -1345,10 +1369,10 @@ public class AllTests
test(false);
}
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("catching unknown local exception... ");
- Console.Out.Flush();
+ Write("catching unknown local exception... ");
+ Flush();
try
{
@@ -1363,10 +1387,10 @@ public class AllTests
test(false);
}
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("catching unknown non-Ice exception... ");
- Console.Out.Flush();
+ Write("catching unknown non-Ice exception... ");
+ Flush();
try
{
@@ -1381,10 +1405,10 @@ public class AllTests
test(false);
}
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("testing asynchronous exceptions... ");
- Console.Out.Flush();
+ Write("testing asynchronous exceptions... ");
+ Flush();
try
{
@@ -1408,12 +1432,12 @@ public class AllTests
test(false);
}
- Console.WriteLine("ok");
+ WriteLine("ok");
if(!collocated)
{
- Console.Write("catching exact types with AMI... ");
- Console.Out.Flush();
+ Write("catching exact types with AMI... ");
+ Flush();
{
AMI_Thrower_throwAasAI cb = new AMI_Thrower_throwAasAI();
@@ -1445,10 +1469,10 @@ public class AllTests
cb.check();
}
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("catching derived types... ");
- Console.Out.Flush();
+ Write("catching derived types... ");
+ Flush();
{
AMI_Thrower_throwBasAI cb = new AMI_Thrower_throwBasAI();
@@ -1468,12 +1492,12 @@ public class AllTests
cb.check();
}
- Console.WriteLine("ok");
+ WriteLine("ok");
if(thrower.supportsUndeclaredExceptions())
{
- Console.Write("catching unknown user exception with AMI... ");
- Console.Out.Flush();
+ Write("catching unknown user exception with AMI... ");
+ Flush();
{
AMI_Thrower_throwUndeclaredAI cb = new AMI_Thrower_throwUndeclaredAI();
@@ -1493,11 +1517,11 @@ public class AllTests
cb.check();
}
- Console.WriteLine("ok");
+ WriteLine("ok");
}
- Console.Write("catching object not exist exception with AMI... ");
- Console.Out.Flush();
+ Write("catching object not exist exception with AMI... ");
+ Flush();
{
Ice.Identity id = communicator.stringToIdentity("does not exist");
@@ -1507,10 +1531,10 @@ public class AllTests
cb.check();
}
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("catching facet not exist exception with AMI... ");
- Console.Out.Flush();
+ Write("catching facet not exist exception with AMI... ");
+ Flush();
try
{
@@ -1526,10 +1550,10 @@ public class AllTests
test(false);
}
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("catching operation not exist exception with AMI... ");
- Console.Out.Flush();
+ Write("catching operation not exist exception with AMI... ");
+ Flush();
{
AMI_WrongOperation_noSuchOperationI cb = new AMI_WrongOperation_noSuchOperationI();
@@ -1538,10 +1562,10 @@ public class AllTests
cb.check();
}
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("catching unknown local exception with AMI... ");
- Console.Out.Flush();
+ Write("catching unknown local exception with AMI... ");
+ Flush();
{
AMI_Thrower_throwLocalExceptionI cb = new AMI_Thrower_throwLocalExceptionI();
@@ -1549,19 +1573,19 @@ public class AllTests
cb.check();
}
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("catching unknown non-Ice exception with AMI... ");
- Console.Out.Flush();
+ Write("catching unknown non-Ice exception with AMI... ");
+ Flush();
AMI_Thrower_throwNonIceExceptionI cb2 = new AMI_Thrower_throwNonIceExceptionI();
thrower.throwNonIceException_async(cb2);
cb2.check();
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("catching exact types with new AMI mapping... ");
- Console.Out.Flush();
+ Write("catching exact types with new AMI mapping... ");
+ Flush();
{
AsyncCallback cb3 = new AsyncCallback();
@@ -1593,10 +1617,10 @@ public class AllTests
cb3.check();
}
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("catching derived types with new AMI mapping... ");
- Console.Out.Flush();
+ Write("catching derived types with new AMI mapping... ");
+ Flush();
{
AsyncCallback cb3 = new AsyncCallback();
@@ -1616,12 +1640,12 @@ public class AllTests
cb3.check();
}
- Console.WriteLine("ok");
+ WriteLine("ok");
if(thrower.supportsUndeclaredExceptions())
{
- Console.Write("catching unknown user exception with new AMI mapping... ");
- Console.Out.Flush();
+ Write("catching unknown user exception with new AMI mapping... ");
+ Flush();
{
AsyncCallback cb3 = new AsyncCallback();
@@ -1641,11 +1665,11 @@ public class AllTests
cb3.check();
}
- Console.WriteLine("ok");
+ WriteLine("ok");
}
- Console.Write("catching object not exist exception with new AMI mapping... ");
- Console.Out.Flush();
+ Write("catching object not exist exception with new AMI mapping... ");
+ Flush();
{
Ice.Identity id = communicator.stringToIdentity("does not exist");
@@ -1655,10 +1679,10 @@ public class AllTests
cb3.check();
}
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("catching facet not exist exception with new AMI mapping... ");
- Console.Out.Flush();
+ Write("catching facet not exist exception with new AMI mapping... ");
+ Flush();
{
ThrowerPrx thrower2 = ThrowerPrxHelper.uncheckedCast(thrower, "no such facet");
@@ -1667,10 +1691,10 @@ public class AllTests
cb3.check();
}
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("catching operation not exist exception with new AMI mapping... ");
- Console.Out.Flush();
+ Write("catching operation not exist exception with new AMI mapping... ");
+ Flush();
{
AsyncCallback cb3 = new AsyncCallback();
@@ -1679,10 +1703,10 @@ public class AllTests
cb3.check();
}
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("catching unknown local exception with new AMI mapping... ");
- Console.Out.Flush();
+ Write("catching unknown local exception with new AMI mapping... ");
+ Flush();
{
AsyncCallback cb3 = new AsyncCallback();
@@ -1690,10 +1714,10 @@ public class AllTests
cb3.check();
}
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("catching unknown non-Ice exception with new AMI mapping... ");
- Console.Out.Flush();
+ Write("catching unknown non-Ice exception with new AMI mapping... ");
+ Flush();
{
AsyncCallback cb3 = new AsyncCallback();
@@ -1701,9 +1725,12 @@ public class AllTests
cb3.check();
}
- Console.WriteLine("ok");
+ WriteLine("ok");
}
-
+#if SILVERLIGHT
+ thrower.shutdown();
+#else
return thrower;
+#endif
}
}
diff --git a/cs/test/Ice/exceptions/App.xaml b/cs/test/Ice/exceptions/App.xaml
new file mode 100644
index 00000000000..1113ff2030f
--- /dev/null
+++ b/cs/test/Ice/exceptions/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="exceptions.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/exceptions/App.xaml.cs b/cs/test/Ice/exceptions/App.xaml.cs
new file mode 100644
index 00000000000..7f3e5b2b61a
--- /dev/null
+++ b/cs/test/Ice/exceptions/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace exceptions
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if (!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch (Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/exceptions/Makefile b/cs/test/Ice/exceptions/Makefile
index 81757d8cda5..d765fcb426f 100644
--- a/cs/test/Ice/exceptions/Makefile
+++ b/cs/test/Ice/exceptions/Makefile
@@ -11,9 +11,10 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe collocated.exe serveramd.exe
-C_SRCS = AllTests.cs Client.cs EmptyI.cs ObjectFactoryI.cs ServantLocatorI.cs
+C_SRCS = AllTests.cs Client.cs EmptyI.cs ObjectFactoryI.cs ServantLocatorI.cs ../../TestCommon/TestApp.cs
S_SRCS = EmptyI.cs ObjectFactoryI.cs ServantLocatorI.cs Server.cs ThrowerI.cs
-COL_SRCS = AllTests.cs Collocated.cs EmptyI.cs ObjectFactoryI.cs ServantLocatorI.cs ThrowerI.cs
+COL_SRCS = AllTests.cs Collocated.cs EmptyI.cs ObjectFactoryI.cs ServantLocatorI.cs ThrowerI.cs \
+ ../../TestCommon/TestApp.cs
SAMD_SRCS = EmptyI.cs ObjectFactoryI.cs ServantLocatorI.cs Server.cs ThrowerAMDI.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/exceptions/Makefile.mak b/cs/test/Ice/exceptions/Makefile.mak
index 905602a8ad4..f57486cf001 100644
--- a/cs/test/Ice/exceptions/Makefile.mak
+++ b/cs/test/Ice/exceptions/Makefile.mak
@@ -11,9 +11,9 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe collocated.exe serveramd.exe
-C_SRCS = AllTests.cs Client.cs EmptyI.cs ObjectFactoryI.cs ServantLocatorI.cs
+C_SRCS = AllTests.cs Client.cs EmptyI.cs ObjectFactoryI.cs ServantLocatorI.cs ..\..\TestCommon\TestApp.cs
S_SRCS = EmptyI.cs ObjectFactoryI.cs ServantLocatorI.cs Server.cs ThrowerI.cs
-COL_SRCS = AllTests.cs Collocated.cs EmptyI.cs ObjectFactoryI.cs ServantLocatorI.cs ThrowerI.cs
+COL_SRCS = AllTests.cs Collocated.cs EmptyI.cs ObjectFactoryI.cs ServantLocatorI.cs ThrowerI.cs ..\..\TestCommon\TestApp.cs
SAMD_SRCS = EmptyI.cs ObjectFactoryI.cs ServantLocatorI.cs Server.cs ThrowerAMDI.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/exceptions/Properties/AppManifest.xml b/cs/test/Ice/exceptions/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/exceptions/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/exceptions/Properties/AssemblyInfo.cs b/cs/test/Ice/exceptions/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..c40876be853
--- /dev/null
+++ b/cs/test/Ice/exceptions/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("exceptions")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("exceptions")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("fe860a01-5013-4fb3-bed2-236d1d56cdcf")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/exceptions/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/exceptions/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..aebdf0d0bb9
--- /dev/null
+++ b/cs/test/Ice/exceptions/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Exceptions Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Exceptions Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Exceptions Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/exceptions/exceptions.csproj b/cs/test/Ice/exceptions/exceptions.csproj
new file mode 100644
index 00000000000..430bf49d7e7
--- /dev/null
+++ b/cs/test/Ice/exceptions/exceptions.csproj
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{270ADFFA-8123-4C8C-B117-607A3AE4973D}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>exceptions</RootNamespace>
+ <AssemblyName>exceptions</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>exceptions.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>exceptions.App</SilverlightAppEntry>
+ <TestPageFileName>exceptionsTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="ObjectFactoryI.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/facets/AllTests.cs b/cs/test/Ice/facets/AllTests.cs
index db85e050373..b53c4286ab4 100644
--- a/cs/test/Ice/facets/AllTests.cs
+++ b/cs/test/Ice/facets/AllTests.cs
@@ -9,22 +9,31 @@
using System;
using System.Collections.Generic;
-using Test;
+using Test;
+
+#if SILVERLIGHT
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+#endif
-public class AllTests
-{
- private static void test(bool b)
- {
- if(!b)
- {
- throw new System.Exception();
- }
- }
-
+public class AllTests : TestCommon.TestApp
+{
+#if SILVERLIGHT
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static GPrx allTests(Ice.Communicator communicator)
+#endif
{
- Console.Write("testing Ice.Admin.Facets property... ");
+ Write("testing Ice.Admin.Facets property... ");
test(communicator.getProperties().getPropertyAsList("Ice.Admin.Facets").Length == 0);
communicator.getProperties().setProperty("Ice.Admin.Facets", "foobar");
String[] facetFilter = communicator.getProperties().getPropertyAsList("Ice.Admin.Facets");
@@ -43,9 +52,10 @@ public class AllTests
// facetFilter = communicator.getProperties().getPropertyAsList("Ice.Admin.Facets");
// test(facetFilter.Length == 0);
communicator.getProperties().setProperty("Ice.Admin.Facets", "");
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("testing facet registration exceptions... ");
+#if !SILVERLIGHT
+ Write("testing facet registration exceptions... ");
communicator.getProperties().setProperty("FacetExceptionTestAdapter.Endpoints", "default");
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("FacetExceptionTestAdapter");
Ice.Object obj = new EmptyI();
@@ -68,9 +78,9 @@ public class AllTests
catch(Ice.NotRegisteredException)
{
}
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("testing removeAllFacets... ");
+ Write("testing removeAllFacets... ");
Ice.Object obj1 = new EmptyI();
Ice.Object obj2 = new EmptyI();
adapter.addFacet(obj1, communicator.stringToIdentity("id1"), "f1");
@@ -97,19 +107,19 @@ public class AllTests
test(fm["f1"] == obj1);
test(fm["f2"] == obj2);
test(fm[""] == obj3);
- Console.WriteLine("ok");
+ WriteLine("ok");
adapter.deactivate();
-
- Console.Write("testing stringToProxy... ");
- Console.Out.Flush();
+#endif
+ Write("testing stringToProxy... ");
+ Flush();
string @ref = "d:default -p 12010";
Ice.ObjectPrx db = communicator.stringToProxy(@ref);
test(db != null);
- Console.WriteLine("ok");
-
- Console.Write("testing unchecked cast... ");
- Console.Out.Flush();
+ WriteLine("ok");
+
+ Write("testing unchecked cast... ");
+ Flush();
Ice.ObjectPrx prx = Ice.ObjectPrxHelper.uncheckedCast(db);
test(prx.ice_getFacet().Length == 0);
prx = Ice.ObjectPrxHelper.uncheckedCast(db, "facetABCD");
@@ -126,10 +136,10 @@ public class AllTests
test(df2.ice_getFacet() == "facetABCD");
DPrx df3 = Test.DPrxHelper.uncheckedCast(df, "");
test(df3.ice_getFacet().Length == 0);
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("testing checked cast... ");
- Console.Out.Flush();
+ Write("testing checked cast... ");
+ Flush();
prx = Ice.ObjectPrxHelper.checkedCast(db);
test(prx.ice_getFacet().Length == 0);
prx = Ice.ObjectPrxHelper.checkedCast(db, "facetABCD");
@@ -146,10 +156,10 @@ public class AllTests
test(df2.ice_getFacet() == "facetABCD");
df3 = Test.DPrxHelper.checkedCast(df, "");
test(df3.ice_getFacet().Length == 0);
- Console.WriteLine("ok");
-
- Console.Write("testing non-facets A, B, C, and D... ");
- Console.Out.Flush();
+ WriteLine("ok");
+
+ Write("testing non-facets A, B, C, and D... ");
+ Flush();
d = DPrxHelper.checkedCast(db);
test(d != null);
test(d.Equals(db));
@@ -157,41 +167,45 @@ public class AllTests
test(d.callB().Equals("B"));
test(d.callC().Equals("C"));
test(d.callD().Equals("D"));
- Console.WriteLine("ok");
-
- Console.Write("testing facets A, B, C, and D... ");
- Console.Out.Flush();
+ WriteLine("ok");
+
+ Write("testing facets A, B, C, and D... ");
+ Flush();
df = DPrxHelper.checkedCast(d, "facetABCD");
test(df != null);
test(df.callA().Equals("A"));
test(df.callB().Equals("B"));
test(df.callC().Equals("C"));
test(df.callD().Equals("D"));
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("testing facets E and F... ");
- Console.Out.Flush();
+ Write("testing facets E and F... ");
+ Flush();
FPrx ff = FPrxHelper.checkedCast(d, "facetEF");
test(ff != null);
test(ff.callE().Equals("E"));
test(ff.callF().Equals("F"));
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("testing facet G... ");
- Console.Out.Flush();
+ Write("testing facet G... ");
+ Flush();
GPrx gf = GPrxHelper.checkedCast(ff, "facetGH");
test(gf != null);
test(gf.callG().Equals("G"));
- Console.WriteLine("ok");
+ WriteLine("ok");
- Console.Write("testing whether casting preserves the facet... ");
- Console.Out.Flush();
+ Write("testing whether casting preserves the facet... ");
+ Flush();
HPrx hf = HPrxHelper.checkedCast(gf);
test(hf != null);
test(hf.callG().Equals("G"));
test(hf.callH().Equals("H"));
- Console.WriteLine("ok");
+ WriteLine("ok");
+#if SILVERLIGHT
+ gf.shutdown();
+#else
return gf;
+#endif
}
}
diff --git a/cs/test/Ice/facets/App.xaml b/cs/test/Ice/facets/App.xaml
new file mode 100644
index 00000000000..3073fc18839
--- /dev/null
+++ b/cs/test/Ice/facets/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="facets.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/facets/App.xaml.cs b/cs/test/Ice/facets/App.xaml.cs
new file mode 100644
index 00000000000..391e31dac1c
--- /dev/null
+++ b/cs/test/Ice/facets/App.xaml.cs
@@ -0,0 +1,82 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace facets
+{
+ public partial class App : Application
+ {
+
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if (!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch (Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/facets/Makefile b/cs/test/Ice/facets/Makefile
index 4ae199e529b..51c5940da2e 100644
--- a/cs/test/Ice/facets/Makefile
+++ b/cs/test/Ice/facets/Makefile
@@ -11,9 +11,10 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe collocated.exe
-C_SRCS = AllTests.cs Client.cs EmptyI.cs
+C_SRCS = AllTests.cs Client.cs EmptyI.cs ../../TestCommon/TestApp.cs
S_SRCS = AI.cs BI.cs CI.cs DI.cs EI.cs EmptyI.cs FI.cs GI.cs HI.cs Server.cs
-COL_SRCS = AI.cs AllTests.cs BI.cs CI.cs Collocated.cs DI.cs EI.cs EmptyI.cs FI.cs GI.cs HI.cs
+COL_SRCS = AI.cs AllTests.cs BI.cs CI.cs Collocated.cs DI.cs EI.cs EmptyI.cs FI.cs GI.cs HI.cs \
+ ../../TestCommon/TestApp.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/facets/Makefile.mak b/cs/test/Ice/facets/Makefile.mak
index d3bc57aaf78..e624d299657 100644
--- a/cs/test/Ice/facets/Makefile.mak
+++ b/cs/test/Ice/facets/Makefile.mak
@@ -11,9 +11,9 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe collocated.exe
-C_SRCS = AllTests.cs Client.cs EmptyI.cs
+C_SRCS = AllTests.cs Client.cs EmptyI.cs ..\..\TestCommon\TestApp.cs
S_SRCS = AI.cs BI.cs CI.cs DI.cs EI.cs EmptyI.cs FI.cs GI.cs HI.cs Server.cs
-COL_SRCS = AI.cs AllTests.cs BI.cs CI.cs Collocated.cs DI.cs EI.cs EmptyI.cs FI.cs GI.cs HI.cs
+COL_SRCS = AI.cs AllTests.cs BI.cs CI.cs Collocated.cs DI.cs EI.cs EmptyI.cs FI.cs GI.cs HI.cs ..\..\TestCommon\TestApp.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/facets/Properties/AppManifest.xml b/cs/test/Ice/facets/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/facets/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/facets/Properties/AssemblyInfo.cs b/cs/test/Ice/facets/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..f2921b04410
--- /dev/null
+++ b/cs/test/Ice/facets/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("facets")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("facets")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("aaa04446-c929-499a-b9b5-667df952d40c")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/facets/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/facets/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..b55246511ed
--- /dev/null
+++ b/cs/test/Ice/facets/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Facets Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Facets Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Facets Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/facets/facets.csproj b/cs/test/Ice/facets/facets.csproj
new file mode 100644
index 00000000000..50f84e70016
--- /dev/null
+++ b/cs/test/Ice/facets/facets.csproj
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{ACEFEC42-29BF-48E8-BF14-EB554CD06EEF}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>facets</RootNamespace>
+ <AssemblyName>facets</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>facets.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>facets.App</SilverlightAppEntry>
+ <TestPageFileName>facetsTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/faultTolerance/AllTests.cs b/cs/test/Ice/faultTolerance/AllTests.cs
index 8ef59c958ea..f1263e5d0ec 100644
--- a/cs/test/Ice/faultTolerance/AllTests.cs
+++ b/cs/test/Ice/faultTolerance/AllTests.cs
@@ -9,19 +9,24 @@
using System;
using System.Diagnostics;
-using System.Threading;
-using Test;
+using System.Threading;
+using System.Collections.Generic;
+using Test;
+
+#if SILVERLIGHT
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+#endif
-public class AllTests
+public class AllTests : TestCommon.TestApp
{
- private static void test(bool b)
- {
- if(!b)
- {
- throw new System.Exception();
- }
- }
-
private class CallbackBase
{
public CallbackBase()
@@ -126,10 +131,32 @@ public class AllTests
private CallbackBase callback = new CallbackBase();
}
- public static void allTests(Ice.Communicator communicator, System.Collections.ArrayList ports)
+#if SILVERLIGHT
+ public override Ice.InitializationData initData()
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties();
+ initData.properties.setProperty("Ice.Warn.Connections", "0");
+ return initData;
+ }
+ override
+ public void run(Ice.Communicator communicator)
+#else
+ public static void allTests(Ice.Communicator communicator, List<int> ports)
+#endif
{
- Console.Out.Write("testing stringToProxy... ");
- Console.Out.Flush();
+#if SILVERLIGHT
+ List<int> ports = new List<int>();
+ {
+ int basePort = 12340;
+ for (int i = 0; i < 12; i++)
+ {
+ ports.Add(basePort + i);
+ }
+ }
+#endif
+ Write("testing stringToProxy... ");
+ Flush();
string refString = "test";
for(int i = 0; i < ports.Count; i++)
{
@@ -137,22 +164,22 @@ public class AllTests
}
Ice.ObjectPrx basePrx = communicator.stringToProxy(refString);
test(basePrx != null);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing checked cast... ");
- Console.Out.Flush();
+ Write("testing checked cast... ");
+ Flush();
TestIntfPrx obj = TestIntfPrxHelper.checkedCast(basePrx);
test(obj != null);
test(obj.Equals(basePrx));
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
if(IceInternal.AssemblyUtil.runtime_ == IceInternal.AssemblyUtil.Runtime.Mono)
{
- Console.Out.WriteLine();
- Console.Out.WriteLine("This test aborts a number of server processes.");
- Console.Out.WriteLine("Test output may be interspersed with \"killed\" message from the shell.");
- Console.Out.WriteLine("These messages are expected and do NOT indicate a test failure.");
- Console.Out.WriteLine();
+ WriteLine("");
+ WriteLine("This test aborts a number of server processes.");
+ WriteLine("Test output may be interspersed with \"killed\" message from the shell.");
+ WriteLine("These messages are expected and do NOT indicate a test failure.");
+ WriteLine("");
}
int oldPid = 0;
@@ -167,23 +194,23 @@ public class AllTests
if(!ami)
{
- Console.Out.Write("testing server #" + i + "... ");
- Console.Out.Flush();
+ Write("testing server #" + i + "... ");
+ Flush();
int pid = obj.pid();
test(pid != oldPid);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
oldPid = pid;
}
else
{
- Console.Out.Write("testing server #" + i + " with AMI... ");
- Console.Out.Flush();
+ Write("testing server #" + i + " with AMI... ");
+ Flush();
Callback cb = new Callback();
obj.begin_pid().whenCompleted(cb.opPidI, cb.exception);
cb.check();
int pid = cb.pid();
test(pid != oldPid);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
oldPid = pid;
}
@@ -191,26 +218,26 @@ public class AllTests
{
if(!ami)
{
- Console.Out.Write("shutting down server #" + i + "... ");
- Console.Out.Flush();
+ Write("shutting down server #" + i + "... ");
+ Flush();
obj.shutdown();
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
else
{
- Console.Out.Write("shutting down server #" + i + " with AMI... ");
+ Write("shutting down server #" + i + " with AMI... ");
Callback cb = new Callback();
obj.begin_shutdown().whenCompleted(cb.opShutdownI, cb.exception);
cb.check();
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
}
else if(j == 1 || i + 1 > ports.Count)
{
if(!ami)
{
- Console.Out.Write("aborting server #" + i + "... ");
- Console.Out.Flush();
+ Write("aborting server #" + i + "... ");
+ Flush();
try
{
obj.abort();
@@ -218,33 +245,33 @@ public class AllTests
}
catch(Ice.ConnectionLostException)
{
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
catch(Ice.ConnectFailedException)
{
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
catch(Ice.SocketException)
{
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
}
else
{
- Console.Out.Write("aborting server #" + i + " with AMI... ");
- Console.Out.Flush();
+ Write("aborting server #" + i + " with AMI... ");
+ Flush();
Callback cb = new Callback();
obj.begin_abort().whenCompleted(cb.response, cb.exceptAbortI);
cb.check();
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
}
else if(j == 2 || j == 3)
{
if(!ami)
{
- Console.Out.Write("aborting server #" + i + " and #" + (i + 1) + " with idempotent call... ");
- Console.Out.Flush();
+ Write("aborting server #" + i + " and #" + (i + 1) + " with idempotent call... ");
+ Flush();
try
{
obj.idempotentAbort();
@@ -252,25 +279,25 @@ public class AllTests
}
catch(Ice.ConnectionLostException)
{
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
catch(Ice.ConnectFailedException)
{
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
catch(Ice.SocketException)
{
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
}
else
{
- Console.Out.Write("aborting server #" + i + " and #" + (i + 1) + " with idempotent AMI call... ");
- Console.Out.Flush();
+ Write("aborting server #" + i + " and #" + (i + 1) + " with idempotent AMI call... ");
+ Flush();
Callback cb = new Callback();
obj.begin_idempotentAbort().whenCompleted(cb.response, cb.exceptAbortI);
cb.check();
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
++i;
}
@@ -280,8 +307,8 @@ public class AllTests
}
}
- Console.Out.Write("testing whether all servers are gone... ");
- Console.Out.Flush();
+ Write("testing whether all servers are gone... ");
+ Flush();
try
{
obj.ice_ping();
@@ -289,7 +316,7 @@ public class AllTests
}
catch(Ice.LocalException)
{
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
}
}
diff --git a/cs/test/Ice/faultTolerance/App.xaml b/cs/test/Ice/faultTolerance/App.xaml
new file mode 100644
index 00000000000..8474f36f616
--- /dev/null
+++ b/cs/test/Ice/faultTolerance/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="faultTolerance.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/faultTolerance/App.xaml.cs b/cs/test/Ice/faultTolerance/App.xaml.cs
new file mode 100644
index 00000000000..2efa83b88b0
--- /dev/null
+++ b/cs/test/Ice/faultTolerance/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace faultTolerance
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if (!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch (Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/faultTolerance/Client.cs b/cs/test/Ice/faultTolerance/Client.cs
index a4fbec6a973..430c3046072 100644
--- a/cs/test/Ice/faultTolerance/Client.cs
+++ b/cs/test/Ice/faultTolerance/Client.cs
@@ -26,7 +26,7 @@ public class Client
private static int run(string[] args, Ice.Communicator communicator)
{
- System.Collections.ArrayList ports = new System.Collections.ArrayList(args.Length);
+ System.Collections.Generic.List<int> ports = new System.Collections.Generic.List<int>();
for(int i = 0; i < args.Length; i++)
{
int port = 0;
diff --git a/cs/test/Ice/faultTolerance/Makefile b/cs/test/Ice/faultTolerance/Makefile
index 381c84b7fa1..8477c1224fc 100644
--- a/cs/test/Ice/faultTolerance/Makefile
+++ b/cs/test/Ice/faultTolerance/Makefile
@@ -11,7 +11,7 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ../../TestCommon/TestApp.cs
S_SRCS = Server.cs TestI.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/faultTolerance/Makefile.mak b/cs/test/Ice/faultTolerance/Makefile.mak
index 45f1df85236..c3311b8332d 100644
--- a/cs/test/Ice/faultTolerance/Makefile.mak
+++ b/cs/test/Ice/faultTolerance/Makefile.mak
@@ -11,7 +11,7 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ..\..\TestCommon\TestApp.cs
S_SRCS = Server.cs TestI.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/faultTolerance/Properties/AppManifest.xml b/cs/test/Ice/faultTolerance/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/faultTolerance/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/faultTolerance/Properties/AssemblyInfo.cs b/cs/test/Ice/faultTolerance/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..cf8be0346cc
--- /dev/null
+++ b/cs/test/Ice/faultTolerance/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("faultTolerance")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("faultTolerance")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("73af01ab-3917-46fd-b75c-59ac2e5673bf")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/faultTolerance/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/faultTolerance/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..007eb13cd96
--- /dev/null
+++ b/cs/test/Ice/faultTolerance/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Fault Tolerance Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Fault Tolerance Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Fault Tolerance Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/faultTolerance/faultTolerance.csproj b/cs/test/Ice/faultTolerance/faultTolerance.csproj
new file mode 100644
index 00000000000..bafa806c158
--- /dev/null
+++ b/cs/test/Ice/faultTolerance/faultTolerance.csproj
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{61AD7756-4BB3-4772-AB43-A42F5C3CBB34}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>faultTolerance</RootNamespace>
+ <AssemblyName>faultTolerance</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>faultTolerance.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>faultTolerance.App</SilverlightAppEntry>
+ <TestPageFileName>faultToleranceTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/hold/AllTests.cs b/cs/test/Ice/hold/AllTests.cs
index 12568cc83bb..66e50543d26 100644
--- a/cs/test/Ice/hold/AllTests.cs
+++ b/cs/test/Ice/hold/AllTests.cs
@@ -8,18 +8,22 @@
// **********************************************************************
using System;
-using Test;
+using Test;
+
+#if SILVERLIGHT
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+#endif
-public class AllTests
+public class AllTests : TestCommon.TestApp
{
- private static void test(bool b)
- {
- if(!b)
- {
- throw new Exception();
- }
- }
-
private class Condition
{
public Condition(bool value)
@@ -109,20 +113,25 @@ public class AllTests
private readonly IceUtilInternal.Monitor _m = new IceUtilInternal.Monitor();
}
+#if SILVERLIGHT
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static void allTests(Ice.Communicator communicator)
+#endif
{
- Console.Out.Write("testing stringToProxy... ");
- Console.Out.Flush();
+ Write("testing stringToProxy... ");
+ Flush();
String @ref = "hold:default -p 12010";
Ice.ObjectPrx @base = communicator.stringToProxy(@ref);
test(@base != null);
String refSerialized = "hold:default -p 12011";
Ice.ObjectPrx baseSerialized = communicator.stringToProxy(refSerialized);
test(baseSerialized != null);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing checked cast... ");
- Console.Out.Flush();
+ Write("testing checked cast... ");
+ Flush();
HoldPrx hold = HoldPrxHelper.checkedCast(@base);
HoldPrx holdOneway = HoldPrxHelper.uncheckedCast(@base.ice_oneway());
test(hold != null);
@@ -131,10 +140,10 @@ public class AllTests
HoldPrx holdSerializedOneway = HoldPrxHelper.uncheckedCast(baseSerialized.ice_oneway());
test(holdSerialized != null);
test(holdSerialized.Equals(baseSerialized));
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("changing state between active and hold rapidly... ");
- Console.Out.Flush();
+ Write("changing state between active and hold rapidly... ");
+ Flush();
for(int i = 0; i < 100; ++i)
{
hold.putOnHold(0);
@@ -151,10 +160,10 @@ public class AllTests
{
holdSerializedOneway.putOnHold(0);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing without serialize mode... ");
- Console.Out.Flush();
+ Write("testing without serialize mode... ");
+ Flush();
System.Random rand = new System.Random();
{
Condition cond = new Condition(true);
@@ -185,10 +194,10 @@ public class AllTests
cb = null;
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing with serialize mode... ");
- Console.Out.Flush();
+ Write("testing with serialize mode... ");
+ Flush();
{
Condition cond = new Condition(true);
int value = 0;
@@ -221,10 +230,10 @@ public class AllTests
}
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing waitForHold... ");
- Console.Out.Flush();
+ Write("testing waitForHold... ");
+ Flush();
{
hold.waitForHold();
hold.waitForHold();
@@ -241,12 +250,12 @@ public class AllTests
hold.putOnHold(-1);
hold.ice_ping();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("changing state to hold and shutting down server... ");
- Console.Out.Flush();
+ Write("changing state to hold and shutting down server... ");
+ Flush();
hold.shutdown();
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
}
diff --git a/cs/test/Ice/hold/App.xaml b/cs/test/Ice/hold/App.xaml
new file mode 100644
index 00000000000..1f9d506a6fa
--- /dev/null
+++ b/cs/test/Ice/hold/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="hold.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/hold/App.xaml.cs b/cs/test/Ice/hold/App.xaml.cs
new file mode 100644
index 00000000000..9dd556a7635
--- /dev/null
+++ b/cs/test/Ice/hold/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace hold
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if (!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch (Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/hold/Makefile b/cs/test/Ice/hold/Makefile
index 243df134d21..3b382e7ffff 100644
--- a/cs/test/Ice/hold/Makefile
+++ b/cs/test/Ice/hold/Makefile
@@ -11,7 +11,7 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ../../TestCommon/TestApp.cs
S_SRCS = HoldI.cs Server.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/hold/Makefile.mak b/cs/test/Ice/hold/Makefile.mak
index f2d69ef4009..1b38a0d9f16 100644
--- a/cs/test/Ice/hold/Makefile.mak
+++ b/cs/test/Ice/hold/Makefile.mak
@@ -11,7 +11,7 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ..\..\TestCommon\TestApp.cs
S_SRCS = HoldI.cs Server.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/hold/Properties/AppManifest.xml b/cs/test/Ice/hold/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/hold/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/hold/Properties/AssemblyInfo.cs b/cs/test/Ice/hold/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..8c9362c5f8f
--- /dev/null
+++ b/cs/test/Ice/hold/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("hold")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("hold")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("53067721-a3df-445f-b346-81fba8cb747c")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/hold/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/hold/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..e28d2244092
--- /dev/null
+++ b/cs/test/Ice/hold/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Hold Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Hold Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Hold Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/hold/hold.csproj b/cs/test/Ice/hold/hold.csproj
new file mode 100644
index 00000000000..6849283bf62
--- /dev/null
+++ b/cs/test/Ice/hold/hold.csproj
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{44EFC26A-42E7-46A8-B371-96969E8128ED}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>hold</RootNamespace>
+ <AssemblyName>hold</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>hold.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>hold.App</SilverlightAppEntry>
+ <TestPageFileName>holdTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/info/AllTests.cs b/cs/test/Ice/info/AllTests.cs
index ac0ad323f6e..435d7efb504 100644
--- a/cs/test/Ice/info/AllTests.cs
+++ b/cs/test/Ice/info/AllTests.cs
@@ -11,23 +11,31 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
-using Test;
+using Test;
+
+#if SILVERLIGHT
+using System.Windows.Controls;
+#endif
-public class AllTests
+public class AllTests : TestCommon.TestApp
{
- private static void test(bool b)
- {
- if(!b)
- {
- throw new System.Exception();
- }
- }
-
-
+#if SILVERLIGHT
+ public override Ice.InitializationData initData()
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties();
+ initData.properties.setProperty("Ice.Default.Host", "127.0.0.1");
+ return initData;
+ }
+
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static void allTests(Ice.Communicator communicator)
+#endif
{
- Console.Out.Write("testing proxy endpoint information... ");
- Console.Out.Flush();
+ Write("testing proxy endpoint information... ");
+ Flush();
{
Ice.ObjectPrx p1 = communicator.stringToProxy("test -t:default -h tcphost -p 10000 -t 1200 -z:" +
"udp -h udphost -p 10001 --interface eth0 --ttl 5:" +
@@ -43,7 +51,7 @@ public class AllTests
test(ipEndpoint.compress);
test(!ipEndpoint.datagram());
-#if __MonoCS__ || COMPACT
+#if __MonoCS__ || COMPACT || SILVERLIGHT
test(ipEndpoint.type() == Ice.TCPEndpointType.value && !ipEndpoint.secure());
test(ipEndpoint.type() == Ice.TCPEndpointType.value && ipEndpoint is Ice.TCPEndpointInfo);
#else
@@ -67,13 +75,13 @@ public class AllTests
Ice.OpaqueEndpointInfo opaqueEndpoint = (Ice.OpaqueEndpointInfo)endps[2].getInfo();
test(opaqueEndpoint.rawBytes.Length > 0);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- string defaultHost = communicator.getProperties().getProperty("Ice.Default.Host");
+ string defaultHost = communicator.getProperties().getProperty("Ice.Default.Host");
+#if !SILVERLIGHT
Ice.ObjectAdapter adapter;
-
- Console.Out.Write("test object adapter endpoint information... ");
- Console.Out.Flush();
+ Write("test object adapter endpoint information... ");
+ Flush();
{
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -t 15000:udp");
adapter = communicator.createObjectAdapter("TestAdapter");
@@ -84,11 +92,11 @@ public class AllTests
test(IceUtilInternal.Arrays.Equals(endpoints, publishedEndpoints));
Ice.IPEndpointInfo ipEndpoint = (Ice.IPEndpointInfo)endpoints[0].getInfo();
-#if __MonoCS__ || COMPACT
+# if __MonoCS__ || COMPACT
test(ipEndpoint.type() == Ice.TCPEndpointType.value);
-#else
+# else
test(ipEndpoint.type() == Ice.TCPEndpointType.value || ipEndpoint.type() == IceSSL.EndpointType.value);
-#endif
+# endif
test(ipEndpoint.host.Equals(defaultHost));
test(ipEndpoint.port > 0);
test(ipEndpoint.timeout == 15000);
@@ -121,13 +129,14 @@ public class AllTests
adapter.destroy();
}
- Console.Out.WriteLine("ok");
-
+ WriteLine("ok");
+#endif
+
Ice.ObjectPrx @base = communicator.stringToProxy("test:default -p 12010:udp -p 12010");
TestIntfPrx testIntf = TestIntfPrxHelper.checkedCast(@base);
- Console.Out.Write("test connection endpoint information... ");
- Console.Out.Flush();
+ Write("test connection endpoint information... ");
+ Flush();
{
Ice.EndpointInfo info = @base.ice_getConnection().getEndpoint().getInfo();
Ice.IPEndpointInfo ipinfo = (Ice.IPEndpointInfo)info;
@@ -141,27 +150,32 @@ public class AllTests
int port = System.Int32.Parse(ctx["port"]);
test(port > 0);
+#if !SILVERLIGHT
info = @base.ice_datagram().ice_getConnection().getEndpoint().getInfo();
Ice.UDPEndpointInfo udp = (Ice.UDPEndpointInfo)info;
test(udp.port == 12010);
test(udp.host.Equals(defaultHost));
+#endif
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing connection information... ");
- Console.Out.Flush();
+ Write("testing connection information... ");
+ Flush();
{
Ice.IPConnectionInfo info = (Ice.IPConnectionInfo)@base.ice_getConnection().getInfo();
test(!info.incoming);
test(info.adapterName.Length == 0);
+#if !SILVERLIGHT
test(info.localPort > 0);
+ test(info.localAddress.Equals(defaultHost));
+#endif
test(info.remotePort == 12010);
test(info.remoteAddress.Equals(defaultHost));
- test(info.localAddress.Equals(defaultHost));
Dictionary<string, string> ctx = testIntf.getConnectionInfoAsContext();
test(ctx["incoming"].Equals("true"));
test(ctx["adapterName"].Equals("TestAdapter"));
+#if !SILVERLIGHT
test(ctx["remoteAddress"].Equals(info.localAddress));
test(ctx["localAddress"].Equals(info.remoteAddress));
test(ctx["remotePort"].Equals(info.localPort.ToString()));
@@ -171,11 +185,14 @@ public class AllTests
test(!info.incoming);
test(info.adapterName.Length == 0);
test(info.localPort > 0);
+#endif
test(info.remotePort == 12010);
test(info.remoteAddress.Equals(defaultHost));
+#if !SILVERLIGHT
test(info.localAddress.Equals(defaultHost));
+#endif
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
testIntf.shutdown();
diff --git a/cs/test/Ice/info/App.xaml b/cs/test/Ice/info/App.xaml
new file mode 100644
index 00000000000..a502596011f
--- /dev/null
+++ b/cs/test/Ice/info/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="info.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/info/App.xaml.cs b/cs/test/Ice/info/App.xaml.cs
new file mode 100644
index 00000000000..a2440c44c23
--- /dev/null
+++ b/cs/test/Ice/info/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace info
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if (!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch (Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/info/Makefile b/cs/test/Ice/info/Makefile
index de53d6ca9e2..cada0b5e22d 100644
--- a/cs/test/Ice/info/Makefile
+++ b/cs/test/Ice/info/Makefile
@@ -11,7 +11,7 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs TestI.cs
+C_SRCS = AllTests.cs Client.cs TestI.cs ../../TestCommon/TestApp.cs
S_SRCS = TestI.cs Server.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/info/Makefile.mak b/cs/test/Ice/info/Makefile.mak
index eec3a20c42d..8320e92a9ff 100644
--- a/cs/test/Ice/info/Makefile.mak
+++ b/cs/test/Ice/info/Makefile.mak
@@ -11,7 +11,7 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs TestI.cs
+C_SRCS = AllTests.cs Client.cs TestI.cs ..\..\TestCommon\TestApp.cs
S_SRCS = TestI.cs Server.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/info/Properties/AppManifest.xml b/cs/test/Ice/info/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/info/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/info/Properties/AssemblyInfo.cs b/cs/test/Ice/info/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..61cc9b7bcaf
--- /dev/null
+++ b/cs/test/Ice/info/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("info")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("info")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("e73785c9-f924-423c-ac91-fcc7b8884e0c")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/info/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/info/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..65472e771d1
--- /dev/null
+++ b/cs/test/Ice/info/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Info Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Info Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Info Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/info/info.csproj b/cs/test/Ice/info/info.csproj
new file mode 100644
index 00000000000..b6780729067
--- /dev/null
+++ b/cs/test/Ice/info/info.csproj
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{11F271A3-319C-4C8F-B1C6-508416D8EB6A}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>info</RootNamespace>
+ <AssemblyName>info</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>info.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>info.App</SilverlightAppEntry>
+ <TestPageFileName>infoTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/inheritance/AllTests.cs b/cs/test/Ice/inheritance/AllTests.cs
index 831b0b463d4..af3a7cc7d0b 100644
--- a/cs/test/Ice/inheritance/AllTests.cs
+++ b/cs/test/Ice/inheritance/AllTests.cs
@@ -8,36 +8,46 @@
// **********************************************************************
using System;
-using Test;
+using Test;
+
+#if SILVERLIGHT
+using System.Windows.Controls;
+#endif
-public class AllTests
-{
- private static void test(bool b)
- {
- if(!b)
- {
- throw new Exception();
- }
- }
-
+public class AllTests : TestCommon.TestApp
+{
+#if SILVERLIGHT
+ public override Ice.InitializationData initData()
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties();
+ initData.properties.setProperty("Ice.FactoryAssemblies", "inheritance,version=1.0.0.0");
+ return initData;
+ }
+
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static InitialPrx allTests(Ice.Communicator communicator)
+#endif
+
{
- Console.Out.Write("testing stringToProxy... ");
- Console.Out.Flush();
+ Write("testing stringToProxy... ");
+ Flush();
string ref_Renamed = "initial:default -p 12010";
Ice.ObjectPrx @base = communicator.stringToProxy(ref_Renamed);
test(@base != null);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing checked cast... ");
- Console.Out.Flush();
+ Write("testing checked cast... ");
+ Flush();
InitialPrx initial = InitialPrxHelper.checkedCast(@base);
test(initial != null);
test(initial.Equals(@base));
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("getting proxies for class hierarchy... ");
- Console.Out.Flush();
+ Write("getting proxies for class hierarchy... ");
+ Flush();
Test.MA.CAPrx ca = initial.caop();
Test.MB.CBPrx cb = initial.cbop();
Test.MA.CCPrx cc = initial.ccop();
@@ -48,10 +58,10 @@ public class AllTests
test(cb != cc);
test(cb != cd);
test(cc != cd);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("getting proxies for interface hierarchy... ");
- Console.Out.Flush();
+ Write("getting proxies for interface hierarchy... ");
+ Flush();
Test.MA.IAPrx ia = initial.iaop();
Test.MB.IB1Prx ib1 = initial.ib1op();
Test.MB.IB2Prx ib2 = initial.ib2op();
@@ -61,10 +71,10 @@ public class AllTests
test(ia != ic);
test(ib1 != ic);
test(ib2 != ic);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("invoking proxy operations on class hierarchy... ");
- Console.Out.Flush();
+ Write("invoking proxy operations on class hierarchy... ");
+ Flush();
Test.MA.CAPrx cao;
Test.MB.CBPrx cbo;
Test.MA.CCPrx cco;
@@ -111,10 +121,10 @@ public class AllTests
test(cbo.Equals(cc));
cco = cc.ccop(cc);
test(cco.Equals(cc));
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("ditto, but for interface hierarchy... ");
- Console.Out.Flush();
+ Write("ditto, but for interface hierarchy... ");
+ Flush();
Test.MA.IAPrx iao;
Test.MB.IB1Prx ib1o;
Test.MB.IB2Prx ib2o;
@@ -195,10 +205,10 @@ public class AllTests
test(ib2o.Equals(ic));
ico = ic.icop(ic);
test(ico.Equals(ic));
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("ditto, but for class implementing interfaces... ");
- Console.Out.Flush();
+ Write("ditto, but for class implementing interfaces... ");
+ Flush();
cao = cd.caop(cd);
test(cao.Equals(cd));
@@ -227,8 +237,12 @@ public class AllTests
test(ib1o.Equals(cd));
ib2o = cd.cdop(cd);
test(ib2o.Equals(cd));
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
+#if SILVERLIGHT
+ initial.shutdown();
+#else
return initial;
+#endif
}
}
diff --git a/cs/test/Ice/inheritance/App.xaml b/cs/test/Ice/inheritance/App.xaml
new file mode 100644
index 00000000000..0e28137edac
--- /dev/null
+++ b/cs/test/Ice/inheritance/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="inheritance.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/inheritance/App.xaml.cs b/cs/test/Ice/inheritance/App.xaml.cs
new file mode 100644
index 00000000000..c006ba5d125
--- /dev/null
+++ b/cs/test/Ice/inheritance/App.xaml.cs
@@ -0,0 +1,82 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace inheritance
+{
+ public partial class App : Application
+ {
+
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if (!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch (Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/inheritance/Makefile b/cs/test/Ice/inheritance/Makefile
index da0649427f5..5a64bc80cd8 100644
--- a/cs/test/Ice/inheritance/Makefile
+++ b/cs/test/Ice/inheritance/Makefile
@@ -11,9 +11,10 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe collocated.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ../../TestCommon/TestApp.cs
S_SRCS = CAI.cs CBI.cs CCI.cs CDI.cs IAI.cs IB1I.cs IB2I.cs ICI.cs InitialI.cs Server.cs
-COL_SRCS = AllTests.cs CAI.cs CBI.cs CCI.cs CDI.cs Collocated.cs IAI.cs IB1I.cs IB2I.cs ICI.cs InitialI.cs
+COL_SRCS = AllTests.cs CAI.cs CBI.cs CCI.cs CDI.cs Collocated.cs IAI.cs IB1I.cs IB2I.cs ICI.cs InitialI.cs \
+ ../../TestCommon/TestApp.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/inheritance/Makefile.mak b/cs/test/Ice/inheritance/Makefile.mak
index 3fc7c40823e..3a040fddc7e 100644
--- a/cs/test/Ice/inheritance/Makefile.mak
+++ b/cs/test/Ice/inheritance/Makefile.mak
@@ -11,9 +11,9 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe collocated.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ..\..\TestCommon\TestApp.cs
S_SRCS = CAI.cs CBI.cs CCI.cs CDI.cs IAI.cs IB1I.cs IB2I.cs ICI.cs InitialI.cs Server.cs
-COL_SRCS = AllTests.cs CAI.cs CBI.cs CCI.cs CDI.cs Collocated.cs IAI.cs IB1I.cs IB2I.cs ICI.cs InitialI.cs
+COL_SRCS = AllTests.cs CAI.cs CBI.cs CCI.cs CDI.cs Collocated.cs IAI.cs IB1I.cs IB2I.cs ICI.cs InitialI.cs ..\..\TestCommon\TestApp.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/inheritance/Properties/AppManifest.xml b/cs/test/Ice/inheritance/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/inheritance/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/inheritance/Properties/AssemblyInfo.cs b/cs/test/Ice/inheritance/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..a5b01514570
--- /dev/null
+++ b/cs/test/Ice/inheritance/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("inheritance")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("inheritance")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("5264c7d8-3353-469e-828a-b42f454b8d1b")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/inheritance/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/inheritance/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..6125307fba6
--- /dev/null
+++ b/cs/test/Ice/inheritance/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Inheritance Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Inheritance Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Inheritance Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/inheritance/inheritance.csproj b/cs/test/Ice/inheritance/inheritance.csproj
new file mode 100644
index 00000000000..3b5ad16607b
--- /dev/null
+++ b/cs/test/Ice/inheritance/inheritance.csproj
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{0C325152-DF80-4BFF-A412-EAC75504B393}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>inheritance</RootNamespace>
+ <AssemblyName>inheritance</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>inheritance.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>inheritance.App</SilverlightAppEntry>
+ <TestPageFileName>inheritanceTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/invoke/AllTests.cs b/cs/test/Ice/invoke/AllTests.cs
index f692237fec1..8f97c8dd9ee 100644
--- a/cs/test/Ice/invoke/AllTests.cs
+++ b/cs/test/Ice/invoke/AllTests.cs
@@ -9,9 +9,13 @@
using System;
using System.Diagnostics;
-using System.Threading;
+using System.Threading;
+
+#if SILVERLIGHT
+using System.Windows.Controls;
+#endif
-public class AllTests
+public class AllTests : TestCommon.TestApp
{
private static string testString = "This is a test string";
@@ -23,14 +27,6 @@ public class AllTests
}
}
- private static void test(bool b)
- {
- if(!b)
- {
- throw new System.Exception();
- }
- }
-
private class CallbackBase
{
internal CallbackBase()
@@ -190,15 +186,27 @@ public class AllTests
private CallbackBase callback = new CallbackBase();
}
-
+#if SILVERLIGHT
+ public override Ice.InitializationData initData()
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties();
+ initData.properties.setProperty("Ice.FactoryAssemblies", "invoke,version=1.0.0.0");
+ return initData;
+ }
+
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static Test.MyClassPrx allTests(Ice.Communicator communicator)
+#endif
{
Ice.ObjectPrx baseProxy = communicator.stringToProxy("test:default -p 12010");
Test.MyClassPrx cl = Test.MyClassPrxHelper.checkedCast(baseProxy);
Test.MyClassPrx oneway = Test.MyClassPrxHelper.uncheckedCast(cl.ice_oneway());
- Console.Out.Write("testing ice_invoke... ");
- Console.Out.Flush();
+ Write("testing ice_invoke... ");
+ Flush();
{
byte[] inParams, outParams;
@@ -248,10 +256,10 @@ public class AllTests
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing asynchronous ice_invoke... ");
- Console.Out.Flush();
+ Write("testing asynchronous ice_invoke... ");
+ Flush();
{
byte[] inParams, outParams;
@@ -336,8 +344,12 @@ public class AllTests
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
+#if SILVERLIGHT
+ cl.shutdown();
+#else
return cl;
+#endif
}
}
diff --git a/cs/test/Ice/invoke/App.xaml b/cs/test/Ice/invoke/App.xaml
new file mode 100644
index 00000000000..d5e159f3e47
--- /dev/null
+++ b/cs/test/Ice/invoke/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="invoke.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/invoke/App.xaml.cs b/cs/test/Ice/invoke/App.xaml.cs
new file mode 100644
index 00000000000..80f70d452fa
--- /dev/null
+++ b/cs/test/Ice/invoke/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace invoke
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if (!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch (Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/invoke/Makefile b/cs/test/Ice/invoke/Makefile
index f26a4ec69f9..3eeb1191b80 100644
--- a/cs/test/Ice/invoke/Makefile
+++ b/cs/test/Ice/invoke/Makefile
@@ -11,7 +11,7 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ../../TestCommon/TestApp.cs
S_SRCS = BlobjectI.cs Server.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/invoke/Makefile.mak b/cs/test/Ice/invoke/Makefile.mak
index 0527602fc87..fe0459112f9 100644
--- a/cs/test/Ice/invoke/Makefile.mak
+++ b/cs/test/Ice/invoke/Makefile.mak
@@ -11,7 +11,7 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ..\..\TestCommon\TestApp.cs
S_SRCS = Server.cs BlobjectI.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/invoke/Properties/AppManifest.xml b/cs/test/Ice/invoke/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/invoke/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/invoke/Properties/AssemblyInfo.cs b/cs/test/Ice/invoke/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..2f03e2c1123
--- /dev/null
+++ b/cs/test/Ice/invoke/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("invoke")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("invoke")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("ed22e757-0252-4801-be0f-a9977d49fe8a")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/invoke/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/invoke/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..5f8332e8c36
--- /dev/null
+++ b/cs/test/Ice/invoke/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Invoke Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Invoke Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Invoke Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/invoke/invoke.csproj b/cs/test/Ice/invoke/invoke.csproj
new file mode 100644
index 00000000000..5e730a2bb45
--- /dev/null
+++ b/cs/test/Ice/invoke/invoke.csproj
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{95E9131E-6630-4658-B48F-405DDBE0C1C9}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>invoke</RootNamespace>
+ <AssemblyName>invoke</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>invoke.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>invoke.App</SilverlightAppEntry>
+ <TestPageFileName>invokeTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/location/AllTests.cs b/cs/test/Ice/location/AllTests.cs
index f54fd85289d..c463444de8b 100644
--- a/cs/test/Ice/location/AllTests.cs
+++ b/cs/test/Ice/location/AllTests.cs
@@ -9,19 +9,27 @@
using System;
using Test;
-using System.Collections.Generic;
+using System.Collections.Generic;
+#if SILVERLIGHT
+using System.Windows.Controls;
+#endif
-public class AllTests
-{
- private static void test(bool b)
- {
- if(!b)
- {
- throw new Exception();
- }
- }
-
+public class AllTests : TestCommon.TestApp
+{
+#if SILVERLIGHT
+ public override Ice.InitializationData initData()
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties();
+ initData.properties.setProperty("Ice.Default.Locator", "locator:default -p 12010");
+ return initData;
+ }
+
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static void allTests(Ice.Communicator communicator)
+#endif
{
ServerManagerPrx manager = ServerManagerPrxHelper.checkedCast(
communicator.stringToProxy("ServerManager :default -p 12010"));
@@ -31,17 +39,17 @@ public class AllTests
TestLocatorRegistryPrx registry = TestLocatorRegistryPrxHelper.checkedCast(locator.getRegistry());
test(registry != null);
- Console.Out.Write("testing stringToProxy... ");
- Console.Out.Flush();
+ Write("testing stringToProxy... ");
+ Flush();
Ice.ObjectPrx @base = communicator.stringToProxy("test @ TestAdapter");
Ice.ObjectPrx base2 = communicator.stringToProxy("test @ TestAdapter");
Ice.ObjectPrx base3 = communicator.stringToProxy("test");
Ice.ObjectPrx base4 = communicator.stringToProxy("ServerManager");
Ice.ObjectPrx base5 = communicator.stringToProxy("test2");
Ice.ObjectPrx base6 = communicator.stringToProxy("test @ ReplicatedAdapter");
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing ice_locator and ice_getLocator... ");
+ Write("testing ice_locator and ice_getLocator... ");
test(Ice.Util.proxyIdentityCompare(@base.ice_getLocator(), communicator.getDefaultLocator()) == 0);
Ice.LocatorPrx anotherLocator =
Ice.LocatorPrxHelper.uncheckedCast(communicator.stringToProxy("anotherLocator"));
@@ -71,15 +79,15 @@ public class AllTests
communicator.setDefaultRouter(null);
@base = communicator.stringToProxy("test @ TestAdapter");
test(@base.ice_getRouter() == null);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("starting server... ");
- Console.Out.Flush();
+ Write("starting server... ");
+ Flush();
manager.startServer();
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing checked cast... ");
- Console.Out.Flush();
+ Write("testing checked cast... ");
+ Flush();
TestIntfPrx obj = TestIntfPrxHelper.checkedCast(@base);
test(obj != null);
TestIntfPrx obj2 = TestIntfPrxHelper.checkedCast(base2);
@@ -92,10 +100,10 @@ public class AllTests
test(obj5 != null);
TestIntfPrx obj6 = TestIntfPrxHelper.checkedCast(base6);
test(obj6 != null);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing id@AdapterId indirect proxy... ");
- Console.Out.Flush();
+ Write("testing id@AdapterId indirect proxy... ");
+ Flush();
obj.shutdown();
manager.startServer();
try
@@ -106,10 +114,10 @@ public class AllTests
{
test(false);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing id@ReplicaGroupId indirect proxy... ");
- Console.Out.Flush();
+ Write("testing id@ReplicaGroupId indirect proxy... ");
+ Flush();
obj.shutdown();
manager.startServer();
try
@@ -120,10 +128,10 @@ public class AllTests
{
test(false);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing identity indirect proxy... ");
- Console.Out.Flush();
+ Write("testing identity indirect proxy... ");
+ Flush();
obj.shutdown();
manager.startServer();
try
@@ -191,10 +199,10 @@ public class AllTests
{
test(false);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing proxy with unknown identity... ");
- Console.Out.Flush();
+ Write("testing proxy with unknown identity... ");
+ Flush();
try
{
@base = communicator.stringToProxy("unknown/unknown");
@@ -206,10 +214,10 @@ public class AllTests
test(ex.kindOfObject.Equals("object"));
test(ex.id.Equals("unknown/unknown"));
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing proxy with unknown adapter... ");
- Console.Out.Flush();
+ Write("testing proxy with unknown adapter... ");
+ Flush();
try
{
@base = communicator.stringToProxy("test @ TestAdapterUnknown");
@@ -221,10 +229,10 @@ public class AllTests
test(ex.kindOfObject.Equals("object adapter"));
test(ex.id.Equals("TestAdapterUnknown"));
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing locator cache timeout... ");
- Console.Out.Flush();
+ Write("testing locator cache timeout... ");
+ Flush();
int count = locator.getRequestCount();
communicator.stringToProxy("test@TestAdapter").ice_locatorCacheTimeout(0).ice_ping(); // No locator cache.
@@ -258,10 +266,10 @@ public class AllTests
test(communicator.stringToProxy("test").ice_locatorCacheTimeout(99).ice_getLocatorCacheTimeout() == 99);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing proxy from server... ");
- Console.Out.Flush();
+ Write("testing proxy from server... ");
+ Flush();
obj = TestIntfPrxHelper.checkedCast(communicator.stringToProxy("test@TestAdapter"));
HelloPrx hello = obj.getHello();
test(hello.ice_getAdapterId().Equals("TestAdapter"));
@@ -269,10 +277,10 @@ public class AllTests
hello = obj.getReplicatedHello();
test(hello.ice_getAdapterId().Equals("ReplicatedAdapter"));
hello.sayHello();
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing locator request queuing... ");
- Console.Out.Flush();
+ Write("testing locator request queuing... ");
+ Flush();
hello = (HelloPrx)obj.getReplicatedHello().ice_locatorCacheTimeout(0).ice_connectionCached(false);
count = locator.getRequestCount();
hello.ice_ping();
@@ -299,7 +307,7 @@ public class AllTests
test(locator.getRequestCount() > count && locator.getRequestCount() < count + 999);
if(locator.getRequestCount() > count + 800)
{
- Console.Out.Write("queuing = " + (locator.getRequestCount() - count));
+ Write("queuing = " + (locator.getRequestCount() - count));
}
count = locator.getRequestCount();
hello = (HelloPrx)hello.ice_adapterId("unknown");
@@ -326,12 +334,12 @@ public class AllTests
test(locator.getRequestCount() > count && locator.getRequestCount() < count + 1999);
if(locator.getRequestCount() > count + 800)
{
- Console.Out.Write("queuing = " + (locator.getRequestCount() - count));
+ Write("queuing = " + (locator.getRequestCount() - count));
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing adapter locator cache... ");
- Console.Out.Flush();
+ Write("testing adapter locator cache... ");
+ Flush();
try
{
communicator.stringToProxy("test@TestAdapter3").ice_ping();
@@ -379,10 +387,10 @@ public class AllTests
{
test(false);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing well-known object locator cache... ");
- Console.Out.Flush();
+ Write("testing well-known object locator cache... ");
+ Flush();
registry.addObject(communicator.stringToProxy("test3@TestUnknown"));
try
{
@@ -467,10 +475,10 @@ public class AllTests
catch(Ice.NoEndpointException)
{
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing locator cache background updates... ");
- Console.Out.Flush();
+ Write("testing locator cache background updates... ");
+ Flush();
{
Ice.InitializationData initData = new Ice.InitializationData();
initData.properties = communicator.getProperties().ice_clone_();
@@ -524,18 +532,18 @@ public class AllTests
}
ic.destroy();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing proxy from server after shutdown... ");
- Console.Out.Flush();
+ Write("testing proxy from server after shutdown... ");
+ Flush();
hello = obj.getReplicatedHello();
obj.shutdown();
manager.startServer();
hello.sayHello();
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing object migration... ");
- Console.Out.Flush();
+ Write("testing object migration... ");
+ Flush();
hello = HelloPrxHelper.checkedCast(communicator.stringToProxy("hello"));
obj.migrateHello();
hello.sayHello();
@@ -543,15 +551,15 @@ public class AllTests
hello.sayHello();
obj.migrateHello();
hello.sayHello();
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("shutdown server... ");
- Console.Out.Flush();
+ Write("shutdown server... ");
+ Flush();
obj.shutdown();
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing whether server is gone... ");
- Console.Out.Flush();
+ Write("testing whether server is gone... ");
+ Flush();
try
{
obj2.ice_ping();
@@ -576,10 +584,11 @@ public class AllTests
catch(Ice.LocalException)
{
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing indirect proxies to collocated objects... ");
- Console.Out.Flush();
+#if !SILVERLIGHT
+ Write("testing indirect proxies to collocated objects... ");
+ Flush();
//
// Set up test for calling a collocated object through an
@@ -606,11 +615,14 @@ public class AllTests
{
}
adapter.deactivate();
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("shutdown server manager... ");
- Console.Out.Flush();
+ Write("shutdown server manager... ");
+ Flush();
+ manager.shutdown();
+ WriteLine("ok");
+#else
manager.shutdown();
- Console.Out.WriteLine("ok");
+#endif
}
}
diff --git a/cs/test/Ice/location/App.xaml b/cs/test/Ice/location/App.xaml
new file mode 100644
index 00000000000..e24aaa3d564
--- /dev/null
+++ b/cs/test/Ice/location/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="location.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/location/App.xaml.cs b/cs/test/Ice/location/App.xaml.cs
new file mode 100644
index 00000000000..70fa3410ce7
--- /dev/null
+++ b/cs/test/Ice/location/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace location
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if (!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch (Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/location/Makefile b/cs/test/Ice/location/Makefile
index e1b0a16881f..cea8719a616 100644
--- a/cs/test/Ice/location/Makefile
+++ b/cs/test/Ice/location/Makefile
@@ -11,7 +11,7 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs HelloI.cs
+C_SRCS = AllTests.cs Client.cs HelloI.cs ../../TestCommon/TestApp.cs
S_SRCS = HelloI.cs Server.cs ServerLocator.cs ServerLocatorRegistry.cs ServerManagerI.cs TestI.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/location/Makefile.mak b/cs/test/Ice/location/Makefile.mak
index e17d2fbafb5..5cab0dcf7b4 100644
--- a/cs/test/Ice/location/Makefile.mak
+++ b/cs/test/Ice/location/Makefile.mak
@@ -11,7 +11,7 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs HelloI.cs
+C_SRCS = AllTests.cs Client.cs HelloI.cs ..\..\TestCommon\TestApp.cs
S_SRCS = HelloI.cs Server.cs ServerLocator.cs ServerLocatorRegistry.cs ServerManagerI.cs TestI.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/location/Properties/AppManifest.xml b/cs/test/Ice/location/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/location/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/location/Properties/AssemblyInfo.cs b/cs/test/Ice/location/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..b0ad1a86c20
--- /dev/null
+++ b/cs/test/Ice/location/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("location")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("location")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("05699060-e3cb-4aa0-98f3-193dcad053e1")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/location/Properties/InBrowserSettings.xml b/cs/test/Ice/location/Properties/InBrowserSettings.xml
new file mode 100644
index 00000000000..3b6382d71c5
--- /dev/null
+++ b/cs/test/Ice/location/Properties/InBrowserSettings.xml
@@ -0,0 +1,5 @@
+<InBrowserSettings>
+ <InBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="NotRequired" />
+ </InBrowserSettings.SecuritySettings>
+</InBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/location/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/location/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..f9bab939f8b
--- /dev/null
+++ b/cs/test/Ice/location/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Location Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Location Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Location Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/location/location.csproj b/cs/test/Ice/location/location.csproj
new file mode 100644
index 00000000000..4385032946c
--- /dev/null
+++ b/cs/test/Ice/location/location.csproj
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{1170795D-9EE2-472A-AC4F-18F77255292C}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>location</RootNamespace>
+ <AssemblyName>location</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>location.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>location.App</SilverlightAppEntry>
+ <TestPageFileName>locationTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ <InBrowserSettingsFile>Properties\InBrowserSettings.xml</InBrowserSettingsFile>
+ <RequireInBrowserElevation>false</RequireInBrowserElevation>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\InBrowserSettings.xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/objects/AllTests.cs b/cs/test/Ice/objects/AllTests.cs
index 735babc2917..b8f554bf172 100644
--- a/cs/test/Ice/objects/AllTests.cs
+++ b/cs/test/Ice/objects/AllTests.cs
@@ -7,61 +7,130 @@
//
// **********************************************************************
-using System;
+using System;
+using System.Diagnostics;
using Test;
-public class AllTests
-{
- private static void test(bool b)
- {
- if(!b)
- {
- throw new Exception();
- }
+#if SILVERLIGHT
+using System.Windows.Controls;
+#endif
+
+public class AllTests : TestCommon.TestApp
+{
+ private class MyObjectFactory : Ice.ObjectFactory
+ {
+ public Ice.Object create(string type)
+ {
+ if (type.Equals("::Test::B"))
+ {
+ return new BI();
+ }
+ else if (type.Equals("::Test::C"))
+ {
+ return new CI();
+ }
+ else if (type.Equals("::Test::D"))
+ {
+ return new DI();
+ }
+ else if (type.Equals("::Test::E"))
+ {
+ return new EI();
+ }
+ else if (type.Equals("::Test::F"))
+ {
+ return new FI();
+ }
+ else if (type.Equals("::Test::I"))
+ {
+ return new II();
+ }
+ else if (type.Equals("::Test::J"))
+ {
+ return new JI();
+ }
+ else if (type.Equals("::Test::H"))
+ {
+ return new HI();
+ }
+ Debug.Assert(false); // Should never be reached
+ return null;
+ }
+
+ public void
+ destroy()
+ {
+ // Nothing to do
+ }
}
-
+#if SILVERLIGHT
+ public override Ice.InitializationData initData()
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties();
+ initData.properties.setProperty("Ice.FactoryAssemblies", "objects,version=1.0.0.0");
+ return initData;
+ }
+
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static InitialPrx allTests(Ice.Communicator communicator, bool collocated)
+#endif
{
- Console.Out.Write("testing stringToProxy... ");
- Console.Out.Flush();
+#if SILVERLIGHT
+ bool collocated = false;
+#endif
+ Ice.ObjectFactory factory = new MyObjectFactory();
+ communicator.addObjectFactory(factory, "::Test::B");
+ communicator.addObjectFactory(factory, "::Test::C");
+ communicator.addObjectFactory(factory, "::Test::D");
+ communicator.addObjectFactory(factory, "::Test::E");
+ communicator.addObjectFactory(factory, "::Test::F");
+ communicator.addObjectFactory(factory, "::Test::I");
+ communicator.addObjectFactory(factory, "::Test::J");
+ communicator.addObjectFactory(factory, "::Test::H");
+
+ Write("testing stringToProxy... ");
+ Flush();
String @ref = "initial:default -p 12010";
Ice.ObjectPrx @base = communicator.stringToProxy(@ref);
test(@base != null);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing checked cast... ");
- Console.Out.Flush();
+ Write("testing checked cast... ");
+ Flush();
InitialPrx initial = InitialPrxHelper.checkedCast(@base);
test(initial != null);
test(initial.Equals(@base));
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("getting B1... ");
- Console.Out.Flush();
+ Write("getting B1... ");
+ Flush();
B b1 = initial.getB1();
test(b1 != null);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("getting B2... ");
- Console.Out.Flush();
+ Write("getting B2... ");
+ Flush();
B b2 = initial.getB2();
test(b2 != null);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("getting C... ");
- Console.Out.Flush();
+ Write("getting C... ");
+ Flush();
C c = initial.getC();
test(c != null);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("getting D... ");
- Console.Out.Flush();
+ Write("getting D... ");
+ Flush();
D d = initial.getD();
test(d != null);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("checking consistency... ");
- Console.Out.Flush();
+ Write("checking consistency... ");
+ Flush();
test(b1 != b2);
//test(b1 != c);
//test(b1 != d);
@@ -88,10 +157,10 @@ public class AllTests
// sufficient.
test(b2.theA == b2);
test(d.theC == null);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("getting B1, B2, C, and D all at once... ");
- Console.Out.Flush();
+ Write("getting B1, B2, C, and D all at once... ");
+ Flush();
B b1out;
B b2out;
C cout;
@@ -101,10 +170,10 @@ public class AllTests
test(b2out != null);
test(cout != null);
test(dout != null);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("checking consistency... ");
- Console.Out.Flush();
+ Write("checking consistency... ");
+ Flush();
test(b1out != b2out);
test(b1out.theA == b2out);
test(b1out.theB == b1out);
@@ -127,10 +196,10 @@ public class AllTests
test(dout.theB.theC.preMarshalInvoked);
test(dout.theB.theC.postUnmarshalInvoked());
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing protected members... ");
- Console.Out.Flush();
+ Write("testing protected members... ");
+ Flush();
E e = initial.getE();
test(e.checkValues());
System.Reflection.BindingFlags flags = System.Reflection.BindingFlags.NonPublic |
@@ -143,29 +212,29 @@ public class AllTests
test(f.e2.checkValues());
test(!typeof(F).GetField("e1", flags).IsPublic && !typeof(F).GetField("e1", flags).IsPrivate);
test(typeof(F).GetField("e2", flags).IsPublic && !typeof(F).GetField("e2", flags).IsPrivate);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("getting I, J and H... ");
- Console.Out.Flush();
+ Write("getting I, J and H... ");
+ Flush();
I i = initial.getI();
test(i != null);
I j = initial.getJ();
test(j != null && ((J)j) != null);
I h = initial.getH();
test(h != null && ((H)h) != null);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("setting I... ");
- Console.Out.Flush();
+ Write("setting I... ");
+ Flush();
initial.setI(i);
initial.setI(j);
initial.setI(h);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
if(!collocated)
{
- Console.Out.Write("testing UnexpectedObjectException...");
- Console.Out.Flush();
+ Write("testing UnexpectedObjectException...");
+ Flush();
@ref = "uoet:default -p 12010";
@base = communicator.stringToProxy(@ref);
test(@base != null);
@@ -183,12 +252,15 @@ public class AllTests
}
catch(System.Exception ex)
{
- Console.Out.WriteLine(ex);
+ WriteLine(ex.ToString());
test(false);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
-
+#if SILVERLIGHT
+ initial.shutdown();
+#else
return initial;
+#endif
}
}
diff --git a/cs/test/Ice/objects/App.xaml b/cs/test/Ice/objects/App.xaml
new file mode 100644
index 00000000000..f66e01941e2
--- /dev/null
+++ b/cs/test/Ice/objects/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="objects.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/objects/App.xaml.cs b/cs/test/Ice/objects/App.xaml.cs
new file mode 100644
index 00000000000..c3b0fcb83ba
--- /dev/null
+++ b/cs/test/Ice/objects/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace objects
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if(!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch(Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/objects/Client.cs b/cs/test/Ice/objects/Client.cs
index 10e3bbb996d..c001184a2d1 100644
--- a/cs/test/Ice/objects/Client.cs
+++ b/cs/test/Ice/objects/Client.cs
@@ -20,65 +20,8 @@ using System.Reflection;
public class Client
{
- private class MyObjectFactory : Ice.ObjectFactory
- {
- public Ice.Object create(string type)
- {
- if(type.Equals("::Test::B"))
- {
- return new BI();
- }
- else if(type.Equals("::Test::C"))
- {
- return new CI();
- }
- else if(type.Equals("::Test::D"))
- {
- return new DI();
- }
- else if(type.Equals("::Test::E"))
- {
- return new EI();
- }
- else if(type.Equals("::Test::F"))
- {
- return new FI();
- }
- else if(type.Equals("::Test::I"))
- {
- return new II();
- }
- else if(type.Equals("::Test::J"))
- {
- return new JI();
- }
- else if(type.Equals("::Test::H"))
- {
- return new HI();
- }
- Debug.Assert(false); // Should never be reached
- return null;
- }
-
- public void
- destroy()
- {
- // Nothing to do
- }
- }
-
private static int run(string[] args, Ice.Communicator communicator)
{
- Ice.ObjectFactory factory = new MyObjectFactory();
- communicator.addObjectFactory(factory, "::Test::B");
- communicator.addObjectFactory(factory, "::Test::C");
- communicator.addObjectFactory(factory, "::Test::D");
- communicator.addObjectFactory(factory, "::Test::E");
- communicator.addObjectFactory(factory, "::Test::F");
- communicator.addObjectFactory(factory, "::Test::I");
- communicator.addObjectFactory(factory, "::Test::J");
- communicator.addObjectFactory(factory, "::Test::H");
-
InitialPrx initial = AllTests.allTests(communicator, false);
initial.shutdown();
return 0;
diff --git a/cs/test/Ice/objects/Makefile b/cs/test/Ice/objects/Makefile
index de85931fd2a..2452355c717 100644
--- a/cs/test/Ice/objects/Makefile
+++ b/cs/test/Ice/objects/Makefile
@@ -11,11 +11,11 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe collocated.exe
-C_SRCS = AllTests.cs BI.cs CI.cs DI.cs EI.cs FI.cs II.cs JI.cs HI.cs Client.cs
+C_SRCS = AllTests.cs BI.cs CI.cs DI.cs EI.cs FI.cs II.cs JI.cs HI.cs Client.cs ../../TestCommon/TestApp.cs
S_SRCS = InitialI.cs BI.cs CI.cs DI.cs EI.cs FI.cs II.cs JI.cs HI.cs Server.cs \
UnexpectedObjectExceptionTestI.cs
COL_SRCS = AllTests.cs BI.cs CI.cs DI.cs EI.cs FI.cs II.cs JI.cs HI.cs Collocated.cs InitialI.cs \
- UnexpectedObjectExceptionTestI.cs
+ UnexpectedObjectExceptionTestI.cs ../../TestCommon/TestApp.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/objects/Makefile.mak b/cs/test/Ice/objects/Makefile.mak
index b4a4d49bd07..24031e22a8a 100644
--- a/cs/test/Ice/objects/Makefile.mak
+++ b/cs/test/Ice/objects/Makefile.mak
@@ -11,11 +11,11 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe collocated.exe
-C_SRCS = AllTests.cs BI.cs CI.cs DI.cs EI.cs FI.cs II.cs JI.cs HI.cs Client.cs
+C_SRCS = AllTests.cs BI.cs CI.cs DI.cs EI.cs FI.cs II.cs JI.cs HI.cs Client.cs ..\..\TestCommon\TestApp.cs
S_SRCS = InitialI.cs BI.cs CI.cs DI.cs EI.cs FI.cs II.cs JI.cs HI.cs Server.cs \
UnexpectedObjectExceptionTestI.cs
COL_SRCS = AllTests.cs BI.cs CI.cs DI.cs EI.cs FI.cs II.cs JI.cs HI.cs Collocated.cs InitialI.cs \
- UnexpectedObjectExceptionTestI.cs
+ UnexpectedObjectExceptionTestI.cs ..\..\TestCommon\TestApp.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/objects/Properties/AppManifest.xml b/cs/test/Ice/objects/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/objects/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/objects/Properties/AssemblyInfo.cs b/cs/test/Ice/objects/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..24c6835e918
--- /dev/null
+++ b/cs/test/Ice/objects/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("objects")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("objects")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("ea52e19b-9e94-442f-9cf3-0c49e4a37bda")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/objects/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/objects/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..2d8b4348747
--- /dev/null
+++ b/cs/test/Ice/objects/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Objects Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Objects Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Objects Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/objects/objects.csproj b/cs/test/Ice/objects/objects.csproj
new file mode 100644
index 00000000000..f2bc3fe729f
--- /dev/null
+++ b/cs/test/Ice/objects/objects.csproj
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{B4C71555-2292-44E2-B5C6-9EB3C92FF308}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>objects</RootNamespace>
+ <AssemblyName>objects</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>objects.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>objects.App</SilverlightAppEntry>
+ <TestPageFileName>objectsTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="BI.cs" />
+ <Compile Include="CI.cs" />
+ <Compile Include="DI.cs" />
+ <Compile Include="EI.cs" />
+ <Compile Include="FI.cs" />
+ <Compile Include="HI.cs" />
+ <Compile Include="II.cs" />
+ <Compile Include="JI.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/operations/AllTests.cs b/cs/test/Ice/operations/AllTests.cs
index 666103aee55..ece2e4490f1 100644
--- a/cs/test/Ice/operations/AllTests.cs
+++ b/cs/test/Ice/operations/AllTests.cs
@@ -7,61 +7,96 @@
//
// **********************************************************************
-using System;
+using System;
+
+#if SILVERLIGHT
+using System.Windows.Controls;
+#endif
-public class AllTests
+public class AllTests : TestCommon.TestApp
{
+#if SILVERLIGHT
+ public override Ice.InitializationData initData()
+ {
+ //
+ // In this test, we need at least two threads in the
+ // client side thread pool for nested AMI.
+ //
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties();
+ initData.properties.setProperty("Ice.ThreadPool.Client.Size", "2");
+ initData.properties.setProperty("Ice.ThreadPool.Client.SizeWarn", "0");
+
+ //
+ // We must set MessageSizeMax to an explicit values,
+ // because we run tests to check whether
+ // Ice.MemoryLimitException is raised as expected.
+ //
+ initData.properties.setProperty("Ice.MessageSizeMax", "100");
+ return initData;
+ }
+
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static Test.MyClassPrx allTests(Ice.Communicator communicator, bool collocated)
+#endif
{
- Console.Out.Flush();
+#if SILVERLIGHT
+ bool collocated = false;
+#endif
+ Flush();
string rf = "test:default -p 12010";
Ice.ObjectPrx baseProxy = communicator.stringToProxy(rf);
Test.MyClassPrx cl = Test.MyClassPrxHelper.checkedCast(baseProxy);
Test.MyDerivedClassPrx derivedProxy = Test.MyDerivedClassPrxHelper.checkedCast(cl);
- Console.Out.Write("testing twoway operations... ");
- Console.Out.Flush();
+ Write("testing twoway operations... ");
+ Flush();
Twoways.twoways(communicator, cl);
Twoways.twoways(communicator, derivedProxy);
derivedProxy.opDerived();
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing oneway operations... ");
- Console.Out.Flush();
+ Write("testing oneway operations... ");
+ Flush();
Oneways.oneways(communicator, cl);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
if(!collocated)
{
- Console.Out.Write("testing twoway operations with AMI... ");
- Console.Out.Flush();
+ Write("testing twoway operations with AMI... ");
+ Flush();
TwowaysAMI.twowaysAMI(communicator, cl);
TwowaysAMI.twowaysAMI(communicator, derivedProxy);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing twoway operations with new AMI mapping... ");
- Console.Out.Flush();
+ Write("testing twoway operations with new AMI mapping... ");
+ Flush();
TwowaysNewAMI.twowaysNewAMI(communicator, cl);
TwowaysNewAMI.twowaysNewAMI(communicator, derivedProxy);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing oneway operations with AMI... ");
- Console.Out.Flush();
+ Write("testing oneway operations with AMI... ");
+ Flush();
OnewaysAMI.onewaysAMI(communicator, cl);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing oneway operations with new AMI mapping... ");
- Console.Out.Flush();
+ Write("testing oneway operations with new AMI mapping... ");
+ Flush();
OnewaysNewAMI.onewaysNewAMI(communicator, cl);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing batch oneway operations... ");
- Console.Out.Flush();
+ Write("testing batch oneway operations... ");
+ Flush();
BatchOneways.batchOneways(cl);
BatchOneways.batchOneways(derivedProxy);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
-
+#if SILVERLIGHT
+ cl.shutdown();
+#else
return cl;
+#endif
}
}
diff --git a/cs/test/Ice/operations/App.xaml b/cs/test/Ice/operations/App.xaml
new file mode 100644
index 00000000000..e1fc027a78a
--- /dev/null
+++ b/cs/test/Ice/operations/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="operations.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/operations/App.xaml.cs b/cs/test/Ice/operations/App.xaml.cs
new file mode 100644
index 00000000000..d328417721d
--- /dev/null
+++ b/cs/test/Ice/operations/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace operations
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if (!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch (Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/operations/Makefile b/cs/test/Ice/operations/Makefile
index 4fbbf7a5f4f..8a7aed1dad4 100644
--- a/cs/test/Ice/operations/Makefile
+++ b/cs/test/Ice/operations/Makefile
@@ -12,9 +12,11 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe collocated.exe serveramd.exe servertie.exe serveramdtie.exe
C_SRCS = AllTests.cs Client.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs BatchOneways.cs \
+ ../../TestCommon/TestApp.cs \
Oneways.cs OnewaysAMI.cs OnewaysNewAMI.cs
S_SRCS = MyDerivedClassI.cs Server.cs
COL_SRCS = AllTests.cs Collocated.cs MyDerivedClassI.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs \
+ ../../TestCommon/TestApp.cs \
BatchOneways.cs Oneways.cs \
OnewaysAMI.cs OnewaysNewAMI.cs
SAMD_SRCS = MyDerivedClassAMDI.cs Server.cs
diff --git a/cs/test/Ice/operations/Makefile.mak b/cs/test/Ice/operations/Makefile.mak
index a5db9cc1e10..d928f9cdd38 100644
--- a/cs/test/Ice/operations/Makefile.mak
+++ b/cs/test/Ice/operations/Makefile.mak
@@ -12,10 +12,10 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe collocated.exe serveramd.exe servertie.exe serveramdtie.exe
C_SRCS = AllTests.cs Client.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs BatchOneways.cs Oneways.cs \
- OnewaysAMI.cs OnewaysNewAMI.cs
+ OnewaysAMI.cs OnewaysNewAMI.cs ..\..\TestCommon\TestApp.cs
S_SRCS = MyDerivedClassI.cs Server.cs
COL_SRCS = AllTests.cs Collocated.cs MyDerivedClassI.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs \
- BatchOneways.cs Oneways.cs OnewaysAMI.cs OnewaysNewAMI.cs
+ BatchOneways.cs Oneways.cs OnewaysAMI.cs OnewaysNewAMI.cs ..\..\TestCommon\TestApp.cs
SAMD_SRCS = MyDerivedClassAMDI.cs Server.cs
STIE_SRCS = MyDerivedClassTieI.cs Server.cs
SAMD_TIE_SRCS = MyDerivedClassAMDTieI.cs Server.cs
diff --git a/cs/test/Ice/operations/Properties/AppManifest.xml b/cs/test/Ice/operations/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/operations/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/operations/Properties/AssemblyInfo.cs b/cs/test/Ice/operations/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..bc440189708
--- /dev/null
+++ b/cs/test/Ice/operations/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("operations")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("operations")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("bda4efb4-5cf6-4ecb-98b1-985ae4e97632")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/operations/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/operations/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..416e8d6fe4b
--- /dev/null
+++ b/cs/test/Ice/operations/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Operations Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Operations Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Operations Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/operations/operations.csproj b/cs/test/Ice/operations/operations.csproj
new file mode 100644
index 00000000000..01a08cb0870
--- /dev/null
+++ b/cs/test/Ice/operations/operations.csproj
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{EEF0327D-EAA7-49B4-80B9-7CC265A7AD96}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>operations</RootNamespace>
+ <AssemblyName>operations</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>operations.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>operations.App</SilverlightAppEntry>
+ <TestPageFileName>operationsTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="BatchOneways.cs" />
+ <Compile Include="Oneways.cs" />
+ <Compile Include="OnewaysAMI.cs" />
+ <Compile Include="OnewaysNewAMI.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ <Compile Include="Twoways.cs" />
+ <Compile Include="TwowaysAMI.cs" />
+ <Compile Include="TwowaysNewAMI.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/proxy/AllTests.cs b/cs/test/Ice/proxy/AllTests.cs
index a96e0a0a2d6..2ac79859a9c 100644
--- a/cs/test/Ice/proxy/AllTests.cs
+++ b/cs/test/Ice/proxy/AllTests.cs
@@ -9,22 +9,23 @@
using System;
using System.Collections.Generic;
-using System.Diagnostics;
+using System.Diagnostics;
+
+#if SILVERLIGHT
+using System.Windows.Controls;
+#endif
-public class AllTests
+public class AllTests : TestCommon.TestApp
{
- private static void test(bool b)
- {
- if (!b)
- {
- throw new Exception();
- }
- }
-
+#if SILVERLIGHT
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static Test.MyClassPrx allTests(Ice.Communicator communicator)
+#endif
{
- Console.Out.Write("testing stringToProxy... ");
- Console.Out.Flush();
+ Write("testing stringToProxy... ");
+ Flush();
string rf = "test:default -p 12010";
Ice.ObjectPrx baseProxy = communicator.stringToProxy(rf);
test(baseProxy != null);
@@ -244,10 +245,10 @@ public class AllTests
catch(Ice.EndpointParseException)
{
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing propertyToProxy... ");
- Console.Out.Flush();
+ Write("testing propertyToProxy... ");
+ Flush();
Ice.Properties prop = communicator.getProperties();
String propertyPrefix = "Foo.Proxy";
prop.setProperty(propertyPrefix, "test:default -p 12010");
@@ -262,8 +263,14 @@ public class AllTests
prop.setProperty(property, "locator:default -p 10000");
b1 = communicator.propertyToProxy(propertyPrefix);
test(b1.ice_getLocator() != null && b1.ice_getLocator().ice_getIdentity().name.Equals("locator"));
- prop.setProperty(property, "");
-
+ try
+ {
+ prop.setProperty(property, "");
+ }
+ catch(Exception ex)
+ {
+ System.Console.WriteLine(ex.ToString());
+ }
property = propertyPrefix + ".LocatorCacheTimeout";
test(b1.ice_getLocatorCacheTimeout() == -1);
prop.setProperty(property, "1");
@@ -336,10 +343,10 @@ public class AllTests
prop.setProperty(property, "");
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing proxyToProperty... ");
- Console.Out.Flush();
+ Write("testing proxyToProperty... ");
+ Flush();
b1 = communicator.stringToProxy("test");
b1 = b1.ice_collocationOptimized(true);
@@ -389,14 +396,14 @@ public class AllTests
test(proxyProps["Test.Locator.Router.EndpointSelection"].Equals("Random"));
test(proxyProps["Test.Locator.Router.LocatorCacheTimeout"].Equals("200"));
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing ice_getCommunicator... ");
- Console.Out.Flush();
+ Write("testing ice_getCommunicator... ");
+ Flush();
test(baseProxy.ice_getCommunicator() == communicator);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing proxy methods... ");
+ Write("testing proxy methods... ");
test(communicator.identityToString(
baseProxy.ice_identity(communicator.stringToIdentity("other")).ice_getIdentity()).Equals("other"));
test(baseProxy.ice_facet("facet").ice_getFacet().Equals("facet"));
@@ -412,10 +419,10 @@ public class AllTests
test(!baseProxy.ice_collocationOptimized(false).ice_isCollocationOptimized());
test(baseProxy.ice_preferSecure(true).ice_isPreferSecure());
test(!baseProxy.ice_preferSecure(false).ice_isPreferSecure());
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing proxy comparison... ");
- Console.Out.Flush();
+ Write("testing proxy comparison... ");
+ Flush();
test(communicator.stringToProxy("foo").Equals(communicator.stringToProxy("foo")));
test(!communicator.stringToProxy("foo").Equals(communicator.stringToProxy("foo2")));
@@ -505,10 +512,10 @@ public class AllTests
//
// TODO: Ideally we should also test comparison of fixed proxies.
//
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing checked cast... ");
- Console.Out.Flush();
+ Write("testing checked cast... ");
+ Flush();
Test.MyClassPrx cl = Test.MyClassPrxHelper.checkedCast(baseProxy);
test(cl != null);
Test.MyDerivedClassPrx derived = Test.MyDerivedClassPrxHelper.checkedCast(cl);
@@ -516,10 +523,10 @@ public class AllTests
test(cl.Equals(baseProxy));
test(derived.Equals(baseProxy));
test(cl.Equals(derived));
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing checked cast with context... ");
- Console.Out.Flush();
+ Write("testing checked cast with context... ");
+ Flush();
Dictionary<string, string> c = cl.getContext();
test(c == null || c.Count == 0);
@@ -530,10 +537,10 @@ public class AllTests
cl = Test.MyClassPrxHelper.checkedCast(baseProxy, c);
Dictionary<string, string> c2 = cl.getContext();
test(Ice.CollectionComparer.Equals(c, c2));
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing opaque endpoints... ");
- Console.Out.Flush();
+ Write("testing opaque endpoints... ");
+ Flush();
try
{
@@ -709,8 +716,11 @@ public class AllTests
}
}
- Console.Out.WriteLine("ok");
-
+ WriteLine("ok");
+#if SILVERLIGHT
+ cl.shutdown();
+#else
return cl;
+#endif
}
}
diff --git a/cs/test/Ice/proxy/App.xaml b/cs/test/Ice/proxy/App.xaml
new file mode 100644
index 00000000000..391fa54d9b8
--- /dev/null
+++ b/cs/test/Ice/proxy/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="proxy.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/proxy/App.xaml.cs b/cs/test/Ice/proxy/App.xaml.cs
new file mode 100644
index 00000000000..8ad879db76e
--- /dev/null
+++ b/cs/test/Ice/proxy/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace proxy
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if (!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch (Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/proxy/Makefile b/cs/test/Ice/proxy/Makefile
index de0fb97ed79..d3f9919ee30 100644
--- a/cs/test/Ice/proxy/Makefile
+++ b/cs/test/Ice/proxy/Makefile
@@ -11,9 +11,9 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe collocated.exe serveramd.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ../../TestCommon/TestApp.cs
S_SRCS = MyDerivedClassI.cs Server.cs
-COL_SRCS = AllTests.cs Collocated.cs MyDerivedClassI.cs
+COL_SRCS = AllTests.cs Collocated.cs MyDerivedClassI.cs ../../TestCommon/TestApp.cs
SAMD_SRCS = MyDerivedClassAMDI.cs Server.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/proxy/Makefile.mak b/cs/test/Ice/proxy/Makefile.mak
index d6286d8f75c..1a01b9be17e 100644
--- a/cs/test/Ice/proxy/Makefile.mak
+++ b/cs/test/Ice/proxy/Makefile.mak
@@ -11,9 +11,9 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe collocated.exe serveramd.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ..\..\TestCommon\TestApp.cs
S_SRCS = MyDerivedClassI.cs Server.cs
-COL_SRCS = AllTests.cs Collocated.cs MyDerivedClassI.cs
+COL_SRCS = AllTests.cs Collocated.cs MyDerivedClassI.cs ..\..\TestCommon\TestApp.cs
SAMD_SRCS = MyDerivedClassAMDI.cs Server.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/proxy/Properties/AppManifest.xml b/cs/test/Ice/proxy/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/proxy/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/proxy/Properties/AssemblyInfo.cs b/cs/test/Ice/proxy/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..60624fd2999
--- /dev/null
+++ b/cs/test/Ice/proxy/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("proxy")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("proxy")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("967de86e-70d2-4b7e-98cb-191318e47157")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/proxy/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/proxy/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..31903b75392
--- /dev/null
+++ b/cs/test/Ice/proxy/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Proxy Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Proxy Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Proxy Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/proxy/proxy.csproj b/cs/test/Ice/proxy/proxy.csproj
new file mode 100644
index 00000000000..d10b79758a5
--- /dev/null
+++ b/cs/test/Ice/proxy/proxy.csproj
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{B558C1F5-CC5A-4D64-848F-BD196AFB1FC7}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>proxy</RootNamespace>
+ <AssemblyName>proxy</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>proxy.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>proxy.App</SilverlightAppEntry>
+ <TestPageFileName>proxyTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/retry/AllTests.cs b/cs/test/Ice/retry/AllTests.cs
index 8f6a50d527e..5ec5c3b0a7b 100644
--- a/cs/test/Ice/retry/AllTests.cs
+++ b/cs/test/Ice/retry/AllTests.cs
@@ -9,18 +9,14 @@
using System;
using System.Diagnostics;
-using System.Threading;
+using System.Threading;
+
+#if SILVERLIGHT
+using System.Windows.Controls;
+#endif
-public class AllTests
+public class AllTests : TestCommon.TestApp
{
- private static void test(bool b)
- {
- if(!b)
- {
- throw new Exception();
- }
- }
-
private class Callback
{
internal Callback()
@@ -106,34 +102,39 @@ public class AllTests
private Callback callback = new Callback();
}
+#if SILVERLIGHT
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static Test.RetryPrx allTests(Ice.Communicator communicator)
+#endif
{
- Console.Out.Write("testing stringToProxy... ");
- Console.Out.Flush();
+ Write("testing stringToProxy... ");
+ Flush();
string rf = "retry:default -p 12010";
Ice.ObjectPrx base1 = communicator.stringToProxy(rf);
test(base1 != null);
Ice.ObjectPrx base2 = communicator.stringToProxy(rf);
test(base2 != null);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing checked cast... ");
- Console.Out.Flush();
+ Write("testing checked cast... ");
+ Flush();
Test.RetryPrx retry1 = Test.RetryPrxHelper.checkedCast(base1);
test(retry1 != null);
test(retry1.Equals(base1));
Test.RetryPrx retry2 = Test.RetryPrxHelper.checkedCast(base2);
test(retry2 != null);
test(retry2.Equals(base2));
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("calling regular operation with first proxy... ");
- Console.Out.Flush();
+ Write("calling regular operation with first proxy... ");
+ Flush();
retry1.op(false);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("calling operation to kill connection with second proxy... ");
- Console.Out.Flush();
+ Write("calling operation to kill connection with second proxy... ");
+ Flush();
try
{
retry2.op(true);
@@ -141,32 +142,35 @@ public class AllTests
}
catch(Ice.ConnectionLostException)
{
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
- Console.Out.Write("calling regular operation with first proxy again... ");
- Console.Out.Flush();
+ Write("calling regular operation with first proxy again... ");
+ Flush();
retry1.op(false);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
AMIRegular cb1 = new AMIRegular();
AMIException cb2 = new AMIException();
- Console.Out.Write("calling regular AMI operation with first proxy... ");
+ Write("calling regular AMI operation with first proxy... ");
retry1.begin_op(false).whenCompleted(cb1.response, cb1.exception);
cb1.check();
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("calling AMI operation to kill connection with second proxy... ");
+ Write("calling AMI operation to kill connection with second proxy... ");
retry2.begin_op(true).whenCompleted(cb2.response, cb2.exception);
cb2.check();
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("calling regular AMI operation with first proxy again... ");
+ Write("calling regular AMI operation with first proxy again... ");
retry1.begin_op(false).whenCompleted(cb1.response, cb1.exception);
cb1.check();
- Console.Out.WriteLine("ok");
-
+ WriteLine("ok");
+#if SILVERLIGHT
+ retry1.shutdown();
+#else
return retry1;
+#endif
}
}
diff --git a/cs/test/Ice/retry/App.xaml b/cs/test/Ice/retry/App.xaml
new file mode 100644
index 00000000000..fb234f48f43
--- /dev/null
+++ b/cs/test/Ice/retry/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="retry.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/retry/App.xaml.cs b/cs/test/Ice/retry/App.xaml.cs
new file mode 100644
index 00000000000..1190c9cc11b
--- /dev/null
+++ b/cs/test/Ice/retry/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace retry
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if (!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch (Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/retry/Makefile b/cs/test/Ice/retry/Makefile
index 3f2faef10fa..651dcda5566 100644
--- a/cs/test/Ice/retry/Makefile
+++ b/cs/test/Ice/retry/Makefile
@@ -11,7 +11,7 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ../../TestCommon/TestApp.cs
S_SRCS = RetryI.cs Server.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/retry/Makefile.mak b/cs/test/Ice/retry/Makefile.mak
index e64d1b62256..9d7f1a2990a 100644
--- a/cs/test/Ice/retry/Makefile.mak
+++ b/cs/test/Ice/retry/Makefile.mak
@@ -11,7 +11,7 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ..\..\TestCommon\TestApp.cs
S_SRCS = RetryI.cs Server.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/retry/Properties/AppManifest.xml b/cs/test/Ice/retry/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/retry/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/retry/Properties/AssemblyInfo.cs b/cs/test/Ice/retry/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..5226a6758f6
--- /dev/null
+++ b/cs/test/Ice/retry/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("retry")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("retry")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("efbdcebb-806c-49d4-94e8-a966e6c5d441")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/retry/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/retry/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..839e7476e00
--- /dev/null
+++ b/cs/test/Ice/retry/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Retry Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Retry Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Retry Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/retry/retry.csproj b/cs/test/Ice/retry/retry.csproj
new file mode 100644
index 00000000000..e8009cbdc48
--- /dev/null
+++ b/cs/test/Ice/retry/retry.csproj
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{59049797-A1DC-4D8E-BCC2-B2A86C8DFA99}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>retry</RootNamespace>
+ <AssemblyName>retry</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>retry.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>retry.App</SilverlightAppEntry>
+ <TestPageFileName>retryTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/seqMapping/AllTests.cs b/cs/test/Ice/seqMapping/AllTests.cs
index 9ceb7b4e10e..7dc1671ec8b 100644
--- a/cs/test/Ice/seqMapping/AllTests.cs
+++ b/cs/test/Ice/seqMapping/AllTests.cs
@@ -7,35 +7,58 @@
//
// **********************************************************************
-using System;
+using System;
+
+#if SILVERLIGHT
+using System.Windows.Controls;
+#endif
-public class AllTests
+public class AllTests : TestCommon.TestApp
{
+#if SILVERLIGHT
+ public override Ice.InitializationData initData()
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties();
+ initData.properties.setProperty("Ice.FactoryAssemblies", "seqMapping,version=1.0.0.0");
+ return initData;
+ }
+
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static Test.MyClassPrx allTests(Ice.Communicator communicator, bool collocated)
+#endif
{
- Console.Out.Flush();
+#if SILVERLIGHT
+ bool collocated = false;
+#endif
+ Flush();
string rf = "test:default -p 12010";
Ice.ObjectPrx baseProxy = communicator.stringToProxy(rf);
Test.MyClassPrx cl = Test.MyClassPrxHelper.checkedCast(baseProxy);
- Console.Out.Write("testing twoway operations... ");
- Console.Out.Flush();
+ Write("testing twoway operations... ");
+ Flush();
Twoways.twoways(communicator, cl);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
if(!collocated)
{
- Console.Out.Write("testing twoway operations with AMI... ");
- Console.Out.Flush();
+ Write("testing twoway operations with AMI... ");
+ Flush();
TwowaysAMI.twowaysAMI(communicator, cl);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing twoway operations with new AMI mapping... ");
- Console.Out.Flush();
+ Write("testing twoway operations with new AMI mapping... ");
+ Flush();
TwowaysNewAMI.twowaysAMI(communicator, cl);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
-
+#if SILVERLIGHT
+ cl.shutdown();
+#else
return cl;
+#endif
}
}
diff --git a/cs/test/Ice/seqMapping/App.xaml b/cs/test/Ice/seqMapping/App.xaml
new file mode 100644
index 00000000000..4043dbfbaa3
--- /dev/null
+++ b/cs/test/Ice/seqMapping/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="seqMapping.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/seqMapping/App.xaml.cs b/cs/test/Ice/seqMapping/App.xaml.cs
new file mode 100644
index 00000000000..c8742779077
--- /dev/null
+++ b/cs/test/Ice/seqMapping/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace seqMapping
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if(!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch(Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/seqMapping/Makefile b/cs/test/Ice/seqMapping/Makefile
index cd344a8f081..0651d35e703 100644
--- a/cs/test/Ice/seqMapping/Makefile
+++ b/cs/test/Ice/seqMapping/Makefile
@@ -11,9 +11,10 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe collocated.exe serveramd.exe
-C_SRCS = AllTests.cs Client.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs Custom.cs
+C_SRCS = AllTests.cs Client.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs Custom.cs ../../TestCommon/TestApp.cs
S_SRCS = MyClassI.cs Server.cs Custom.cs
-COL_SRCS = AllTests.cs Collocated.cs MyClassI.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs Custom.cs
+COL_SRCS = AllTests.cs Collocated.cs MyClassI.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs Custom.cs \
+ ../../TestCommon/TestApp.cs
SAMD_SRCS = MyClassAMDI.cs ServerAMD.cs Custom.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/seqMapping/Makefile.mak b/cs/test/Ice/seqMapping/Makefile.mak
index 3584cbb0eb3..773238e38eb 100644
--- a/cs/test/Ice/seqMapping/Makefile.mak
+++ b/cs/test/Ice/seqMapping/Makefile.mak
@@ -11,9 +11,9 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe collocated.exe serveramd.exe Serializable.dll
-C_SRCS = AllTests.cs Client.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs Custom.cs
+C_SRCS = AllTests.cs Client.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs Custom.cs ..\..\TestCommon\TestApp.cs
S_SRCS = MyClassI.cs Server.cs Custom.cs
-COL_SRCS = AllTests.cs Collocated.cs MyClassI.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs Custom.cs
+COL_SRCS = AllTests.cs Collocated.cs MyClassI.cs Twoways.cs TwowaysAMI.cs TwowaysNewAMI.cs Custom.cs ..\..\TestCommon\TestApp.cs
SAMD_SRCS = MyClassAMDI.cs ServerAMD.cs Custom.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/seqMapping/Properties/AppManifest.xml b/cs/test/Ice/seqMapping/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/seqMapping/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/seqMapping/Properties/AssemblyInfo.cs b/cs/test/Ice/seqMapping/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..0e618f1d96a
--- /dev/null
+++ b/cs/test/Ice/seqMapping/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("seqMapping")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("seqMapping")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("1f04ea13-1598-4c53-be67-f352328c6bb7")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/seqMapping/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/seqMapping/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..7ea34658961
--- /dev/null
+++ b/cs/test/Ice/seqMapping/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Sequence Mapping Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Sequence Mapping Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Sequence Mapping Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/seqMapping/Serializable.cs b/cs/test/Ice/seqMapping/Serializable.cs
index 9840b486473..5e91ea112c3 100644
--- a/cs/test/Ice/seqMapping/Serializable.cs
+++ b/cs/test/Ice/seqMapping/Serializable.cs
@@ -6,7 +6,7 @@
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
-
+#if !SILVERLIGHT
using System;
[assembly: CLSCompliant(true)]
@@ -45,3 +45,4 @@ public class Struct // Used to test that null members marshal correctly.
}
}
+#endif
diff --git a/cs/test/Ice/seqMapping/Test.ice b/cs/test/Ice/seqMapping/Test.ice
index 2f0f29f8b07..96da90ad816 100644
--- a/cs/test/Ice/seqMapping/Test.ice
+++ b/cs/test/Ice/seqMapping/Test.ice
@@ -131,9 +131,11 @@ sequence<En> AEnS;
["clr:generic:Custom"] sequence<CustomIntS> CustomIntSS;
["clr:generic:Custom"] sequence<CustomCVS> CustomCVSS;
+#ifndef SILVERLIGHT
["clr:serializable:Serialize.Small"] sequence<byte> SerialSmall;
["clr:serializable:Serialize.Large"] sequence<byte> SerialLarge;
["clr:serializable:Serialize.Struct"] sequence<byte> SerialStruct;
+#endif
["ami"] class MyClass
{
@@ -240,15 +242,17 @@ sequence<En> AEnS;
CustomIntSS opCustomIntSS(CustomIntSS i, out CustomIntSS o);
CustomCVSS opCustomCVSS(CustomCVSS i, out CustomCVSS o);
-
+#ifndef SILVERLIGHT
SerialSmall opSerialSmallCSharp(SerialSmall i, out SerialSmall o);
SerialLarge opSerialLargeCSharp(SerialLarge i, out SerialLarge o);
SerialStruct opSerialStructCSharp(SerialStruct i, out SerialStruct o);
+#endif
};
// Remaining type definitions are there to verify that the generated
// code compiles correctly.
+#ifndef SILVERLIGHT
sequence<SerialLarge> SLS;
sequence<SLS> SLSS;
dictionary<int, SerialLarge> SLD;
@@ -270,5 +274,5 @@ class Baz
SerialLarge SLmem;
SLS SLSmem;
};
-
+#endif
};
diff --git a/cs/test/Ice/seqMapping/Twoways.cs b/cs/test/Ice/seqMapping/Twoways.cs
index 07ff5d69bca..4cab74bc00e 100644
--- a/cs/test/Ice/seqMapping/Twoways.cs
+++ b/cs/test/Ice/seqMapping/Twoways.cs
@@ -1410,10 +1410,10 @@ class Twoways
test(obj.i == ir.Current.i);
}
}
- }
- }
-
-#if !COMPACT
+ }
+ }
+
+#if !COMPACT && !SILVERLIGHT
{
Serialize.Small i = null;
Serialize.Small o;
@@ -1521,6 +1521,6 @@ class Twoways
// OK, talking to non-C# server.
}
}
-#endif
+#endif
}
}
diff --git a/cs/test/Ice/seqMapping/TwowaysAMI.cs b/cs/test/Ice/seqMapping/TwowaysAMI.cs
index ff6eb216c3b..80ca2335bba 100644
--- a/cs/test/Ice/seqMapping/TwowaysAMI.cs
+++ b/cs/test/Ice/seqMapping/TwowaysAMI.cs
@@ -2547,7 +2547,7 @@ public class TwowaysAMI
private Callback callback = new Callback();
}
-#if !COMPACT
+#if !COMPACT && !SILVERLIGHT
private class AMI_MyClass_opSerialSmallCSharpNull : Test.AMI_MyClass_opSerialSmallCSharp
{
public AMI_MyClass_opSerialSmallCSharpNull()
@@ -3712,10 +3712,10 @@ public class TwowaysAMI
AMI_MyClass_opCustomCVSSI cb = new AMI_MyClass_opCustomCVSSI(i);
p.opCustomCVSS_async(cb, i);
- cb.check();
- }
-
-#if !COMPACT
+ cb.check();
+ }
+
+#if !COMPACT && !SILVERLIGHT
{
Serialize.Small i = null;
@@ -3762,6 +3762,6 @@ public class TwowaysAMI
p.opSerialStructCSharp_async(cb, i);
cb.check();
}
-#endif
+#endif
}
}
diff --git a/cs/test/Ice/seqMapping/TwowaysNewAMI.cs b/cs/test/Ice/seqMapping/TwowaysNewAMI.cs
index 20b61b1e326..0d964c475f5 100644
--- a/cs/test/Ice/seqMapping/TwowaysNewAMI.cs
+++ b/cs/test/Ice/seqMapping/TwowaysNewAMI.cs
@@ -1021,7 +1021,7 @@ public class TwowaysNewAMI
callback.called();
}
-#if !COMPACT
+#if !COMPACT && !SILVERLIGHT
public void opSerialSmallCSharpNullI(Ice.AsyncResult result)
{
try
@@ -2159,10 +2159,10 @@ public class TwowaysNewAMI
Callback cb = new Callback();
p.begin_opCustomCVSS(i, null, cb.opCustomCVSSI, i);
- cb.check();
- }
-
-#if !COMPACT
+ cb.check();
+ }
+
+#if !COMPACT && !SILVERLIGHT
{
Serialize.Small i = null;
@@ -2209,6 +2209,6 @@ public class TwowaysNewAMI
p.begin_opSerialStructCSharp(i, null, cb.opSerialStructCSharpI, i);
cb.check();
}
-#endif
+#endif
}
}
diff --git a/cs/test/Ice/seqMapping/seqMapping.csproj b/cs/test/Ice/seqMapping/seqMapping.csproj
new file mode 100644
index 00000000000..ce7696ec614
--- /dev/null
+++ b/cs/test/Ice/seqMapping/seqMapping.csproj
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{3B586590-63D2-48FD-9973-6CB6BA107C27}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>seqMapping</RootNamespace>
+ <AssemblyName>seqMapping</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>seqMapping.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>seqMapping.App</SilverlightAppEntry>
+ <TestPageFileName>seqMappingTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Custom.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Serializable.cs" />
+ <Compile Include="Test.cs" />
+ <Compile Include="Twoways.cs" />
+ <Compile Include="TwowaysAMI.cs" />
+ <Compile Include="TwowaysNewAMI.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_ExtraOptions="-DSILVERLIGHT" ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/servantLocator/AllTests.cs b/cs/test/Ice/servantLocator/AllTests.cs
index 825633ed9e2..04c3f7053c2 100644
--- a/cs/test/Ice/servantLocator/AllTests.cs
+++ b/cs/test/Ice/servantLocator/AllTests.cs
@@ -9,18 +9,14 @@
using System;
using Test;
-using Ice;
+using Ice;
+
+#if SILVERLIGHT
+using System.Windows.Controls;
+#endif
-public class AllTests
+public class AllTests : TestCommon.TestApp
{
- private static void test(bool b)
- {
- if(!b)
- {
- throw new System.Exception();
- }
- }
-
public static void testExceptions(TestIntfPrx obj, bool collocated)
{
try
@@ -185,24 +181,40 @@ public class AllTests
}
}
+#if SILVERLIGHT
+ public override Ice.InitializationData initData()
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties();
+ initData.properties.setProperty("Ice.FactoryAssemblies", "servantLocator,version=1.0.0.0");
+ return initData;
+ }
+
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static TestIntfPrx allTests(Ice.Communicator communicator, bool collocated)
+#endif
{
- Console.Out.Write("testing stringToProxy... ");
- Console.Out.Flush();
+#if SILVERLIGHT
+ bool collocated = false;
+#endif
+ Write("testing stringToProxy... ");
+ Flush();
string @ref = "asm:default -p 12010";
Ice.ObjectPrx @base = communicator.stringToProxy(@ref);
test(@base != null);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing checked cast... ");
- Console.Out.Flush();
+ Write("testing checked cast... ");
+ Flush();
TestIntfPrx obj = TestIntfPrxHelper.checkedCast(@base);
test(obj != null);
test(obj.Equals(@base));
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing ice_ids... ");
- Console.Out.Flush();
+ Write("testing ice_ids... ");
+ Flush();
try
{
Ice.ObjectPrx o = communicator.stringToProxy("category/locate:default -p 12010");
@@ -232,10 +244,10 @@ public class AllTests
{
test(false);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing servant locator...");
- Console.Out.Flush();
+ Write("testing servant locator...");
+ Flush();
@base = communicator.stringToProxy("category/locate:default -p 12010");
obj = TestIntfPrxHelper.checkedCast(@base);
try
@@ -245,10 +257,10 @@ public class AllTests
catch(ObjectNotExistException)
{
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing default servant locator...");
- Console.Out.Flush();
+ Write("testing default servant locator...");
+ Flush();
@base = communicator.stringToProxy("anothercat/locate:default -p 12010");
obj = TestIntfPrxHelper.checkedCast(@base);
@base = communicator.stringToProxy("locate:default -p 12010");
@@ -267,17 +279,17 @@ public class AllTests
catch(ObjectNotExistException)
{
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing locate exceptions... ");
- Console.Out.Flush();
+ Write("testing locate exceptions... ");
+ Flush();
@base = communicator.stringToProxy("category/locate:default -p 12010");
obj = TestIntfPrxHelper.checkedCast(@base);
testExceptions(obj, collocated);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing finished exceptions... ");
- Console.Out.Flush();
+ Write("testing finished exceptions... ");
+ Flush();
@base = communicator.stringToProxy("category/finished:default -p 12010");
obj = TestIntfPrxHelper.checkedCast(@base);
testExceptions(obj, collocated);
@@ -318,10 +330,10 @@ public class AllTests
//
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing servant locator removal... ");
- Console.Out.Flush();
+ Write("testing servant locator removal... ");
+ Flush();
@base = communicator.stringToProxy("test/activation:default -p 12010");
TestActivationPrx activation = TestActivationPrxHelper.checkedCast(@base);
activation.activateServantLocator(false);
@@ -332,21 +344,24 @@ public class AllTests
}
catch(ObjectNotExistException)
{
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
- Console.Out.Write("testing servant locator addition... ");
- Console.Out.Flush();
+ Write("testing servant locator addition... ");
+ Flush();
activation.activateServantLocator(true);
try
{
obj.ice_ping();
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
}
catch(System.Exception)
{
test(false);
}
-
+#if SILVERLIGHT
+ obj.shutdown();
+#else
return obj;
+#endif
}
}
diff --git a/cs/test/Ice/servantLocator/App.xaml b/cs/test/Ice/servantLocator/App.xaml
new file mode 100644
index 00000000000..6f55ec8d570
--- /dev/null
+++ b/cs/test/Ice/servantLocator/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="servantLocator.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/servantLocator/App.xaml.cs b/cs/test/Ice/servantLocator/App.xaml.cs
new file mode 100644
index 00000000000..857c669be48
--- /dev/null
+++ b/cs/test/Ice/servantLocator/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace servantLocator
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if(!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch(Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/servantLocator/Makefile b/cs/test/Ice/servantLocator/Makefile
index 18e3d347ba0..34ee9a8fe4a 100644
--- a/cs/test/Ice/servantLocator/Makefile
+++ b/cs/test/Ice/servantLocator/Makefile
@@ -11,9 +11,10 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe serveramd.exe collocated.exe
-C_SRCS = Client.cs AllTests.cs
+C_SRCS = Client.cs AllTests.cs ../../TestCommon/TestApp.cs
S_SRCS = Server.cs CookieI.cs ServantLocatorI.cs TestI.cs TestActivationI.cs
-COL_SRCS = Collocated.cs AllTests.cs CookieI.cs ServantLocatorI.cs TestI.cs TestActivationI.cs
+COL_SRCS = Collocated.cs AllTests.cs CookieI.cs ServantLocatorI.cs TestI.cs TestActivationI.cs \
+ ../../TestCommon/TestApp.cs
SAMD_SRCS = Server.cs CookieI.cs ServantLocatorI.cs TestAMDI.cs TestActivationI.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/servantLocator/Makefile.mak b/cs/test/Ice/servantLocator/Makefile.mak
index 29c1d876545..3fb74c6a19f 100644
--- a/cs/test/Ice/servantLocator/Makefile.mak
+++ b/cs/test/Ice/servantLocator/Makefile.mak
@@ -11,9 +11,9 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe serveramd.exe collocated.exe
-C_SRCS = Client.cs AllTests.cs
+C_SRCS = Client.cs AllTests.cs ..\..\TestCommon\TestApp.cs
S_SRCS = Server.cs CookieI.cs ServantLocatorI.cs TestI.cs TestActivationI.cs
-COL_SRCS = Collocated.cs AllTests.cs CookieI.cs ServantLocatorI.cs TestI.cs TestActivationI.cs
+COL_SRCS = Collocated.cs AllTests.cs CookieI.cs ServantLocatorI.cs TestI.cs TestActivationI.cs ..\..\TestCommon\TestApp.cs
SAMD_SRCS = Server.cs CookieI.cs ServantLocatorI.cs TestAMDI.cs TestActivationI.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/servantLocator/Properties/AppManifest.xml b/cs/test/Ice/servantLocator/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/servantLocator/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/servantLocator/Properties/AssemblyInfo.cs b/cs/test/Ice/servantLocator/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..f7c362e38ab
--- /dev/null
+++ b/cs/test/Ice/servantLocator/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("servantLocator")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("servantLocator")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("79b1229a-4d32-47d0-b513-b8c99b869470")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/servantLocator/Properties/InBrowserSettings.xml b/cs/test/Ice/servantLocator/Properties/InBrowserSettings.xml
new file mode 100644
index 00000000000..75bbd385a4f
--- /dev/null
+++ b/cs/test/Ice/servantLocator/Properties/InBrowserSettings.xml
@@ -0,0 +1,5 @@
+<InBrowserSettings>
+ <InBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </InBrowserSettings.SecuritySettings>
+</InBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/servantLocator/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/servantLocator/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..ff978db5e02
--- /dev/null
+++ b/cs/test/Ice/servantLocator/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Servant Locator Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Servant Locator Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Servant Locator Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/servantLocator/servantLocator.csproj b/cs/test/Ice/servantLocator/servantLocator.csproj
new file mode 100644
index 00000000000..b20c90378fa
--- /dev/null
+++ b/cs/test/Ice/servantLocator/servantLocator.csproj
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{E2F1D989-CA09-4A83-9511-7C03FD13E5D1}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>servantLocator</RootNamespace>
+ <AssemblyName>servantLocator</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>servantLocator.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>servantLocator.App</SilverlightAppEntry>
+ <TestPageFileName>servantLocatorTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ <InBrowserSettingsFile>Properties\InBrowserSettings.xml</InBrowserSettingsFile>
+ <RequireInBrowserElevation>true</RequireInBrowserElevation>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\InBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/slicing/exceptions/AllTests.cs b/cs/test/Ice/slicing/exceptions/AllTests.cs
index a3408375818..ecb49286d00 100644
--- a/cs/test/Ice/slicing/exceptions/AllTests.cs
+++ b/cs/test/Ice/slicing/exceptions/AllTests.cs
@@ -10,18 +10,14 @@
using System;
using System.Diagnostics;
using System.Threading;
-using Test;
+using Test;
+
+#if SILVERLIGHT
+using System.Windows.Controls;
+#endif
-public class AllTests
+public class AllTests : TestCommon.TestApp
{
- private static void test(bool b)
- {
- if(!b)
- {
- throw new System.Exception();
- }
- }
-
private class Callback
{
internal Callback()
@@ -327,24 +323,37 @@ public class AllTests
private Callback callback = new Callback();
}
+#if SILVERLIGHT
+ public override Ice.InitializationData initData()
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties();
+ initData.properties.setProperty("Ice.FactoryAssemblies", "exceptions,version=1.0.0.0");
+ return initData;
+ }
+
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static TestIntfPrx allTests(Ice.Communicator communicator, bool collocated)
+#endif
{
- Console.Out.Write("testing stringToProxy... ");
- Console.Out.Flush();
+ Write("testing stringToProxy... ");
+ Flush();
String @ref = "Test:default -p 12010 -t 2000";
Ice.ObjectPrx @base = communicator.stringToProxy(@ref);
test(@base != null);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing checked cast... ");
- Console.Out.Flush();
+ Write("testing checked cast... ");
+ Flush();
TestIntfPrx testPrx = TestIntfPrxHelper.checkedCast(@base);
test(testPrx != null);
test(testPrx.Equals(@base));
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("base... ");
- Console.Out.Flush();
+ Write("base... ");
+ Flush();
{
try
{
@@ -361,19 +370,19 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("base (AMI)... ");
- Console.Out.Flush();
+ Write("base (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_baseAsBase().whenCompleted(cb.response, cb.exception_baseAsBase);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("slicing of unknown derived... ");
- Console.Out.Flush();
+ Write("slicing of unknown derived... ");
+ Flush();
{
try
{
@@ -390,19 +399,19 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("slicing of unknown derived (AMI)... ");
- Console.Out.Flush();
+ Write("slicing of unknown derived (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_unknownDerivedAsBase().whenCompleted(cb.response, cb.exception_unknownDerivedAsBase);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("non-slicing of known derived as base... ");
- Console.Out.Flush();
+ Write("non-slicing of known derived as base... ");
+ Flush();
{
try
{
@@ -420,19 +429,19 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("non-slicing of known derived as base (AMI)... ");
- Console.Out.Flush();
+ Write("non-slicing of known derived as base (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_knownDerivedAsBase().whenCompleted(cb.response, cb.exception_knownDerivedAsBase);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("non-slicing of known derived as derived... ");
- Console.Out.Flush();
+ Write("non-slicing of known derived as derived... ");
+ Flush();
{
try
{
@@ -450,20 +459,20 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("non-slicing of known derived as derived (AMI)... ");
- Console.Out.Flush();
+ Write("non-slicing of known derived as derived (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_knownDerivedAsKnownDerived().whenCompleted(
cb.response, cb.exception_knownDerivedAsKnownDerived);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("slicing of unknown intermediate as base... ");
- Console.Out.Flush();
+ Write("slicing of unknown intermediate as base... ");
+ Flush();
{
try
{
@@ -480,20 +489,20 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("slicing of unknown intermediate as base (AMI)... ");
- Console.Out.Flush();
+ Write("slicing of unknown intermediate as base (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_unknownIntermediateAsBase().whenCompleted(
cb.response, cb.exception_unknownIntermediateAsBase);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("slicing of known intermediate as base... ");
- Console.Out.Flush();
+ Write("slicing of known intermediate as base... ");
+ Flush();
{
try
{
@@ -511,20 +520,20 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("slicing of known intermediate as base (AMI)... ");
- Console.Out.Flush();
+ Write("slicing of known intermediate as base (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_knownIntermediateAsBase().whenCompleted(
cb.response, cb.exception_knownIntermediateAsBase);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("slicing of known most derived as base... ");
- Console.Out.Flush();
+ Write("slicing of known most derived as base... ");
+ Flush();
{
try
{
@@ -543,20 +552,20 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("slicing of known most derived as base (AMI)... ");
- Console.Out.Flush();
+ Write("slicing of known most derived as base (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_knownMostDerivedAsBase().whenCompleted(
cb.response, cb.exception_knownMostDerivedAsBase);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("non-slicing of known intermediate as intermediate... ");
- Console.Out.Flush();
+ Write("non-slicing of known intermediate as intermediate... ");
+ Flush();
{
try
{
@@ -574,20 +583,20 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("non-slicing of known intermediate as intermediate (AMI)... ");
- Console.Out.Flush();
+ Write("non-slicing of known intermediate as intermediate (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_knownIntermediateAsKnownIntermediate().whenCompleted(
cb.response, cb.exception_knownIntermediateAsKnownIntermediate);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("non-slicing of known most derived as intermediate... ");
- Console.Out.Flush();
+ Write("non-slicing of known most derived as intermediate... ");
+ Flush();
{
try
{
@@ -606,20 +615,20 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("non-slicing of known most derived as intermediate (AMI)... ");
- Console.Out.Flush();
+ Write("non-slicing of known most derived as intermediate (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_knownMostDerivedAsKnownIntermediate().whenCompleted(
cb.response, cb.exception_knownMostDerivedAsKnownIntermediate);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("non-slicing of known most derived as most derived... ");
- Console.Out.Flush();
+ Write("non-slicing of known most derived as most derived... ");
+ Flush();
{
try
{
@@ -638,20 +647,20 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("non-slicing of known most derived as most derived (AMI)... ");
- Console.Out.Flush();
+ Write("non-slicing of known most derived as most derived (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_knownMostDerivedAsKnownMostDerived().whenCompleted(
cb.response, cb.exception_knownMostDerivedAsKnownMostDerived);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("slicing of unknown most derived, known intermediate as base... ");
- Console.Out.Flush();
+ Write("slicing of unknown most derived, known intermediate as base... ");
+ Flush();
{
try
{
@@ -669,20 +678,20 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("slicing of unknown most derived, known intermediate as base (AMI)... ");
- Console.Out.Flush();
+ Write("slicing of unknown most derived, known intermediate as base (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_unknownMostDerived1AsBase().whenCompleted(
cb.response, cb.exception_unknownMostDerived1AsBase);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("slicing of unknown most derived, known intermediate as intermediate... ");
- Console.Out.Flush();
+ Write("slicing of unknown most derived, known intermediate as intermediate... ");
+ Flush();
{
try
{
@@ -700,20 +709,20 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("slicing of unknown most derived, known intermediate as intermediate (AMI)... ");
- Console.Out.Flush();
+ Write("slicing of unknown most derived, known intermediate as intermediate (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_unknownMostDerived1AsKnownIntermediate().whenCompleted(
cb.response, cb.exception_unknownMostDerived1AsKnownIntermediate);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("slicing of unknown most derived, unknown intermediate thrown as base... ");
- Console.Out.Flush();
+ Write("slicing of unknown most derived, unknown intermediate thrown as base... ");
+ Flush();
{
try
{
@@ -730,18 +739,21 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("slicing of unknown most derived, unknown intermediate thrown as base (AMI)... ");
- Console.Out.Flush();
+ Write("slicing of unknown most derived, unknown intermediate thrown as base (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_unknownMostDerived2AsBase().whenCompleted(
cb.response, cb.exception_unknownMostDerived2AsBase);
cb.check();
}
- Console.Out.WriteLine("ok");
-
+ WriteLine("ok");
+#if SILVERLIGHT
+ testPrx.shutdown();
+#else
return testPrx;
+#endif
}
}
diff --git a/cs/test/Ice/slicing/exceptions/App.xaml b/cs/test/Ice/slicing/exceptions/App.xaml
new file mode 100644
index 00000000000..0222c57044d
--- /dev/null
+++ b/cs/test/Ice/slicing/exceptions/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="slicingExceptions.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/slicing/exceptions/App.xaml.cs b/cs/test/Ice/slicing/exceptions/App.xaml.cs
new file mode 100644
index 00000000000..209a52aaa2a
--- /dev/null
+++ b/cs/test/Ice/slicing/exceptions/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace slicingExceptions
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if (!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch (Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/slicing/exceptions/Makefile b/cs/test/Ice/slicing/exceptions/Makefile
index fa979e581d4..37fa5b0fa6b 100644
--- a/cs/test/Ice/slicing/exceptions/Makefile
+++ b/cs/test/Ice/slicing/exceptions/Makefile
@@ -11,7 +11,7 @@ top_srcdir = ../../../..
TARGETS = client.exe server.exe serveramd.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ../../../TestCommon/TestApp.cs
S_SRCS = Server.cs TestI.cs
SAMD_SRCS = Server.cs TestAMDI.cs
diff --git a/cs/test/Ice/slicing/exceptions/Makefile.mak b/cs/test/Ice/slicing/exceptions/Makefile.mak
index 1cc4f24b3c2..a9d3b999ebb 100644
--- a/cs/test/Ice/slicing/exceptions/Makefile.mak
+++ b/cs/test/Ice/slicing/exceptions/Makefile.mak
@@ -11,7 +11,7 @@ top_srcdir = ..\..\..\..
TARGETS = client.exe server.exe serveramd.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ..\..\..\TestCommon\TestApp.cs
S_SRCS = Server.cs TestI.cs
SAMD_SRCS = Server.cs TestAMDI.cs
diff --git a/cs/test/Ice/slicing/exceptions/Properties/AppManifest.xml b/cs/test/Ice/slicing/exceptions/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/slicing/exceptions/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/slicing/exceptions/Properties/AssemblyInfo.cs b/cs/test/Ice/slicing/exceptions/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..c3a200065e3
--- /dev/null
+++ b/cs/test/Ice/slicing/exceptions/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("exceptions")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("exceptions")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("a7af9caf-0691-42f1-be3c-e0701303e006")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/slicing/exceptions/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/slicing/exceptions/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..abfc76dd52f
--- /dev/null
+++ b/cs/test/Ice/slicing/exceptions/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Slicing Exceptions Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Slicing Exceptions Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Slicing Exceptions Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/slicing/exceptions/exceptions.csproj b/cs/test/Ice/slicing/exceptions/exceptions.csproj
new file mode 100644
index 00000000000..f78122897b7
--- /dev/null
+++ b/cs/test/Ice/slicing/exceptions/exceptions.csproj
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{DD327892-C079-4209-863D-855E32A4C379}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>exceptions</RootNamespace>
+ <AssemblyName>exceptions</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>exceptions.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>slicingExceptions.App</SilverlightAppEntry>
+ <TestPageFileName>slicingExceptionsTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/slicing/objects/AllTests.cs b/cs/test/Ice/slicing/objects/AllTests.cs
index 6b38a610efc..4e7b1162dc6 100644
--- a/cs/test/Ice/slicing/objects/AllTests.cs
+++ b/cs/test/Ice/slicing/objects/AllTests.cs
@@ -11,18 +11,14 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
-using Test;
+using Test;
+
+#if SILVERLIGHT
+using System.Windows.Controls;
+#endif
-public class AllTests
+public class AllTests : TestCommon.TestApp
{
- private static void test(bool b)
- {
- if(!b)
- {
- throw new System.Exception();
- }
- }
-
private class Callback
{
internal Callback()
@@ -407,24 +403,37 @@ public class AllTests
private Callback callback = new Callback();
}
+#if SILVERLIGHT
+ public override Ice.InitializationData initData()
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties();
+ initData.properties.setProperty("Ice.FactoryAssemblies", "objects,version=1.0.0.0");
+ return initData;
+ }
+
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static TestIntfPrx allTests(Ice.Communicator communicator, bool collocated)
+#endif
{
- Console.Out.Write("testing stringToProxy... ");
- Console.Out.Flush();
+ Write("testing stringToProxy... ");
+ Flush();
string r = "Test:default -p 12010 -t 2000";
Ice.ObjectPrx basePrx = communicator.stringToProxy(r);
test(basePrx != null);
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing checked cast... ");
- Console.Out.Flush();
+ Write("testing checked cast... ");
+ Flush();
TestIntfPrx testPrx = TestIntfPrxHelper.checkedCast(basePrx);
test(testPrx != null);
test(testPrx.Equals(basePrx));
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("base as Object... ");
- Console.Out.Flush();
+ Write("base as Object... ");
+ Flush();
{
Ice.Object o;
SBase sb = null;
@@ -442,19 +451,19 @@ public class AllTests
test(sb != null);
test(sb.sb.Equals("SBase.sb"));
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("base as Object (AMI)... ");
- Console.Out.Flush();
+ Write("base as Object (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_SBaseAsObject().whenCompleted(cb.response_SBaseAsObject, cb.exception);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("base as base... ");
- Console.Out.Flush();
+ Write("base as base... ");
+ Flush();
{
SBase sb;
try
@@ -467,19 +476,19 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("base as base (AMI)... ");
- Console.Out.Flush();
+ Write("base as base (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_SBaseAsSBase().whenCompleted(cb.response_SBaseAsSBase, cb.exception);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("base with known derived as base... ");
- Console.Out.Flush();
+ Write("base with known derived as base... ");
+ Flush();
{
SBase sb;
SBSKnownDerived sbskd = null;
@@ -496,19 +505,19 @@ public class AllTests
test(sbskd != null);
test(sbskd.sbskd.Equals("SBSKnownDerived.sbskd"));
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("base with known derived as base (AMI)... ");
- Console.Out.Flush();
+ Write("base with known derived as base (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_SBSKnownDerivedAsSBase().whenCompleted(cb.response_SBSKnownDerivedAsSBase, cb.exception);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("base with known derived as known derived... ");
- Console.Out.Flush();
+ Write("base with known derived as known derived... ");
+ Flush();
{
SBSKnownDerived sbskd;
try
@@ -521,20 +530,20 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("base with known derived as known derived (AMI)... ");
- Console.Out.Flush();
+ Write("base with known derived as known derived (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_SBSKnownDerivedAsSBSKnownDerived().whenCompleted(
cb.response_SBSKnownDerivedAsSBSKnownDerived, cb.exception);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("base with unknown derived as base... ");
- Console.Out.Flush();
+ Write("base with unknown derived as base... ");
+ Flush();
{
SBase sb;
try
@@ -547,20 +556,20 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("base with unknown derived as base (AMI)... ");
- Console.Out.Flush();
+ Write("base with unknown derived as base (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_SBSUnknownDerivedAsSBase().whenCompleted(
cb.response_SBSUnknownDerivedAsSBase, cb.exception);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("unknown with Object as Object... ");
- Console.Out.Flush();
+ Write("unknown with Object as Object... ");
+ Flush();
{
try
{
@@ -575,10 +584,10 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("unknown with Object as Object (AMI)... ");
- Console.Out.Flush();
+ Write("unknown with Object as Object (AMI)... ");
+ Flush();
{
try
{
@@ -592,10 +601,10 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("one-element cycle... ");
- Console.Out.Flush();
+ Write("one-element cycle... ");
+ Flush();
{
try
{
@@ -610,20 +619,20 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("one-element cycle (AMI)... ");
- Console.Out.Flush();
+ Write("one-element cycle (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_oneElementCycle().whenCompleted(
cb.response_oneElementCycle, cb.exception);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("two-element cycle... ");
- Console.Out.Flush();
+ Write("two-element cycle... ");
+ Flush();
{
try
{
@@ -643,20 +652,20 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("two-element cycle (AMI)... ");
- Console.Out.Flush();
+ Write("two-element cycle (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_twoElementCycle().whenCompleted(
cb.response_twoElementCycle, cb.exception);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("known derived pointer slicing as base... ");
- Console.Out.Flush();
+ Write("known derived pointer slicing as base... ");
+ Flush();
{
try
{
@@ -685,19 +694,19 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("known derived pointer slicing as base (AMI)... ");
- Console.Out.Flush();
+ Write("known derived pointer slicing as base (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_D1AsB().whenCompleted(cb.response_D1AsB, cb.exception);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("known derived pointer slicing as derived... ");
- Console.Out.Flush();
+ Write("known derived pointer slicing as derived... ");
+ Flush();
{
try
{
@@ -720,19 +729,19 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("known derived pointer slicing as derived (AMI)... ");
- Console.Out.Flush();
+ Write("known derived pointer slicing as derived (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_D1AsD1().whenCompleted(cb.response_D1AsD1, cb.exception);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("unknown derived pointer slicing as base... ");
- Console.Out.Flush();
+ Write("unknown derived pointer slicing as base... ");
+ Flush();
{
try
{
@@ -759,19 +768,19 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("unknown derived pointer slicing as base (AMI)... ");
- Console.Out.Flush();
+ Write("unknown derived pointer slicing as base (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_D2AsB().whenCompleted(cb.response_D2AsB, cb.exception);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("param ptr slicing with known first... ");
- Console.Out.Flush();
+ Write("param ptr slicing with known first... ");
+ Flush();
{
try
{
@@ -798,19 +807,19 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("param ptr slicing with known first (AMI)... ");
- Console.Out.Flush();
+ Write("param ptr slicing with known first (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_paramTest1().whenCompleted(cb.response_paramTest1, cb.exception);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("param ptr slicing with unknown first... ");
- Console.Out.Flush();
+ Write("param ptr slicing with unknown first... ");
+ Flush();
{
try
{
@@ -837,19 +846,19 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("param ptr slicing with unknown first (AMI)... ");
- Console.Out.Flush();
+ Write("param ptr slicing with unknown first (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_paramTest2().whenCompleted(cb.response_paramTest2, cb.exception);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("return value identity with known first... ");
- Console.Out.Flush();
+ Write("return value identity with known first... ");
+ Flush();
{
try
{
@@ -863,19 +872,19 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("return value identity with known first (AMI)... ");
- Console.Out.Flush();
+ Write("return value identity with known first (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_returnTest1().whenCompleted(cb.response_returnTest1, cb.exception);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("return value identity with unknown first... ");
- Console.Out.Flush();
+ Write("return value identity with unknown first... ");
+ Flush();
{
try
{
@@ -889,19 +898,19 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("return value identity with unknown first (AMI)... ");
- Console.Out.Flush();
+ Write("return value identity with unknown first (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_returnTest2().whenCompleted(cb.response_returnTest2, cb.exception);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("return value identity for input params known first... ");
- Console.Out.Flush();
+ Write("return value identity for input params known first... ");
+ Flush();
{
try
{
@@ -951,10 +960,10 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("return value identity for input params known first (AMI)... ");
- Console.Out.Flush();
+ Write("return value identity for input params known first (AMI)... ");
+ Flush();
{
D1 d1 = new D1();
d1.sb = "D1.sb";
@@ -1000,10 +1009,10 @@ public class AllTests
test(b2 != d1);
test(b2 != d3);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("return value identity for input params unknown first... ");
- Console.Out.Flush();
+ Write("return value identity for input params unknown first... ");
+ Flush();
{
try
{
@@ -1054,10 +1063,10 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("return value identity for input params unknown first (AMI)... ");
- Console.Out.Flush();
+ Write("return value identity for input params unknown first (AMI)... ");
+ Flush();
{
D1 d1 = new D1();
d1.sb = "D1.sb";
@@ -1104,10 +1113,10 @@ public class AllTests
test(b2 != d1);
test(b2 != d3);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("remainder unmarshaling (3 instances)... ");
- Console.Out.Flush();
+ Write("remainder unmarshaling (3 instances)... ");
+ Flush();
{
try
{
@@ -1135,19 +1144,19 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("remainder unmarshaling (3 instances) (AMI)... ");
- Console.Out.Flush();
+ Write("remainder unmarshaling (3 instances) (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_paramTest3().whenCompleted(cb.response_paramTest3, cb.exception);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("remainder unmarshaling (4 instances)... ");
- Console.Out.Flush();
+ Write("remainder unmarshaling (4 instances)... ");
+ Flush();
{
try
{
@@ -1169,19 +1178,19 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("remainder unmarshaling (4 instances) (AMI)... ");
- Console.Out.Flush();
+ Write("remainder unmarshaling (4 instances) (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_paramTest4().whenCompleted(cb.response_paramTest4, cb.exception);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("param ptr slicing, instance marshaled in unknown derived as base... ");
- Console.Out.Flush();
+ Write("param ptr slicing, instance marshaled in unknown derived as base... ");
+ Flush();
{
try
{
@@ -1211,10 +1220,10 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("param ptr slicing, instance marshaled in unknown derived as base (AMI)... ");
- Console.Out.Flush();
+ Write("param ptr slicing, instance marshaled in unknown derived as base (AMI)... ");
+ Flush();
{
B b1 = new B();
b1.sb = "B.sb(1)";
@@ -1240,10 +1249,10 @@ public class AllTests
test(rv.sb.Equals("D3.sb"));
test(rv.pb == rv);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("param ptr slicing, instance marshaled in unknown derived as derived... ");
- Console.Out.Flush();
+ Write("param ptr slicing, instance marshaled in unknown derived as derived... ");
+ Flush();
{
try
{
@@ -1275,10 +1284,10 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("param ptr slicing, instance marshaled in unknown derived as derived (AMI)... ");
- Console.Out.Flush();
+ Write("param ptr slicing, instance marshaled in unknown derived as derived (AMI)... ");
+ Flush();
{
D1 d11 = new D1();
d11.sb = "D1.sb(1)";
@@ -1307,10 +1316,10 @@ public class AllTests
test(rv.sb.Equals("D3.sb"));
test(rv.pb == rv);
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("sequence slicing... ");
- Console.Out.Flush();
+ Write("sequence slicing... ");
+ Flush();
{
try
{
@@ -1397,10 +1406,10 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("sequence slicing (AMI)... ");
- Console.Out.Flush();
+ Write("sequence slicing (AMI)... ");
+ Flush();
{
SS ss;
{
@@ -1482,10 +1491,10 @@ public class AllTests
test(ss2d5.ice_id().Equals("::Test::D1"));
test(ss2d6.ice_id().Equals("::Test::B"));
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("dictionary slicing... ");
- Console.Out.Flush();
+ Write("dictionary slicing... ");
+ Flush();
{
try
{
@@ -1537,10 +1546,10 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("dictionary slicing (AMI)... ");
- Console.Out.Flush();
+ Write("dictionary slicing (AMI)... ");
+ Flush();
{
Dictionary<int, B> bin = new Dictionary<int, B>();
Dictionary<int, B> bout;
@@ -1589,10 +1598,10 @@ public class AllTests
test(d1.pd1 == d1);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("base exception thrown as base exception... ");
- Console.Out.Flush();
+ Write("base exception thrown as base exception... ");
+ Flush();
{
try
{
@@ -1612,19 +1621,19 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("base exception thrown as base exception (AMI)... ");
- Console.Out.Flush();
+ Write("base exception thrown as base exception (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_throwBaseAsBase().whenCompleted(cb.response, cb.exception_throwBaseAsBase);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("derived exception thrown as base exception... ");
- Console.Out.Flush();
+ Write("derived exception thrown as base exception... ");
+ Flush();
{
try
{
@@ -1650,19 +1659,19 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("derived exception thrown as base exception (AMI)... ");
- Console.Out.Flush();
+ Write("derived exception thrown as base exception (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_throwDerivedAsBase().whenCompleted(cb.response, cb.exception_throwDerivedAsBase);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("derived exception thrown as derived exception... ");
- Console.Out.Flush();
+ Write("derived exception thrown as derived exception... ");
+ Flush();
{
try
{
@@ -1688,19 +1697,19 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("derived exception thrown as derived exception (AMI)... ");
- Console.Out.Flush();
+ Write("derived exception thrown as derived exception (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_throwDerivedAsDerived().whenCompleted(cb.response, cb.exception_throwDerivedAsDerived);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("unknown derived exception thrown as base exception... ");
- Console.Out.Flush();
+ Write("unknown derived exception thrown as base exception... ");
+ Flush();
{
try
{
@@ -1720,20 +1729,20 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("unknown derived exception thrown as base exception (AMI)... ");
- Console.Out.Flush();
+ Write("unknown derived exception thrown as base exception (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_throwUnknownDerivedAsBase().whenCompleted(
cb.response, cb.exception_throwUnknownDerivedAsBase);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("forward-declared class... ");
- Console.Out.Flush();
+ Write("forward-declared class... ");
+ Flush();
{
try
{
@@ -1746,17 +1755,21 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("forward-declared class (AMI)... ");
- Console.Out.Flush();
+ Write("forward-declared class (AMI)... ");
+ Flush();
{
AsyncCallback cb = new AsyncCallback();
testPrx.begin_useForward().whenCompleted(cb.response_useForward, cb.exception);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
+#if SILVERLIGHT
+ testPrx.shutdown();
+#else
return testPrx;
+#endif
}
}
diff --git a/cs/test/Ice/slicing/objects/App.xaml b/cs/test/Ice/slicing/objects/App.xaml
new file mode 100644
index 00000000000..3a7d02c08aa
--- /dev/null
+++ b/cs/test/Ice/slicing/objects/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="slicingObjects.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/slicing/objects/App.xaml.cs b/cs/test/Ice/slicing/objects/App.xaml.cs
new file mode 100644
index 00000000000..5d71da8e79b
--- /dev/null
+++ b/cs/test/Ice/slicing/objects/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace slicingObjects
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if(!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch(Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/slicing/objects/Makefile b/cs/test/Ice/slicing/objects/Makefile
index 2c66b824820..b8c0b797a76 100644
--- a/cs/test/Ice/slicing/objects/Makefile
+++ b/cs/test/Ice/slicing/objects/Makefile
@@ -11,7 +11,7 @@ top_srcdir = ../../../..
TARGETS = client.exe server.exe serveramd.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ../../../TestCommon/TestApp.cs
S_SRCS = Server.cs TestI.cs
SAMD_SRCS = ServerAMD.cs TestAMDI.cs
diff --git a/cs/test/Ice/slicing/objects/Makefile.mak b/cs/test/Ice/slicing/objects/Makefile.mak
index e10ce75feba..f3aa8e7c243 100644
--- a/cs/test/Ice/slicing/objects/Makefile.mak
+++ b/cs/test/Ice/slicing/objects/Makefile.mak
@@ -11,7 +11,7 @@ top_srcdir = ..\..\..\..
TARGETS = client.exe server.exe serveramd.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ..\..\..\TestCommon\TestApp.cs
S_SRCS = Server.cs TestI.cs
SAMD_SRCS = ServerAMD.cs TestAMDI.cs
diff --git a/cs/test/Ice/slicing/objects/Properties/AppManifest.xml b/cs/test/Ice/slicing/objects/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/slicing/objects/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/slicing/objects/Properties/AssemblyInfo.cs b/cs/test/Ice/slicing/objects/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..8cbef4d0efc
--- /dev/null
+++ b/cs/test/Ice/slicing/objects/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("objects")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("objects")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("a8682ac6-10f9-4999-9381-5f70def73c7a")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/slicing/objects/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/slicing/objects/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..093fd89df77
--- /dev/null
+++ b/cs/test/Ice/slicing/objects/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Slicing Objects Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Slicing Objects Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Slicing Objects Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/slicing/objects/objects.csproj b/cs/test/Ice/slicing/objects/objects.csproj
new file mode 100644
index 00000000000..fde8f26b4fc
--- /dev/null
+++ b/cs/test/Ice/slicing/objects/objects.csproj
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{0FB1D189-5BA6-4EE0-BAAF-E9EE0AFE6D3D}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>objects</RootNamespace>
+ <AssemblyName>objects</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>objects.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>slicingObjects.App</SilverlightAppEntry>
+ <TestPageFileName>slicingObjectsTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="ClientPrivate.cs" />
+ <Compile Include="Forward.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="ClientPrivate.ice" />
+ <None Include="Forward.ice" />
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_IncludePath="." ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/stream/AllTests.cs b/cs/test/Ice/stream/AllTests.cs
new file mode 100644
index 00000000000..4ef1aa7af85
--- /dev/null
+++ b/cs/test/Ice/stream/AllTests.cs
@@ -0,0 +1,1433 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Diagnostics;
+using Test;
+
+#if SILVERLIGHT
+using System.Windows.Controls;
+#endif
+
+public class AllTests : TestCommon.TestApp
+{
+ //
+ // There does not appear to be any way to compare collections
+ // in either C# or with the .NET framework. Something like
+ // C++ STL EqualRange would be nice...
+ //
+ private static bool Compare(ICollection c1, ICollection c2)
+ {
+ if (c1 == null)
+ {
+ return c2 == null;
+ }
+ if (c2 == null)
+ {
+ return false;
+ }
+ if (!c1.GetType().Equals(c2.GetType()))
+ {
+ return false;
+ }
+
+ if (c1.Count != c2.Count)
+ {
+ return false;
+ }
+
+ IEnumerator i1 = c1.GetEnumerator();
+ IEnumerator i2 = c2.GetEnumerator();
+ while (i1.MoveNext())
+ {
+ i2.MoveNext();
+ if (i1.Current is ICollection)
+ {
+ Debug.Assert(i2.Current is ICollection);
+ if (!Compare((ICollection)i1.Current, (ICollection)i2.Current))
+ {
+ return false;
+ }
+ }
+ else if (!i1.Current.Equals(i2.Current))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private class TestObjectWriter : Ice.ObjectWriter
+ {
+ public TestObjectWriter(Test.MyClass obj)
+ {
+ this.obj = obj;
+ }
+
+ public override void write(Ice.OutputStream @out)
+ {
+ obj.write__(@out);
+ called = true;
+ }
+
+ internal Test.MyClass obj;
+ internal bool called = false;
+ }
+
+ private class TestObjectReader : Ice.ObjectReader
+ {
+ public override void read(Ice.InputStream @in, bool rid)
+ {
+ obj = new Test.MyClass();
+ obj.read__(@in, rid);
+ called = true;
+ }
+
+ internal Test.MyClass obj;
+ internal bool called = false;
+ }
+
+ private class MyInterfaceI : Test.MyInterfaceDisp_
+ {
+ }
+
+ private class MyInterfaceFactory : Ice.ObjectFactory
+ {
+ public Ice.Object create(string type)
+ {
+ Debug.Assert(type.Equals(Test.MyInterfaceDisp_.ice_staticId()));
+ return new MyInterfaceI();
+ }
+
+ public void destroy()
+ {
+ }
+ }
+
+ private class TestObjectFactory : Ice.ObjectFactory
+ {
+ public Ice.Object create(string type)
+ {
+ Debug.Assert(type.Equals(Test.MyClass.ice_staticId()));
+ return new TestObjectReader();
+ }
+
+ public void destroy()
+ {
+ }
+ }
+
+ private class TestReadObjectCallback : Ice.ReadObjectCallback
+ {
+ public void invoke(Ice.Object obj)
+ {
+ this.obj = obj;
+ }
+
+ internal Ice.Object obj;
+ }
+
+ public class MyClassFactoryWrapper : Ice.ObjectFactory
+ {
+ public MyClassFactoryWrapper()
+ {
+ _factory = null;
+ }
+
+ public Ice.Object create(string type)
+ {
+ if (_factory != null)
+ {
+ return _factory.create(type);
+ }
+ return new Test.MyClass();
+ }
+
+ public void destroy()
+ {
+ }
+
+ public void setFactory(Ice.ObjectFactory factory)
+ {
+ _factory = factory;
+ }
+
+ private Ice.ObjectFactory _factory;
+ }
+
+#if SILVERLIGHT
+ public override Ice.InitializationData initData()
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties();
+ initData.properties.setProperty("Ice.FactoryAssemblies", "stream,version=1.0.0.0");
+ return initData;
+ }
+
+ override
+ public void run(Ice.Communicator communicator)
+#else
+ static public int run(Ice.Communicator communicator)
+#endif
+ {
+ MyClassFactoryWrapper factoryWrapper = new MyClassFactoryWrapper();
+ communicator.addObjectFactory(factoryWrapper, Test.MyClass.ice_staticId());
+ communicator.addObjectFactory(new MyInterfaceFactory(), Test.MyInterfaceDisp_.ice_staticId());
+
+ Ice.InputStream @in;
+ Ice.OutputStream @out;
+
+ Write("testing primitive types... ");
+ Flush();
+
+ {
+ byte[] data = new byte[0];
+ @in = Ice.Util.createInputStream(communicator, data);
+ @in.destroy();
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ @out.startEncapsulation();
+ @out.writeBool(true);
+ @out.endEncapsulation();
+ byte[] data = @out.finished();
+ @out.destroy();
+
+ @in = Ice.Util.createInputStream(communicator, data);
+ @in.startEncapsulation();
+ test(@in.readBool());
+ @in.endEncapsulation();
+ @in.destroy();
+ }
+
+ {
+ byte[] data = new byte[0];
+ @in = Ice.Util.createInputStream(communicator, data);
+ try
+ {
+ @in.readBool();
+ test(false);
+ }
+ catch (Ice.UnmarshalOutOfBoundsException)
+ {
+ }
+ @in.destroy();
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ @out.writeBool(true);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ test(@in.readBool());
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ @out.writeByte((byte)1);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ test(@in.readByte() == (byte)1);
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ @out.writeShort((short)2);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ test(@in.readShort() == (short)2);
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ @out.writeInt(3);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ test(@in.readInt() == 3);
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ @out.writeLong(4);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ test(@in.readLong() == 4);
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ @out.writeFloat((float)5.0);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ test(@in.readFloat() == (float)5.0);
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ @out.writeDouble(6.0);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ test(@in.readDouble() == 6.0);
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ @out.writeString("hello world");
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ test(@in.readString().Equals("hello world"));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ WriteLine("ok");
+
+ Write("testing constructed types... ");
+ Flush();
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.MyEnumHelper.write(@out, Test.MyEnum.enum3);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ test(Test.MyEnumHelper.read(@in) == Test.MyEnum.enum3);
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.SmallStruct s = new Test.SmallStruct();
+ s.bo = true;
+ s.by = (byte)1;
+ s.sh = (short)2;
+ s.i = 3;
+ s.l = 4;
+ s.f = (float)5.0;
+ s.d = 6.0;
+ s.str = "7";
+ s.e = Test.MyEnum.enum2;
+ s.p = Test.MyClassPrxHelper.uncheckedCast(communicator.stringToProxy("test:default"));
+ s.ice_write(@out);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Test.SmallStruct s2 = new Test.SmallStruct();
+ s2.ice_read(@in);
+ test(s2.Equals(s));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ bool[] arr =
+ {
+ true,
+ false,
+ true,
+ false
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Ice.BoolSeqHelper.write(@out, arr);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ bool[] arr2 = Ice.BoolSeqHelper.read(@in);
+ test(Compare(arr2, arr));
+ @out.destroy();
+ @in.destroy();
+
+ bool[][] arrS =
+ {
+ arr,
+ new bool[0],
+ arr
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.BoolSSHelper.write(@out, arrS);
+ data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ bool[][] arr2S = Test.BoolSSHelper.read(@in);
+ test(Compare(arr2S, arrS));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ byte[] arr =
+ {
+ (byte)0x01,
+ (byte)0x11,
+ (byte)0x12,
+ (byte)0x22
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Ice.ByteSeqHelper.write(@out, arr);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ byte[] arr2 = Ice.ByteSeqHelper.read(@in);
+ test(Compare(arr2, arr));
+ @out.destroy();
+ @in.destroy();
+
+ byte[][] arrS =
+ {
+ arr,
+ new byte[0],
+ arr
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.ByteSSHelper.write(@out, arrS);
+ data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ byte[][] arr2S = Test.ByteSSHelper.read(@in);
+ test(Compare(arr2S, arrS));
+ @out.destroy();
+ @in.destroy();
+ }
+
+#if !COMPACT && !SILVERLIGHT
+ {
+ Serialize.Small small = new Serialize.Small();
+ small.i = 99;
+ @out = Ice.Util.createOutputStream(communicator);
+ @out.writeSerializable(small);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Serialize.Small small2 = (Serialize.Small)@in.readSerializable();
+ test(small2.i == 99);
+ @out.destroy();
+ @in.destroy();
+ }
+#endif
+
+ {
+ short[] arr =
+ {
+ (short)0x01,
+ (short)0x11,
+ (short)0x12,
+ (short)0x22
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Ice.ShortSeqHelper.write(@out, arr);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ short[] arr2 = Ice.ShortSeqHelper.read(@in);
+ test(Compare(arr2, arr));
+ @out.destroy();
+ @in.destroy();
+
+ short[][] arrS =
+ {
+ arr,
+ new short[0],
+ arr
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.ShortSSHelper.write(@out, arrS);
+ data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ short[][] arr2S = Test.ShortSSHelper.read(@in);
+ test(Compare(arr2S, arrS));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ int[] arr =
+ {
+ 0x01,
+ 0x11,
+ 0x12,
+ 0x22
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Ice.IntSeqHelper.write(@out, arr);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ int[] arr2 = Ice.IntSeqHelper.read(@in);
+ test(Compare(arr2, arr));
+ @out.destroy();
+ @in.destroy();
+
+ int[][] arrS =
+ {
+ arr,
+ new int[0],
+ arr
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.IntSSHelper.write(@out, arrS);
+ data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ int[][] arr2S = Test.IntSSHelper.read(@in);
+ test(Compare(arr2S, arrS));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ long[] arr =
+ {
+ 0x01,
+ 0x11,
+ 0x12,
+ 0x22
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Ice.LongSeqHelper.write(@out, arr);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ long[] arr2 = Ice.LongSeqHelper.read(@in);
+ test(Compare(arr2, arr));
+ @out.destroy();
+ @in.destroy();
+
+ long[][] arrS =
+ {
+ arr,
+ new long[0],
+ arr
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.LongSSHelper.write(@out, arrS);
+ data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ long[][] arr2S = Test.LongSSHelper.read(@in);
+ test(Compare(arr2S, arrS));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ float[] arr =
+ {
+ (float)1,
+ (float)2,
+ (float)3,
+ (float)4
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Ice.FloatSeqHelper.write(@out, arr);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ float[] arr2 = Ice.FloatSeqHelper.read(@in);
+ test(Compare(arr2, arr));
+ @out.destroy();
+ @in.destroy();
+
+ float[][] arrS =
+ {
+ arr,
+ new float[0],
+ arr
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.FloatSSHelper.write(@out, arrS);
+ data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ float[][] arr2S = Test.FloatSSHelper.read(@in);
+ test(Compare(arr2S, arrS));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ double[] arr =
+ {
+ (double)1,
+ (double)2,
+ (double)3,
+ (double)4
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Ice.DoubleSeqHelper.write(@out, arr);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ double[] arr2 = Ice.DoubleSeqHelper.read(@in);
+ test(Compare(arr2, arr));
+ @out.destroy();
+ @in.destroy();
+
+ double[][] arrS =
+ {
+ arr,
+ new double[0],
+ arr
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.DoubleSSHelper.write(@out, arrS);
+ data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ double[][] arr2S = Test.DoubleSSHelper.read(@in);
+ test(Compare(arr2S, arrS));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ string[] arr =
+ {
+ "string1",
+ "string2",
+ "string3",
+ "string4"
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Ice.StringSeqHelper.write(@out, arr);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ string[] arr2 = Ice.StringSeqHelper.read(@in);
+ test(Compare(arr2, arr));
+ @out.destroy();
+ @in.destroy();
+
+ string[][] arrS =
+ {
+ arr,
+ new string[0],
+ arr
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.StringSSHelper.write(@out, arrS);
+ data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ string[][] arr2S = Test.StringSSHelper.read(@in);
+ test(Compare(arr2S, arrS));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ Test.MyEnum[] arr =
+ {
+ Test.MyEnum.enum3,
+ Test.MyEnum.enum2,
+ Test.MyEnum.enum1,
+ Test.MyEnum.enum2
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.MyEnumSHelper.write(@out, arr);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Test.MyEnum[] arr2 = Test.MyEnumSHelper.read(@in);
+ test(Compare(arr2, arr));
+ @out.destroy();
+ @in.destroy();
+
+ Test.MyEnum[][] arrS =
+ {
+ arr,
+ new Test.MyEnum[0],
+ arr
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.MyEnumSSHelper.write(@out, arrS);
+ data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Test.MyEnum[][] arr2S = Test.MyEnumSSHelper.read(@in);
+ test(Compare(arr2S, arrS));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ Test.SmallStruct[] smallStructArray = new Test.SmallStruct[3];
+ for (int i = 0; i < smallStructArray.Length; ++i)
+ {
+ smallStructArray[i] = new Test.SmallStruct();
+ smallStructArray[i].bo = true;
+ smallStructArray[i].by = (byte)1;
+ smallStructArray[i].sh = (short)2;
+ smallStructArray[i].i = 3;
+ smallStructArray[i].l = 4;
+ smallStructArray[i].f = (float)5.0;
+ smallStructArray[i].d = 6.0;
+ smallStructArray[i].str = "7";
+ smallStructArray[i].e = Test.MyEnum.enum2;
+ smallStructArray[i].p = Test.MyClassPrxHelper.uncheckedCast(communicator.stringToProxy("test:default"));
+ }
+
+ Test.MyClass[] myClassArray = new Test.MyClass[4];
+ for (int i = 0; i < myClassArray.Length; ++i)
+ {
+ myClassArray[i] = new Test.MyClass();
+ myClassArray[i].c = myClassArray[i];
+ myClassArray[i].o = myClassArray[i];
+ myClassArray[i].s = new Test.SmallStruct();
+ myClassArray[i].s.e = Test.MyEnum.enum2;
+ myClassArray[i].seq1 = new bool[] { true, false, true, false };
+ myClassArray[i].seq2 = new byte[] { (byte)1, (byte)2, (byte)3, (byte)4 };
+ myClassArray[i].seq3 = new short[] { (short)1, (short)2, (short)3, (short)4 };
+ myClassArray[i].seq4 = new int[] { 1, 2, 3, 4 };
+ myClassArray[i].seq5 = new long[] { 1, 2, 3, 4 };
+ myClassArray[i].seq6 = new float[] { (float)1, (float)2, (float)3, (float)4 };
+ myClassArray[i].seq7 = new double[] { (double)1, (double)2, (double)3, (double)4 };
+ myClassArray[i].seq8 = new string[] { "string1", "string2", "string3", "string4" };
+ myClassArray[i].seq9 = new Test.MyEnum[] { Test.MyEnum.enum3, Test.MyEnum.enum2, Test.MyEnum.enum1 };
+ myClassArray[i].seq10 = new Test.MyClass[4]; // null elements.
+ myClassArray[i].d = new System.Collections.Generic.Dictionary<string, Test.MyClass>();
+ myClassArray[i].d["hi"] = myClassArray[i];
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.MyClassSHelper.write(@out, myClassArray);
+ @out.writePendingObjects();
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Test.MyClass[] arr2 = Test.MyClassSHelper.read(@in);
+ @in.readPendingObjects();
+ test(arr2.Length == myClassArray.Length);
+ for (int i = 0; i < arr2.Length; ++i)
+ {
+ test(arr2[i] != null);
+ test(arr2[i].c == arr2[i]);
+ test(arr2[i].o == arr2[i]);
+ test(arr2[i].s.e == Test.MyEnum.enum2);
+ test(Compare(arr2[i].seq1, myClassArray[i].seq1));
+ test(Compare(arr2[i].seq2, myClassArray[i].seq2));
+ test(Compare(arr2[i].seq3, myClassArray[i].seq3));
+ test(Compare(arr2[i].seq4, myClassArray[i].seq4));
+ test(Compare(arr2[i].seq5, myClassArray[i].seq5));
+ test(Compare(arr2[i].seq6, myClassArray[i].seq6));
+ test(Compare(arr2[i].seq7, myClassArray[i].seq7));
+ test(Compare(arr2[i].seq8, myClassArray[i].seq8));
+ test(Compare(arr2[i].seq9, myClassArray[i].seq9));
+ test(arr2[i].d["hi"].Equals(arr2[i]));
+ }
+ @out.destroy();
+ @in.destroy();
+
+ Test.MyClass[][] arrS =
+ {
+ myClassArray,
+ new Test.MyClass[0],
+ myClassArray
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.MyClassSSHelper.write(@out, arrS);
+ data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Test.MyClass[][] arr2S = Test.MyClassSSHelper.read(@in);
+ test(arr2S.Length == arrS.Length);
+ test(arr2S[0].Length == arrS[0].Length);
+ test(arr2S[1].Length == arrS[1].Length);
+ test(arr2S[2].Length == arrS[2].Length);
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ Test.MyInterface i = new MyInterfaceI();
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.MyInterfaceHelper.write(@out, i);
+ @out.writePendingObjects();
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Test.MyInterfaceHelper helper = new Test.MyInterfaceHelper(@in);
+ helper.read();
+ @in.readPendingObjects();
+ test(helper.value != null);
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.MyClass obj = new Test.MyClass();
+ obj.s = new Test.SmallStruct();
+ obj.s.e = Test.MyEnum.enum2;
+ TestObjectWriter writer = new TestObjectWriter(obj);
+ @out.writeObject(writer);
+ @out.writePendingObjects();
+ byte[] data = @out.finished();
+ test(writer.called);
+ factoryWrapper.setFactory(new TestObjectFactory());
+ @in = Ice.Util.createInputStream(communicator, data);
+ TestReadObjectCallback cb = new TestReadObjectCallback();
+ @in.readObject(cb);
+ @in.readPendingObjects();
+ test(cb.obj != null);
+ test(cb.obj is TestObjectReader);
+ TestObjectReader reader = (TestObjectReader)cb.obj;
+ test(reader.called);
+ test(reader.obj != null);
+ test(reader.obj.s.e == Test.MyEnum.enum2);
+ @out.destroy();
+ @in.destroy();
+ factoryWrapper.setFactory(null);
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.MyException ex = new Test.MyException();
+
+ Test.MyClass c = new Test.MyClass();
+ c.c = c;
+ c.o = c;
+ c.s = new Test.SmallStruct();
+ c.s.e = Test.MyEnum.enum2;
+ c.seq1 = new bool[] { true, false, true, false };
+ c.seq2 = new byte[] { (byte)1, (byte)2, (byte)3, (byte)4 };
+ c.seq3 = new short[] { (short)1, (short)2, (short)3, (short)4 };
+ c.seq4 = new int[] { 1, 2, 3, 4 };
+ c.seq5 = new long[] { 1, 2, 3, 4 };
+ c.seq6 = new float[] { (float)1, (float)2, (float)3, (float)4 };
+ c.seq7 = new double[] { (double)1, (double)2, (double)3, (double)4 };
+ c.seq8 = new string[] { "string1", "string2", "string3", "string4" };
+ c.seq9 = new Test.MyEnum[] { Test.MyEnum.enum3, Test.MyEnum.enum2, Test.MyEnum.enum1 };
+ c.seq10 = new Test.MyClass[4]; // null elements.
+ c.d = new Dictionary<string, Test.MyClass>();
+ c.d.Add("hi", c);
+
+ ex.c = c;
+
+ @out.writeException(ex);
+ byte[] data = @out.finished();
+
+ @in = Ice.Util.createInputStream(communicator, data);
+ try
+ {
+ @in.throwException();
+ test(false);
+ }
+ catch (Test.MyException ex1)
+ {
+ test(ex1.c.s.e == c.s.e);
+ test(Compare(ex1.c.seq1, c.seq1));
+ test(Compare(ex1.c.seq2, c.seq2));
+ test(Compare(ex1.c.seq3, c.seq3));
+ test(Compare(ex1.c.seq4, c.seq4));
+ test(Compare(ex1.c.seq5, c.seq5));
+ test(Compare(ex1.c.seq6, c.seq6));
+ test(Compare(ex1.c.seq7, c.seq7));
+ test(Compare(ex1.c.seq8, c.seq8));
+ test(Compare(ex1.c.seq9, c.seq9));
+ }
+ catch (Ice.UserException)
+ {
+ test(false);
+ }
+ }
+
+ {
+ Dictionary<byte, bool> dict = new Dictionary<byte, bool>();
+ dict.Add((byte)4, true);
+ dict.Add((byte)1, false);
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.ByteBoolDHelper.write(@out, dict);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Dictionary<byte, bool> dict2 = Test.ByteBoolDHelper.read(@in);
+ test(Ice.CollectionComparer.Equals(dict2, dict));
+ }
+
+ {
+ Dictionary<short, int> dict = new Dictionary<short, int>();
+ dict.Add((short)1, 9);
+ dict.Add((short)4, 8);
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.ShortIntDHelper.write(@out, dict);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Dictionary<short, int> dict2 = Test.ShortIntDHelper.read(@in);
+ test(Ice.CollectionComparer.Equals(dict2, dict));
+ }
+
+ {
+ Dictionary<long, float> dict = new Dictionary<long, float>();
+ dict.Add((long)123809828, (float)0.51f);
+ dict.Add((long)123809829, (float)0.56f);
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.LongFloatDHelper.write(@out, dict);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Dictionary<long, float> dict2 = Test.LongFloatDHelper.read(@in);
+ test(Ice.CollectionComparer.Equals(dict2, dict));
+ }
+
+ {
+ Dictionary<string, string> dict = new Dictionary<string, string>();
+ dict.Add("key1", "value1");
+ dict.Add("key2", "value2");
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.StringStringDHelper.write(@out, dict);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Dictionary<string, string> dict2 = Test.StringStringDHelper.read(@in);
+ test(Ice.CollectionComparer.Equals(dict2, dict));
+ }
+
+ {
+ Dictionary<string, Test.MyClass> dict = new Dictionary<string, Test.MyClass>();
+ Test.MyClass c;
+ c = new Test.MyClass();
+ c.s = new Test.SmallStruct();
+ c.s.e = Test.MyEnum.enum2;
+ dict.Add("key1", c);
+ c = new Test.MyClass();
+ c.s = new Test.SmallStruct();
+ c.s.e = Test.MyEnum.enum3;
+ dict.Add("key2", c);
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.StringMyClassDHelper.write(@out, dict);
+ @out.writePendingObjects();
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Dictionary<string, Test.MyClass> dict2 = Test.StringMyClassDHelper.read(@in);
+ @in.readPendingObjects();
+ test(dict2.Count == dict.Count);
+ test(dict2["key1"].s.e == Test.MyEnum.enum2);
+ test(dict2["key2"].s.e == Test.MyEnum.enum3);
+ }
+
+ {
+ bool[] arr =
+ {
+ true,
+ false,
+ true,
+ false
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ List<bool> l = new List<bool>(arr);
+ Test.BoolListHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ List<bool> l2 = Test.BoolListHelper.read(@in);
+ test(Compare(l, l2));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ byte[] arr =
+ {
+ (byte)0x01,
+ (byte)0x11,
+ (byte)0x12,
+ (byte)0x22
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ List<byte> l = new List<byte>(arr);
+ Test.ByteListHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ List<byte> l2 = Test.ByteListHelper.read(@in);
+ test(Compare(l2, l));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ Test.MyEnum[] arr =
+ {
+ Test.MyEnum.enum3,
+ Test.MyEnum.enum2,
+ Test.MyEnum.enum1,
+ Test.MyEnum.enum2
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ List<Test.MyEnum> l = new List<Test.MyEnum>(arr);
+ Test.MyEnumListHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ List<Test.MyEnum> l2 = Test.MyEnumListHelper.read(@in);
+ test(Compare(l2, l));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ List<Test.SmallStruct> l = new List<Test.SmallStruct>(smallStructArray);
+ Test.SmallStructListHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ List<Test.SmallStruct> l2 = Test.SmallStructListHelper.read(@in);
+ test(l2.Count == l.Count);
+ for (int i = 0; i < l2.Count; ++i)
+ {
+ test(l2[i].Equals(smallStructArray[i]));
+ }
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ List<Test.MyClass> l = new List<Test.MyClass>(myClassArray);
+ Test.MyClassListHelper.write(@out, l);
+ @out.writePendingObjects();
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ List<Test.MyClass> l2 = Test.MyClassListHelper.read(@in);
+ @in.readPendingObjects();
+ test(l2.Count == l.Count);
+ for (int i = 0; i < l2.Count; ++i)
+ {
+ test(l2[i] != null);
+ test(l2[i].c == l2[i]);
+ test(l2[i].o == l2[i]);
+ test(l2[i].s.e == Test.MyEnum.enum2);
+ test(Compare(l2[i].seq1, l[i].seq1));
+ test(Compare(l2[i].seq2, l[i].seq2));
+ test(Compare(l2[i].seq3, l[i].seq3));
+ test(Compare(l2[i].seq4, l[i].seq4));
+ test(Compare(l2[i].seq5, l[i].seq5));
+ test(Compare(l2[i].seq6, l[i].seq6));
+ test(Compare(l2[i].seq7, l[i].seq7));
+ test(Compare(l2[i].seq8, l[i].seq8));
+ test(Compare(l2[i].seq9, l[i].seq9));
+ test(l2[i].d["hi"].Equals(l2[i]));
+ }
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ Test.MyClassPrx[] arr = new Test.MyClassPrx[2];
+ arr[0] = Test.MyClassPrxHelper.uncheckedCast(communicator.stringToProxy("zero"));
+ arr[1] = Test.MyClassPrxHelper.uncheckedCast(communicator.stringToProxy("one"));
+ @out = Ice.Util.createOutputStream(communicator);
+ List<Test.MyClassPrx> l = new List<Test.MyClassPrx>(arr);
+ Test.MyClassProxyListHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ List<Test.MyClassPrx> l2 = Test.MyClassProxyListHelper.read(@in);
+ test(Compare(l2, l));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ short[] arr =
+ {
+ (short)0x01,
+ (short)0x11,
+ (short)0x12,
+ (short)0x22
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ LinkedList<short> l = new LinkedList<short>(arr);
+ Test.ShortLinkedListHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ LinkedList<short> l2 = Test.ShortLinkedListHelper.read(@in);
+ test(Compare(l2, l));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ int[] arr =
+ {
+ 0x01,
+ 0x11,
+ 0x12,
+ 0x22
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ LinkedList<int> l = new LinkedList<int>(arr);
+ Test.IntLinkedListHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ LinkedList<int> l2 = Test.IntLinkedListHelper.read(@in);
+ test(Compare(l2, l));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ Test.MyEnum[] arr =
+ {
+ Test.MyEnum.enum3,
+ Test.MyEnum.enum2,
+ Test.MyEnum.enum1,
+ Test.MyEnum.enum2
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ LinkedList<Test.MyEnum> l = new LinkedList<Test.MyEnum>(arr);
+ Test.MyEnumLinkedListHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ LinkedList<Test.MyEnum> l2 = Test.MyEnumLinkedListHelper.read(@in);
+ test(Compare(l2, l));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ LinkedList<Test.SmallStruct> l = new LinkedList<Test.SmallStruct>(smallStructArray);
+ Test.SmallStructLinkedListHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ LinkedList<Test.SmallStruct> l2 = Test.SmallStructLinkedListHelper.read(@in);
+ test(l2.Count == l.Count);
+ IEnumerator<Test.SmallStruct> e = l.GetEnumerator();
+ IEnumerator<Test.SmallStruct> e2 = l2.GetEnumerator();
+ while (e.MoveNext() && e2.MoveNext())
+ {
+ test(e.Current.Equals(e2.Current));
+ }
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ long[] arr =
+ {
+ 0x01,
+ 0x11,
+ 0x12,
+ 0x22
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Stack<long> l = new Stack<long>(arr);
+ Test.LongStackHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Stack<long> l2 = Test.LongStackHelper.read(@in);
+ test(Compare(l2, l));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ float[] arr =
+ {
+ (float)1,
+ (float)2,
+ (float)3,
+ (float)4
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Stack<float> l = new Stack<float>(arr);
+ Test.FloatStackHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Stack<float> l2 = Test.FloatStackHelper.read(@in);
+ test(Compare(l2, l));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ Stack<Test.SmallStruct> l = new Stack<Test.SmallStruct>(smallStructArray);
+ Test.SmallStructStackHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Stack<Test.SmallStruct> l2 = Test.SmallStructStackHelper.read(@in);
+ test(l2.Count == l.Count);
+ IEnumerator<Test.SmallStruct> e = l.GetEnumerator();
+ IEnumerator<Test.SmallStruct> e2 = l2.GetEnumerator();
+ while (e.MoveNext() && e2.MoveNext())
+ {
+ test(e.Current.Equals(e2.Current));
+ }
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ Test.MyClassPrx[] arr = new Test.MyClassPrx[2];
+ arr[0] = Test.MyClassPrxHelper.uncheckedCast(communicator.stringToProxy("zero"));
+ arr[1] = Test.MyClassPrxHelper.uncheckedCast(communicator.stringToProxy("one"));
+ @out = Ice.Util.createOutputStream(communicator);
+ Stack<Test.MyClassPrx> l = new Stack<Test.MyClassPrx>(arr);
+ Test.MyClassProxyStackHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Stack<Test.MyClassPrx> l2 = Test.MyClassProxyStackHelper.read(@in);
+ test(Compare(l2, l));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ double[] arr =
+ {
+ (double)1,
+ (double)2,
+ (double)3,
+ (double)4
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Queue<double> l = new Queue<double>(arr);
+ Test.DoubleQueueHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Queue<double> l2 = Test.DoubleQueueHelper.read(@in);
+ test(Compare(l2, l));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ string[] arr =
+ {
+ "string1",
+ "string2",
+ "string3",
+ "string4"
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Queue<string> l = new Queue<string>(arr);
+ Test.StringQueueHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Queue<string> l2 = Test.StringQueueHelper.read(@in);
+ test(Compare(l2, l));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ Queue<Test.SmallStruct> l = new Queue<Test.SmallStruct>(smallStructArray);
+ Test.SmallStructQueueHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Queue<Test.SmallStruct> l2 = Test.SmallStructQueueHelper.read(@in);
+ test(l2.Count == l.Count);
+ IEnumerator<Test.SmallStruct> e = l.GetEnumerator();
+ IEnumerator<Test.SmallStruct> e2 = l2.GetEnumerator();
+ while (e.MoveNext() && e2.MoveNext())
+ {
+ test(e.Current.Equals(e2.Current));
+ }
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ bool[] arr =
+ {
+ true,
+ false,
+ true,
+ false
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.BoolCollection l = new Test.BoolCollection(arr);
+ Test.BoolCollectionHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Test.BoolCollection l2 = Test.BoolCollectionHelper.read(@in);
+ test(Compare(l, l2));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ int[] arr =
+ {
+ 0x01,
+ 0x11,
+ 0x12,
+ 0x22
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.IntCollection l = new Test.IntCollection(arr);
+ Test.IntCollectionHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Test.IntCollection l2 = Test.IntCollectionHelper.read(@in);
+ test(Compare(l2, l));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ string[] arr =
+ {
+ "string1",
+ "string2",
+ "string3",
+ "string4"
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.StringCollection l = new Test.StringCollection(arr);
+ Test.StringCollectionHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Test.StringCollection l2 = Test.StringCollectionHelper.read(@in);
+ test(Compare(l2, l));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ Test.MyEnum[] arr =
+ {
+ Test.MyEnum.enum3,
+ Test.MyEnum.enum2,
+ Test.MyEnum.enum1,
+ Test.MyEnum.enum2
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.MyEnumCollection l = new Test.MyEnumCollection(arr);
+ Test.MyEnumCollectionHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Test.MyEnumCollection l2 = Test.MyEnumCollectionHelper.read(@in);
+ test(Compare(l2, l));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.SmallStructCollection l = new Test.SmallStructCollection(smallStructArray);
+ Test.SmallStructCollectionHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Test.SmallStructCollection l2 = Test.SmallStructCollectionHelper.read(@in);
+ test(l2.Count == l.Count);
+ IEnumerator<Test.SmallStruct> e = l.GetEnumerator();
+ IEnumerator<Test.SmallStruct> e2 = l2.GetEnumerator();
+ while (e.MoveNext() && e2.MoveNext())
+ {
+ test(e.Current.Equals(e2.Current));
+ }
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.MyClassCollection l = new Test.MyClassCollection(myClassArray);
+ Test.MyClassCollectionHelper.write(@out, l);
+ @out.writePendingObjects();
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Test.MyClassCollection l2 = Test.MyClassCollectionHelper.read(@in);
+ @in.readPendingObjects();
+ test(l2.Count == l.Count);
+ for (int i = 0; i < l2.Count; ++i)
+ {
+ test(l2[i] != null);
+ test(l2[i].c == l2[i]);
+ test(l2[i].o == l2[i]);
+ test(l2[i].s.e == Test.MyEnum.enum2);
+ test(Compare(l2[i].seq1, l[i].seq1));
+ test(Compare(l2[i].seq2, l[i].seq2));
+ test(Compare(l2[i].seq3, l[i].seq3));
+ test(Compare(l2[i].seq4, l[i].seq4));
+ test(Compare(l2[i].seq5, l[i].seq5));
+ test(Compare(l2[i].seq6, l[i].seq6));
+ test(Compare(l2[i].seq7, l[i].seq7));
+ test(Compare(l2[i].seq8, l[i].seq8));
+ test(Compare(l2[i].seq9, l[i].seq9));
+ test(l2[i].d["hi"].Equals(l2[i]));
+ }
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ string[] arr =
+ {
+ "string1",
+ "string2",
+ "string3",
+ "string4"
+ };
+ string[][] arrS =
+ {
+ arr,
+ new string[0],
+ arr
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ List<string[]> l = new List<string[]>(arrS);
+ Test.StringSListHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ List<string[]> l2 = Test.StringSListHelper.read(@in);
+ test(Compare(l2, l));
+ @out.destroy();
+ @in.destroy();
+ }
+
+ {
+ string[] arr =
+ {
+ "string1",
+ "string2",
+ "string3",
+ "string4"
+ };
+ string[][] arrS =
+ {
+ arr,
+ new string[0],
+ arr
+ };
+ @out = Ice.Util.createOutputStream(communicator);
+ Stack<string[]> l = new Stack<string[]>(arrS);
+ Test.StringSStackHelper.write(@out, l);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Stack<string[]> l2 = Test.StringSStackHelper.read(@in);
+ test(Compare(l2, l));
+ @out.destroy();
+ @in.destroy();
+ }
+#if !SILVERLIGHT
+ {
+#if COMPACT
+ SortedList<string, string> dict = new SortedList<string, string>();
+#else
+ SortedDictionary<string, string> dict = new SortedDictionary<string, string>();
+#endif
+ dict.Add("key1", "value1");
+ dict.Add("key2", "value2");
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.SortedStringStringDHelper.write(@out, dict);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ IDictionary<string, string> dict2 = Test.SortedStringStringDHelper.read(@in);
+ test(Ice.CollectionComparer.Equals(dict2, dict));
+ }
+
+ {
+ Test.StringIntDCollection dict = new Test.StringIntDCollection();
+ dict.Add("key1", 1);
+ dict.Add("key2", 2);
+ @out = Ice.Util.createOutputStream(communicator);
+ Test.StringIntDCollectionHelper.write(@out, dict);
+ byte[] data = @out.finished();
+ @in = Ice.Util.createInputStream(communicator, data);
+ Test.StringIntDCollection dict2 = Test.StringIntDCollectionHelper.read(@in);
+ test(Ice.CollectionComparer.Equals(dict2, dict));
+ }
+#endif
+ WriteLine("ok");
+#if !SILVERLIGHT
+ return 0;
+#endif
+ }
+}
diff --git a/cs/test/Ice/stream/App.xaml b/cs/test/Ice/stream/App.xaml
new file mode 100644
index 00000000000..ad9341c5046
--- /dev/null
+++ b/cs/test/Ice/stream/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="stream.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/stream/App.xaml.cs b/cs/test/Ice/stream/App.xaml.cs
new file mode 100644
index 00000000000..26c753f47df
--- /dev/null
+++ b/cs/test/Ice/stream/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace stream
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if (!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch (Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/stream/Client.cs b/cs/test/Ice/stream/Client.cs
index 1a3383191cc..1696e62af47 100644
--- a/cs/test/Ice/stream/Client.cs
+++ b/cs/test/Ice/stream/Client.cs
@@ -21,1412 +21,6 @@ using System.Collections.Generic;
public class Client
{
- private static void test(bool b)
- {
- if(!b)
- {
- throw new Exception();
- }
- }
-
- //
- // There does not appear to be any way to compare collections
- // in either C# or with the .NET framework. Something like
- // C++ STL EqualRange would be nice...
- //
- private static bool Compare(ICollection c1, ICollection c2)
- {
- if(c1 == null)
- {
- return c2 == null;
- }
- if(c2 == null)
- {
- return false;
- }
- if(!c1.GetType().Equals(c2.GetType()))
- {
- return false;
- }
-
- if(c1.Count != c2.Count)
- {
- return false;
- }
-
- IEnumerator i1 = c1.GetEnumerator();
- IEnumerator i2 = c2.GetEnumerator();
- while(i1.MoveNext())
- {
- i2.MoveNext();
- if(i1.Current is ICollection)
- {
- Debug.Assert(i2.Current is ICollection);
- if(!Compare((ICollection)i1.Current, (ICollection)i2.Current))
- {
- return false;
- }
- }
- else if(!i1.Current.Equals(i2.Current))
- {
- return false;
- }
- }
- return true;
- }
-
- private class TestObjectWriter : Ice.ObjectWriter
- {
- public TestObjectWriter(Test.MyClass obj)
- {
- this.obj = obj;
- }
-
- public override void write(Ice.OutputStream @out)
- {
- obj.write__(@out);
- called = true;
- }
-
- internal Test.MyClass obj;
- internal bool called = false;
- }
-
- private class TestObjectReader : Ice.ObjectReader
- {
- public override void read(Ice.InputStream @in, bool rid)
- {
- obj = new Test.MyClass();
- obj.read__(@in, rid);
- called = true;
- }
-
- internal Test.MyClass obj;
- internal bool called = false;
- }
-
- private class MyInterfaceI : Test.MyInterfaceDisp_
- {
- }
-
- private class MyInterfaceFactory : Ice.ObjectFactory
- {
- public Ice.Object create(string type)
- {
- Debug.Assert(type.Equals(Test.MyInterfaceDisp_.ice_staticId()));
- return new MyInterfaceI();
- }
-
- public void destroy()
- {
- }
- }
-
- private class TestObjectFactory : Ice.ObjectFactory
- {
- public Ice.Object create(string type)
- {
- Debug.Assert(type.Equals(Test.MyClass.ice_staticId()));
- return new TestObjectReader();
- }
-
- public void destroy()
- {
- }
- }
-
- private class TestReadObjectCallback : Ice.ReadObjectCallback
- {
- public void invoke(Ice.Object obj)
- {
- this.obj = obj;
- }
-
- internal Ice.Object obj;
- }
-
- public class MyClassFactoryWrapper : Ice.ObjectFactory
- {
- public MyClassFactoryWrapper()
- {
- _factory = null;
- }
-
- public Ice.Object create(string type)
- {
- if(_factory != null)
- {
- return _factory.create(type);
- }
- return new Test.MyClass();
- }
-
- public void destroy()
- {
- }
-
- public void setFactory(Ice.ObjectFactory factory)
- {
- _factory = factory;
- }
-
- private Ice.ObjectFactory _factory;
- }
-
- private static int run(string[] args, Ice.Communicator communicator)
- {
- MyClassFactoryWrapper factoryWrapper = new MyClassFactoryWrapper();
- communicator.addObjectFactory(factoryWrapper, Test.MyClass.ice_staticId());
- communicator.addObjectFactory(new MyInterfaceFactory(), Test.MyInterfaceDisp_.ice_staticId());
-
- Ice.InputStream @in;
- Ice.OutputStream @out;
-
- Console.Write("testing primitive types... ");
- Console.Out.Flush();
-
- {
- byte[] data = new byte[0];
- @in = Ice.Util.createInputStream(communicator, data);
- @in.destroy();
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- @out.startEncapsulation();
- @out.writeBool(true);
- @out.endEncapsulation();
- byte[] data = @out.finished();
- @out.destroy();
-
- @in = Ice.Util.createInputStream(communicator, data);
- @in.startEncapsulation();
- test(@in.readBool());
- @in.endEncapsulation();
- @in.destroy();
- }
-
- {
- byte[] data = new byte[0];
- @in = Ice.Util.createInputStream(communicator, data);
- try
- {
- @in.readBool();
- test(false);
- }
- catch(Ice.UnmarshalOutOfBoundsException)
- {
- }
- @in.destroy();
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- @out.writeBool(true);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- test(@in.readBool());
- @out.destroy();
- @in.destroy();
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- @out.writeByte((byte)1);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- test(@in.readByte() == (byte)1);
- @out.destroy();
- @in.destroy();
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- @out.writeShort((short)2);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- test(@in.readShort() == (short)2);
- @out.destroy();
- @in.destroy();
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- @out.writeInt(3);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- test(@in.readInt() == 3);
- @out.destroy();
- @in.destroy();
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- @out.writeLong(4);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- test(@in.readLong() == 4);
- @out.destroy();
- @in.destroy();
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- @out.writeFloat((float)5.0);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- test(@in.readFloat() == (float)5.0);
- @out.destroy();
- @in.destroy();
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- @out.writeDouble(6.0);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- test(@in.readDouble() == 6.0);
- @out.destroy();
- @in.destroy();
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- @out.writeString("hello world");
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- test(@in.readString().Equals("hello world"));
- @out.destroy();
- @in.destroy();
- }
-
- Console.WriteLine("ok");
-
- Console.Write("testing constructed types... ");
- Console.Out.Flush();
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- Test.MyEnumHelper.write(@out, Test.MyEnum.enum3);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- test(Test.MyEnumHelper.read(@in) == Test.MyEnum.enum3);
- @out.destroy();
- @in.destroy();
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- Test.SmallStruct s = new Test.SmallStruct();
- s.bo = true;
- s.by = (byte)1;
- s.sh = (short)2;
- s.i = 3;
- s.l = 4;
- s.f = (float)5.0;
- s.d = 6.0;
- s.str = "7";
- s.e = Test.MyEnum.enum2;
- s.p = Test.MyClassPrxHelper.uncheckedCast(communicator.stringToProxy("test:default"));
- s.ice_write(@out);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Test.SmallStruct s2 = new Test.SmallStruct();
- s2.ice_read(@in);
- test(s2.Equals(s));
- @out.destroy();
- @in.destroy();
- }
-
- {
- bool[] arr =
- {
- true,
- false,
- true,
- false
- };
- @out = Ice.Util.createOutputStream(communicator);
- Ice.BoolSeqHelper.write(@out, arr);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- bool[] arr2 = Ice.BoolSeqHelper.read(@in);
- test(Compare(arr2, arr));
- @out.destroy();
- @in.destroy();
-
- bool[][] arrS =
- {
- arr,
- new bool[0],
- arr
- };
- @out = Ice.Util.createOutputStream(communicator);
- Test.BoolSSHelper.write(@out, arrS);
- data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- bool[][] arr2S = Test.BoolSSHelper.read(@in);
- test(Compare(arr2S, arrS));
- @out.destroy();
- @in.destroy();
- }
-
- {
- byte[] arr =
- {
- (byte)0x01,
- (byte)0x11,
- (byte)0x12,
- (byte)0x22
- };
- @out = Ice.Util.createOutputStream(communicator);
- Ice.ByteSeqHelper.write(@out, arr);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- byte[] arr2 = Ice.ByteSeqHelper.read(@in);
- test(Compare(arr2, arr));
- @out.destroy();
- @in.destroy();
-
- byte[][] arrS =
- {
- arr,
- new byte[0],
- arr
- };
- @out = Ice.Util.createOutputStream(communicator);
- Test.ByteSSHelper.write(@out, arrS);
- data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- byte[][] arr2S = Test.ByteSSHelper.read(@in);
- test(Compare(arr2S, arrS));
- @out.destroy();
- @in.destroy();
- }
-
-#if !COMPACT
- {
- Serialize.Small small = new Serialize.Small();
- small.i = 99;
- @out = Ice.Util.createOutputStream(communicator);
- @out.writeSerializable(small);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Serialize.Small small2 = (Serialize.Small)@in.readSerializable();
- test(small2.i == 99);
- @out.destroy();
- @in.destroy();
- }
-#endif
-
- {
- short[] arr =
- {
- (short)0x01,
- (short)0x11,
- (short)0x12,
- (short)0x22
- };
- @out = Ice.Util.createOutputStream(communicator);
- Ice.ShortSeqHelper.write(@out, arr);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- short[] arr2 = Ice.ShortSeqHelper.read(@in);
- test(Compare(arr2, arr));
- @out.destroy();
- @in.destroy();
-
- short[][] arrS =
- {
- arr,
- new short[0],
- arr
- };
- @out = Ice.Util.createOutputStream(communicator);
- Test.ShortSSHelper.write(@out, arrS);
- data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- short[][] arr2S = Test.ShortSSHelper.read(@in);
- test(Compare(arr2S, arrS));
- @out.destroy();
- @in.destroy();
- }
-
- {
- int[] arr =
- {
- 0x01,
- 0x11,
- 0x12,
- 0x22
- };
- @out = Ice.Util.createOutputStream(communicator);
- Ice.IntSeqHelper.write(@out, arr);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- int[] arr2 = Ice.IntSeqHelper.read(@in);
- test(Compare(arr2, arr));
- @out.destroy();
- @in.destroy();
-
- int[][] arrS =
- {
- arr,
- new int[0],
- arr
- };
- @out = Ice.Util.createOutputStream(communicator);
- Test.IntSSHelper.write(@out, arrS);
- data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- int[][] arr2S = Test.IntSSHelper.read(@in);
- test(Compare(arr2S, arrS));
- @out.destroy();
- @in.destroy();
- }
-
- {
- long[] arr =
- {
- 0x01,
- 0x11,
- 0x12,
- 0x22
- };
- @out = Ice.Util.createOutputStream(communicator);
- Ice.LongSeqHelper.write(@out, arr);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- long[] arr2 = Ice.LongSeqHelper.read(@in);
- test(Compare(arr2, arr));
- @out.destroy();
- @in.destroy();
-
- long[][] arrS =
- {
- arr,
- new long[0],
- arr
- };
- @out = Ice.Util.createOutputStream(communicator);
- Test.LongSSHelper.write(@out, arrS);
- data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- long[][] arr2S = Test.LongSSHelper.read(@in);
- test(Compare(arr2S, arrS));
- @out.destroy();
- @in.destroy();
- }
-
- {
- float[] arr =
- {
- (float)1,
- (float)2,
- (float)3,
- (float)4
- };
- @out = Ice.Util.createOutputStream(communicator);
- Ice.FloatSeqHelper.write(@out, arr);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- float[] arr2 = Ice.FloatSeqHelper.read(@in);
- test(Compare(arr2, arr));
- @out.destroy();
- @in.destroy();
-
- float[][] arrS =
- {
- arr,
- new float[0],
- arr
- };
- @out = Ice.Util.createOutputStream(communicator);
- Test.FloatSSHelper.write(@out, arrS);
- data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- float[][] arr2S = Test.FloatSSHelper.read(@in);
- test(Compare(arr2S, arrS));
- @out.destroy();
- @in.destroy();
- }
-
- {
- double[] arr =
- {
- (double)1,
- (double)2,
- (double)3,
- (double)4
- };
- @out = Ice.Util.createOutputStream(communicator);
- Ice.DoubleSeqHelper.write(@out, arr);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- double[] arr2 = Ice.DoubleSeqHelper.read(@in);
- test(Compare(arr2, arr));
- @out.destroy();
- @in.destroy();
-
- double[][] arrS =
- {
- arr,
- new double[0],
- arr
- };
- @out = Ice.Util.createOutputStream(communicator);
- Test.DoubleSSHelper.write(@out, arrS);
- data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- double[][] arr2S = Test.DoubleSSHelper.read(@in);
- test(Compare(arr2S, arrS));
- @out.destroy();
- @in.destroy();
- }
-
- {
- string[] arr =
- {
- "string1",
- "string2",
- "string3",
- "string4"
- };
- @out = Ice.Util.createOutputStream(communicator);
- Ice.StringSeqHelper.write(@out, arr);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- string[] arr2 = Ice.StringSeqHelper.read(@in);
- test(Compare(arr2, arr));
- @out.destroy();
- @in.destroy();
-
- string[][] arrS =
- {
- arr,
- new string[0],
- arr
- };
- @out = Ice.Util.createOutputStream(communicator);
- Test.StringSSHelper.write(@out, arrS);
- data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- string[][] arr2S = Test.StringSSHelper.read(@in);
- test(Compare(arr2S, arrS));
- @out.destroy();
- @in.destroy();
- }
-
- {
- Test.MyEnum[] arr =
- {
- Test.MyEnum.enum3,
- Test.MyEnum.enum2,
- Test.MyEnum.enum1,
- Test.MyEnum.enum2
- };
- @out = Ice.Util.createOutputStream(communicator);
- Test.MyEnumSHelper.write(@out, arr);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Test.MyEnum[] arr2 = Test.MyEnumSHelper.read(@in);
- test(Compare(arr2, arr));
- @out.destroy();
- @in.destroy();
-
- Test.MyEnum[][] arrS =
- {
- arr,
- new Test.MyEnum[0],
- arr
- };
- @out = Ice.Util.createOutputStream(communicator);
- Test.MyEnumSSHelper.write(@out, arrS);
- data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Test.MyEnum[][] arr2S = Test.MyEnumSSHelper.read(@in);
- test(Compare(arr2S, arrS));
- @out.destroy();
- @in.destroy();
- }
-
- Test.SmallStruct[] smallStructArray = new Test.SmallStruct[3];
- for(int i = 0; i < smallStructArray.Length; ++i)
- {
- smallStructArray[i] = new Test.SmallStruct();
- smallStructArray[i].bo = true;
- smallStructArray[i].by = (byte)1;
- smallStructArray[i].sh = (short)2;
- smallStructArray[i].i = 3;
- smallStructArray[i].l = 4;
- smallStructArray[i].f = (float)5.0;
- smallStructArray[i].d = 6.0;
- smallStructArray[i].str = "7";
- smallStructArray[i].e = Test.MyEnum.enum2;
- smallStructArray[i].p = Test.MyClassPrxHelper.uncheckedCast(communicator.stringToProxy("test:default"));
- }
-
- Test.MyClass[] myClassArray = new Test.MyClass[4];
- for(int i = 0; i < myClassArray.Length; ++i)
- {
- myClassArray[i] = new Test.MyClass();
- myClassArray[i].c = myClassArray[i];
- myClassArray[i].o = myClassArray[i];
- myClassArray[i].s = new Test.SmallStruct();
- myClassArray[i].s.e = Test.MyEnum.enum2;
- myClassArray[i].seq1 = new bool[] { true, false, true, false };
- myClassArray[i].seq2 = new byte[] { (byte)1, (byte)2, (byte)3, (byte)4 };
- myClassArray[i].seq3 = new short[] { (short)1, (short)2, (short)3, (short)4 };
- myClassArray[i].seq4 = new int[] { 1, 2, 3, 4 };
- myClassArray[i].seq5 = new long[] { 1, 2, 3, 4 };
- myClassArray[i].seq6 = new float[] { (float)1, (float)2, (float)3, (float)4 };
- myClassArray[i].seq7 = new double[] { (double)1, (double)2, (double)3, (double)4 };
- myClassArray[i].seq8 = new string[] { "string1", "string2", "string3", "string4" };
- myClassArray[i].seq9 = new Test.MyEnum[] { Test.MyEnum.enum3, Test.MyEnum.enum2, Test.MyEnum.enum1 };
- myClassArray[i].seq10 = new Test.MyClass[4]; // null elements.
- myClassArray[i].d = new System.Collections.Generic.Dictionary<string, Test.MyClass>();
- myClassArray[i].d["hi"] = myClassArray[i];
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- Test.MyClassSHelper.write(@out, myClassArray);
- @out.writePendingObjects();
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Test.MyClass[] arr2 = Test.MyClassSHelper.read(@in);
- @in.readPendingObjects();
- test(arr2.Length == myClassArray.Length);
- for(int i = 0; i < arr2.Length; ++i)
- {
- test(arr2[i] != null);
- test(arr2[i].c == arr2[i]);
- test(arr2[i].o == arr2[i]);
- test(arr2[i].s.e == Test.MyEnum.enum2);
- test(Compare(arr2[i].seq1, myClassArray[i].seq1));
- test(Compare(arr2[i].seq2, myClassArray[i].seq2));
- test(Compare(arr2[i].seq3, myClassArray[i].seq3));
- test(Compare(arr2[i].seq4, myClassArray[i].seq4));
- test(Compare(arr2[i].seq5, myClassArray[i].seq5));
- test(Compare(arr2[i].seq6, myClassArray[i].seq6));
- test(Compare(arr2[i].seq7, myClassArray[i].seq7));
- test(Compare(arr2[i].seq8, myClassArray[i].seq8));
- test(Compare(arr2[i].seq9, myClassArray[i].seq9));
- test(arr2[i].d["hi"].Equals(arr2[i]));
- }
- @out.destroy();
- @in.destroy();
-
- Test.MyClass[][] arrS =
- {
- myClassArray,
- new Test.MyClass[0],
- myClassArray
- };
- @out = Ice.Util.createOutputStream(communicator);
- Test.MyClassSSHelper.write(@out, arrS);
- data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Test.MyClass[][] arr2S = Test.MyClassSSHelper.read(@in);
- test(arr2S.Length == arrS.Length);
- test(arr2S[0].Length == arrS[0].Length);
- test(arr2S[1].Length == arrS[1].Length);
- test(arr2S[2].Length == arrS[2].Length);
- @out.destroy();
- @in.destroy();
- }
-
- {
- Test.MyInterface i = new MyInterfaceI();
- @out = Ice.Util.createOutputStream(communicator);
- Test.MyInterfaceHelper.write(@out, i);
- @out.writePendingObjects();
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Test.MyInterfaceHelper helper = new Test.MyInterfaceHelper(@in);
- helper.read();
- @in.readPendingObjects();
- test(helper.value != null);
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- Test.MyClass obj = new Test.MyClass();
- obj.s = new Test.SmallStruct();
- obj.s.e = Test.MyEnum.enum2;
- TestObjectWriter writer = new TestObjectWriter(obj);
- @out.writeObject(writer);
- @out.writePendingObjects();
- byte[] data = @out.finished();
- test(writer.called);
- factoryWrapper.setFactory(new TestObjectFactory());
- @in = Ice.Util.createInputStream(communicator, data);
- TestReadObjectCallback cb = new TestReadObjectCallback();
- @in.readObject(cb);
- @in.readPendingObjects();
- test(cb.obj != null);
- test(cb.obj is TestObjectReader);
- TestObjectReader reader = (TestObjectReader)cb.obj;
- test(reader.called);
- test(reader.obj != null);
- test(reader.obj.s.e == Test.MyEnum.enum2);
- @out.destroy();
- @in.destroy();
- factoryWrapper.setFactory(null);
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- Test.MyException ex = new Test.MyException();
-
- Test.MyClass c = new Test.MyClass();
- c.c = c;
- c.o = c;
- c.s = new Test.SmallStruct();
- c.s.e = Test.MyEnum.enum2;
- c.seq1 = new bool[] { true, false, true, false };
- c.seq2 = new byte[] { (byte)1, (byte)2, (byte)3, (byte)4 };
- c.seq3 = new short[] { (short)1, (short)2, (short)3, (short)4 };
- c.seq4 = new int[] { 1, 2, 3, 4 };
- c.seq5 = new long[] { 1, 2, 3, 4 };
- c.seq6 = new float[] { (float)1, (float)2, (float)3, (float)4 };
- c.seq7 = new double[] { (double)1, (double)2, (double)3, (double)4 };
- c.seq8 = new string[] { "string1", "string2", "string3", "string4" };
- c.seq9 = new Test.MyEnum[] { Test.MyEnum.enum3, Test.MyEnum.enum2, Test.MyEnum.enum1 };
- c.seq10 = new Test.MyClass[4]; // null elements.
- c.d = new Dictionary<string, Test.MyClass>();
- c.d.Add("hi", c);
-
- ex.c = c;
-
- @out.writeException(ex);
- byte[] data = @out.finished();
-
- @in = Ice.Util.createInputStream(communicator, data);
- try
- {
- @in.throwException();
- test(false);
- }
- catch(Test.MyException ex1)
- {
- test(ex1.c.s.e == c.s.e);
- test(Compare(ex1.c.seq1, c.seq1));
- test(Compare(ex1.c.seq2, c.seq2));
- test(Compare(ex1.c.seq3, c.seq3));
- test(Compare(ex1.c.seq4, c.seq4));
- test(Compare(ex1.c.seq5, c.seq5));
- test(Compare(ex1.c.seq6, c.seq6));
- test(Compare(ex1.c.seq7, c.seq7));
- test(Compare(ex1.c.seq8, c.seq8));
- test(Compare(ex1.c.seq9, c.seq9));
- }
- catch(Ice.UserException)
- {
- test(false);
- }
- }
-
- {
- Dictionary<byte, bool> dict = new Dictionary<byte, bool>();
- dict.Add((byte)4, true);
- dict.Add((byte)1, false);
- @out = Ice.Util.createOutputStream(communicator);
- Test.ByteBoolDHelper.write(@out, dict);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Dictionary<byte, bool> dict2 = Test.ByteBoolDHelper.read(@in);
- test(Ice.CollectionComparer.Equals(dict2, dict));
- }
-
- {
- Dictionary<short, int> dict = new Dictionary<short, int>();
- dict.Add((short)1, 9);
- dict.Add((short)4, 8);
- @out = Ice.Util.createOutputStream(communicator);
- Test.ShortIntDHelper.write(@out, dict);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Dictionary<short, int> dict2 = Test.ShortIntDHelper.read(@in);
- test(Ice.CollectionComparer.Equals(dict2, dict));
- }
-
- {
- Dictionary<long, float> dict = new Dictionary<long, float>();
- dict.Add((long)123809828, (float)0.51f);
- dict.Add((long)123809829, (float)0.56f);
- @out = Ice.Util.createOutputStream(communicator);
- Test.LongFloatDHelper.write(@out, dict);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Dictionary<long, float> dict2 = Test.LongFloatDHelper.read(@in);
- test(Ice.CollectionComparer.Equals(dict2, dict));
- }
-
- {
- Dictionary<string, string> dict = new Dictionary<string, string>();
- dict.Add("key1", "value1");
- dict.Add("key2", "value2");
- @out = Ice.Util.createOutputStream(communicator);
- Test.StringStringDHelper.write(@out, dict);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Dictionary<string, string> dict2 = Test.StringStringDHelper.read(@in);
- test(Ice.CollectionComparer.Equals(dict2, dict));
- }
-
- {
- Dictionary<string, Test.MyClass> dict = new Dictionary<string, Test.MyClass>();
- Test.MyClass c;
- c = new Test.MyClass();
- c.s = new Test.SmallStruct();
- c.s.e = Test.MyEnum.enum2;
- dict.Add("key1", c);
- c = new Test.MyClass();
- c.s = new Test.SmallStruct();
- c.s.e = Test.MyEnum.enum3;
- dict.Add("key2", c);
- @out = Ice.Util.createOutputStream(communicator);
- Test.StringMyClassDHelper.write(@out, dict);
- @out.writePendingObjects();
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Dictionary<string, Test.MyClass> dict2 = Test.StringMyClassDHelper.read(@in);
- @in.readPendingObjects();
- test(dict2.Count == dict.Count);
- test(dict2["key1"].s.e == Test.MyEnum.enum2);
- test(dict2["key2"].s.e == Test.MyEnum.enum3);
- }
-
- {
- bool[] arr =
- {
- true,
- false,
- true,
- false
- };
- @out = Ice.Util.createOutputStream(communicator);
- List<bool> l = new List<bool>(arr);
- Test.BoolListHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- List<bool> l2 = Test.BoolListHelper.read(@in);
- test(Compare(l, l2));
- @out.destroy();
- @in.destroy();
- }
-
- {
- byte[] arr =
- {
- (byte)0x01,
- (byte)0x11,
- (byte)0x12,
- (byte)0x22
- };
- @out = Ice.Util.createOutputStream(communicator);
- List<byte> l = new List<byte>(arr);
- Test.ByteListHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- List<byte> l2 = Test.ByteListHelper.read(@in);
- test(Compare(l2, l));
- @out.destroy();
- @in.destroy();
- }
-
- {
- Test.MyEnum[] arr =
- {
- Test.MyEnum.enum3,
- Test.MyEnum.enum2,
- Test.MyEnum.enum1,
- Test.MyEnum.enum2
- };
- @out = Ice.Util.createOutputStream(communicator);
- List<Test.MyEnum> l = new List<Test.MyEnum>(arr);
- Test.MyEnumListHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- List<Test.MyEnum> l2 = Test.MyEnumListHelper.read(@in);
- test(Compare(l2, l));
- @out.destroy();
- @in.destroy();
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- List<Test.SmallStruct> l = new List<Test.SmallStruct>(smallStructArray);
- Test.SmallStructListHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- List<Test.SmallStruct> l2 = Test.SmallStructListHelper.read(@in);
- test(l2.Count == l.Count);
- for(int i = 0; i < l2.Count; ++i)
- {
- test(l2[i].Equals(smallStructArray[i]));
- }
- @out.destroy();
- @in.destroy();
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- List<Test.MyClass> l = new List<Test.MyClass>(myClassArray);
- Test.MyClassListHelper.write(@out, l);
- @out.writePendingObjects();
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- List<Test.MyClass> l2 = Test.MyClassListHelper.read(@in);
- @in.readPendingObjects();
- test(l2.Count == l.Count);
- for(int i = 0; i < l2.Count; ++i)
- {
- test(l2[i] != null);
- test(l2[i].c == l2[i]);
- test(l2[i].o == l2[i]);
- test(l2[i].s.e == Test.MyEnum.enum2);
- test(Compare(l2[i].seq1, l[i].seq1));
- test(Compare(l2[i].seq2, l[i].seq2));
- test(Compare(l2[i].seq3, l[i].seq3));
- test(Compare(l2[i].seq4, l[i].seq4));
- test(Compare(l2[i].seq5, l[i].seq5));
- test(Compare(l2[i].seq6, l[i].seq6));
- test(Compare(l2[i].seq7, l[i].seq7));
- test(Compare(l2[i].seq8, l[i].seq8));
- test(Compare(l2[i].seq9, l[i].seq9));
- test(l2[i].d["hi"].Equals(l2[i]));
- }
- @out.destroy();
- @in.destroy();
- }
-
- {
- Test.MyClassPrx[] arr = new Test.MyClassPrx[2];
- arr[0] = Test.MyClassPrxHelper.uncheckedCast(communicator.stringToProxy("zero"));
- arr[1] = Test.MyClassPrxHelper.uncheckedCast(communicator.stringToProxy("one"));
- @out = Ice.Util.createOutputStream(communicator);
- List<Test.MyClassPrx> l = new List<Test.MyClassPrx>(arr);
- Test.MyClassProxyListHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- List<Test.MyClassPrx> l2 = Test.MyClassProxyListHelper.read(@in);
- test(Compare(l2, l));
- @out.destroy();
- @in.destroy();
- }
-
- {
- short[] arr =
- {
- (short)0x01,
- (short)0x11,
- (short)0x12,
- (short)0x22
- };
- @out = Ice.Util.createOutputStream(communicator);
- LinkedList<short> l = new LinkedList<short>(arr);
- Test.ShortLinkedListHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- LinkedList<short> l2 = Test.ShortLinkedListHelper.read(@in);
- test(Compare(l2, l));
- @out.destroy();
- @in.destroy();
- }
-
- {
- int[] arr =
- {
- 0x01,
- 0x11,
- 0x12,
- 0x22
- };
- @out = Ice.Util.createOutputStream(communicator);
- LinkedList<int> l = new LinkedList<int>(arr);
- Test.IntLinkedListHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- LinkedList<int> l2 = Test.IntLinkedListHelper.read(@in);
- test(Compare(l2, l));
- @out.destroy();
- @in.destroy();
- }
-
- {
- Test.MyEnum[] arr =
- {
- Test.MyEnum.enum3,
- Test.MyEnum.enum2,
- Test.MyEnum.enum1,
- Test.MyEnum.enum2
- };
- @out = Ice.Util.createOutputStream(communicator);
- LinkedList<Test.MyEnum> l = new LinkedList<Test.MyEnum>(arr);
- Test.MyEnumLinkedListHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- LinkedList<Test.MyEnum> l2 = Test.MyEnumLinkedListHelper.read(@in);
- test(Compare(l2, l));
- @out.destroy();
- @in.destroy();
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- LinkedList<Test.SmallStruct> l = new LinkedList<Test.SmallStruct>(smallStructArray);
- Test.SmallStructLinkedListHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- LinkedList<Test.SmallStruct> l2 = Test.SmallStructLinkedListHelper.read(@in);
- test(l2.Count == l.Count);
- IEnumerator<Test.SmallStruct> e = l.GetEnumerator();
- IEnumerator<Test.SmallStruct> e2 = l2.GetEnumerator();
- while(e.MoveNext() && e2.MoveNext())
- {
- test(e.Current.Equals(e2.Current));
- }
- @out.destroy();
- @in.destroy();
- }
-
- {
- long[] arr =
- {
- 0x01,
- 0x11,
- 0x12,
- 0x22
- };
- @out = Ice.Util.createOutputStream(communicator);
- Stack<long> l = new Stack<long>(arr);
- Test.LongStackHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Stack<long> l2 = Test.LongStackHelper.read(@in);
- test(Compare(l2, l));
- @out.destroy();
- @in.destroy();
- }
-
- {
- float[] arr =
- {
- (float)1,
- (float)2,
- (float)3,
- (float)4
- };
- @out = Ice.Util.createOutputStream(communicator);
- Stack<float> l = new Stack<float>(arr);
- Test.FloatStackHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Stack<float> l2 = Test.FloatStackHelper.read(@in);
- test(Compare(l2, l));
- @out.destroy();
- @in.destroy();
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- Stack<Test.SmallStruct> l = new Stack<Test.SmallStruct>(smallStructArray);
- Test.SmallStructStackHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Stack<Test.SmallStruct> l2 = Test.SmallStructStackHelper.read(@in);
- test(l2.Count == l.Count);
- IEnumerator<Test.SmallStruct> e = l.GetEnumerator();
- IEnumerator<Test.SmallStruct> e2 = l2.GetEnumerator();
- while(e.MoveNext() && e2.MoveNext())
- {
- test(e.Current.Equals(e2.Current));
- }
- @out.destroy();
- @in.destroy();
- }
-
- {
- Test.MyClassPrx[] arr = new Test.MyClassPrx[2];
- arr[0] = Test.MyClassPrxHelper.uncheckedCast(communicator.stringToProxy("zero"));
- arr[1] = Test.MyClassPrxHelper.uncheckedCast(communicator.stringToProxy("one"));
- @out = Ice.Util.createOutputStream(communicator);
- Stack<Test.MyClassPrx> l = new Stack<Test.MyClassPrx>(arr);
- Test.MyClassProxyStackHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Stack<Test.MyClassPrx> l2 = Test.MyClassProxyStackHelper.read(@in);
- test(Compare(l2, l));
- @out.destroy();
- @in.destroy();
- }
-
- {
- double[] arr =
- {
- (double)1,
- (double)2,
- (double)3,
- (double)4
- };
- @out = Ice.Util.createOutputStream(communicator);
- Queue<double> l = new Queue<double>(arr);
- Test.DoubleQueueHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Queue<double> l2 = Test.DoubleQueueHelper.read(@in);
- test(Compare(l2, l));
- @out.destroy();
- @in.destroy();
- }
-
- {
- string[] arr =
- {
- "string1",
- "string2",
- "string3",
- "string4"
- };
- @out = Ice.Util.createOutputStream(communicator);
- Queue<string> l = new Queue<string>(arr);
- Test.StringQueueHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Queue<string> l2 = Test.StringQueueHelper.read(@in);
- test(Compare(l2, l));
- @out.destroy();
- @in.destroy();
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- Queue<Test.SmallStruct> l = new Queue<Test.SmallStruct>(smallStructArray);
- Test.SmallStructQueueHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Queue<Test.SmallStruct> l2 = Test.SmallStructQueueHelper.read(@in);
- test(l2.Count == l.Count);
- IEnumerator<Test.SmallStruct> e = l.GetEnumerator();
- IEnumerator<Test.SmallStruct> e2 = l2.GetEnumerator();
- while(e.MoveNext() && e2.MoveNext())
- {
- test(e.Current.Equals(e2.Current));
- }
- @out.destroy();
- @in.destroy();
- }
-
- {
- bool[] arr =
- {
- true,
- false,
- true,
- false
- };
- @out = Ice.Util.createOutputStream(communicator);
- Test.BoolCollection l = new Test.BoolCollection(arr);
- Test.BoolCollectionHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Test.BoolCollection l2 = Test.BoolCollectionHelper.read(@in);
- test(Compare(l, l2));
- @out.destroy();
- @in.destroy();
- }
-
- {
- int[] arr =
- {
- 0x01,
- 0x11,
- 0x12,
- 0x22
- };
- @out = Ice.Util.createOutputStream(communicator);
- Test.IntCollection l = new Test.IntCollection(arr);
- Test.IntCollectionHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Test.IntCollection l2 = Test.IntCollectionHelper.read(@in);
- test(Compare(l2, l));
- @out.destroy();
- @in.destroy();
- }
-
- {
- string[] arr =
- {
- "string1",
- "string2",
- "string3",
- "string4"
- };
- @out = Ice.Util.createOutputStream(communicator);
- Test.StringCollection l = new Test.StringCollection(arr);
- Test.StringCollectionHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Test.StringCollection l2 = Test.StringCollectionHelper.read(@in);
- test(Compare(l2, l));
- @out.destroy();
- @in.destroy();
- }
-
- {
- Test.MyEnum[] arr =
- {
- Test.MyEnum.enum3,
- Test.MyEnum.enum2,
- Test.MyEnum.enum1,
- Test.MyEnum.enum2
- };
- @out = Ice.Util.createOutputStream(communicator);
- Test.MyEnumCollection l = new Test.MyEnumCollection(arr);
- Test.MyEnumCollectionHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Test.MyEnumCollection l2 = Test.MyEnumCollectionHelper.read(@in);
- test(Compare(l2, l));
- @out.destroy();
- @in.destroy();
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- Test.SmallStructCollection l = new Test.SmallStructCollection(smallStructArray);
- Test.SmallStructCollectionHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Test.SmallStructCollection l2 = Test.SmallStructCollectionHelper.read(@in);
- test(l2.Count == l.Count);
- IEnumerator<Test.SmallStruct> e = l.GetEnumerator();
- IEnumerator<Test.SmallStruct> e2 = l2.GetEnumerator();
- while(e.MoveNext() && e2.MoveNext())
- {
- test(e.Current.Equals(e2.Current));
- }
- @out.destroy();
- @in.destroy();
- }
-
- {
- @out = Ice.Util.createOutputStream(communicator);
- Test.MyClassCollection l = new Test.MyClassCollection(myClassArray);
- Test.MyClassCollectionHelper.write(@out, l);
- @out.writePendingObjects();
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Test.MyClassCollection l2 = Test.MyClassCollectionHelper.read(@in);
- @in.readPendingObjects();
- test(l2.Count == l.Count);
- for(int i = 0; i < l2.Count; ++i)
- {
- test(l2[i] != null);
- test(l2[i].c == l2[i]);
- test(l2[i].o == l2[i]);
- test(l2[i].s.e == Test.MyEnum.enum2);
- test(Compare(l2[i].seq1, l[i].seq1));
- test(Compare(l2[i].seq2, l[i].seq2));
- test(Compare(l2[i].seq3, l[i].seq3));
- test(Compare(l2[i].seq4, l[i].seq4));
- test(Compare(l2[i].seq5, l[i].seq5));
- test(Compare(l2[i].seq6, l[i].seq6));
- test(Compare(l2[i].seq7, l[i].seq7));
- test(Compare(l2[i].seq8, l[i].seq8));
- test(Compare(l2[i].seq9, l[i].seq9));
- test(l2[i].d["hi"].Equals(l2[i]));
- }
- @out.destroy();
- @in.destroy();
- }
-
- {
- string[] arr =
- {
- "string1",
- "string2",
- "string3",
- "string4"
- };
- string[][] arrS =
- {
- arr,
- new string[0],
- arr
- };
- @out = Ice.Util.createOutputStream(communicator);
- List<string[]> l = new List<string[]>(arrS);
- Test.StringSListHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- List<string[]> l2 = Test.StringSListHelper.read(@in);
- test(Compare(l2, l));
- @out.destroy();
- @in.destroy();
- }
-
- {
- string[] arr =
- {
- "string1",
- "string2",
- "string3",
- "string4"
- };
- string[][] arrS =
- {
- arr,
- new string[0],
- arr
- };
- @out = Ice.Util.createOutputStream(communicator);
- Stack<string[]> l = new Stack<string[]>(arrS);
- Test.StringSStackHelper.write(@out, l);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Stack<string[]> l2 = Test.StringSStackHelper.read(@in);
- test(Compare(l2, l));
- @out.destroy();
- @in.destroy();
- }
-
- {
-#if COMPACT
- SortedList<string, string> dict = new SortedList<string, string>();
-#else
- SortedDictionary<string, string> dict = new SortedDictionary<string, string>();
-#endif
- dict.Add("key1", "value1");
- dict.Add("key2", "value2");
- @out = Ice.Util.createOutputStream(communicator);
- Test.SortedStringStringDHelper.write(@out, dict);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- IDictionary<string, string> dict2 = Test.SortedStringStringDHelper.read(@in);
- test(Ice.CollectionComparer.Equals(dict2, dict));
- }
-
- {
- Test.StringIntDCollection dict = new Test.StringIntDCollection();
- dict.Add("key1", 1);
- dict.Add("key2", 2);
- @out = Ice.Util.createOutputStream(communicator);
- Test.StringIntDCollectionHelper.write(@out, dict);
- byte[] data = @out.finished();
- @in = Ice.Util.createInputStream(communicator, data);
- Test.StringIntDCollection dict2 = Test.StringIntDCollectionHelper.read(@in);
- test(Ice.CollectionComparer.Equals(dict2, dict));
- }
-
- Console.WriteLine("ok");
-
- return 0;
- }
-
public static int Main(string[] args)
{
int status = 0;
@@ -1448,7 +42,7 @@ public class Client
data.properties.setProperty("Ice.FactoryAssemblies", "client");
#endif
communicator = Ice.Util.initialize(ref args, data);
- status = run(args, communicator);
+ status = AllTests.run(communicator);
}
catch(System.Exception ex)
{
diff --git a/cs/test/Ice/stream/Makefile b/cs/test/Ice/stream/Makefile
index 2f5bc590cb2..1741101e207 100644
--- a/cs/test/Ice/stream/Makefile
+++ b/cs/test/Ice/stream/Makefile
@@ -11,7 +11,7 @@ top_srcdir = ../../..
TARGETS = client.exe
-C_SRCS = Client.cs
+C_SRCS = Client.cs AllTests.cs ../../TestCommon/TestApp.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/stream/Makefile.mak b/cs/test/Ice/stream/Makefile.mak
index 5b8f78c28ca..9f2d651e8e4 100644
--- a/cs/test/Ice/stream/Makefile.mak
+++ b/cs/test/Ice/stream/Makefile.mak
@@ -11,7 +11,7 @@ top_srcdir = ..\..\..
TARGETS = client.exe Serializable.dll
-C_SRCS = Client.cs
+C_SRCS = Client.cs AllTests.cs ..\..\TestCommon\TestApp.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/stream/Properties/AppManifest.xml b/cs/test/Ice/stream/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/stream/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/stream/Properties/AssemblyInfo.cs b/cs/test/Ice/stream/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..5b18f2eac22
--- /dev/null
+++ b/cs/test/Ice/stream/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("stream")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("stream")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("bd19b1a3-70fe-42b7-a833-4d9daa9e5fab")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/stream/Properties/InBrowserSettings.xml b/cs/test/Ice/stream/Properties/InBrowserSettings.xml
new file mode 100644
index 00000000000..3b6382d71c5
--- /dev/null
+++ b/cs/test/Ice/stream/Properties/InBrowserSettings.xml
@@ -0,0 +1,5 @@
+<InBrowserSettings>
+ <InBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="NotRequired" />
+ </InBrowserSettings.SecuritySettings>
+</InBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/stream/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/stream/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..a21bfded055
--- /dev/null
+++ b/cs/test/Ice/stream/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Stream Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>stream Application on your desktop; at home, at work or on the go.</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Stream Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/stream/Test.ice b/cs/test/Ice/stream/Test.ice
index 4c7c00b136a..41f76e41ca8 100644
--- a/cs/test/Ice/stream/Test.ice
+++ b/cs/test/Ice/stream/Test.ice
@@ -113,17 +113,22 @@ sequence<Ice::StringSeq> StringSList;
["clr:generic:Stack"]
sequence<Ice::StringSeq> StringSStack;
-#if COMPACT
+#ifndef SILVERLIGHT
+# if COMPACT
["clr:generic:SortedList"]
dictionary<string, string> SortedStringStringD;
-#else
+# else
["clr:generic:SortedDictionary"]
dictionary<string, string> SortedStringStringD;
+# endif
#endif
+
["clr:collection"]
dictionary<string, int> StringIntDCollection;
+#ifndef SILVERLIGHT
["clr:serializable:Serialize.Small"] sequence<byte> SerialSmall;
+#endif
class MyClass
{
@@ -141,7 +146,7 @@ class MyClass
MyEnumS seq9;
MyClassS seq10;
StringMyClassD d;
-#ifndef COMPACT
+#if !defined(COMPACT) && !defined(SILVERLIGHT)
SerialSmall ss;
#endif
};
diff --git a/cs/test/Ice/stream/stream.csproj b/cs/test/Ice/stream/stream.csproj
new file mode 100644
index 00000000000..444378bd7cf
--- /dev/null
+++ b/cs/test/Ice/stream/stream.csproj
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{21950547-9EDD-48D9-8311-8EBA541524C9}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>stream</RootNamespace>
+ <AssemblyName>stream</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>stream.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>stream.App</SilverlightAppEntry>
+ <TestPageFileName>streamTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ <InBrowserSettingsFile>Properties\InBrowserSettings.xml</InBrowserSettingsFile>
+ <RequireInBrowserElevation>false</RequireInBrowserElevation>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\InBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_ExtraOptions="-DSILVERLIGHT" ZerocIce_Streaming="True" ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/Ice/timeout/AllTests.cs b/cs/test/Ice/timeout/AllTests.cs
index 14cb68653c5..2aaf97dcb13 100644
--- a/cs/test/Ice/timeout/AllTests.cs
+++ b/cs/test/Ice/timeout/AllTests.cs
@@ -9,18 +9,14 @@
using System;
using System.Diagnostics;
-using System.Threading;
+using System.Threading;
+
+#if SILVERLIGHT
+using System.Windows.Controls;
+#endif
-public class AllTests
+public class AllTests : TestCommon.TestApp
{
- private static void test(bool b)
- {
- if(!b)
- {
- throw new Exception();
- }
- }
-
private class CallbackBase
{
internal CallbackBase()
@@ -96,7 +92,28 @@ public class AllTests
private CallbackBase callback = new CallbackBase();
}
+#if SILVERLIGHT
+ public override Ice.InitializationData initData()
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties();
+ //
+ // For this test, we want to disable retries.
+ //
+ initData.properties.setProperty("Ice.RetryIntervals", "-1");
+
+ //
+ // This test kills connections, so we don't want warnings.
+ //
+ initData.properties.setProperty("Ice.Warn.Connections", "0");
+ return initData;
+ }
+
+ override
+ public void run(Ice.Communicator communicator)
+#else
public static Test.TimeoutPrx allTests(Ice.Communicator communicator)
+#endif
{
string sref = "timeout:default -p 12010";
Ice.ObjectPrx obj = communicator.stringToProxy(sref);
@@ -105,8 +122,8 @@ public class AllTests
Test.TimeoutPrx timeout = Test.TimeoutPrxHelper.checkedCast(obj);
test(timeout != null);
- Console.Out.Write("testing connect timeout... ");
- Console.Out.Flush();
+ Write("testing connect timeout... ");
+ Flush();
{
//
// Expect ConnectTimeoutException.
@@ -141,10 +158,10 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing read timeout... ");
- Console.Out.Flush();
+ Write("testing read timeout... ");
+ Flush();
{
//
// Expect TimeoutException.
@@ -175,10 +192,10 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing write timeout... ");
- Console.Out.Flush();
+ Write("testing write timeout... ");
+ Flush();
{
//
// Expect TimeoutException.
@@ -213,10 +230,10 @@ public class AllTests
test(false);
}
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing AMI read timeout... ");
- Console.Out.Flush();
+ Write("testing AMI read timeout... ");
+ Flush();
{
//
// Expect TimeoutException.
@@ -236,10 +253,10 @@ public class AllTests
to.begin_sleep(500).whenCompleted(cb.response, cb.exception);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing AMI write timeout... ");
- Console.Out.Flush();
+ Write("testing AMI write timeout... ");
+ Flush();
{
//
// Expect TimeoutException.
@@ -263,10 +280,10 @@ public class AllTests
to.begin_sendData(seq).whenCompleted(cb.response, cb.exception);
cb.check();
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing close timeout... ");
- Console.Out.Flush();
+ Write("testing close timeout... ");
+ Flush();
{
Test.TimeoutPrx to = Test.TimeoutPrxHelper.checkedCast(obj.ice_timeout(250));
Ice.Connection connection = to.ice_getConnection();
@@ -292,10 +309,10 @@ public class AllTests
}
timeout.op(); // Ensure adapter is active.
}
- Console.Out.WriteLine("ok");
+ WriteLine("ok");
- Console.Out.Write("testing timeout overrides... ");
- Console.Out.Flush();
+ Write("testing timeout overrides... ");
+ Flush();
{
//
// Test Ice.Override.Timeout. This property overrides all
@@ -391,14 +408,17 @@ public class AllTests
initData.properties.setProperty("Ice.Override.CloseTimeout", "200");
Ice.Communicator comm = Ice.Util.initialize(initData);
comm.stringToProxy(sref).ice_getConnection();
- timeout.holdAdapter(750);
- Stopwatch stopwatch = new Stopwatch();
- long now = stopwatch.ElapsedMilliseconds;
- comm.destroy();
- test(stopwatch.ElapsedMilliseconds - now < 500);
+ timeout.holdAdapter(750);
+ timeout.holdAdapter(750);
+ long begin = System.DateTime.Now.Ticks;
+ comm.destroy();
+ test(((long)new System.TimeSpan(System.DateTime.Now.Ticks - begin).TotalMilliseconds - begin) < 500);
}
- Console.Out.WriteLine("ok");
-
+ WriteLine("ok");
+#if SILVERLIGHT
+ timeout.shutdown();
+#else
return timeout;
+#endif
}
}
diff --git a/cs/test/Ice/timeout/App.xaml b/cs/test/Ice/timeout/App.xaml
new file mode 100644
index 00000000000..77376526f5d
--- /dev/null
+++ b/cs/test/Ice/timeout/App.xaml
@@ -0,0 +1,8 @@
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="timeout.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/test/Ice/timeout/App.xaml.cs b/cs/test/Ice/timeout/App.xaml.cs
new file mode 100644
index 00000000000..b84a63034db
--- /dev/null
+++ b/cs/test/Ice/timeout/App.xaml.cs
@@ -0,0 +1,81 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace timeout
+{
+ public partial class App : Application
+ {
+ public App()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Current.MainWindow.WindowState = WindowState.Minimized;
+ Current.MainWindow.Visibility = Visibility.Collapsed;
+ });
+ this.Startup += this.Application_Startup;
+ this.Exit += this.Application_Exit;
+ this.UnhandledException += this.Application_UnhandledException;
+ InitializeComponent();
+ }
+
+ private void Application_Startup(object sender, StartupEventArgs e)
+ {
+ TestCommon.TestApp app = new AllTests();
+ app.main();
+ }
+
+ private void Application_Exit(object sender, EventArgs e)
+ {
+
+ }
+
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ // If the app is running outside of the debugger then report the exception using
+ // the browser's exception mechanism. On IE this will display it a yellow alert
+ // icon in the status bar and Firefox will display a script error.
+ if(!System.Diagnostics.Debugger.IsAttached)
+ {
+
+ // NOTE: This will allow the application to continue running after an exception has been thrown
+ // but not handled.
+ // For production applications this error handling should be replaced with something that will
+ // report the error to the website and stop the application.
+ e.Handled = true;
+ Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+ }
+ }
+
+ private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+ errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+ System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+ }
+ catch(Exception)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/test/Ice/timeout/Makefile b/cs/test/Ice/timeout/Makefile
index 42e0401ea1e..fd2863789a0 100644
--- a/cs/test/Ice/timeout/Makefile
+++ b/cs/test/Ice/timeout/Makefile
@@ -11,7 +11,7 @@ top_srcdir = ../../..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ../../TestCommon/TestApp.cs
S_SRCS = TimeoutI.cs Server.cs
SLICE_SRCS = $(SDIR)/Test.ice
diff --git a/cs/test/Ice/timeout/Makefile.mak b/cs/test/Ice/timeout/Makefile.mak
index fb119ff664e..16217e6d4b6 100644
--- a/cs/test/Ice/timeout/Makefile.mak
+++ b/cs/test/Ice/timeout/Makefile.mak
@@ -11,7 +11,7 @@ top_srcdir = ..\..\..
TARGETS = client.exe server.exe
-C_SRCS = AllTests.cs Client.cs
+C_SRCS = AllTests.cs Client.cs ..\..\TestCommon\TestApp.cs
S_SRCS = TimeoutI.cs Server.cs
GEN_SRCS = $(GDIR)\Test.cs
diff --git a/cs/test/Ice/timeout/Properties/AppManifest.xml b/cs/test/Ice/timeout/Properties/AppManifest.xml
new file mode 100644
index 00000000000..a9552327529
--- /dev/null
+++ b/cs/test/Ice/timeout/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
diff --git a/cs/test/Ice/timeout/Properties/AssemblyInfo.cs b/cs/test/Ice/timeout/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..8a962a894e1
--- /dev/null
+++ b/cs/test/Ice/timeout/Properties/AssemblyInfo.cs
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2011 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.
+//
+// **********************************************************************
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("timeout")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("timeout")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("f47eb28d-54ef-4285-8441-a55a39eb749b")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/cs/test/Ice/timeout/Properties/OutOfBrowserSettings.xml b/cs/test/Ice/timeout/Properties/OutOfBrowserSettings.xml
new file mode 100644
index 00000000000..fb7eaa8e3a6
--- /dev/null
+++ b/cs/test/Ice/timeout/Properties/OutOfBrowserSettings.xml
@@ -0,0 +1,10 @@
+<OutOfBrowserSettings ShortName="Timeout Test" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Timeout Test</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Timeout Test" Height="1" Width="1" Top="0" Left="0" WindowStartupLocation="Manual" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings> \ No newline at end of file
diff --git a/cs/test/Ice/timeout/timeout.csproj b/cs/test/Ice/timeout/timeout.csproj
new file mode 100644
index 00000000000..35e4caa8dc6
--- /dev/null
+++ b/cs/test/Ice/timeout/timeout.csproj
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{86F3AD27-AC8E-417F-ADCF-461AE33870A6}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>timeout</RootNamespace>
+ <AssemblyName>timeout</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>timeout.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>timeout.App</SilverlightAppEntry>
+ <TestPageFileName>timeoutTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AllTests.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Test.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\TestCommon\TestCommon.csproj">
+ <Project>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</Project>
+ <Name>TestCommon</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/cs/test/TestCommon/Properties/AssemblyInfo.cs b/cs/test/TestCommon/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..a9735d4210b
--- /dev/null
+++ b/cs/test/TestCommon/Properties/AssemblyInfo.cs
@@ -0,0 +1,37 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("TestCommon")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("TestCommon")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("3e6b7796-9f29-4fb1-8dea-643450684954")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+
+[assembly: System.CLSCompliant(true)] \ No newline at end of file
diff --git a/cs/test/TestCommon/TestApp.cs b/cs/test/TestCommon/TestApp.cs
new file mode 100644
index 00000000000..75e6d8439f1
--- /dev/null
+++ b/cs/test/TestCommon/TestApp.cs
@@ -0,0 +1,142 @@
+using System;
+
+#if SILVERLIGHT
+using System.Collections.Generic;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+#endif
+
+namespace TestCommon
+{
+ public abstract class TestApp
+ {
+ protected static void test(bool b)
+ {
+ if(!b)
+ {
+ throw new System.Exception();
+ }
+ }
+
+#if !SILVERLIGHT
+ static
+#endif
+ public void Write(string msg)
+ {
+#if SILVERLIGHT
+ Console.Out.Write(msg);
+#else
+ Console.Out.Write(msg);
+#endif
+ }
+
+#if !SILVERLIGHT
+ static
+#endif
+ public void WriteLine(string msg)
+ {
+#if SILVERLIGHT
+ Console.Out.WriteLine(msg);
+#else
+ Console.Out.WriteLine(msg);
+#endif
+ }
+
+#if !SILVERLIGHT
+ static
+#endif
+ public void Flush()
+ {
+ Console.Out.Flush();
+ }
+
+#if SILVERLIGHT
+
+ public abstract void run(Ice.Communicator communicator);
+
+ public virtual Ice.InitializationData
+ initData()
+ {
+ return new Ice.InitializationData();
+ }
+
+ public void main()
+ {
+ int args = Application.Current.Host.Source.OriginalString.IndexOf("?");
+ Dictionary<string, string> properties = new Dictionary<string, string>();
+ if(args > 0 && args + 1 < Application.Current.Host.Source.OriginalString.Length)
+ {
+ string[] props = Application.Current.Host.Source.OriginalString.Substring(args + 1).Split(';');
+ foreach (string prop in props)
+ {
+ int pos = prop.IndexOf('=');
+ if(pos > 0)
+ {
+ properties[prop.Substring(0, pos)] = prop.Substring(pos + 1);
+ }
+ }
+ }
+
+ System.Threading.Thread t = new System.Threading.Thread(() =>
+ {
+ Ice.Communicator communicator = null;
+ try
+ {
+ Ice.InitializationData initializationData = initData();
+ if(initializationData.properties == null)
+ {
+ initializationData.properties = Ice.Util.createProperties();
+ }
+
+ foreach(KeyValuePair<String,String> entry in properties)
+ {
+ if(initializationData.properties.getProperty(entry.Key).Equals(""))
+ {
+ initializationData.properties.setProperty(entry.Key, entry.Value);
+ }
+ }
+
+ communicator = Ice.Util.initialize(initializationData);
+ run(communicator);
+ completed();
+ }
+ catch(System.Exception ex)
+ {
+ failed(ex);
+ }
+ finally
+ {
+ if(communicator != null)
+ {
+ communicator.destroy();
+ }
+ }
+ });
+ t.Start();
+ }
+
+ public void completed()
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(delegate()
+ {
+ Application.Current.MainWindow.Close();
+ });
+ }
+
+ public void failed(System.Exception ex)
+ {
+ System.Environment.ExitCode = 1;
+ WriteLine(Environment.NewLine + "Test Failed:");
+ WriteLine("Exception: " + ex.ToString());
+ completed();
+ }
+#endif
+ }
+}
diff --git a/cs/test/TestCommon/TestCommon.csproj b/cs/test/TestCommon/TestCommon.csproj
new file mode 100644
index 00000000000..696e058c607
--- /dev/null
+++ b/cs/test/TestCommon/TestCommon.csproj
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{09CE99C4-5118-4EFF-B99D-6E0C160E4413}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>TestCommon</RootNamespace>
+ <AssemblyName>TestCommon</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>false</SilverlightApplication>
+ <ValidateXaml>true</ValidateXaml>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ </PropertyGroup>
+ <!-- This property group is only here to support building this project using the
+ MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
+ to set the TargetFrameworkVersion to v3.5 -->
+ <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="TestApp.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project> \ No newline at end of file
diff --git a/cs/test/testsl.sln b/cs/test/testsl.sln
new file mode 100644
index 00000000000..bfd3f6d97ab
--- /dev/null
+++ b/cs/test/testsl.sln
@@ -0,0 +1,195 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestCommon", "TestCommon\TestCommon.csproj", "{09CE99C4-5118-4EFF-B99D-6E0C160E4413}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "adapterDeactivation", "Ice\adapterDeactivation\adapterDeactivation.csproj", "{73497706-4139-4821-B8DF-E83654E6EE55}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ami", "Ice\ami\ami.csproj", "{7A9447E3-31BF-46DF-A3FF-B4DF792DE86F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "binding", "Ice\binding\binding.csproj", "{974F0F9B-7EB4-4566-B5C8-1313AE9218A5}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "defaultValue", "Ice\defaultValue\defaultValue.csproj", "{0858ED5B-68D1-444D-912C-6147BC4FC968}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dictMapping", "Ice\dictMapping\dictMapping.csproj", "{4F085C35-BF17-4947-BB56-E5F48C1C30E8}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dispatcher", "Ice\dispatcher\dispatcher.csproj", "{E71BAF76-681E-43F5-930F-8B547F4978C3}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "exceptions", "Ice\exceptions\exceptions.csproj", "{270ADFFA-8123-4C8C-B117-607A3AE4973D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "facets", "Ice\facets\facets.csproj", "{ACEFEC42-29BF-48E8-BF14-EB554CD06EEF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "faultTolerance", "Ice\faultTolerance\faultTolerance.csproj", "{61AD7756-4BB3-4772-AB43-A42F5C3CBB34}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "hold", "Ice\hold\hold.csproj", "{44EFC26A-42E7-46A8-B371-96969E8128ED}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "info", "Ice\info\info.csproj", "{11F271A3-319C-4C8F-B1C6-508416D8EB6A}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "inheritance", "Ice\inheritance\inheritance.csproj", "{0C325152-DF80-4BFF-A412-EAC75504B393}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "invoke", "Ice\invoke\invoke.csproj", "{95E9131E-6630-4658-B48F-405DDBE0C1C9}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "location", "Ice\location\location.csproj", "{1170795D-9EE2-472A-AC4F-18F77255292C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "objects", "Ice\objects\objects.csproj", "{B4C71555-2292-44E2-B5C6-9EB3C92FF308}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "operations", "Ice\operations\operations.csproj", "{EEF0327D-EAA7-49B4-80B9-7CC265A7AD96}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "proxy", "Ice\proxy\proxy.csproj", "{B558C1F5-CC5A-4D64-848F-BD196AFB1FC7}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "retry", "Ice\retry\retry.csproj", "{59049797-A1DC-4D8E-BCC2-B2A86C8DFA99}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "seqMapping", "Ice\seqMapping\seqMapping.csproj", "{3B586590-63D2-48FD-9973-6CB6BA107C27}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "servantLocator", "Ice\servantLocator\servantLocator.csproj", "{E2F1D989-CA09-4A83-9511-7C03FD13E5D1}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "exceptions", "Ice\slicing\exceptions\exceptions.csproj", "{DD327892-C079-4209-863D-855E32A4C379}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "objects", "Ice\slicing\objects\objects.csproj", "{0FB1D189-5BA6-4EE0-BAAF-E9EE0AFE6D3D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "stream", "Ice\stream\stream.csproj", "{21950547-9EDD-48D9-8311-8EBA541524C9}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "timeout", "Ice\timeout\timeout.csproj", "{86F3AD27-AC8E-417F-ADCF-461AE33870A6}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ice", "Ice", "{3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "slicing", "slicing", "{D20CFB7E-6C8B-47DD-928F-DAE52F01AF7E}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {09CE99C4-5118-4EFF-B99D-6E0C160E4413}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {09CE99C4-5118-4EFF-B99D-6E0C160E4413}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {09CE99C4-5118-4EFF-B99D-6E0C160E4413}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {09CE99C4-5118-4EFF-B99D-6E0C160E4413}.Release|Any CPU.Build.0 = Release|Any CPU
+ {73497706-4139-4821-B8DF-E83654E6EE55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {73497706-4139-4821-B8DF-E83654E6EE55}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {73497706-4139-4821-B8DF-E83654E6EE55}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {73497706-4139-4821-B8DF-E83654E6EE55}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7A9447E3-31BF-46DF-A3FF-B4DF792DE86F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7A9447E3-31BF-46DF-A3FF-B4DF792DE86F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7A9447E3-31BF-46DF-A3FF-B4DF792DE86F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7A9447E3-31BF-46DF-A3FF-B4DF792DE86F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {974F0F9B-7EB4-4566-B5C8-1313AE9218A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {974F0F9B-7EB4-4566-B5C8-1313AE9218A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {974F0F9B-7EB4-4566-B5C8-1313AE9218A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {974F0F9B-7EB4-4566-B5C8-1313AE9218A5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0858ED5B-68D1-444D-912C-6147BC4FC968}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0858ED5B-68D1-444D-912C-6147BC4FC968}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0858ED5B-68D1-444D-912C-6147BC4FC968}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0858ED5B-68D1-444D-912C-6147BC4FC968}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4F085C35-BF17-4947-BB56-E5F48C1C30E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4F085C35-BF17-4947-BB56-E5F48C1C30E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4F085C35-BF17-4947-BB56-E5F48C1C30E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4F085C35-BF17-4947-BB56-E5F48C1C30E8}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E71BAF76-681E-43F5-930F-8B547F4978C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E71BAF76-681E-43F5-930F-8B547F4978C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E71BAF76-681E-43F5-930F-8B547F4978C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E71BAF76-681E-43F5-930F-8B547F4978C3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {270ADFFA-8123-4C8C-B117-607A3AE4973D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {270ADFFA-8123-4C8C-B117-607A3AE4973D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {270ADFFA-8123-4C8C-B117-607A3AE4973D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {270ADFFA-8123-4C8C-B117-607A3AE4973D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {ACEFEC42-29BF-48E8-BF14-EB554CD06EEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {ACEFEC42-29BF-48E8-BF14-EB554CD06EEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {ACEFEC42-29BF-48E8-BF14-EB554CD06EEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {ACEFEC42-29BF-48E8-BF14-EB554CD06EEF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {61AD7756-4BB3-4772-AB43-A42F5C3CBB34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {61AD7756-4BB3-4772-AB43-A42F5C3CBB34}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {61AD7756-4BB3-4772-AB43-A42F5C3CBB34}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {61AD7756-4BB3-4772-AB43-A42F5C3CBB34}.Release|Any CPU.Build.0 = Release|Any CPU
+ {44EFC26A-42E7-46A8-B371-96969E8128ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {44EFC26A-42E7-46A8-B371-96969E8128ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {44EFC26A-42E7-46A8-B371-96969E8128ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {44EFC26A-42E7-46A8-B371-96969E8128ED}.Release|Any CPU.Build.0 = Release|Any CPU
+ {11F271A3-319C-4C8F-B1C6-508416D8EB6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {11F271A3-319C-4C8F-B1C6-508416D8EB6A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {11F271A3-319C-4C8F-B1C6-508416D8EB6A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {11F271A3-319C-4C8F-B1C6-508416D8EB6A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0C325152-DF80-4BFF-A412-EAC75504B393}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0C325152-DF80-4BFF-A412-EAC75504B393}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0C325152-DF80-4BFF-A412-EAC75504B393}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0C325152-DF80-4BFF-A412-EAC75504B393}.Release|Any CPU.Build.0 = Release|Any CPU
+ {95E9131E-6630-4658-B48F-405DDBE0C1C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {95E9131E-6630-4658-B48F-405DDBE0C1C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {95E9131E-6630-4658-B48F-405DDBE0C1C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {95E9131E-6630-4658-B48F-405DDBE0C1C9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1170795D-9EE2-472A-AC4F-18F77255292C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1170795D-9EE2-472A-AC4F-18F77255292C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1170795D-9EE2-472A-AC4F-18F77255292C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1170795D-9EE2-472A-AC4F-18F77255292C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B4C71555-2292-44E2-B5C6-9EB3C92FF308}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B4C71555-2292-44E2-B5C6-9EB3C92FF308}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B4C71555-2292-44E2-B5C6-9EB3C92FF308}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B4C71555-2292-44E2-B5C6-9EB3C92FF308}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EEF0327D-EAA7-49B4-80B9-7CC265A7AD96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EEF0327D-EAA7-49B4-80B9-7CC265A7AD96}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EEF0327D-EAA7-49B4-80B9-7CC265A7AD96}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EEF0327D-EAA7-49B4-80B9-7CC265A7AD96}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B558C1F5-CC5A-4D64-848F-BD196AFB1FC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B558C1F5-CC5A-4D64-848F-BD196AFB1FC7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B558C1F5-CC5A-4D64-848F-BD196AFB1FC7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B558C1F5-CC5A-4D64-848F-BD196AFB1FC7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {59049797-A1DC-4D8E-BCC2-B2A86C8DFA99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {59049797-A1DC-4D8E-BCC2-B2A86C8DFA99}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {59049797-A1DC-4D8E-BCC2-B2A86C8DFA99}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {59049797-A1DC-4D8E-BCC2-B2A86C8DFA99}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3B586590-63D2-48FD-9973-6CB6BA107C27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3B586590-63D2-48FD-9973-6CB6BA107C27}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3B586590-63D2-48FD-9973-6CB6BA107C27}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3B586590-63D2-48FD-9973-6CB6BA107C27}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E2F1D989-CA09-4A83-9511-7C03FD13E5D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E2F1D989-CA09-4A83-9511-7C03FD13E5D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E2F1D989-CA09-4A83-9511-7C03FD13E5D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E2F1D989-CA09-4A83-9511-7C03FD13E5D1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DD327892-C079-4209-863D-855E32A4C379}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DD327892-C079-4209-863D-855E32A4C379}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DD327892-C079-4209-863D-855E32A4C379}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DD327892-C079-4209-863D-855E32A4C379}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0FB1D189-5BA6-4EE0-BAAF-E9EE0AFE6D3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0FB1D189-5BA6-4EE0-BAAF-E9EE0AFE6D3D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0FB1D189-5BA6-4EE0-BAAF-E9EE0AFE6D3D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0FB1D189-5BA6-4EE0-BAAF-E9EE0AFE6D3D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {21950547-9EDD-48D9-8311-8EBA541524C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {21950547-9EDD-48D9-8311-8EBA541524C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {21950547-9EDD-48D9-8311-8EBA541524C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {21950547-9EDD-48D9-8311-8EBA541524C9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {86F3AD27-AC8E-417F-ADCF-461AE33870A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {86F3AD27-AC8E-417F-ADCF-461AE33870A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {86F3AD27-AC8E-417F-ADCF-461AE33870A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {86F3AD27-AC8E-417F-ADCF-461AE33870A6}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {86F3AD27-AC8E-417F-ADCF-461AE33870A6} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {21950547-9EDD-48D9-8311-8EBA541524C9} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {73497706-4139-4821-B8DF-E83654E6EE55} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {7A9447E3-31BF-46DF-A3FF-B4DF792DE86F} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {974F0F9B-7EB4-4566-B5C8-1313AE9218A5} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {0858ED5B-68D1-444D-912C-6147BC4FC968} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {4F085C35-BF17-4947-BB56-E5F48C1C30E8} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {E71BAF76-681E-43F5-930F-8B547F4978C3} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {270ADFFA-8123-4C8C-B117-607A3AE4973D} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {ACEFEC42-29BF-48E8-BF14-EB554CD06EEF} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {61AD7756-4BB3-4772-AB43-A42F5C3CBB34} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {44EFC26A-42E7-46A8-B371-96969E8128ED} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {11F271A3-319C-4C8F-B1C6-508416D8EB6A} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {0C325152-DF80-4BFF-A412-EAC75504B393} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {95E9131E-6630-4658-B48F-405DDBE0C1C9} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {1170795D-9EE2-472A-AC4F-18F77255292C} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {B4C71555-2292-44E2-B5C6-9EB3C92FF308} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {EEF0327D-EAA7-49B4-80B9-7CC265A7AD96} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {B558C1F5-CC5A-4D64-848F-BD196AFB1FC7} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {59049797-A1DC-4D8E-BCC2-B2A86C8DFA99} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {3B586590-63D2-48FD-9973-6CB6BA107C27} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {E2F1D989-CA09-4A83-9511-7C03FD13E5D1} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {D20CFB7E-6C8B-47DD-928F-DAE52F01AF7E} = {3182DFB4-2F4F-4131-8011-CA0A32C5B9C4}
+ {DD327892-C079-4209-863D-855E32A4C379} = {D20CFB7E-6C8B-47DD-928F-DAE52F01AF7E}
+ {0FB1D189-5BA6-4EE0-BAAF-E9EE0AFE6D3D} = {D20CFB7E-6C8B-47DD-928F-DAE52F01AF7E}
+ EndGlobalSection
+EndGlobal