diff options
author | Matthew Johnson <mjj29@matthew.ath.cx> | 2010-01-17 23:37:24 +0000 |
---|---|---|
committer | Matthew Johnson <mjj29@matthew.ath.cx> | 2010-01-17 23:37:24 +0000 |
commit | 026bcc45ba3138c067965455ac03ebda4a946028 (patch) | |
tree | 7701a6b4814bf7614fcd2db2481924a4c1efe4a1 /org/freedesktop | |
parent | 20bfd2be023b35fd71edd280d55c802a6351d900 (diff) |
Diffstat (limited to 'org/freedesktop')
-rw-r--r-- | org/freedesktop/dbus/test/TestRemoteInterface.java | 2 | ||||
-rw-r--r-- | org/freedesktop/dbus/test/test.java | 37 | ||||
-rw-r--r-- | org/freedesktop/dbus/test/test_p2p_server.java | 2 |
3 files changed, 31 insertions, 10 deletions
diff --git a/org/freedesktop/dbus/test/TestRemoteInterface.java b/org/freedesktop/dbus/test/TestRemoteInterface.java index a24ef43..ba77e29 100644 --- a/org/freedesktop/dbus/test/TestRemoteInterface.java +++ b/org/freedesktop/dbus/test/TestRemoteInterface.java @@ -13,6 +13,7 @@ package org.freedesktop.dbus.test; import org.freedesktop.dbus.DBusInterface; import org.freedesktop.dbus.Path; import org.freedesktop.dbus.UInt16; +import org.freedesktop.dbus.Variant; import org.freedesktop.DBus.Description; import org.freedesktop.DBus.Method; @@ -50,6 +51,7 @@ public interface TestRemoteInterface extends DBusInterface public int[][] teststructstruct(TestStruct3 in); @Description("Regression test for #13291") public void reg13291(byte[] as, byte[] bs); + public Map<String, Variant> svm(); /* test lots of things involving Path */ public Path pathrv(Path a); public List<Path> pathlistrv(List<Path> a); diff --git a/org/freedesktop/dbus/test/test.java b/org/freedesktop/dbus/test/test.java index 4ccd696..9a593ca 100644 --- a/org/freedesktop/dbus/test/test.java +++ b/org/freedesktop/dbus/test/test.java @@ -305,16 +305,28 @@ class testclass implements TestRemoteInterface, TestRemoteInterface2, TestSignal for (int i = 0; i < as.length; i++) if (as[i] != bs[i]) test.fail("didn't receive identical byte arrays"); } - @SuppressWarnings("unchecked") - public <A> A Get (String interface_name, String property_name) - { - return (A) new Path("/nonexistant/path"); - } - public <A> void Set (String interface_name, String property_name, A value) {} - public Map<String, Variant> GetAll (String interface_name) { return new HashMap<String,Variant>(); } - public Path pathrv(Path a) { return a; } - public List<Path> pathlistrv(List<Path> a) { return a; } - public Map<Path,Path> pathmaprv(Map<Path,Path> a) { return a; } +@SuppressWarnings("unchecked") +public <A> A Get (String interface_name, String property_name) +{ + return (A) new Path("/nonexistant/path"); +} +public <A> void Set (String interface_name, String property_name, A value) {} +public Map<String, Variant> GetAll (String interface_name) { return new HashMap<String,Variant>(); } +public Path pathrv(Path a) { return a; } +public List<Path> pathlistrv(List<Path> a) { return a; } +public Map<Path,Path> pathmaprv(Map<Path,Path> a) { return a; } +@SuppressWarnings("unchecked") + public Map<String, Variant> svm() + { + HashMap<String, Variant> properties = new HashMap<String, Variant>(); + HashMap<String, Variant<String>> parameters = new HashMap<String, Variant<String>>(); + + parameters.put("Name", new Variant<String>("Joe")); + parameters.put("Password", new Variant<String>("abcdef")); + + properties.put("Parameters", new Variant(parameters, "a{sv}")); + return (Map<String, Variant>) properties; + } } /** @@ -649,6 +661,11 @@ public class test String rname = tri.getName(); System.out.println("Got Remote Name: "+rname); + Map<String, Variant> svmmap = tri.svm(); + System.out.println(svmmap.toString()); + if (!"{ Parameters => [{ Name => [Joe],Password => [abcdef] }] }".equals(svmmap.toString())) + fail("incorrect reply from svm"); + Path path = new Path("/nonexistantwooooooo"); Path p = tri.pathrv(path); System.out.println(path.toString()+" => "+p.toString()); diff --git a/org/freedesktop/dbus/test/test_p2p_server.java b/org/freedesktop/dbus/test/test_p2p_server.java index 6840694..f972ddc 100644 --- a/org/freedesktop/dbus/test/test_p2p_server.java +++ b/org/freedesktop/dbus/test/test_p2p_server.java @@ -20,6 +20,7 @@ import java.util.Map; import org.freedesktop.dbus.DirectConnection; import org.freedesktop.dbus.Path; import org.freedesktop.dbus.UInt16; +import org.freedesktop.dbus.Variant; public class test_p2p_server implements TestRemoteInterface { @@ -73,6 +74,7 @@ public class test_p2p_server implements TestRemoteInterface public List<Path> pathlistrv(List<Path> a) { return a; } public Map<Path,Path> pathmaprv(Map<Path,Path> a) { return a; } public boolean isRemote() { return false; } + public Map<String, Variant> svm() { return null; } public float testfloat(float[] f) { System.out.println("got float: "+Arrays.toString(f)); |