Skip to content

Commit

Permalink
Remove useless ExecutorEngine.execute (#28025)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Aug 10, 2023
1 parent 4a76714 commit ae03933
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,6 @@ public static ExecutorEngine createExecutorEngineWithSize(final int executorSize
return new ExecutorEngine(executorSize);
}

/**
* Execute.
*
* @param executionGroupContext execution group context
* @param callback executor callback
* @param <I> type of input value
* @param <O> type of return value
* @return execute result
* @throws SQLException throw if execute failure
*/
public <I, O> List<O> execute(final ExecutionGroupContext<I> executionGroupContext, final ExecutorCallback<I, O> callback) throws SQLException {
return execute(executionGroupContext, null, callback, false);
}

/**
* Execute.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;

class ExecutorEngineTest {
Expand Down Expand Up @@ -76,13 +75,6 @@ private List<Object> createMockedInputs(final int size) {
return result;
}

@Test
void assertParallelExecuteWithoutFirstCallback() throws SQLException, InterruptedException {
List<String> actual = executorEngine.execute(executionGroupContext, callback);
latch.await();
assertThat(actual.size(), is(4));
}

@Test
void assertParallelExecuteWithFirstCallback() throws SQLException, InterruptedException {
List<String> actual = executorEngine.execute(executionGroupContext, firstCallback, callback, false);
Expand All @@ -96,12 +88,4 @@ void assertSerialExecute() throws SQLException, InterruptedException {
latch.await();
assertThat(actual.size(), is(4));
}

@Test
void assertExecutionGroupIsEmpty() throws SQLException {
CountDownLatch latch = new CountDownLatch(1);
List<String> actual = executorEngine.execute(new ExecutionGroupContext<>(new LinkedList<>(), mock(ExecutionGroupReportContext.class)), new ExecutorCallbackFixture(latch));
latch.countDown();
assertTrue(actual.isEmpty());
}
}

0 comments on commit ae03933

Please sign in to comment.