Search in sources :

Example 1 with SelectCommand

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));
}
Also used : SelectCommand(com.zimbra.cs.imap.SelectCommand) ImapPath(com.zimbra.cs.imap.ImapPath) QResyncInfo(com.zimbra.cs.imap.QResyncInfo) Test(org.junit.Test)

Example 2 with SelectCommand

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));
}
Also used : ExamineCommand(com.zimbra.cs.imap.ExamineCommand) ImapPath(com.zimbra.cs.imap.ImapPath) SelectCommand(com.zimbra.cs.imap.SelectCommand) QResyncInfo(com.zimbra.cs.imap.QResyncInfo) Test(org.junit.Test)

Aggregations

ImapPath (com.zimbra.cs.imap.ImapPath)2 QResyncInfo (com.zimbra.cs.imap.QResyncInfo)2 SelectCommand (com.zimbra.cs.imap.SelectCommand)2 Test (org.junit.Test)2 ExamineCommand (com.zimbra.cs.imap.ExamineCommand)1