# OJI JNI Tests Cases

Function Name | Test cases | Comments | Number of tests
Version Information
GetVersion | have 100% test cases | according to specification - writed 1 test | 1
Total: | 1
Class operations
FindClass | have 100% test cases | according to specification - writed 8 tests (additional 1 test - for java.lang.String) | 8
GetSuperclass | have 100% test cases | according to specification - writed 4 tests | 4
IsAssignableFrom | have 100% test cases | according to specification - writed 5 tests | 5
Total: | 17
Exceptions
Throw | have 100% test cases | according to specification - writed 2 tests | 2
ThrowNew | have 100% test cases | according to specification - writed 5 tests | 5
ExceptionOccured | have 100% test cases | according to specification - writed 2 tests | 2
ExceptionDescribe | have 100% test cases | according to specification - writed 2 tests | 2
ExceptionClear | have 100% test cases | according to specification - writed 2 tests | 2
FatalError | have 100% test cases | only 1 test written, do not need to write other, always failed | 1
Total: | 14
Global and Local References
NewGlobalRef | have 100% test cases | according to specification - writed 2 tests | 2
DeleteGlobalRef | have 100% test cases | according to specification - writed 2 tests | 2
DeleteLocalRef | have 100% test cases | according to specification - writed 2 tests | 2
Total: | 6
Object operations
AllocObject | have 100% test cases | according to specification - writed 4 tests | 4
GetObjectClass | have 100% test cases | according to specification - writed 2 tests (additional 1 test for GetObjectClass(NULL)) | 4
IsSameObject | have 100% test cases | according to specification | 4
IsInstanceOf | have 100% test cases | according to specification - writed 5 tests | 5
NewObject, NewObjectA, NewObjectV | have 100% test cases | according to specification - writed only 18 tests for NewObject and NewObjectA | 18
Total: | 35
Accessing Fields
GetFieldID | have 100% test cases | Written all tests for <field types> = 10 tests. Written only 3 tests for <access modifiers> and <inherited from>. Test cases are: public <int, object> from superclass (intersection = 2) and 1 test for private int in class - trown exception as a result of wrapping SecureEnv. Written only 1 test for <other modifiers> (for final int in class) Total: 20 tests. | 20
Get<Type>Field | have 100% test cases | There is one test for accessing Array field - GetIntField_6.cpp. Do not need to write the same test. | 53
Set<Type>Field | have 100% test cases | according to specification - writed 50 tests | 50
Total: | 123
Calling Instance Methods
GetMethodID | have 100% test cases | according to specification - writed 39 tests | 39
Call<Type>Method | Do not tests for Call<TYPE>MethodV | according to specification (have only 2 tests for CallVoidMethd - CallVoidMethodA, CallVoidMethod (return values only void))- writed 56 tests | 56
CallNonvirtual<Type>Method | have 100% of test cases | according to specification (have only 2 tests for CallVoidMethd - CallVoidMethodA, CallVoidMethod (return values only void))- writed 69 tests | 69
Total: | 164
Accessing Static Fields
GetStaticFieldID | have 100% test cases | The same test cases as for GetFieldID | 20
GetStatic<Type>Field | have 100% test cases | according to specification - writed 51 tests | 51
SetStatic<Type>Field | have 100% test cases | according to specification - writed 50 tests | 50
Total: | 121
Calling Static Methods
GetStaticMethodID | have 100% test cases | The same test cases as for GetMethodID | 22
CallStatic<Type>Method | have 100% test cases | according to specification - writed 56 tests | 56
Total: | 78
Strings operations
NewString | have 100% test cases | according to specification - writed 3 tests | 3
GetStringLength | have 100% test cases | according to specification - writed 3 tests | 2
GetStringChars | have 100% test cases | according to specification - writed 4 tests | 4
ReleaseStringChars | have 100% test cases | according to specification - writed 2 tests | 2
NewStringUTF | have 100% test cases | according to specification - writed 3 tests | 3
GetStringUTFLength | have 100% test cases | according to specification - writed 3 tests | 3
GetStringUTFChars | have 100% test cases | according to specification - writed 4 tests | 4
ReleaseStringUTFChars | have 100% test cases | according to specification - writed 2 tests | 2
Total: | 23
Array Operations
GetArrayLength | have 100% test cases | according to specification - writed 3 tests | 3
NewObjectArray | have 100% test cases | according to specification - writed 6 tests | 6
GetObjectArrayElement | have 100% test cases | according to specification - writed 5 tests | 5
SetObjectArrayElement | have 100% test cases | according to specification - writed 5 tests | 5
New<PrimitiveType>Array | have 100% test cases | according to specification - writed 24 tests | 24
Set<PrimitiveType>ArrayRegion | have 100% test cases | according to specification - writed 11 tests | 11
Get<PrimitiveType>ArrayRegion | have 100% test cases | according to specification - writed 11 tests | 11
Get<PrimitiveType>ArrayElements | have 100% test cases | according to specification - writed 24 tests | 24
Release<PrimitiveType>ArrayElements | have 100% test cases | according to specification - writed 24 tests | 24
Total: | 113
Registering Native Methods
Java VM Interface
GetJavaVM | have 100% test cases | according to specification - writed 2 tests | 2
Total: | 2