Search in sources :

Example 1 with Tuple4

use of cyclops.data.tuple.Tuple4 in project cyclops by aol.

the class SyncZippingTest method testUnzip4WithLimits.

@Test
public void testUnzip4WithLimits() {
    Supplier<ReactiveSeq<Tuple4<Integer, String, Long, Character>>> s = () -> of(new Tuple4(1, "a", 2l, 'z'), new Tuple4(2, "b", 3l, 'y'), new Tuple4(3, "c", 4l, 'x'));
    Tuple4<ReactiveSeq<Integer>, ReactiveSeq<String>, ReactiveSeq<Long>, ReactiveSeq<Character>> u1 = ReactiveSeq.unzip4(s.get());
    assertTrue(u1._1().limit(1).toList().containsAll(Arrays.asList(1)));
    assertTrue(u1._2().limit(2).toList().containsAll(asList("a", "b")));
    assertTrue(u1._3().limit(3).toList().containsAll(asList(2l, 3l, 4l)));
    assertTrue(u1._4().limit(4).toList().containsAll(asList('z', 'y', 'x')));
}
Also used : Tuple4(cyclops.data.tuple.Tuple4) ReactiveSeq(cyclops.reactive.ReactiveSeq) Test(org.junit.Test)

Example 2 with Tuple4

use of cyclops.data.tuple.Tuple4 in project cyclops by aol.

the class AsyncZippingTest method testUnzip4WithLimits.

@Test
public void testUnzip4WithLimits() {
    Supplier<ReactiveSeq<Tuple4<Integer, String, Long, Character>>> s = () -> of(new Tuple4(1, "a", 2l, 'z'), new Tuple4(2, "b", 3l, 'y'), new Tuple4(3, "c", 4l, 'x'));
    Tuple4<ReactiveSeq<Integer>, ReactiveSeq<String>, ReactiveSeq<Long>, ReactiveSeq<Character>> u1 = ReactiveSeq.unzip4(s.get());
    assertTrue(u1._1().limit(1).toList().containsAll(Arrays.asList(1)));
    assertTrue(u1._2().limit(2).toList().containsAll(asList("a", "b")));
    assertTrue(u1._3().limit(3).toList().containsAll(asList(2l, 3l, 4l)));
    assertTrue(u1._4().limit(4).toList().containsAll(asList('z', 'y', 'x')));
}
Also used : Tuple4(cyclops.data.tuple.Tuple4) ReactiveSeq(cyclops.reactive.ReactiveSeq) ObservableReactiveSeq(cyclops.reactive.ObservableReactiveSeq) Test(org.junit.Test)

Example 3 with Tuple4

use of cyclops.data.tuple.Tuple4 in project cyclops by aol.

the class AsyncZippingTest method testUnzip4.

@Test
public void testUnzip4() {
    Supplier<ReactiveSeq<Tuple4<Integer, String, Long, Character>>> s = () -> of(new Tuple4(1, "a", 2l, 'z'), new Tuple4(2, "b", 3l, 'y'), new Tuple4(3, "c", 4l, 'x'));
    Tuple4<ReactiveSeq<Integer>, ReactiveSeq<String>, ReactiveSeq<Long>, ReactiveSeq<Character>> u1 = ReactiveSeq.unzip4(s.get());
    assertTrue(u1._1().toList().containsAll(Arrays.asList(1, 2, 3)));
    assertTrue(u1._2().toList().containsAll(asList("a", "b", "c")));
    assertTrue(u1._3().toList().containsAll(asList(2l, 3l, 4l)));
    assertTrue(u1._4().toList().containsAll(asList('z', 'y', 'x')));
}
Also used : Tuple4(cyclops.data.tuple.Tuple4) ReactiveSeq(cyclops.reactive.ReactiveSeq) ObservableReactiveSeq(cyclops.reactive.ObservableReactiveSeq) Test(org.junit.Test)

Example 4 with Tuple4

use of cyclops.data.tuple.Tuple4 in project cyclops by aol.

the class SyncZippingTest method testUnzip4WithLimits.

@Test
public void testUnzip4WithLimits() {
    Supplier<ReactiveSeq<Tuple4<Integer, String, Long, Character>>> s = () -> of(new Tuple4(1, "a", 2l, 'z'), new Tuple4(2, "b", 3l, 'y'), new Tuple4(3, "c", 4l, 'x'));
    Tuple4<ReactiveSeq<Integer>, ReactiveSeq<String>, ReactiveSeq<Long>, ReactiveSeq<Character>> u1 = ReactiveSeq.unzip4(s.get());
    assertTrue(u1._1().limit(1).toList().containsAll(Arrays.asList(1)));
    assertTrue(u1._2().limit(2).toList().containsAll(asList("a", "b")));
    assertTrue(u1._3().limit(3).toList().containsAll(asList(2l, 3l, 4l)));
    assertTrue(u1._4().limit(4).toList().containsAll(asList('z', 'y', 'x')));
}
Also used : Tuple4(cyclops.data.tuple.Tuple4) FlowableReactiveSeq(cyclops.reactive.FlowableReactiveSeq) ReactiveSeq(cyclops.reactive.ReactiveSeq) Test(org.junit.Test)

Example 5 with Tuple4

use of cyclops.data.tuple.Tuple4 in project cyclops by aol.

the class AsyncRSZippingTest method testUnzip4.

@Test
public void testUnzip4() {
    Supplier<ReactiveSeq<Tuple4<Integer, String, Long, Character>>> s = () -> of(new Tuple4(1, "a", 2l, 'z'), new Tuple4(2, "b", 3l, 'y'), new Tuple4(3, "c", 4l, 'x'));
    Tuple4<ReactiveSeq<Integer>, ReactiveSeq<String>, ReactiveSeq<Long>, ReactiveSeq<Character>> u1 = ReactiveSeq.unzip4(s.get());
    assertTrue(u1._1().toList().containsAll(Arrays.asList(1, 2, 3)));
    assertTrue(u1._2().toList().containsAll(asList("a", "b", "c")));
    assertTrue(u1._3().toList().containsAll(asList(2l, 3l, 4l)));
    assertTrue(u1._4().toList().containsAll(asList('z', 'y', 'x')));
}
Also used : Tuple4(cyclops.data.tuple.Tuple4) FlowableReactiveSeq(cyclops.reactive.FlowableReactiveSeq) ReactiveSeq(cyclops.reactive.ReactiveSeq) Test(org.junit.Test)

Aggregations

Tuple4 (cyclops.data.tuple.Tuple4)30 Test (org.junit.Test)30 ReactiveSeq (cyclops.reactive.ReactiveSeq)28 FlowableReactiveSeq (cyclops.reactive.FlowableReactiveSeq)6 FluxReactiveSeq (cyclops.reactive.FluxReactiveSeq)6 Streamable (cyclops.companion.Streamable)2 DuplicationTest (cyclops.futurestream.react.lazy.DuplicationTest)2 ObservableReactiveSeq (cyclops.reactive.ObservableReactiveSeq)2