pyjnius/tests/test_cast.py

14 lines
411 B
Python

import unittest
from jnius.reflect import autoclass
from jnius import cast
class MultipleSignature(unittest.TestCase):
def test_multiple_constructors(self):
String = autoclass('java.lang.String')
s = String('hello world')
self.assertEquals(s.__javaclass__, 'java/lang/String')
o = cast('java.lang.Object', s)
self.assertEquals(o.__javaclass__, 'java/lang/Object')