use of com.zimbra.cs.mailclient.imap.Literal in project zm-mailbox by Zimbra.
the class TestImapThrottle method append.
@Test
public void append() throws Exception {
assertTrue(connection.hasCapability("UIDPLUS"));
Date date = new Date(System.currentTimeMillis());
Flags flags = Flags.fromSpec("afs");
for (int i = 0; i < LOOP_LIMIT; i++) {
Literal msg = message(100000);
try {
connection.append("INBOX", flags, date, msg);
} finally {
msg.dispose();
}
}
Literal msg = message(100000);
try {
connection.append("INBOX", flags, date, msg);
Assert.fail("expected exception here...");
} catch (Exception e) {
Assert.assertTrue(connection.isClosed());
} finally {
msg.dispose();
}
}
use of com.zimbra.cs.mailclient.imap.Literal in project zm-mailbox by Zimbra.
the class TestImap method testAppend.
@Test
public void testAppend() throws Exception {
assertTrue(connection.hasCapability("UIDPLUS"));
Flags flags = Flags.fromSpec("afs");
Date date = new Date(System.currentTimeMillis());
Literal msg = message(100000);
try {
AppendResult res = connection.append("INBOX", flags, date, msg);
assertNotNull(res);
byte[] b = fetchBody(res.getUid());
assertArrayEquals("content mismatch", msg.getBytes(), b);
} finally {
msg.dispose();
}
}
Aggregations