Package net.java.sip.communicator.service.filehistory

Examples of net.java.sip.communicator.service.filehistory.FileRecord


                    new String[]{FileHistoryService.class.getName()},
                    testMetaContact, 2));
        assertEquals("Filetransfers must be 2", rs.size(), 2);

        it = rs.iterator();
        FileRecord fr = it.next();
        assertTrue("Filetransfers not found",
                    fr.getFile().getName().
                    equals(files[4].getName()));

        assertTrue("Filetransfers status wrong",
                    fr.getStatus().
                    equals("refused"));
        assertTrue("Filetransfers direction wrong",
                    fr.getDirection().
                    equalsIgnoreCase("out"));

        fr = it.next();
        assertTrue("Filetransfers not found",
                    fr.getFile().getName().
                    equals(files[5].getName()));
        assertTrue("Filetransfers status wrong",
                    fr.getStatus().
                    equals("completed"));
        assertTrue("Filetransfers direction wrong",
                    fr.getDirection().
                    equalsIgnoreCase("in"));

        rs = getFileRecords(
                metaHistoryService.findByKeyword(
                    new String[]{FileHistoryService.class.getName()},
                    testMetaContact,
                    "t3"));
        assertTrue("Filetransfers must be atleast 1", rs.size() > 0);

        it = rs.iterator();
        assertTrue("Filetransfers not found",
                    it.next().getFile().getName().
                        equals(files[2].getName()));

        rs = getFileRecords(
                metaHistoryService.findByKeyword(
                    new String[]{FileHistoryService.class.getName()},
                    testMetaContact,
                    "T3", true));
        assertEquals("Filetransfers must be 0", rs.size(), 0);

        rs = getFileRecords(
                metaHistoryService.findByKeywords(
                    new String[]{FileHistoryService.class.getName()},
                    testMetaContact,
                    new String[]{"t3"}));
        assertTrue("Filetransfers must be atleast 1", rs.size() > 0);

        it = rs.iterator();
        assertTrue("Filetransfers not found",
                    it.next().getFile().getName().
                        equals(files[2].getName()));

        rs = getFileRecords(
                metaHistoryService.findByKeywords(
                    new String[]{FileHistoryService.class.getName()},
                    testMetaContact,
                    new String[]{"T3"}, true));
        assertEquals("Filetransfers must be 0", rs.size(), 0);

        rs = getFileRecords(
                metaHistoryService.findFirstMessagesAfter(
                    new String[]{FileHistoryService.class.getName()},
                    testMetaContact,
                    controlDate1,
                    2));
        assertEquals("Filetransfers must be 2", rs.size(), 2);

        it = rs.iterator();
        fr = it.next();
        assertTrue("Filetransfers not found",
                    fr.getFile().getName().
                    equals(files[2].getName()));
        assertTrue("Filetransfers status wrong",
                    fr.getStatus().
                    equals("completed"));
        assertTrue("Filetransfers direction wrong",
                    fr.getDirection().
                    equalsIgnoreCase("out"));

        fr = it.next();
        assertTrue("Filetransfers not found",
                    fr.getFile().getName().
                    equals(files[3].getName()));
        assertTrue("Filetransfers status wrong",
                    fr.getStatus().
                    equals("active"));
        assertTrue("Filetransfers direction wrong",
                    fr.getDirection().
                    equalsIgnoreCase("in"));

        rs = getFileRecords(
                metaHistoryService.findLastMessagesBefore(
                    new String[]{FileHistoryService.class.getName()},
                    testMetaContact,
                    controlDate1,
                    2));
        assertEquals("Filetransfers must be 2", rs.size(), 2);

        it = rs.iterator();
        fr = it.next();
        assertTrue("Filetransfers not found",
                    fr.getFile().getName().
                    equals(files[0].getName()));
        assertTrue("Filetransfers status wrong",
                    fr.getStatus().
                    equals("canceled"));
        assertTrue("Filetransfers direction wrong",
                    fr.getDirection().
                    equalsIgnoreCase("out"));

        fr = it.next();
        assertTrue("Filetransfers not found",
                    fr.getFile().getName().
                    equals(files[1].getName()));
        assertTrue("Filetransfers status wrong",
                    fr.getStatus().
                    equals("completed"));
        assertTrue("Filetransfers direction wrong",
                    fr.getDirection().
                    equalsIgnoreCase("in"));
    }
View Full Code Here

TOP

Related Classes of net.java.sip.communicator.service.filehistory.FileRecord

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.