Package org.jtalks.jcommune.model.dto

Examples of org.jtalks.jcommune.model.dto.PageRequest


        int pageCount = 2;
        int itemsOnPage = totalSize / pageCount;
        JCUser userTo = PersistedObjectsFactory.getUser("UserTo", "mail2@mail.com");
        JCUser userFrom = PersistedObjectsFactory.getUser("UserFrom", "mail1@mail.com");

        PageRequest pageRequest = new PageRequest("1",
                itemsOnPage);
        PersistedObjectsFactory.preparePrivateMessages(totalSize, userTo, userFrom);

        Page<PrivateMessage> messagePage = dao.getDraftsForUser(userFrom, pageRequest);
View Full Code Here


        int pageCount = 2;
        int itemsOnPage = totalSize / pageCount;
        JCUser userTo = PersistedObjectsFactory.getUser("UserTo", "mail2@mail.com");
        JCUser userFrom = PersistedObjectsFactory.getUser("UserFrom", "mail1@mail.com");

        PageRequest pageRequest = new PageRequest("0",
                itemsOnPage);
        PersistedObjectsFactory.preparePrivateMessages(totalSize, userTo, userFrom);

        Page<PrivateMessage> messagePage = dao.getDraftsForUser(userFrom, pageRequest);
View Full Code Here

        int pageCount = 2;
        int itemsOnPage = totalSize / pageCount;
        JCUser userTo = PersistedObjectsFactory.getUser("UserTo", "mail2@mail.com");
        JCUser userFrom = PersistedObjectsFactory.getUser("UserFrom", "mail1@mail.com");

        PageRequest pageRequest = new PageRequest("0",
                itemsOnPage);
        PersistedObjectsFactory.preparePrivateMessages(totalSize, userTo, userFrom);

        Page<PrivateMessage> messagePage = dao.getDraftsForUser(userFrom, pageRequest);
View Full Code Here

        int pageCount = 2;
        int itemsOnPage = totalSize / pageCount;
        JCUser userTo = PersistedObjectsFactory.getUser("UserTo", "mail2@mail.com");
        JCUser userFrom = PersistedObjectsFactory.getUser("UserFrom", "mail1@mail.com");

        PageRequest pageRequest = new PageRequest("1000",
                itemsOnPage);
        PersistedObjectsFactory.preparePrivateMessages(totalSize, userTo, userFrom);

        Page<PrivateMessage> messagePage = dao.getDraftsForUser(userFrom, pageRequest);
View Full Code Here

        int pageCount = 2;
        int itemsOnPage = totalSize / pageCount;
        JCUser userTo = PersistedObjectsFactory.getUser("UserTo", "mail2@mail.com");
        JCUser userFrom = PersistedObjectsFactory.getUser("UserFrom", "mail1@mail.com");

        PageRequest pageRequest = new PageRequest("1000",
                itemsOnPage);
        PersistedObjectsFactory.preparePrivateMessages(totalSize, userTo, userFrom);

        Page<PrivateMessage> messagePage = dao.getDraftsForUser(userFrom, pageRequest);
View Full Code Here

        int pageCount = 2;
        int itemsOnPage = totalSize / pageCount;
        JCUser userTo = PersistedObjectsFactory.getUser("UserTo", "mail2@mail.com");
        JCUser userFrom = PersistedObjectsFactory.getUser("UserFrom", "mail1@mail.com");

        PageRequest pageRequest = new PageRequest("1000",
                itemsOnPage);
        PersistedObjectsFactory.preparePrivateMessages(totalSize, userTo, userFrom);

        Page<PrivateMessage> messagePage = dao.getDraftsForUser(userFrom, pageRequest);
View Full Code Here

        int itemsOnPage = totalSize / pageCount;
        int messageNumber = 1;
        JCUser userTo = PersistedObjectsFactory.getUser("UserTo", "mail2@mail.com");
        JCUser userFrom = PersistedObjectsFactory.getUser("UserFrom", "mail1@mail.com");

        PageRequest pageRequest = new PageRequest("1",
                itemsOnPage);
        PersistedObjectsFactory.preparePrivateMessages(messageNumber, userTo, userFrom);

        Page<PrivateMessage> messagePage = dao.getDraftsForUser(userFrom, pageRequest);
View Full Code Here

        int itemsOnPage = totalSize / pageCount;
        int messageNumber = 1;
        JCUser userTo = PersistedObjectsFactory.getUser("UserTo", "mail2@mail.com");
        JCUser userFrom = PersistedObjectsFactory.getUser("UserFrom", "mail1@mail.com");

        PageRequest pageRequest = new PageRequest("1", itemsOnPage);
        PersistedObjectsFactory.preparePrivateMessages(messageNumber, userTo, userFrom);

        Page<PrivateMessage> messagePage = dao.getDraftsForUser(userFrom, pageRequest);

        assertEquals(messagePage.getTotalPages(), pageCount, "Incorrect count of pages.");
View Full Code Here

    public void testSearchPaging() {
        int totalSize = 50;
        int pageCount = 2;
        int pageSize = totalSize / pageCount;
        String searchText = "JCommune";
        PageRequest pageRequest = new PageRequest("1", pageSize);
        List<Topic> topicList = PersistedObjectsFactory.createAndSaveTopicList(totalSize);
        for (Topic topic : topicList) {
            topic.setTitle(searchText);
        }
View Full Code Here

        expectedTopic.setTitle(TOPIC_CONTENT);

        saveAndFlushIndexes(Arrays.asList(expectedTopic));
        configureMocks(TOPIC_CONTENT, TOPIC_CONTENT);

        PageRequest pageRequest = new PageRequest("-1", PAGE_SIZE);
        Page<Topic> searchResultPage = topicSearchDao.searchByTitleAndContent(
                TOPIC_CONTENT, pageRequest, Arrays.asList(expectedTopic.getBranch().getId()));

        Assert.assertEquals(searchResultPage.getNumber(), 1);
        Assert.assertTrue(searchResultPage.hasContent(), "Search result must not be empty.");
View Full Code Here

TOP

Related Classes of org.jtalks.jcommune.model.dto.PageRequest

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.