Skip to content

Commit

Permalink
modified code
Browse files Browse the repository at this point in the history
  • Loading branch information
Praful Makani committed Jun 14, 2019
1 parent 6d7e110 commit fc3b729
Showing 1 changed file with 0 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import com.google.api.gax.core.ExecutorProvider;
import com.google.api.gax.core.FixedExecutorProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.core.NoCredentialsProvider;
Expand All @@ -37,10 +36,6 @@
import io.grpc.StatusException;
import io.grpc.inprocess.InProcessChannelBuilder;
import io.grpc.inprocess.InProcessServerBuilder;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
Expand Down Expand Up @@ -117,33 +112,6 @@ public void testFailedChannel_recoverableError_channelReopened() throws Exceptio
subscriber.stopAsync().awaitTerminated();
}

@Test
public void testFailedChannelTerminated() throws InterruptedException, TimeoutException {
final ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(5);
ExecutorProvider provider =
new ExecutorProvider() {
@Override
public boolean shouldAutoClose() {
return true;
}

@Override
public ScheduledExecutorService getExecutor() {
return scheduledExecutorService;
}
};

try {
Subscriber subscriber =
startSubscriber(
getTestSubscriberBuilder(testReceiver).setSystemExecutorProvider(provider));
subscriber.stopAsync().awaitTerminated(10, TimeUnit.SECONDS);
assertTrue(scheduledExecutorService.awaitTermination(10, TimeUnit.SECONDS));
} finally {
scheduledExecutorService.shutdownNow();
}
}

@Test(expected = IllegalStateException.class)
public void testFailedChannel_fatalError_subscriberFails() throws Exception {
Subscriber subscriber =
Expand Down

0 comments on commit fc3b729

Please sign in to comment.