Search in sources :

Example 6 with Tuple3

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

the class AsyncRSZippingTest method testUnzip3WithLimits.

@Test
public void testUnzip3WithLimits() {
    Supplier<ReactiveSeq<Tuple3<Integer, String, Long>>> s = () -> of(new Tuple3(1, "a", 2l), new Tuple3(2, "b", 3l), new Tuple3(3, "c", 4l));
    Tuple3<ReactiveSeq<Integer>, ReactiveSeq<String>, ReactiveSeq<Long>> u1 = ReactiveSeq.unzip3(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().toList().containsAll(asList(2l, 3l, 4l)));
}
Also used : Tuple3(cyclops.data.tuple.Tuple3) FlowableReactiveSeq(cyclops.reactive.FlowableReactiveSeq) ReactiveSeq(cyclops.reactive.ReactiveSeq) Test(org.junit.Test)

Example 7 with Tuple3

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

the class AsyncRSZippingTest method testUnzip3.

@Test
public void testUnzip3() {
    Supplier<ReactiveSeq<Tuple3<Integer, String, Long>>> s = () -> of(new Tuple3(1, "a", 2l), new Tuple3(2, "b", 3l), new Tuple3(3, "c", 4l));
    Tuple3<ReactiveSeq<Integer>, ReactiveSeq<String>, ReactiveSeq<Long>> u1 = ReactiveSeq.unzip3(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)));
}
Also used : Tuple3(cyclops.data.tuple.Tuple3) FlowableReactiveSeq(cyclops.reactive.FlowableReactiveSeq) ReactiveSeq(cyclops.reactive.ReactiveSeq) Test(org.junit.Test)

Example 8 with Tuple3

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

the class ReactiveZippingRSTest method testUnzip3.

@Test
public void testUnzip3() {
    Supplier<ReactiveSeq<Tuple3<Integer, String, Long>>> s = () -> of(new Tuple3(1, "a", 2l), new Tuple3(2, "b", 3l), new Tuple3(3, "c", 4l));
    Tuple3<ReactiveSeq<Integer>, ReactiveSeq<String>, ReactiveSeq<Long>> u1 = ReactiveSeq.unzip3(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)));
}
Also used : Tuple3(cyclops.data.tuple.Tuple3) FlowableReactiveSeq(cyclops.reactive.FlowableReactiveSeq) ReactiveSeq(cyclops.reactive.ReactiveSeq) Test(org.junit.Test)

Example 9 with Tuple3

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

the class ZippingTest method testUnzip3.

@Test
public void testUnzip3() {
    Supplier<Streamable<Tuple3<Integer, String, Long>>> s = () -> of(new Tuple3(1, "a", 2l), new Tuple3(2, "b", 3l), new Tuple3(3, "c", 4l));
    Tuple3<Streamable<Integer>, Streamable<String>, Streamable<Long>> u1 = Streamable.unzip3(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)));
}
Also used : Tuple3(cyclops.data.tuple.Tuple3) Streamable(cyclops.companion.Streamable) Test(org.junit.Test)

Example 10 with Tuple3

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

the class ZippingTest method testUnzip3WithLimits.

@Test
public void testUnzip3WithLimits() {
    Supplier<ReactiveSeq<Tuple3<Integer, String, Long>>> s = () -> of(new Tuple3(1, "a", 2l), new Tuple3(2, "b", 3l), new Tuple3(3, "c", 4l));
    Tuple3<ReactiveSeq<Integer>, ReactiveSeq<String>, ReactiveSeq<Long>> u1 = ReactiveSeq.unzip3(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().toList().containsAll(asList(2l, 3l, 4l)));
}
Also used : Tuple3(cyclops.data.tuple.Tuple3) ReactiveSeq(cyclops.reactive.ReactiveSeq) Test(org.junit.Test)

Aggregations

Tuple3 (cyclops.data.tuple.Tuple3)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