clean up dependencies #19755 and other fixes

* remove inter-project dependencies between streamTestkit -> peristence -> remote
* make PartitionOutOfBoundsException extend IndexOutOfBoundsException
* some weird formatting
* remove -experimental from HTTP Testkit/Tests
* split out shared LevelDb journal tests into new subproject (not to be
  published)
This commit is contained in:
Roland Kuhn 2016-02-15 16:53:57 +01:00
parent 10d3af1478
commit e202ea8c40
18 changed files with 288 additions and 218 deletions

View file

@ -100,23 +100,18 @@ public class FlowTest extends StreamTest {
}
@Test
public void mustBeAbleToUseStatefullMaponcat() throws Exception {
public void mustBeAbleToUseStatefulMaponcat() throws Exception {
final JavaTestKit probe = new JavaTestKit(system);
final java.lang.Iterable<Integer> input = Arrays.asList(1, 2, 3, 4, 5);
final Source<Integer, NotUsed> ints = Source.from(input);
final Flow<Integer, Integer, NotUsed> flow = Flow.of(Integer.class).statefulMapConcat(
new Creator<Function<Integer, Iterable<Integer>>>() {
public Function<Integer, Iterable<Integer>> create() {
int[] state = new int[1];
state[0] = 0;
return new Function<Integer, Iterable<Integer>>() {
public List<Integer> apply(Integer elem) {
List<Integer> list = new ArrayList<>(Collections.nCopies(state[0], elem));
state[0] = elem;
return list;
}
};
}
() -> {
int[] state = new int[] {0};
return (elem) -> {
List<Integer> list = new ArrayList<>(Collections.nCopies(state[0], elem));
state[0] = elem;
return list;
};
});
ints.via(flow)