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
|
2015-11-04 22:30:24 +00:00
|
|
|
from six import with_metaclass
|
2012-08-14 01:42:43 +00:00
|
|
|
|
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
|
|
|
|
2015-05-01 21:57:22 +00:00
|
|
|
class HelloWorld(with_metaclass(MetaJavaClass, JavaClass)):
|
2012-08-15 14:31:22 +00:00
|
|
|
__javaclass__ = 'org/jnius/HelloWorld'
|
|
|
|
hello = JavaMethod('()Ljava/lang/String;')
|
|
|
|
|
|
|
|
a = HelloWorld()
|
|
|
|
self.assertEqual(a.hello(), 'world')
|