| 478 | } |
| 479 | |
| 480 | jobject createDatabase(jobject workload, FDBDatabase* db) { |
| 481 | auto executor = env->CallObjectMethod(workload, |
| 482 | getMethod(getClass("com/apple/foundationdb/testing/AbstractWorkload"), |
| 483 | "getExecutor", |
| 484 | "()Ljava/util/concurrent/Executor;")); |
| 485 | auto databaseClass = getClass("com/apple/foundationdb/FDBDatabase"); |
| 486 | jlong databasePtr = reinterpret_cast<jlong>(db); |
| 487 | jobject javaDatabase = env->NewObject(databaseClass, |
| 488 | getMethod(databaseClass, "<init>", "(JLjava/util/concurrent/Executor;)V"), |
| 489 | databasePtr, |
| 490 | executor); |
| 491 | env->DeleteLocalRef(executor); |
| 492 | return javaDatabase; |
| 493 | } |
| 494 | |
| 495 | void callWorkload(jobject workload, FDBDatabase* db, const char* method, GenericPromise<bool>&& promise) { |
| 496 | jobject jPromise = nullptr; |
nothing calls this directly
no test coverage detected