def test_03_07_cw_get_fields(self): c = J.get_class_wrapper('java.lang.String') fields = c.getFields() fields = J.get_env().get_object_array_elements(fields) self.assertEqual(len(fields), 1) self.assertEqual(J.call(fields[0], 'getName', '()Ljava/lang/String;'), "CASE_INSENSITIVE_ORDER")
def __init__(self): klass = jutil.get_env().find_class( 'ome/xml/model/enums/PixelType') self.INT8 = jutil.get_static_field( klass, 'INT8', 'Lome/xml/model/enums/PixelType;') self.INT16 = jutil.get_static_field( klass, 'INT16', 'Lome/xml/model/enums/PixelType;') self.INT32 = jutil.get_static_field( klass, 'INT32', 'Lome/xml/model/enums/PixelType;') self.UINT8 = jutil.get_static_field( klass, 'UINT8', 'Lome/xml/model/enums/PixelType;') self.UINT16 = jutil.get_static_field( klass, 'UINT16', 'Lome/xml/model/enums/PixelType;') self.UINT32 = jutil.get_static_field( klass, 'UINT32', 'Lome/xml/model/enums/PixelType;') self.FLOAT = jutil.get_static_field( klass, 'FLOAT', 'Lome/xml/model/enums/PixelType;') self.BIT = jutil.get_static_field( klass, 'BIT', 'Lome/xml/model/enums/PixelType;') self.DOUBLE = jutil.get_static_field( klass, 'DOUBLE', 'Lome/xml/model/enums/PixelType;') self.COMPLEX = jutil.get_static_field( klass, 'COMPLEX', 'Lome/xml/model/enums/PixelType;') self.DOUBLECOMPLEX = jutil.get_static_field( klass, 'DOUBLECOMPLEX', 'Lome/xml/model/enums/PixelType;')
def __init__(self): klass = jutil.get_env().find_class('ome/xml/model/enums/PixelType') self.INT8 = jutil.get_static_field(klass, 'INT8', 'Lome/xml/model/enums/PixelType;') self.INT16 = jutil.get_static_field(klass, 'INT16', 'Lome/xml/model/enums/PixelType;') self.INT32 = jutil.get_static_field(klass, 'INT32', 'Lome/xml/model/enums/PixelType;') self.UINT8 = jutil.get_static_field(klass, 'UINT8', 'Lome/xml/model/enums/PixelType;') self.UINT16 = jutil.get_static_field(klass, 'UINT16', 'Lome/xml/model/enums/PixelType;') self.UINT32 = jutil.get_static_field(klass, 'UINT32', 'Lome/xml/model/enums/PixelType;') self.FLOAT = jutil.get_static_field(klass, 'FLOAT', 'Lome/xml/model/enums/PixelType;') self.BIT = jutil.get_static_field(klass, 'BIT', 'Lome/xml/model/enums/PixelType;') self.DOUBLE = jutil.get_static_field(klass, 'DOUBLE', 'Lome/xml/model/enums/PixelType;') self.COMPLEX = jutil.get_static_field(klass, 'COMPLEX', 'Lome/xml/model/enums/PixelType;') self.DOUBLECOMPLEX = jutil.get_static_field(klass, 'DOUBLECOMPLEX', 'Lome/xml/model/enums/PixelType;')
def test_03_10_cw_get_methods(self): c = J.get_class_wrapper('java.lang.String') mmm = J.get_env().get_object_array_elements(c.getMethods()) self.assertTrue(any([J.call(m, 'getName', '()Ljava/lang/String;') == 'concat' for m in mmm]))
def test_03_06_cw_get_constructors(self): c = J.get_class_wrapper('java.lang.String') constructors = c.getConstructors() constructors = J.get_env().get_object_array_elements(constructors) self.assertEqual(len(constructors), 15)
def test_03_05_cw_get_annotations(self): c = J.get_class_wrapper('java.security.Identity') annotations = c.getAnnotations() annotations = J.get_env().get_object_array_elements(annotations) self.assertEqual(len(annotations), 1) self.assertEqual(J.to_string(annotations[0]),'@java.lang.Deprecated()')
def test_03_03_cw_get_classes(self): c = J.get_class_wrapper('java.lang.Number') classes = c.getClasses() self.assertEqual(len(J.get_env().get_object_array_elements(classes)), 0)