2015-05-01 21:57:22 +00:00
|
|
|
from __future__ import print_function
|
|
|
|
from __future__ import division
|
|
|
|
from __future__ import absolute_import
|
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-18 10:59:15 +00:00
|
|
|
def test_helloworld(self):
|
2012-08-14 01:42:43 +00:00
|
|
|
|
2022-10-16 12:56:56 +00:00
|
|
|
class HelloWorld(JavaClass, metaclass=MetaJavaClass):
|
2012-08-15 14:31:22 +00:00
|
|
|
__javaclass__ = 'org/jnius/HelloWorld'
|
|
|
|
hello = JavaMethod('()Ljava/lang/String;')
|
|
|
|
|
|
|
|
a = HelloWorld()
|
|
|
|
self.assertEqual(a.hello(), 'world')
|