Re-implement javadsl testkit (#22240)

* re-implement javadsl testkit

* fix mima problem

* rebase master

* move ImplicitSender/DefaultTimeout to scaladsl

* undo the change of moving scala api

* fix return type and add doc

* resolve conflicts and add more comments
This commit is contained in:
Hawstein 2017-03-17 03:02:47 +08:00 committed by Patrik Nordwall
parent 3643f18ded
commit 6434cbe868
93 changed files with 1147 additions and 619 deletions

View file

@ -9,7 +9,7 @@ import akka.stream.ActorMaterializer;
import akka.stream.Materializer;
import akka.stream.javadsl.Sink;
import akka.stream.javadsl.Source;
import akka.testkit.JavaTestKit;
import akka.testkit.javadsl.TestKit;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@ -30,14 +30,14 @@ public class RecipeSeq extends RecipeTest {
@AfterClass
public static void tearDown() {
JavaTestKit.shutdownActorSystem(system);
TestKit.shutdownActorSystem(system);
system = null;
mat = null;
}
@Test
public void drainSourceToList() throws Exception {
new JavaTestKit(system) {
new TestKit(system) {
{
final Source<String, NotUsed> mySource = Source.from(Arrays.asList("1", "2", "3"));
//#draining-to-list-unsafe
@ -52,7 +52,7 @@ public class RecipeSeq extends RecipeTest {
@Test
public void drainSourceToListWithLimit() throws Exception {
new JavaTestKit(system) {
new TestKit(system) {
{
final Source<String, NotUsed> mySource = Source.from(Arrays.asList("1", "2", "3"));
//#draining-to-list-safe
@ -70,7 +70,7 @@ public class RecipeSeq extends RecipeTest {
}
public void drainSourceToListWithTake() throws Exception {
new JavaTestKit(system) {
new TestKit(system) {
{
final Source<String, NotUsed> mySource = Source.from(Arrays.asList("1", "2", "3"));
final int MAX_ALLOWED_SIZE = 100;