Package etc.aloe.data

Examples of etc.aloe.data.Segment


        SegmentSet segments = instance.segment(messages);

        //Expecting 5 segments
        assertEquals(5, segments.size());

        Segment seg0 = segments.get(0);
        Segment seg1 = segments.get(1);
        Segment seg2 = segments.get(2);
        Segment seg3 = segments.get(3);
        Segment seg4 = segments.get(4);

        assertEquals(1, seg0.getMessages().size()); //Alice
        assertEquals(1, seg1.getMessages().size()); //Alice
        assertEquals(2, seg2.getMessages().size()); //Alice, Alice
        assertEquals(2, seg3.getMessages().size()); //Bob, Bob
        assertEquals(2, seg4.getMessages().size()); //Bob, Bob

        assertEquals(messages.get(0), seg0.getMessages().get(0));
        assertEquals(messages.get(5), seg1.getMessages().get(0));
        assertEquals(messages.get(6), seg2.getMessages().get(0));
        assertEquals(messages.get(1), seg3.getMessages().get(0));
        assertEquals(messages.get(3), seg4.getMessages().get(0));
    }
View Full Code Here


        SegmentSet segments = instance.segment(messages);

        //Expecting 4 segments
        assertEquals(4, segments.size());

        Segment seg0 = segments.get(0);
        Segment seg1 = segments.get(1);
        Segment seg2 = segments.get(2);
        Segment seg3 = segments.get(3);

        assertEquals(3, seg0.getMessages().size());
        assertEquals(2, seg1.getMessages().size());
        assertEquals(1, seg2.getMessages().size());
        assertEquals(2, seg3.getMessages().size());

        assertEquals(messages.get(0), seg0.getMessages().get(0));
        assertEquals(messages.get(3), seg1.getMessages().get(0));
        assertEquals(messages.get(5), seg2.getMessages().get(0));
        assertEquals(messages.get(6), seg3.getMessages().get(0));
    }
View Full Code Here

        SegmentSet segments = instance.segment(messages);

        //Expecting 2 segments, one for each participant
        assertEquals(2, segments.size());

        Segment seg0 = segments.get(0);
        Segment seg1 = segments.get(1);

        assertEquals(4, seg0.getMessages().size());
        assertEquals(4, seg1.getMessages().size());

        String participant0 = seg0.getMessages().get(0).getParticipant();
        String participant1 = seg1.getMessages().get(0).getParticipant();
        assertFalse(participant0.equals(participant1));

        for (Message message : seg0.getMessages()) {
            assertTrue(message.getParticipant().equals(participant0));
        }

        for (Message message : seg1.getMessages()) {
            assertTrue(message.getParticipant().equals(participant1));
        }
    }
View Full Code Here

        SegmentSet segments = instance.segment(messages);

        //Expecting 1 segment
        assertEquals(1, segments.size());

        Segment seg0 = segments.get(0);

        assertEquals(8, seg0.getMessages().size());

        for (int i = 0; i < seg0.getMessages().size(); i++) {
            Message message = seg0.getMessages().get(i);
            Message expectedMessage = seg0.getMessages().get(i);
            assertEquals(expectedMessage, message);
        }
    }
View Full Code Here

TOP

Related Classes of etc.aloe.data.Segment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.