3333 set_default_callback_accept_timeout , GatewayConnectionGuard ,
3434 get_java_class )
3535from py4j .protocol import (
36- Py4JError , Py4JJavaError , Py4JNetworkError , decode_bytearray ,
37- encode_bytearray , escape_new_line , unescape_new_line , smart_decode )
36+ Py4JError , Py4JJavaError , Py4JNetworkError , TypeHint , LONG_TYPE ,
37+ decode_bytearray , encode_bytearray , escape_new_line , unescape_new_line , smart_decode )
3838
3939
4040SERVER_PORT = 25333
@@ -607,7 +607,7 @@ def internal():
607607class TypeConversionTest (unittest .TestCase ):
608608 def setUp (self ):
609609 self .p = start_example_app_process ()
610- self .gateway = JavaGateway ()
610+ self .gateway = JavaGateway (auto_convert = True )
611611
612612 def tearDown (self ):
613613 safe_shutdown (self )
@@ -619,6 +619,8 @@ def testLongInt(self):
619619 self .assertEqual (4 , ex .method7 (2147483648 ))
620620 self .assertEqual (4 , ex .method7 (- 2147483649 ))
621621 self .assertEqual (4 , ex .method7 (long (2147483648 )))
622+ self .assertEqual (4 , ex .method7 (TypeHint (1 , LONG_TYPE )))
623+ self .assertEqual (4 , ex .method12 ({TypeHint (1 , LONG_TYPE )}))
622624 self .assertEqual (long (4 ), ex .method8 (3 ))
623625 self .assertEqual (4 , ex .method8 (3 ))
624626 self .assertEqual (long (4 ), ex .method8 (long (3 )))
0 commit comments