diff options
author | Vijay Yellapragada <vijay.yellapragada@gmail.com> | 2011-03-09 10:01:18 -0600 |
---|---|---|
committer | Vijay Yellapragada <vijay.yellapragada@gmail.com> | 2011-03-09 10:01:18 -0600 |
commit | a00d9246892a6c23b2fdc2fd8e794c14144e8793 (patch) | |
tree | 4196fd2fc1864780d7abfb78a2e937fefdc49e1a /monkeyrunner/src | |
parent | 9be69095bcb0d56373c0a0e52f0b3840aa0df127 (diff) | |
download | sdk-a00d9246892a6c23b2fdc2fd8e794c14144e8793.zip sdk-a00d9246892a6c23b2fdc2fd8e794c14144e8793.tar.gz sdk-a00d9246892a6c23b2fdc2fd8e794c14144e8793.tar.bz2 |
- Fix a NPE when arguments are not properly understood by MonkeyRunner
- Add the ability to pass Boolean types for Intent extras (extras={'a':True, 'b':False})
- Fix an improper flag being passed to am start
- Pass the key and value to am start instead of just the value.
Change-Id: Ifd0c69ccb4c2755a49efca2d3f8b3befa212a69f
Diffstat (limited to 'monkeyrunner/src')
3 files changed, 8 insertions, 4 deletions
diff --git a/monkeyrunner/src/com/android/monkeyrunner/JythonUtils.java b/monkeyrunner/src/com/android/monkeyrunner/JythonUtils.java index 864441e..7054695 100644 --- a/monkeyrunner/src/com/android/monkeyrunner/JythonUtils.java +++ b/monkeyrunner/src/com/android/monkeyrunner/JythonUtils.java @@ -32,6 +32,7 @@ import java.util.logging.Logger; import org.python.core.ArgParser; import org.python.core.ClassDictInit; import org.python.core.Py; +import org.python.core.PyBoolean; import org.python.core.PyDictionary; import org.python.core.PyFloat; import org.python.core.PyInteger; @@ -73,6 +74,7 @@ public final class JythonUtils { // What python calls float, most people call double builder.put(PyFloat.class, Double.class); builder.put(PyInteger.class, Integer.class); + builder.put(PyBoolean.class, Boolean.class); PYOBJECT_TO_JAVA_OBJECT_MAP = builder.build(); } @@ -228,6 +230,8 @@ public final class JythonUtils { } else if (o instanceof Float) { float f = (Float) o; return new PyFloat(f); + } else if (o instanceof Boolean) { + return new PyBoolean((Boolean) o); } return Py.None; } diff --git a/monkeyrunner/src/com/android/monkeyrunner/MonkeyRunnerStarter.java b/monkeyrunner/src/com/android/monkeyrunner/MonkeyRunnerStarter.java index 90fce6f..5244dbc 100644 --- a/monkeyrunner/src/com/android/monkeyrunner/MonkeyRunnerStarter.java +++ b/monkeyrunner/src/com/android/monkeyrunner/MonkeyRunnerStarter.java @@ -191,13 +191,12 @@ public class MonkeyRunnerStarter { public static void main(String[] args) { MonkeyRunnerOptions options = MonkeyRunnerOptions.processOptions(args); - // logging property files are difficult - replaceAllLogFormatters(MonkeyFormatter.DEFAULT_INSTANCE, options.getLogLevel()); - if (options == null) { return; } + // logging property files are difficult + replaceAllLogFormatters(MonkeyFormatter.DEFAULT_INSTANCE, options.getLogLevel()); MonkeyRunnerStarter runner = new MonkeyRunnerStarter(options); int error = runner.run(); diff --git a/monkeyrunner/src/com/android/monkeyrunner/adb/AdbMonkeyDevice.java b/monkeyrunner/src/com/android/monkeyrunner/adb/AdbMonkeyDevice.java index e7e2e1c..befec28 100644 --- a/monkeyrunner/src/com/android/monkeyrunner/adb/AdbMonkeyDevice.java +++ b/monkeyrunner/src/com/android/monkeyrunner/adb/AdbMonkeyDevice.java @@ -419,9 +419,10 @@ public class AdbMonkeyDevice extends MonkeyDevice { } else { // treat is as a string. valueString = value.toString(); - arg = "--esmake"; + arg = "--es"; } parts.add(arg); + parts.add(entry.getKey()); parts.add(valueString); } |