<commit_before>package libjoe.testlib.executors.testers;

import static com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor;
import libjoe.testlib.executors.ExecutorFeature;
import libjoe.testlib.executors.ExecutorFeature.Require;

import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;

@Require(value=ExecutorFeature.LISTENING)
public class ListenableFutureTester<E extends ListeningExecutorService> extends AbstractExecutorTester<E> {
    public void testListenableFutureExecuted_Runnable() throws Exception {
        doTestListenableFutureExecuted(ExecutorSubmitters.RUNNABLE);
    }
    public void testListenableFutureExecuted_RunnableWithValue() throws Exception {
        doTestListenableFutureExecuted(ExecutorSubmitters.RUNNABLE_WITH_VALUE);
    }
    public void testListenableFutureExecuted_Callable() throws Exception {
        doTestListenableFutureExecuted(ExecutorSubmitters.CALLABLE);
    }
    private void doTestListenableFutureExecuted(ExecutorSubmitter submitter) throws Exception {
        LoggingRunnable originalTask = noopRunnable();
        ListenableFuture<?> future = (ListenableFuture<?>) submitter.submit(getSubjectGenerator().createTestSubject(), originalTask);
        
        LoggingRunnable listener = noopRunnable();
        future.addListener(listener, sameThreadExecutor());
        checkTaskRan(listener);
        checkCompletedFuture(originalTask, future, submitter.getExpectedValue());
    }
}<commit_msg>add one missing case for ListenableFuture basic test<commit_after>package libjoe.testlib.executors.testers;

import static com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor;
import libjoe.testlib.executors.ExecutorFeature;
import libjoe.testlib.executors.ExecutorFeature.Require;

import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;

@Require(value=ExecutorFeature.LISTENING)
public class ListenableFutureTester<E extends ListeningExecutorService> extends AbstractExecutorTester<E> {
    public void testListenableFutureExecuted_Runnable() throws Exception {
        doTestListenableFutureExecuted(ExecutorSubmitters.RUNNABLE);
    }
    public void testListenableFutureExecuted_RunnableWithValue() throws Exception {
        doTestListenableFutureExecuted(ExecutorSubmitters.RUNNABLE_WITH_VALUE);
    }
    public void testListenableFutureExecuted_Callable() throws Exception {
        doTestListenableFutureExecuted(ExecutorSubmitters.CALLABLE);
    }
    public void testListenableFutureExecuted_InvokeAll() throws Exception {
        doTestListenableFutureExecuted(ExecutorSubmitters.INVOKE_ALL);
    }
    private void doTestListenableFutureExecuted(ExecutorSubmitter submitter) throws Exception {
        LoggingRunnable originalTask = noopRunnable();
        ListenableFuture<?> future = (ListenableFuture<?>) submitter.submit(getSubjectGenerator().createTestSubject(), originalTask);
        
        LoggingRunnable listener = noopRunnable();
        future.addListener(listener, sameThreadExecutor());
        checkTaskRan(listener);
        checkCompletedFuture(originalTask, future, submitter.getExpectedValue());
    }
}
{'fraction_non_alphanumeric': 0.07555282555282555, 'fraction_numerical': 0.0, 'mean_word_length': 5.771309771309771, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1118289', 'n_tokens_mistral': 848, 'n_tokens_neox': 836, 'n_words': 137}