<s> from __future__ import print_function <EOL> from __future__ import division <EOL> from __future__ import absolute_import <EOL> import unittest <EOL> from jnius . reflect import autoclass <EOL> class BasicsTest ( unittest . TestCase ) : <EOL> def test_static_methods ( self ) : <EOL> Test = autoclass ( '<STR_LIT>' ) <EOL> self . assertEquals ( Test . methodStaticZ ( ) , True ) <EOL> self . assertEquals ( Test . methodStaticB ( ) , <NUM_LIT> ) <EOL> self . assertEquals ( Test . methodStaticC ( ) , '<STR_LIT:k>' ) <EOL> self . assertEquals ( Test . methodStaticS ( ) , <NUM_LIT> ) <EOL> self . assertEquals ( Test . methodStaticI ( ) , <NUM_LIT> ) <EOL> self . assertEquals ( Test . methodStaticJ ( ) , <NUM_LIT> ) <EOL> self . assertAlmostEquals ( Test . methodStaticF ( ) , <NUM_LIT> ) <EOL> self . assertEquals ( Test . methodStaticD ( ) , <NUM_LIT> ) <EOL> self . assertEquals ( Test . methodStaticString ( ) , '<STR_LIT>' ) <EOL> def test_static_fields ( self ) : <EOL> Test = autoclass ( '<STR_LIT>' ) <EOL> self . assertEquals ( Test . fieldStaticZ , True ) <EOL> self . assertEquals ( Test . fieldStaticB , <NUM_LIT> ) <EOL> self . assertEquals ( Test . fieldStaticC , '<STR_LIT:k>' ) <EOL> self . assertEquals ( Test . fieldStaticS , <NUM_LIT> ) <EOL> self . assertEquals ( Test . fieldStaticI , <NUM_LIT> ) <EOL> self . assertEquals ( Test . fieldStaticJ , <NUM_LIT> ) <EOL> self . assertAlmostEquals ( Test . fieldStaticF , <NUM_LIT> ) <EOL> self . assertEquals ( Test . fieldStaticD , <NUM_LIT> ) <EOL> self . assertEquals ( Test . fieldStaticString , '<STR_LIT>' ) <EOL> def test_instance_methods ( self ) : <EOL> test = autoclass ( '<STR_LIT>' ) ( ) <EOL> self . assertEquals ( test . methodZ ( ) , True ) <EOL> self . assertEquals ( test . methodB ( ) , <NUM_LIT> ) <EOL> self . assertEquals ( test . methodC ( ) , '<STR_LIT:k>' ) <EOL> self . assertEquals ( test . methodS ( ) , <NUM_LIT> ) <EOL> self . assertEquals ( test . methodI ( ) , <NUM_LIT> ) <EOL> self . assertEquals ( test . methodJ ( ) , <NUM_LIT> ) <EOL> self . assertAlmostEquals ( test . methodF ( ) , <NUM_LIT> ) <EOL> self . assertEquals ( test . methodD ( ) , <NUM_LIT> ) <EOL> self . assertEquals ( test . methodString ( ) , '<STR_LIT>' ) <EOL> def test_instance_fields ( self ) : <EOL> test = autoclass ( '<STR_LIT>' ) ( ) <EOL> self . assertEquals ( test . fieldZ , True ) <EOL> self . assertEquals ( test . fieldB , <NUM_LIT> ) <EOL> self . assertEquals ( test . fieldC , '<STR_LIT:k>' ) <EOL> self . assertEquals ( test . fieldS , <NUM_LIT> ) <EOL> self . assertEquals ( test . fieldI , <NUM_LIT> ) <EOL> self . assertEquals ( test . fieldJ , <NUM_LIT> ) <EOL> self . assertAlmostEquals ( test . fieldF , <NUM_LIT> ) <EOL> self . assertEquals ( test . fieldD , <NUM_LIT> ) <EOL> self . assertEquals ( test . fieldString , '<STR_LIT>' ) <EOL> test2 = autoclass ( '<STR_LIT>' ) ( <NUM_LIT:10> ) <EOL> self . assertEquals ( test2 . fieldB , <NUM_LIT:10> ) <EOL> self . assertEquals ( test . fieldB , <NUM_LIT> ) <EOL> self . assertEquals ( test2 . fieldB , <NUM_LIT:10> ) <EOL> def test_instance_set_fields ( self ) : <EOL> test = autoclass ( '<STR_LIT>' ) ( ) <EOL> test . fieldSetZ = True <EOL> test . fieldSetB = <NUM_LIT> <EOL> test . fieldSetC = ord ( '<STR_LIT:k>' ) <EOL> test . fieldSetS = <NUM_LIT> <EOL> test . fieldSetI = <NUM_LIT> <EOL> test . fieldSetJ = <NUM_LIT> <EOL> test . fieldSetF = <NUM_LIT> <EOL> test . fieldSetD = <NUM_LIT> <EOL> self . assertTrue ( test . testFieldSetZ ( ) ) <EOL> self . assertTrue ( test . testFieldSetB ( ) ) <EOL> self . assertTrue ( test . testFieldSetC ( ) ) <EOL> self . assertTrue ( test . testFieldSetS ( ) ) <EOL> self . assertTrue ( test . testFieldSetI ( ) ) <EOL> self . assertTrue ( test . testFieldSetJ ( ) ) <EOL> self . assertTrue ( test . testFieldSetF ( ) ) <EOL> self . assertTrue ( test . testFieldSetD ( ) ) <EOL> def test_instances_methods_array ( self ) : <EOL> test = autoclass ( '<STR_LIT>' ) ( ) <EOL> self . assertEquals ( test . methodArrayZ ( ) , [ True ] * <NUM_LIT:3> ) <EOL> self . assertEquals ( test . methodArrayB ( ) [ <NUM_LIT:0> ] , <NUM_LIT> ) <EOL> self . assertEquals ( test . methodArrayB ( ) , [ <NUM_LIT> ] * <NUM_LIT:3> ) <EOL> self . assertEquals ( test . methodArrayC ( ) , [ '<STR_LIT:k>' ] * <NUM_LIT:3> ) <EOL> self . assertEquals ( test . methodArrayS ( ) , [ <NUM_LIT> ] * <NUM_LIT:3> ) <EOL> self . assertEquals ( test . methodArrayI ( ) , [ <NUM_LIT> ] * <NUM_LIT:3> ) <EOL> self . assertEquals ( test . methodArrayJ ( ) , [ <NUM_LIT> ] * <NUM_LIT:3> ) <EOL> ret = test . methodArrayF ( ) <EOL> ref = [ <NUM_LIT> ] * <NUM_LIT:3> <EOL> self . assertAlmostEquals ( ret [ <NUM_LIT:0> ] , ref [ <NUM_LIT:0> ] ) <EOL> self . assertAlmostEquals ( ret [ <NUM_LIT:1> ] , ref [ <NUM_LIT:1> ] ) <EOL> self . assertAlmostEquals ( ret [ <NUM_LIT:2> ] , ref [ <NUM_LIT:2> ] ) <EOL> self . assertEquals ( test . methodArrayD ( ) , [ <NUM_LIT> ] * <NUM_LIT:3> ) <EOL> self . assertEquals ( test . methodArrayString ( ) , [ '<STR_LIT>' ] * <NUM_LIT:3> ) <EOL> def test_instances_methods_params ( self ) : <EOL> test = autoclass ( '<STR_LIT>' ) ( ) <EOL> self . assertEquals ( test . methodParamsZBCSIJFD ( <EOL> True , <NUM_LIT> , '<STR_LIT:k>' , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) , True ) <EOL> self . assertEquals ( test . methodParamsString ( '<STR_LIT>' ) , True ) <EOL> self . assertEquals ( test . methodParamsArrayI ( [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] ) , True ) <EOL> self . assertEquals ( test . methodParamsArrayString ( [ <EOL> '<STR_LIT:hello>' , '<STR_LIT>' ] ) , True ) <EOL> def test_instances_methods_params_object_list_str ( self ) : <EOL> test = autoclass ( '<STR_LIT>' ) ( ) <EOL> self . assertEquals ( test . methodParamsObject ( [ <EOL> '<STR_LIT:hello>' , '<STR_LIT>' ] ) , True ) <EOL> def test_instances_methods_params_object_list_int ( self ) : <EOL> test = autoclass ( '<STR_LIT>' ) ( ) <EOL> self . assertEquals ( test . methodParamsObject ( [ <NUM_LIT:1> , <NUM_LIT:2> ] ) , True ) <EOL> def test_instances_methods_params_object_list_float ( self ) : <EOL> test = autoclass ( '<STR_LIT>' ) ( ) <EOL> self . assertEquals ( test . methodParamsObject ( [ <NUM_LIT> , <NUM_LIT> ] ) , True ) <EOL> def test_instances_methods_params_object_list_long ( self ) : <EOL> test = autoclass ( '<STR_LIT>' ) ( ) <EOL> self . assertEquals ( test . methodParamsObject ( [ <NUM_LIT:1> , <NUM_LIT:2> ] ) , True ) <EOL> def test_instances_methods_params_array_byte ( self ) : <EOL> test = autoclass ( '<STR_LIT>' ) ( ) <EOL> self . assertEquals ( test . methodParamsArrayByte ( [ <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ] ) , True ) <EOL> ret = test . methodArrayB ( ) <EOL> self . assertEquals ( test . methodParamsArrayByte ( ret ) , True ) <EOL> def test_return_array_as_object_array_of_strings ( self ) : <EOL> test = autoclass ( '<STR_LIT>' ) ( ) <EOL> self . assertEquals ( test . methodReturnStrings ( ) , [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> def test_return_array_as_object_of_integers ( self ) : <EOL> test = autoclass ( '<STR_LIT>' ) ( ) <EOL> self . assertEquals ( test . methodReturnIntegers ( ) , [ <NUM_LIT:1> , <NUM_LIT:2> ] ) </s>
