Back to index

lightning-sunbird  0.9+nobinonly
CallNonvirtualIntMethod_2.cpp File Reference
#include "JNIEnvTests.h"
#include "CallingInstanceMethods.h"

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_CallNonvirtualIntMethod_2)

Function Documentation

JNI_OJIAPITest ( JNIEnv_CallNonvirtualIntMethod_2  )

Definition at line 40 of file CallNonvirtualIntMethod_2.cpp.


  jclass clazz_exp = env->FindClass("Ljava/security/PrivilegedActionException;");
  IMPLEMENT_GetMethodID_METHOD("Test1", "Test1_thrown_excp", "(I)I");
  jvalue *args  = new jvalue[0];
  args[0].i = 10;
  jint value = env->CallNonvirtualIntMethodA(obj, env->GetSuperclass(clazz), MethodID, args);
  jthrowable excep = env->ExceptionOccurred();

  if((MethodID != NULL) && (env->IsInstanceOf(excep, clazz_exp))){
     return TestResult::PASS("CallNonvirtualIntMethodA for public not inherited method that thrown exception really thrown exception");
     return TestResult::FAIL("CallNonvirtualIntMethodA for public not inherited method that thrown exception do not really thrown exception");


Here is the call graph for this function: