pyjnius/tests/test_simple.py

15 lines
391 B
Python
Raw Normal View History

import unittest
2012-08-14 01:42:43 +00:00
from jnius import JavaClass, MetaJavaClass, JavaMethod
class HelloWorldTest(unittest.TestCase):
2012-08-14 01:42:43 +00:00
def test(self):
2012-08-14 01:42:43 +00:00
class HelloWorld(JavaClass):
__metaclass__ = MetaJavaClass
__javaclass__ = 'org/jnius/HelloWorld'
hello = JavaMethod('()Ljava/lang/String;')
a = HelloWorld()
self.assertEqual(a.hello(), 'world')