use of it.vige.rubia.search.SearchCriteria in project rubia-forums by flashboss.
the class SearchPostTest method verifyPostProfileFromTopicPageButton.
@Test
public void verifyPostProfileFromTopicPageButton() {
goTo(driver);
SearchCriteria searchTopicCriteria = new SearchCriteria();
searchTopicCriteria.setAuthor("root");
searchTopicCriteria.setCategory(null);
searchTopicCriteria.setDisplayAs(POSTS.name());
searchTopicCriteria.setForum(null);
searchTopicCriteria.setKeywords("Body");
searchTopicCriteria.setPageNumber(0);
searchTopicCriteria.setPageSize(0);
searchTopicCriteria.setSearching(null);
searchTopicCriteria.setSortBy(null);
searchTopicCriteria.setSortOrder(null);
searchTopicCriteria.setTimePeriod(null);
List<Post> posts = searchPost(driver, searchTopicCriteria);
Post post = posts.get(3);
Poster poster = getPosterFromButton(driver, post);
assertTrue(poster != null);
assertEquals("root", poster.getUserId());
assertTrue(poster.getPostCount() >= 6);
}
use of it.vige.rubia.search.SearchCriteria in project rubia-forums by flashboss.
the class SearchPostTest method verifyPostProfileFromTopicPage.
@Test
public void verifyPostProfileFromTopicPage() {
goTo(driver);
SearchCriteria searchTopicCriteria = new SearchCriteria();
searchTopicCriteria.setAuthor("root");
searchTopicCriteria.setCategory(null);
searchTopicCriteria.setDisplayAs(POSTS.name());
searchTopicCriteria.setForum(null);
searchTopicCriteria.setKeywords("Body");
searchTopicCriteria.setPageNumber(0);
searchTopicCriteria.setPageSize(0);
searchTopicCriteria.setSearching(null);
searchTopicCriteria.setSortBy(null);
searchTopicCriteria.setSortOrder(null);
searchTopicCriteria.setTimePeriod(null);
List<Post> posts = searchPost(driver, searchTopicCriteria);
Post post = posts.get(2);
Poster poster = getPosterFromLink(driver, post);
assertTrue(poster != null);
assertEquals("root", poster.getUserId());
assertTrue(poster.getPostCount() >= 6);
}
use of it.vige.rubia.search.SearchCriteria in project rubia-forums by flashboss.
the class SearchPostTest method searchPostsWithReset.
@Test
public void searchPostsWithReset() {
goTo(driver);
SearchCriteria searchTopicCriteria = new SearchCriteria();
searchTopicCriteria.setAuthor(null);
searchTopicCriteria.setCategory(null);
searchTopicCriteria.setDisplayAs(POSTS.name());
searchTopicCriteria.setForum(null);
searchTopicCriteria.setKeywords("First");
searchTopicCriteria.setPageNumber(0);
searchTopicCriteria.setPageSize(0);
searchTopicCriteria.setSearching(null);
searchTopicCriteria.setSortBy(null);
searchTopicCriteria.setSortOrder(null);
searchTopicCriteria.setTimePeriod(null);
reset(driver, searchTopicCriteria);
List<Post> posts = getPosts(driver, searchTopicCriteria);
assertTrue(posts == null);
}
use of it.vige.rubia.search.SearchCriteria in project rubia-forums by flashboss.
the class Search method search.
public String search() throws Exception {
int currentPage = 0;
SearchCriteria criteria = getSearchCriteria();
criteria.setPageSize(userPreferences.getPostsPerTopic());
criteria.setPageNumber(currentPage);
if (criteria.getDisplayAs().equals(POSTS.name())) {
ResultPage<Post> resultPage = forumsSearchModule.findPosts(criteria);
viewSearch.setPosts(resultPage.getPage());
viewSearch.setPostsDataModel(new ListDataModel<Post>(viewSearch.getPosts()));
if (viewSearch.getPosts() != null && viewSearch.getPosts().isEmpty()) {
viewSearch.setPosts(null);
viewSearch.setPostsDataModel(null);
}
return "posts";
} else {
ResultPage<Topic> resultPage = forumsSearchModule.findTopics(criteria);
viewSearch.setTopics(resultPage.getPage());
viewSearch.setTopicsDataModel(new ListDataModel<Topic>(viewSearch.getTopics()));
if (viewSearch.getTopics() == null || viewSearch.getTopics().isEmpty()) {
viewSearch.setTopics(null);
viewSearch.setTopicsDataModel(null);
} else {
viewSearch.setTopicLastPosts(forumsModule.findLastPostsOfTopics(viewSearch.getTopics()));
}
return "topics";
}
}
use of it.vige.rubia.search.SearchCriteria in project rubia-forums by flashboss.
the class SearchTopicTest method searchTopicsNoResults.
@Test
public void searchTopicsNoResults() {
goTo(driver);
SearchCriteria searchForumCriteria = new SearchCriteria();
searchForumCriteria.setAuthor(null);
searchForumCriteria.setCategory(null);
searchForumCriteria.setDisplayAs(TOPICS.name());
searchForumCriteria.setForum(null);
searchForumCriteria.setKeywords("Firstaaaaa");
searchForumCriteria.setPageNumber(0);
searchForumCriteria.setPageSize(0);
searchForumCriteria.setSearching(null);
searchForumCriteria.setSortBy(null);
searchForumCriteria.setSortOrder(null);
searchForumCriteria.setTimePeriod(null);
List<Topic> topics = searchTopic(driver, searchForumCriteria);
assertTrue(topics == null);
}
Aggregations