private static void invokeApiActivityAndReceiver(final int expected_result, Intent intent) throws ExecutionException, InterruptedException {
		final Context context = getContext();
		intent = new Intent(intent).setPackage("com.oasisfeng.island");

		final CompletableFuture<Integer> result_code = new CompletableFuture<>();
		final CompletableFuture<String> result_data = new CompletableFuture<>();
		context.sendOrderedBroadcast(intent, null, new BroadcastReceiver() { @Override public void onReceive(final Context context, final Intent intent) {
			result_code.complete(getResultCode());
			result_data.complete(getResultData());
		}}, null, 0, null, null);
		assertEquals(result_data.get(), expected_result, (int) result_code.get());

		context.startActivity(intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
	}
Test cases for {@link ApiActivity}

Created by Oasis on 2016/7/27.
engine/src/androidTest/java/com/oasisfeng/island/api/ApiActivityTest.java