Exemplo n.º 1
0
 def test_11_01_make_run_dictionary(self):
     from javabridge.jutil import make_run_dictionary
     o = javabridge.make_instance("java/util/Hashtable", "()V")
     a = javabridge.make_instance("java/util/ArrayList", "()V")
     javabridge.call(
         o, "put",
         "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", "foo",
         "bar")
     javabridge.call(
         o, "put",
         "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", "baz",
         a)
     d = make_run_dictionary(o)
     self.assertIn("foo", d)
     self.assertEquals(d["foo"], "bar")
     self.assertIn("baz", d)
     self.assertTrue(
         javabridge.call(d["baz"], "equals", "(Ljava/lang/Object;)Z", a))
Exemplo n.º 2
0
 def test_11_01_make_run_dictionary(self):
     from javabridge.jutil import make_run_dictionary
     o = javabridge.make_instance("java/util/Hashtable", "()V")
     a = javabridge.make_instance("java/util/ArrayList", "()V")
     javabridge.call(
         o, "put", 
         "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;",
         "foo", "bar")
     javabridge.call(
         o, "put", 
         "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;",
         "baz", a)
     d = make_run_dictionary(o)
     self.assertIn("foo", d)
     self.assertEquals(d["foo"], "bar")
     self.assertIn("baz", d)
     self.assertTrue(javabridge.call(d["baz"], "equals", 
                                     "(Ljava/lang/Object;)Z", a))