Examples of MboxInputStream


Examples of org.lilyproject.tools.mboximport.MboxInputStream

import static org.junit.Assert.assertEquals;

public class MboxInputStreamTest {
    @Test
    public void test() throws Exception {
        MboxInputStream stream = new MboxInputStream(new ByteArrayInputStream("From someone\nfoobar\nFrom someone else\nanother foobar".getBytes()), 10000);

        stream.nextMessage();
        String msg1 = IOUtils.toString(stream);
        assertEquals("foobar\n", msg1);

        stream.nextMessage();
        String msg2 = IOUtils.toString(stream);
        assertEquals("another foobar\n", msg2);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.