diff options
-rwxr-xr-x[-rw-r--r--] | cpp/test/TestSuite/10.0/Package.appxmanifest | 4 | ||||
-rw-r--r-- | cpp/test/TestSuite/Controller.ice | 10 | ||||
-rwxr-xr-x[-rw-r--r--] | cpp/test/TestSuite/MainPage.xaml.cpp | 4 | ||||
-rw-r--r-- | java/test/controller/src/main/java/Test/Common/ControllerServer.java | 11 | ||||
-rw-r--r-- | java/test/controller/src/main/slice/Controller.ice | 10 | ||||
-rw-r--r-- | js/test/Common/Controller.ice | 10 | ||||
-rw-r--r-- | js/test/Common/TestRunner.js | 19 |
7 files changed, 50 insertions, 18 deletions
diff --git a/cpp/test/TestSuite/10.0/Package.appxmanifest b/cpp/test/TestSuite/10.0/Package.appxmanifest index c392fede467..92debdae674 100644..100755 --- a/cpp/test/TestSuite/10.0/Package.appxmanifest +++ b/cpp/test/TestSuite/10.0/Package.appxmanifest @@ -3,7 +3,7 @@ <Identity Name="f4c6cdff-3ef9-43fb-8094-d50c547e70f6" Publisher="CN=jose" Version="1.0.0.0" /> <mp:PhoneIdentity PhoneProductId="f4c6cdff-3ef9-43fb-8094-d50c547e70f6" PhonePublisherId="00000000-0000-0000-0000-000000000000" /> <Properties> - <DisplayName>TestSuite</DisplayName> + <DisplayName>Ice Test Suite</DisplayName> <PublisherDisplayName>jose</PublisherDisplayName> <Logo>Assets\StoreLogo.png</Logo> </Properties> @@ -15,7 +15,7 @@ </Resources> <Applications> <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="TestSuite.App"> - <uap:VisualElements DisplayName="TestSuite" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="TestSuite" BackgroundColor="transparent"> + <uap:VisualElements DisplayName="Ice Test Suite" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="TestSuite" BackgroundColor="transparent"> <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"> </uap:DefaultTile> <uap:SplashScreen Image="Assets\SplashScreen.png" /> diff --git a/cpp/test/TestSuite/Controller.ice b/cpp/test/TestSuite/Controller.ice index 0508b4826da..7e4c2b95eda 100644 --- a/cpp/test/TestSuite/Controller.ice +++ b/cpp/test/TestSuite/Controller.ice @@ -13,10 +13,15 @@ module Test module Common { +exception ServerFailedException +{ + string reason; +}; + interface Server { void waitTestSuccess(); - void waitForServer(); + void waitForServer() throws ServerFailedException; void terminate(); }; @@ -24,8 +29,7 @@ sequence<string> StringSeq; interface Controller { - Server* runServer(string lang, string name, string protocol, string host, bool winrt, - StringSeq options); + Server* runServer(string lang, string name, string protocol, string host, bool winrt, StringSeq options); }; }; diff --git a/cpp/test/TestSuite/MainPage.xaml.cpp b/cpp/test/TestSuite/MainPage.xaml.cpp index aa64f17b31d..cabd8733ad2 100644..100755 --- a/cpp/test/TestSuite/MainPage.xaml.cpp +++ b/cpp/test/TestSuite/MainPage.xaml.cpp @@ -563,6 +563,10 @@ TestRunner::run() { _page->failed(ex->Message); } + catch (Test::Common::ServerFailedException& ex) + { + _page->failed(ref new String(IceUtil::stringToWstring("Server failed to start:\n\n" + ex.reason).c_str())); + } catch(const std::exception& ex) { _page->failed(ref new String(IceUtil::stringToWstring(ex.what()).c_str())); diff --git a/java/test/controller/src/main/java/Test/Common/ControllerServer.java b/java/test/controller/src/main/java/Test/Common/ControllerServer.java index 508c27d90ae..6bb7d874993 100644 --- a/java/test/controller/src/main/java/Test/Common/ControllerServer.java +++ b/java/test/controller/src/main/java/Test/Common/ControllerServer.java @@ -26,6 +26,7 @@ public class ControllerServer extends Ice.Application public ServerI(Process process, String name) { _process = process; + _processOutput = new StringBuffer(); _name = name; _started = 0; _terminated = false; @@ -46,6 +47,11 @@ public class ControllerServer extends Ice.Application String line = null; while((line = reader.readLine()) != null) { + if(_started == 0) + { + _processOutput.append(line + "\n"); + } + if(line.matches(Pattern.quote("starting server...") + ".*ok") || line.matches(Pattern.quote("starting serveramd...") + ".*ok") || line.matches(Pattern.quote("starting servertie...") + ".*ok") || @@ -137,6 +143,7 @@ public class ControllerServer extends Ice.Application } public synchronized void waitForServer(Ice.Current current) + throws ServerFailedException { while(!_terminated) { @@ -156,12 +163,12 @@ public class ControllerServer extends Ice.Application } if(_terminated && _started == 0) { - // TODO: Add user exception instead of throwing a local exception. - throw new RuntimeException("process failed to start"); + throw new ServerFailedException(_processOutput.toString()); } } private Process _process; + private StringBuffer _processOutput; private String _name; private int _started; private boolean _terminated; diff --git a/java/test/controller/src/main/slice/Controller.ice b/java/test/controller/src/main/slice/Controller.ice index 0508b4826da..7e4c2b95eda 100644 --- a/java/test/controller/src/main/slice/Controller.ice +++ b/java/test/controller/src/main/slice/Controller.ice @@ -13,10 +13,15 @@ module Test module Common { +exception ServerFailedException +{ + string reason; +}; + interface Server { void waitTestSuccess(); - void waitForServer(); + void waitForServer() throws ServerFailedException; void terminate(); }; @@ -24,8 +29,7 @@ sequence<string> StringSeq; interface Controller { - Server* runServer(string lang, string name, string protocol, string host, bool winrt, - StringSeq options); + Server* runServer(string lang, string name, string protocol, string host, bool winrt, StringSeq options); }; }; diff --git a/js/test/Common/Controller.ice b/js/test/Common/Controller.ice index 0508b4826da..7e4c2b95eda 100644 --- a/js/test/Common/Controller.ice +++ b/js/test/Common/Controller.ice @@ -13,10 +13,15 @@ module Test module Common { +exception ServerFailedException +{ + string reason; +}; + interface Server { void waitTestSuccess(); - void waitForServer(); + void waitForServer() throws ServerFailedException; void terminate(); }; @@ -24,8 +29,7 @@ sequence<string> StringSeq; interface Controller { - Server* runServer(string lang, string name, string protocol, string host, bool winrt, - StringSeq options); + Server* runServer(string lang, string name, string protocol, string host, bool winrt, StringSeq options); }; }; diff --git a/js/test/Common/TestRunner.js b/js/test/Common/TestRunner.js index 75a960644ed..a1f51d19440 100644 --- a/js/test/Common/TestRunner.js +++ b/js/test/Common/TestRunner.js @@ -21,7 +21,7 @@ function isSafari() function isWorker() { - return typeof(WorkerGlobalScope) !== 'undefined' && this instanceof WorkerGlobalScope; + return typeof(WorkerGlobalScope) !== 'undefined' && this instanceof WorkerGlobalScope; } function runTest(name, language, defaultHost, protocol, configurations, out) @@ -86,7 +86,8 @@ function runTest(name, language, defaultHost, protocol, configurations, out) var initData = id.clone(); if(configuration.args !== undefined) { - initData.properties = Ice.createProperties(configuration.args, id.properties); + initData.properties = + Ice.createProperties(configuration.args, id.properties); } return __test__(out, initData); }); @@ -154,10 +155,18 @@ function runTest(name, language, defaultHost, protocol, configurations, out) { out.writeLine("exception occurred in call to " + r.operation); } - out.writeLine(ex.toString()); - if(ex.stack) + if(ex instanceof Test.Common.ServerFailedException) { - out.writeLine(ex.stack); + out.writeLine("Server failed to start:\n"); + out.writeLine(ex.reason); + } + else + { + out.writeLine(ex.toString()); + if(ex.stack) + { + out.writeLine(ex.stack); + } } return false; }); |