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