use of com.zimbra.cs.imap.SelectCommand in project zm-mailbox by Zimbra.
the class ImapCommandThrottleTest method select.
@Test
public void select() {
String pathName = "testfolder";
SelectCommand select = new SelectCommand(new ImapPath(pathName, null), (byte) 123, makeQri());
Assert.assertTrue("same obj", select.isDuplicate(select));
SelectCommand select2 = new SelectCommand(new ImapPath(pathName, null), (byte) 123, makeQri());
Assert.assertTrue("diff obj same fields", select.isDuplicate(select2));
SelectCommand select3 = new SelectCommand(new ImapPath(pathName + "foo", null), (byte) 123, makeQri());
Assert.assertFalse("different path", select.isDuplicate(select3));
SelectCommand select4 = new SelectCommand(new ImapPath(pathName, null), (byte) 101, makeQri());
Assert.assertFalse("different params", select.isDuplicate(select4));
QResyncInfo qri = makeQri();
qri.setKnownUIDs("foo");
SelectCommand select5 = new SelectCommand(new ImapPath(pathName, null), (byte) 123, qri);
Assert.assertFalse("different qri", select.isDuplicate(select5));
}
use of com.zimbra.cs.imap.SelectCommand in project zm-mailbox by Zimbra.
the class ImapCommandThrottleTest method examine.
@Test
public void examine() {
String pathName = "testfolder";
ExamineCommand examine = new ExamineCommand(new ImapPath(pathName, null), (byte) 123, makeQri());
Assert.assertTrue("same obj", examine.isDuplicate(examine));
SelectCommand select = new SelectCommand(new ImapPath(pathName, null), (byte) 123, makeQri());
Assert.assertFalse("select vs examine", examine.isDuplicate(select));
ExamineCommand examine2 = new ExamineCommand(new ImapPath(pathName, null), (byte) 123, makeQri());
Assert.assertTrue("diff obj same fields", examine.isDuplicate(examine2));
ExamineCommand examine3 = new ExamineCommand(new ImapPath(pathName + "foo", null), (byte) 123, makeQri());
Assert.assertFalse("different path", examine.isDuplicate(examine3));
ExamineCommand examine4 = new ExamineCommand(new ImapPath(pathName, null), (byte) 101, makeQri());
Assert.assertFalse("different params", examine.isDuplicate(examine4));
QResyncInfo qri = makeQri();
qri.setKnownUIDs("foo");
ExamineCommand examine5 = new ExamineCommand(new ImapPath(pathName, null), (byte) 123, qri);
Assert.assertFalse("different qri", examine.isDuplicate(examine5));
}
Aggregations