diff options
author | Joe George <joe@zeroc.com> | 2014-12-12 11:23:31 -0500 |
---|---|---|
committer | Joe George <joe@zeroc.com> | 2014-12-12 11:24:00 -0500 |
commit | 29d1dd4ec39710767888f87e62b6d3fb4720706d (patch) | |
tree | 58ea2f41078f255de41e8680fa039cf03b347f89 | |
parent | Fixed (ICE-6151) - Android Chrome test Ice/operationsBidir fails (diff) | |
download | ice-29d1dd4ec39710767888f87e62b6d3fb4720706d.tar.bz2 ice-29d1dd4ec39710767888f87e62b6d3fb4720706d.tar.xz ice-29d1dd4ec39710767888f87e62b6d3fb4720706d.zip |
ICE-6169 - Android hello demo not catching batch exceptions
-rw-r--r-- | android/.idea/modules.xml | 1 | ||||
-rw-r--r-- | android/android.iml | 2 | ||||
-rw-r--r-- | android/demo/chat/chat.iml | 1 | ||||
-rw-r--r-- | android/demo/hello/src/main/java/com/zeroc/hello/HelloWorld.java | 24 | ||||
-rw-r--r-- | android/demo/library/library.iml | 1 | ||||
-rw-r--r-- | android/src/Ice/ice.iml | 5 | ||||
-rw-r--r-- | android/test/android/testApp.iml | 1 | ||||
-rw-r--r-- | android/test/plugins/testPlugins.iml | 3 | ||||
-rw-r--r-- | android/test/test.iml | 11 |
9 files changed, 37 insertions, 12 deletions
diff --git a/android/.idea/modules.xml b/android/.idea/modules.xml index 2f31308dd93..90e9d3fc59f 100644 --- a/android/.idea/modules.xml +++ b/android/.idea/modules.xml @@ -17,6 +17,7 @@ <module fileurl="file://$PROJECT_DIR$/test/test.iml" filepath="$PROJECT_DIR$/test/test.iml" /> <module fileurl="file://$PROJECT_DIR$/test/android/testApp.iml" filepath="$PROJECT_DIR$/test/android/testApp.iml" /> <module fileurl="file://$PROJECT_DIR$/test/plugins/testPlugins.iml" filepath="$PROJECT_DIR$/test/plugins/testPlugins.iml" /> + <module fileurl="file://$PROJECT_DIR$/test/src/test_Ice_acm/test_Ice_acm.iml" filepath="$PROJECT_DIR$/test/src/test_Ice_acm/test_Ice_acm.iml" /> </modules> </component> </project> diff --git a/android/android.iml b/android/android.iml index f729997331b..62553dc5260 100644 --- a/android/android.iml +++ b/android/android.iml @@ -14,7 +14,7 @@ <content url="file://$MODULE_DIR$"> <excludeFolder url="file://$MODULE_DIR$/.gradle" /> </content> - <orderEntry type="jdk" jdkName="Android API 20 Platform" jdkType="Android SDK" /> + <orderEntry type="jdk" jdkName="1.7" jdkType="JavaSDK" /> <orderEntry type="sourceFolder" forTests="false" /> </component> </module> diff --git a/android/demo/chat/chat.iml b/android/demo/chat/chat.iml index f7ac420f600..568a2dbfd66 100644 --- a/android/demo/chat/chat.iml +++ b/android/demo/chat/chat.iml @@ -81,7 +81,6 @@ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" /> <excludeFolder url="file://$MODULE_DIR$/build/outputs" /> - <excludeFolder url="file://$MODULE_DIR$/build/tmp" /> </content> <orderEntry type="jdk" jdkName="Android API 17 Platform" jdkType="Android SDK" /> <orderEntry type="sourceFolder" forTests="false" /> diff --git a/android/demo/hello/src/main/java/com/zeroc/hello/HelloWorld.java b/android/demo/hello/src/main/java/com/zeroc/hello/HelloWorld.java index b90c895d70b..5db8fed8932 100644 --- a/android/demo/hello/src/main/java/com/zeroc/hello/HelloWorld.java +++ b/android/demo/hello/src/main/java/com/zeroc/hello/HelloWorld.java @@ -81,8 +81,13 @@ public class HelloWorld extends Activity } } - private Demo.HelloPrx createProxy() + private void updateProxy() { + if(_communicator == null) + { + return; + } + String host = _host.getText().toString().trim(); assert (host.length() > 0); // Change the preferences if necessary. @@ -101,7 +106,7 @@ public class HelloWorld extends Activity { prx = prx.ice_timeout(timeout); } - return Demo.HelloPrxHelper.uncheckedCast(prx); + _helloPrx = Demo.HelloPrxHelper.uncheckedCast(prx); } class SayHelloI extends Demo.Callback_Hello_sayHello @@ -175,12 +180,11 @@ public class HelloWorld extends Activity private void sayHello() { - Demo.HelloPrx hello = createProxy(); try { if(!_deliveryMode.isBatch()) { - Ice.AsyncResult r = hello.begin_sayHello(_delay.getProgress(), new SayHelloI()); + Ice.AsyncResult r = _helloPrx.begin_sayHello(_delay.getProgress(), new SayHelloI()); if(r.sentSynchronously()) { if(_deliveryMode == DeliveryMode.TWOWAY || _deliveryMode == DeliveryMode.TWOWAY_SECURE) @@ -198,7 +202,7 @@ public class HelloWorld extends Activity else { _flushButton.setEnabled(true); - hello.sayHello(_delay.getProgress()); + _helloPrx.sayHello(_delay.getProgress()); _status.setText("Queued hello request"); } } @@ -225,12 +229,11 @@ public class HelloWorld extends Activity private void shutdown() { - Demo.HelloPrx hello = createProxy(); try { if(!_deliveryMode.isBatch()) { - hello.begin_shutdown(new Demo.Callback_Hello_shutdown() + _helloPrx.begin_shutdown(new Demo.Callback_Hello_shutdown() { @Override public void exception(final Ice.LocalException ex) @@ -271,7 +274,7 @@ public class HelloWorld extends Activity else { _flushButton.setEnabled(true); - hello.shutdown(); + _helloPrx.shutdown(); _status.setText("Queued shutdown request"); } } @@ -378,6 +381,7 @@ public class HelloWorld extends Activity { _sayHelloButton.setEnabled(true); _shutdownButton.setEnabled(true); + updateProxy(); } } @@ -409,6 +413,7 @@ public class HelloWorld extends Activity public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { changeDeliveryMode(id); + updateProxy(); } @@ -452,6 +457,7 @@ public class HelloWorld extends Activity public void onProgressChanged(SeekBar seekBar, int progress, boolean fromThumb) { timeoutView.setText(String.format("%.1f", progress / 1000.0)); + updateProxy(); } public void onStartTrackingTouch(SeekBar seekBar) @@ -503,6 +509,7 @@ public class HelloWorld extends Activity } _status.setText("Ready"); _communicator = communicator; + updateProxy(); } }); } @@ -612,6 +619,7 @@ public class HelloWorld extends Activity private Ice.Communicator _communicator = null; private DeliveryMode _deliveryMode; + private Demo.HelloPrx _helloPrx = null; private Button _sayHelloButton; private Button _shutdownButton; diff --git a/android/demo/library/library.iml b/android/demo/library/library.iml index 78508801778..75eeb0736cb 100644 --- a/android/demo/library/library.iml +++ b/android/demo/library/library.iml @@ -81,7 +81,6 @@ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" /> <excludeFolder url="file://$MODULE_DIR$/build/outputs" /> - <excludeFolder url="file://$MODULE_DIR$/build/tmp" /> </content> <orderEntry type="jdk" jdkName="Android API 17 Platform" jdkType="Android SDK" /> <orderEntry type="sourceFolder" forTests="false" /> diff --git a/android/src/Ice/ice.iml b/android/src/Ice/ice.iml index 78e13f7a622..06e2c627d0a 100644 --- a/android/src/Ice/ice.iml +++ b/android/src/Ice/ice.iml @@ -23,6 +23,11 @@ <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> <excludeFolder url="file://$MODULE_DIR$/.gradle" /> + <excludeFolder url="file://$MODULE_DIR$/build/classes" /> + <excludeFolder url="file://$MODULE_DIR$/build/dependency-cache" /> + <excludeFolder url="file://$MODULE_DIR$/build/nostream.d.xml" /> + <excludeFolder url="file://$MODULE_DIR$/build/stream.d.xml" /> + <excludeFolder url="file://$MODULE_DIR$/build/tmp" /> </content> <content url="file://$MODULE_DIR$/../../../java/src/Ice/src/main/java"> <sourceFolder url="file://$MODULE_DIR$/../../../java/src/Ice/src/main/java" isTestSource="false" /> diff --git a/android/test/android/testApp.iml b/android/test/android/testApp.iml index 299ec77ac2d..981662e19b1 100644 --- a/android/test/android/testApp.iml +++ b/android/test/android/testApp.iml @@ -80,7 +80,6 @@ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" /> <excludeFolder url="file://$MODULE_DIR$/build/outputs" /> - <excludeFolder url="file://$MODULE_DIR$/build/tmp" /> </content> <orderEntry type="jdk" jdkName="Android API 17 Platform" jdkType="Android SDK" /> <orderEntry type="sourceFolder" forTests="false" /> diff --git a/android/test/plugins/testPlugins.iml b/android/test/plugins/testPlugins.iml index dbb8f1fdefc..916e385fd3b 100644 --- a/android/test/plugins/testPlugins.iml +++ b/android/test/plugins/testPlugins.iml @@ -23,6 +23,9 @@ <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> <excludeFolder url="file://$MODULE_DIR$/.gradle" /> + <excludeFolder url="file://$MODULE_DIR$/build/classes" /> + <excludeFolder url="file://$MODULE_DIR$/build/dependency-cache" /> + <excludeFolder url="file://$MODULE_DIR$/build/tmp" /> </content> <content url="file://$MODULE_DIR$/../../../java/test/plugins/src/main/java"> <sourceFolder url="file://$MODULE_DIR$/../../../java/test/plugins/src/main/java" isTestSource="false" /> diff --git a/android/test/test.iml b/android/test/test.iml index 76f996b06be..790e5061a02 100644 --- a/android/test/test.iml +++ b/android/test/test.iml @@ -23,6 +23,17 @@ <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> <excludeFolder url="file://$MODULE_DIR$/.gradle" /> + <excludeFolder url="file://$MODULE_DIR$/build/classes" /> + <excludeFolder url="file://$MODULE_DIR$/build/dependency-cache" /> + <excludeFolder url="file://$MODULE_DIR$/build/libs" /> + <excludeFolder url="file://$MODULE_DIR$/build/set1.d.xml" /> + <excludeFolder url="file://$MODULE_DIR$/build/set2.d.xml" /> + <excludeFolder url="file://$MODULE_DIR$/build/set3.d.xml" /> + <excludeFolder url="file://$MODULE_DIR$/build/set4.d.xml" /> + <excludeFolder url="file://$MODULE_DIR$/build/set5.d.xml" /> + <excludeFolder url="file://$MODULE_DIR$/build/set6.d.xml" /> + <excludeFolder url="file://$MODULE_DIR$/build/slice2freezej.df.xml" /> + <excludeFolder url="file://$MODULE_DIR$/build/tmp" /> </content> <content url="file://$MODULE_DIR$/../../java/test/src/main/java"> <sourceFolder url="file://$MODULE_DIR$/../../java/test/src/main/java" isTestSource="false" /> |