| 129 | } |
| 130 | |
| 131 | void startJvm() { |
| 132 | JavaVMInitArgs vm_args; |
| 133 | JavaVMOption options[1]; |
| 134 | |
| 135 | options[0].optionString = const_cast<char*>("-Djava.class.path=build/test/classes"); |
| 136 | //options[1].optionString = const_cast<char*>("-Xcheck:jni"); |
| 137 | |
| 138 | // Configure JVM |
| 139 | vm_args.version = JNI_VERSION_1_6; |
| 140 | vm_args.nOptions = 1; |
| 141 | vm_args.options = options; |
| 142 | vm_args.ignoreUnrecognized = true; |
| 143 | |
| 144 | CreateJvm createJvm = (CreateJvm)dlsym(_jvm_lib, "JNI_CreateJavaVM"); |
| 145 | if (createJvm == NULL) { |
| 146 | std::cerr << "Unable to find: JNI_CreateJavaVM" << std::endl; |
| 147 | exit(1); |
| 148 | } |
| 149 | |
| 150 | // Create the JVM |
| 151 | jint rc = createJvm(&_jvm, (void**)&_env, &vm_args); |
| 152 | if (rc != JNI_OK) { |
| 153 | std::cerr << "Failed to create JVM" << std::endl; |
| 154 | exit(1); |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | void executeJvmTask() { |
| 159 | jclass customClass = _env->FindClass("test/nonjava/JavaClass"); |
no outgoing calls
no test coverage detected