use of it.vige.rubia.ui.action.PreferenceController in project rubia-forums by flashboss.
the class PreferencesTest method scenary2.
public void scenary2() {
Category firstTestCategory = new Category("First Test Category");
Category secondTestCategory = new Category("Second Test Category");
goTo(driver);
PreferenceController submitCriteria = new PreferenceController();
submitCriteria.setAlwaysAddSignature(false);
submitCriteria.setSummaryTopicLimit(5);
submitCriteria.setSummaryTopicReplies(5);
submitCriteria.setSummaryTopicDays(1);
submitCriteria.setNotifyOnReply(false);
submitCriteria.setSummaryMode(BLOCK_TOPICS_MODE_MOST_VIEWED);
submitCriteria.setAlwaysAllowHtml(false);
submitCriteria.setSignature("My Old Signature");
submitCriteria.setDateFormat("d-MM-yyyy");
submit(driver, submitCriteria);
List<Topic> summaryTopics = viewSummary(driver);
int sizeSummaryTopics = viewSize(driver);
Topic summaryTopicDetail = getDetail(driver, "Ninteen Test Topic");
assertTrue(summaryTopics != null);
assertEquals(5, summaryTopics.size());
assertEquals(5, sizeSummaryTopics);
assertEquals("Ninteen Test Topic", summaryTopics.get(0).getSubject());
assertEquals("Ninteen Test Topic", summaryTopicDetail.getSubject());
Topic newTopic = new Topic(new Forum("Third Test Forum", "Third Test Description", new Category("Second Test Category")), "Thirtytwo Test Topic", asList(new Post[] { new Post("Thirtytwo Test Body") }), NORMAL, null);
String message = createTopic(driver, newTopic);
assertTrue(message.equals("Thirtytwo Test Topic"));
List<Forum> forums = getForumsOfCategories(driver, firstTestCategory, secondTestCategory);
Date today = new Date();
List<Topic> topics = getTopicsOfForums(driver, forums.toArray(new Forum[0]));
assertTrue(topics != null);
assertEquals(24, topics.size());
assertEquals("Ninteen Test Topic", topics.get(0).getSubject());
assertEquals("root", topics.get(0).getPoster().getUserId());
assertEquals(32, topics.get(0).getReplies());
assertEquals(102, topics.get(0).getViewCount());
assertTrue(topics.get(0).getLastPostDate().compareTo(today) < 0);
assertEquals(15, topics.get(0).getPosts().size());
assertTrue(topics.get(0).getPosts().get(0).getMessage().getSubject().startsWith("Ninteen Test Topic"));
assertEquals("Ninteen Test Body", topics.get(0).getPosts().get(0).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(0).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(1).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen4</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(1).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(1).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(1).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(2).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen5</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(2).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(2).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(2).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(3).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen6</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(3).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(3).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(3).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(4).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen7</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(4).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(4).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(4).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(5).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen8</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(5).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(5).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(5).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(6).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen9</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(6).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(6).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(6).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(7).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen10</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(7).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(7).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(7).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(8).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen11</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(8).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(8).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(8).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(9).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen12</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(9).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(9).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(9).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(10).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen13</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(10).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(10).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(10).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(11).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen14</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(11).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(11).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(11).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(12).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen15</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(12).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(12).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(12).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(13).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen16</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(13).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(13).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(13).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(14).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen17</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(14).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(14).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(14).getPoster().getUserId());
assertEquals("Eighteen Test Topic", topics.get(1).getSubject());
assertEquals("root", topics.get(1).getPoster().getUserId());
assertEquals(0, topics.get(1).getReplies());
assertEquals(2, topics.get(1).getViewCount());
assertTrue(topics.get(1).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(1).getPosts().size());
assertTrue(topics.get(1).getPosts().get(0).getMessage().getSubject().startsWith("Eighteen Test Topic"));
assertTrue(topics.get(1).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(1).getPosts().get(0).getPoster().getUserId());
assertEquals("Seventeen Test Topic", topics.get(2).getSubject());
assertEquals("root", topics.get(2).getPoster().getUserId());
assertEquals(0, topics.get(2).getReplies());
assertEquals(2, topics.get(2).getViewCount());
assertTrue(topics.get(2).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(2).getPosts().size());
assertTrue(topics.get(2).getPosts().get(0).getMessage().getSubject().startsWith("Seventeen Test Topic"));
assertTrue(topics.get(2).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(2).getPosts().get(0).getPoster().getUserId());
assertEquals("Sixteen Test Topic", topics.get(3).getSubject());
assertEquals("root", topics.get(3).getPoster().getUserId());
assertEquals(0, topics.get(3).getReplies());
assertEquals(2, topics.get(3).getViewCount());
assertTrue(topics.get(3).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(3).getPosts().size());
assertTrue(topics.get(3).getPosts().get(0).getMessage().getSubject().startsWith("Sixteen Test Topic"));
assertTrue(topics.get(3).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(3).getPosts().get(0).getPoster().getUserId());
assertEquals("Fifteen Test Topic", topics.get(4).getSubject());
assertEquals("root", topics.get(4).getPoster().getUserId());
assertEquals(0, topics.get(4).getReplies());
assertEquals(2, topics.get(4).getViewCount());
assertTrue(topics.get(4).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(4).getPosts().size());
assertTrue(topics.get(4).getPosts().get(0).getMessage().getSubject().startsWith("Fifteen Test Topic"));
assertTrue(topics.get(4).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(4).getPosts().get(0).getPoster().getUserId());
assertEquals("Fourteen Test Topic", topics.get(5).getSubject());
assertEquals("root", topics.get(5).getPoster().getUserId());
assertEquals(0, topics.get(5).getReplies());
assertEquals(2, topics.get(5).getViewCount());
assertTrue(topics.get(5).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(5).getPosts().size());
assertTrue(topics.get(5).getPosts().get(0).getMessage().getSubject().startsWith("Fourteen Test Topic"));
assertTrue(topics.get(5).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(5).getPosts().get(0).getPoster().getUserId());
assertEquals("Thirteen Test Topic", topics.get(6).getSubject());
assertEquals("root", topics.get(6).getPoster().getUserId());
assertEquals(0, topics.get(6).getReplies());
assertEquals(2, topics.get(6).getViewCount());
assertTrue(topics.get(6).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(6).getPosts().size());
assertTrue(topics.get(6).getPosts().get(0).getMessage().getSubject().startsWith("Thirteen Test Topic"));
assertTrue(topics.get(6).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(6).getPosts().get(0).getPoster().getUserId());
assertEquals("Twelve Test Topic", topics.get(7).getSubject());
assertEquals("root", topics.get(7).getPoster().getUserId());
assertEquals(0, topics.get(7).getReplies());
assertEquals(2, topics.get(7).getViewCount());
assertTrue(topics.get(7).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(7).getPosts().size());
assertTrue(topics.get(7).getPosts().get(0).getMessage().getSubject().startsWith("Twelve Test Topic"));
assertTrue(topics.get(7).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(7).getPosts().get(0).getPoster().getUserId());
assertEquals("Eleven Test Topic", topics.get(8).getSubject());
assertEquals("root", topics.get(8).getPoster().getUserId());
assertEquals(0, topics.get(8).getReplies());
assertEquals(2, topics.get(8).getViewCount());
assertTrue(topics.get(8).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(8).getPosts().size());
assertTrue(topics.get(8).getPosts().get(0).getMessage().getSubject().startsWith("Eleven Test Topic"));
assertTrue(topics.get(8).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(8).getPosts().get(0).getPoster().getUserId());
assertEquals("Ten Test Topic", topics.get(9).getSubject());
assertEquals("root", topics.get(9).getPoster().getUserId());
assertEquals(0, topics.get(9).getReplies());
assertEquals(2, topics.get(9).getViewCount());
assertTrue(topics.get(9).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(9).getPosts().size());
assertTrue(topics.get(9).getPosts().get(0).getMessage().getSubject().startsWith("Ten Test Topic"));
assertTrue(topics.get(9).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(9).getPosts().get(0).getPoster().getUserId());
assertEquals("Second Test Topic", topics.get(10).getSubject());
assertEquals("root", topics.get(10).getPoster().getUserId());
assertEquals(0, topics.get(10).getReplies());
assertEquals(2, topics.get(10).getViewCount());
assertTrue(topics.get(10).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(10).getPosts().size());
assertTrue(topics.get(10).getPosts().get(0).getMessage().getSubject().startsWith("Second Test Topic"));
assertTrue(topics.get(10).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(10).getPosts().get(0).getPoster().getUserId());
assertEquals("Thirtyone Test Topic", topics.get(11).getSubject());
assertEquals("root", topics.get(11).getPoster().getUserId());
assertEquals(0, topics.get(11).getReplies());
assertEquals(2, topics.get(11).getViewCount());
assertTrue(topics.get(11).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(11).getPosts().size());
assertTrue(topics.get(11).getPosts().get(0).getMessage().getSubject().startsWith("Thirtyone Test Topic"));
assertTrue(topics.get(11).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(11).getPosts().get(0).getPoster().getUserId());
assertEquals("Thirty Test Topic", topics.get(12).getSubject());
assertEquals("root", topics.get(12).getPoster().getUserId());
assertEquals(0, topics.get(12).getReplies());
assertEquals(2, topics.get(12).getViewCount());
assertTrue(topics.get(12).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(12).getPosts().size());
assertTrue(topics.get(12).getPosts().get(0).getMessage().getSubject().startsWith("Thirty Test Topic"));
assertTrue(topics.get(12).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(12).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentynine Test Topic", topics.get(13).getSubject());
assertEquals("root", topics.get(13).getPoster().getUserId());
assertEquals(0, topics.get(13).getReplies());
assertEquals(2, topics.get(13).getViewCount());
assertTrue(topics.get(13).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(13).getPosts().size());
assertTrue(topics.get(13).getPosts().get(0).getMessage().getSubject().startsWith("Twentynine Test Topic"));
assertTrue(topics.get(13).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(13).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentyeight Test Topic", topics.get(14).getSubject());
assertEquals("root", topics.get(14).getPoster().getUserId());
assertEquals(0, topics.get(14).getReplies());
assertEquals(2, topics.get(14).getViewCount());
assertTrue(topics.get(14).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(14).getPosts().size());
assertTrue(topics.get(14).getPosts().get(0).getMessage().getSubject().startsWith("Twentyeight Test Topic"));
assertTrue(topics.get(14).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(14).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentyseven Test Topic", topics.get(15).getSubject());
assertEquals("root", topics.get(15).getPoster().getUserId());
assertEquals(0, topics.get(15).getReplies());
assertEquals(2, topics.get(15).getViewCount());
assertTrue(topics.get(15).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(15).getPosts().size());
assertTrue(topics.get(15).getPosts().get(0).getMessage().getSubject().startsWith("Twentyseven Test Topic"));
assertTrue(topics.get(15).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(15).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentysix Test Topic", topics.get(16).getSubject());
assertEquals("root", topics.get(16).getPoster().getUserId());
assertEquals(0, topics.get(16).getReplies());
assertEquals(0, topics.get(16).getViewCount());
assertTrue(topics.get(16).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(16).getPosts().size());
assertTrue(topics.get(16).getPosts().get(0).getMessage().getSubject().startsWith("Twentysix Test Topic"));
assertTrue(topics.get(16).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(16).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentyfive Test Topic", topics.get(17).getSubject());
assertEquals("root", topics.get(17).getPoster().getUserId());
assertEquals(0, topics.get(17).getReplies());
assertEquals(0, topics.get(17).getViewCount());
assertTrue(topics.get(17).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(17).getPosts().size());
assertTrue(topics.get(17).getPosts().get(0).getMessage().getSubject().startsWith("Twentyfive Test Topic"));
assertTrue(topics.get(17).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(17).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentyfour Test Topic", topics.get(18).getSubject());
assertEquals("root", topics.get(18).getPoster().getUserId());
assertEquals(0, topics.get(18).getReplies());
assertEquals(0, topics.get(18).getViewCount());
assertTrue(topics.get(18).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(18).getPosts().size());
assertTrue(topics.get(18).getPosts().get(0).getMessage().getSubject().startsWith("Twentyfour Test Topic"));
assertTrue(topics.get(18).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(18).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentythree Test Topic", topics.get(19).getSubject());
assertEquals("root", topics.get(19).getPoster().getUserId());
assertEquals(0, topics.get(19).getReplies());
assertEquals(0, topics.get(19).getViewCount());
assertTrue(topics.get(19).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(19).getPosts().size());
assertTrue(topics.get(19).getPosts().get(0).getMessage().getSubject().startsWith("Twentythree Test Topic"));
assertTrue(topics.get(19).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(19).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentytwo Test Topic", topics.get(20).getSubject());
assertEquals("root", topics.get(20).getPoster().getUserId());
assertEquals(0, topics.get(20).getReplies());
assertEquals(0, topics.get(20).getViewCount());
assertTrue(topics.get(20).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(20).getPosts().size());
assertTrue(topics.get(20).getPosts().get(0).getMessage().getSubject().startsWith("Twentytwo Test Topic"));
assertTrue(topics.get(20).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(20).getPosts().get(0).getPoster().getUserId());
assertEquals("Third Test Topic", topics.get(21).getSubject());
assertEquals("root", topics.get(21).getPoster().getUserId());
assertEquals(0, topics.get(21).getReplies());
assertEquals(2, topics.get(21).getViewCount());
assertTrue(topics.get(21).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(21).getPosts().size());
assertTrue(topics.get(21).getPosts().get(0).getMessage().getSubject().startsWith("Third Test Topic"));
assertTrue(topics.get(21).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(21).getPosts().get(0).getPoster().getUserId());
assertEquals("Fourth Test Topic", topics.get(22).getSubject());
assertEquals("root", topics.get(22).getPoster().getUserId());
assertEquals(0, topics.get(22).getReplies());
assertEquals(2, topics.get(22).getViewCount());
assertTrue(topics.get(22).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(22).getPosts().size());
assertTrue(topics.get(22).getPosts().get(0).getMessage().getSubject().startsWith("Fourth Test Topic"));
assertTrue(topics.get(22).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(22).getPosts().get(0).getPoster().getUserId());
assertEquals("Thirtytwo Test Topic", topics.get(23).getSubject());
assertEquals("root", topics.get(23).getPoster().getUserId());
assertEquals(0, topics.get(23).getReplies());
assertEquals(0, topics.get(23).getViewCount());
assertTrue(topics.get(23).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(23).getPosts().size());
assertTrue(topics.get(23).getPosts().get(0).getMessage().getSubject().startsWith("Thirtytwo Test Topic"));
assertTrue(topics.get(23).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(23).getPosts().get(0).getPoster().getUserId());
message = removeTopic(driver, new Topic(new Forum("Third Test Forum", "Third Test Description", new Category("Second Test Category")), "Thirtytwo Test Topic", asList(new Post[] { new Post("Thirtytwo Test Body") }), NORMAL, null));
assertTrue(message.equals(OK));
}
use of it.vige.rubia.ui.action.PreferenceController in project rubia-forums by flashboss.
the class PreferencesTest method scenary3.
public void scenary3() {
Category firstTestCategory = new Category("First Test Category");
Category secondTestCategory = new Category("Second Test Category");
goTo(driver);
PreferenceController submitCriteria = new PreferenceController();
submitCriteria.setPostOrder("ascending");
submitCriteria.setTopicsPerForum(20);
submitCriteria.setAlwaysAddSignature(false);
submitCriteria.setDateFormat("yyyy-MM-d");
submit(driver, submitCriteria);
List<Topic> summaryTopics = viewSummary(driver);
int sizeSummaryTopics = viewSize(driver);
Topic summaryTopicDetail = getDetail(driver, "Fourth Test Topic");
assertTrue(summaryTopics != null);
assertEquals(6, summaryTopics.size());
assertEquals(6, sizeSummaryTopics);
assertEquals("Fourth Test Topic", summaryTopics.get(0).getSubject());
assertEquals("Fourth Test Topic", summaryTopicDetail.getSubject());
Topic newTopic = new Topic(new Forum("Third Test Forum", "Third Test Description", new Category("Second Test Category")), "Thirtytwo Test Topic", asList(new Post[] { new Post("Thirtytwo Test Body") }), NORMAL, null);
String message = createTopic(driver, newTopic);
assertTrue(message.equals("Thirtytwo Test Topic"));
List<Forum> forums = getForumsOfCategories(driver, firstTestCategory, secondTestCategory);
Date today = new Date();
List<Topic> topics = getTopicsOfForums(driver, forums.toArray(new Forum[0]));
assertTrue(topics != null);
assertEquals(27, topics.size());
assertEquals("Ninteen Test Topic", topics.get(0).getSubject());
assertEquals("root", topics.get(0).getPoster().getUserId());
assertEquals(32, topics.get(0).getReplies());
assertEquals(104, topics.get(0).getViewCount());
assertTrue(topics.get(0).getLastPostDate().compareTo(today) < 0);
assertEquals(15, topics.get(0).getPosts().size());
assertTrue(topics.get(0).getPosts().get(0).getMessage().getSubject().startsWith("Ninteen Test Topic"));
assertEquals("Ninteen Test Body", topics.get(0).getPosts().get(0).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(0).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(1).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen4</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(1).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(1).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(1).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(2).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen5</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(2).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(2).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(2).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(3).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen6</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(3).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(3).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(3).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(4).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen7</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(4).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(4).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(4).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(5).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen8</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(5).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(5).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(5).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(6).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen9</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(6).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(6).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(6).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(7).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen10</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(7).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(7).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(7).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(8).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen11</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(8).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(8).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(8).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(9).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen12</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(9).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(9).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(9).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(10).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen13</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(10).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(10).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(10).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(11).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen14</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(11).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(11).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(11).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(12).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen15</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(12).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(12).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(12).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(13).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen16</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(13).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(13).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(13).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(14).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen17</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(14).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(14).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(14).getPoster().getUserId());
assertEquals("Eighteen Test Topic", topics.get(1).getSubject());
assertEquals("root", topics.get(1).getPoster().getUserId());
assertEquals(0, topics.get(1).getReplies());
assertEquals(4, topics.get(1).getViewCount());
assertTrue(topics.get(1).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(1).getPosts().size());
assertTrue(topics.get(1).getPosts().get(0).getMessage().getSubject().startsWith("Eighteen Test Topic"));
assertTrue(topics.get(1).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(1).getPosts().get(0).getPoster().getUserId());
assertEquals("Seventeen Test Topic", topics.get(2).getSubject());
assertEquals("root", topics.get(2).getPoster().getUserId());
assertEquals(0, topics.get(2).getReplies());
assertEquals(4, topics.get(2).getViewCount());
assertTrue(topics.get(2).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(2).getPosts().size());
assertTrue(topics.get(2).getPosts().get(0).getMessage().getSubject().startsWith("Seventeen Test Topic"));
assertTrue(topics.get(2).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(2).getPosts().get(0).getPoster().getUserId());
assertEquals("Sixteen Test Topic", topics.get(3).getSubject());
assertEquals("root", topics.get(3).getPoster().getUserId());
assertEquals(0, topics.get(3).getReplies());
assertEquals(4, topics.get(3).getViewCount());
assertTrue(topics.get(3).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(3).getPosts().size());
assertTrue(topics.get(3).getPosts().get(0).getMessage().getSubject().startsWith("Sixteen Test Topic"));
assertTrue(topics.get(3).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(3).getPosts().get(0).getPoster().getUserId());
assertEquals("Fifteen Test Topic", topics.get(4).getSubject());
assertEquals("root", topics.get(4).getPoster().getUserId());
assertEquals(0, topics.get(4).getReplies());
assertEquals(4, topics.get(4).getViewCount());
assertTrue(topics.get(4).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(4).getPosts().size());
assertTrue(topics.get(4).getPosts().get(0).getMessage().getSubject().startsWith("Fifteen Test Topic"));
assertTrue(topics.get(4).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(4).getPosts().get(0).getPoster().getUserId());
assertEquals("Fourteen Test Topic", topics.get(5).getSubject());
assertEquals("root", topics.get(5).getPoster().getUserId());
assertEquals(0, topics.get(5).getReplies());
assertEquals(4, topics.get(5).getViewCount());
assertTrue(topics.get(5).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(5).getPosts().size());
assertTrue(topics.get(5).getPosts().get(0).getMessage().getSubject().startsWith("Fourteen Test Topic"));
assertTrue(topics.get(5).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(5).getPosts().get(0).getPoster().getUserId());
assertEquals("Thirteen Test Topic", topics.get(6).getSubject());
assertEquals("root", topics.get(6).getPoster().getUserId());
assertEquals(0, topics.get(6).getReplies());
assertEquals(4, topics.get(6).getViewCount());
assertTrue(topics.get(6).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(6).getPosts().size());
assertTrue(topics.get(6).getPosts().get(0).getMessage().getSubject().startsWith("Thirteen Test Topic"));
assertTrue(topics.get(6).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(6).getPosts().get(0).getPoster().getUserId());
assertEquals("Twelve Test Topic", topics.get(7).getSubject());
assertEquals("root", topics.get(7).getPoster().getUserId());
assertEquals(0, topics.get(7).getReplies());
assertEquals(4, topics.get(7).getViewCount());
assertTrue(topics.get(7).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(7).getPosts().size());
assertTrue(topics.get(7).getPosts().get(0).getMessage().getSubject().startsWith("Twelve Test Topic"));
assertTrue(topics.get(7).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(7).getPosts().get(0).getPoster().getUserId());
assertEquals("Eleven Test Topic", topics.get(8).getSubject());
assertEquals("root", topics.get(8).getPoster().getUserId());
assertEquals(0, topics.get(8).getReplies());
assertEquals(4, topics.get(8).getViewCount());
assertTrue(topics.get(8).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(8).getPosts().size());
assertTrue(topics.get(8).getPosts().get(0).getMessage().getSubject().startsWith("Eleven Test Topic"));
assertTrue(topics.get(8).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(8).getPosts().get(0).getPoster().getUserId());
assertEquals("Ten Test Topic", topics.get(9).getSubject());
assertEquals("root", topics.get(9).getPoster().getUserId());
assertEquals(0, topics.get(9).getReplies());
assertEquals(4, topics.get(9).getViewCount());
assertTrue(topics.get(9).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(9).getPosts().size());
assertTrue(topics.get(9).getPosts().get(0).getMessage().getSubject().startsWith("Ten Test Topic"));
assertTrue(topics.get(9).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(9).getPosts().get(0).getPoster().getUserId());
assertEquals("Second Test Topic", topics.get(10).getSubject());
assertEquals("root", topics.get(10).getPoster().getUserId());
assertEquals(0, topics.get(10).getReplies());
assertEquals(4, topics.get(10).getViewCount());
assertTrue(topics.get(10).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(10).getPosts().size());
assertTrue(topics.get(10).getPosts().get(0).getMessage().getSubject().startsWith("Second Test Topic"));
assertTrue(topics.get(10).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(10).getPosts().get(0).getPoster().getUserId());
assertEquals("Thirtyone Test Topic", topics.get(11).getSubject());
assertEquals("root", topics.get(11).getPoster().getUserId());
assertEquals(0, topics.get(11).getReplies());
assertEquals(4, topics.get(11).getViewCount());
assertTrue(topics.get(11).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(11).getPosts().size());
assertTrue(topics.get(11).getPosts().get(0).getMessage().getSubject().startsWith("Thirtyone Test Topic"));
assertTrue(topics.get(11).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(11).getPosts().get(0).getPoster().getUserId());
assertEquals("Thirty Test Topic", topics.get(12).getSubject());
assertEquals("root", topics.get(12).getPoster().getUserId());
assertEquals(0, topics.get(12).getReplies());
assertEquals(4, topics.get(12).getViewCount());
assertTrue(topics.get(12).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(12).getPosts().size());
assertTrue(topics.get(12).getPosts().get(0).getMessage().getSubject().startsWith("Thirty Test Topic"));
assertTrue(topics.get(12).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(12).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentynine Test Topic", topics.get(13).getSubject());
assertEquals("root", topics.get(13).getPoster().getUserId());
assertEquals(0, topics.get(13).getReplies());
assertEquals(4, topics.get(13).getViewCount());
assertTrue(topics.get(13).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(13).getPosts().size());
assertTrue(topics.get(13).getPosts().get(0).getMessage().getSubject().startsWith("Twentynine Test Topic"));
assertTrue(topics.get(13).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(13).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentyeight Test Topic", topics.get(14).getSubject());
assertEquals("root", topics.get(14).getPoster().getUserId());
assertEquals(0, topics.get(14).getReplies());
assertEquals(4, topics.get(14).getViewCount());
assertTrue(topics.get(14).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(14).getPosts().size());
assertTrue(topics.get(14).getPosts().get(0).getMessage().getSubject().startsWith("Twentyeight Test Topic"));
assertTrue(topics.get(14).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(14).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentyseven Test Topic", topics.get(15).getSubject());
assertEquals("root", topics.get(15).getPoster().getUserId());
assertEquals(0, topics.get(15).getReplies());
assertEquals(4, topics.get(15).getViewCount());
assertTrue(topics.get(15).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(15).getPosts().size());
assertTrue(topics.get(15).getPosts().get(0).getMessage().getSubject().startsWith("Twentyseven Test Topic"));
assertTrue(topics.get(15).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(15).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentysix Test Topic", topics.get(16).getSubject());
assertEquals("root", topics.get(16).getPoster().getUserId());
assertEquals(0, topics.get(16).getReplies());
assertEquals(2, topics.get(16).getViewCount());
assertTrue(topics.get(16).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(16).getPosts().size());
assertTrue(topics.get(16).getPosts().get(0).getMessage().getSubject().startsWith("Twentysix Test Topic"));
assertTrue(topics.get(16).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(16).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentyfive Test Topic", topics.get(17).getSubject());
assertEquals("root", topics.get(17).getPoster().getUserId());
assertEquals(0, topics.get(17).getReplies());
assertEquals(2, topics.get(17).getViewCount());
assertTrue(topics.get(17).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(17).getPosts().size());
assertTrue(topics.get(17).getPosts().get(0).getMessage().getSubject().startsWith("Twentyfive Test Topic"));
assertTrue(topics.get(17).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(17).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentyfour Test Topic", topics.get(18).getSubject());
assertEquals("root", topics.get(18).getPoster().getUserId());
assertEquals(0, topics.get(18).getReplies());
assertEquals(2, topics.get(18).getViewCount());
assertTrue(topics.get(18).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(18).getPosts().size());
assertTrue(topics.get(18).getPosts().get(0).getMessage().getSubject().startsWith("Twentyfour Test Topic"));
assertTrue(topics.get(18).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(18).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentythree Test Topic", topics.get(19).getSubject());
assertEquals("root", topics.get(19).getPoster().getUserId());
assertEquals(0, topics.get(19).getReplies());
assertEquals(2, topics.get(19).getViewCount());
assertTrue(topics.get(19).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(19).getPosts().size());
assertTrue(topics.get(19).getPosts().get(0).getMessage().getSubject().startsWith("Twentythree Test Topic"));
assertTrue(topics.get(19).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(19).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentytwo Test Topic", topics.get(20).getSubject());
assertEquals("root", topics.get(20).getPoster().getUserId());
assertEquals(0, topics.get(20).getReplies());
assertEquals(2, topics.get(20).getViewCount());
assertTrue(topics.get(20).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(20).getPosts().size());
assertTrue(topics.get(20).getPosts().get(0).getMessage().getSubject().startsWith("Twentytwo Test Topic"));
assertTrue(topics.get(20).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(20).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentyone Test Topic", topics.get(21).getSubject());
assertEquals("root", topics.get(21).getPoster().getUserId());
assertEquals(0, topics.get(21).getReplies());
assertEquals(0, topics.get(21).getViewCount());
assertTrue(topics.get(21).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(21).getPosts().size());
assertTrue(topics.get(21).getPosts().get(0).getMessage().getSubject().startsWith("Twentyone Test Topic"));
assertTrue(topics.get(21).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(21).getPosts().get(0).getPoster().getUserId());
assertEquals("Twelve Test Topic", topics.get(22).getSubject());
assertEquals("root", topics.get(22).getPoster().getUserId());
assertEquals(0, topics.get(22).getReplies());
assertEquals(0, topics.get(22).getViewCount());
assertTrue(topics.get(22).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(22).getPosts().size());
assertTrue(topics.get(22).getPosts().get(0).getMessage().getSubject().startsWith("Twelve Test Topic"));
assertTrue(topics.get(22).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(22).getPosts().get(0).getPoster().getUserId());
assertEquals("First Test Topic", topics.get(23).getSubject());
assertEquals("root", topics.get(23).getPoster().getUserId());
assertEquals(0, topics.get(23).getReplies());
assertEquals(0, topics.get(23).getViewCount());
assertTrue(topics.get(23).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(23).getPosts().size());
assertTrue(topics.get(23).getPosts().get(0).getMessage().getSubject().startsWith("First Test Topic"));
assertTrue(topics.get(23).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(23).getPosts().get(0).getPoster().getUserId());
assertEquals("Third Test Topic", topics.get(24).getSubject());
assertEquals("root", topics.get(24).getPoster().getUserId());
assertEquals(0, topics.get(24).getReplies());
assertEquals(4, topics.get(24).getViewCount());
assertTrue(topics.get(24).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(24).getPosts().size());
assertTrue(topics.get(24).getPosts().get(0).getMessage().getSubject().startsWith("Third Test Topic"));
assertTrue(topics.get(24).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(24).getPosts().get(0).getPoster().getUserId());
assertEquals("Fourth Test Topic", topics.get(25).getSubject());
assertEquals("root", topics.get(25).getPoster().getUserId());
assertEquals(0, topics.get(25).getReplies());
assertEquals(6, topics.get(25).getViewCount());
assertTrue(topics.get(25).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(25).getPosts().size());
assertTrue(topics.get(25).getPosts().get(0).getMessage().getSubject().startsWith("Fourth Test Topic"));
assertTrue(topics.get(25).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(25).getPosts().get(0).getPoster().getUserId());
assertEquals("Thirtytwo Test Topic", topics.get(26).getSubject());
assertEquals("root", topics.get(26).getPoster().getUserId());
assertEquals(0, topics.get(26).getReplies());
assertEquals(0, topics.get(26).getViewCount());
assertTrue(topics.get(26).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(26).getPosts().size());
assertTrue(topics.get(26).getPosts().get(0).getMessage().getSubject().startsWith("Thirtytwo Test Topic"));
assertTrue(topics.get(26).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(26).getPosts().get(0).getPoster().getUserId());
message = removeTopic(driver, new Topic(new Forum("Third Test Forum", "Third Test Description", new Category("Second Test Category")), "Thirtytwo Test Topic", asList(new Post[] { new Post("Thirtytwo Test Body") }), NORMAL, null));
assertTrue(message.equals(OK));
}
use of it.vige.rubia.ui.action.PreferenceController in project rubia-forums by flashboss.
the class PreferencesTest method submitsWithReset.
public void submitsWithReset() {
Category firstTestCategory = new Category("First Test Category");
Category secondTestCategory = new Category("Second Test Category");
goTo(driver);
PreferenceController submitCriteria = new PreferenceController();
submitCriteria.setAlwaysAddSignature(true);
submitCriteria.setAlwaysAllowHtml(true);
submitCriteria.setNotifyOnReply(true);
submitCriteria.setPostOrder("descending");
submitCriteria.setPostsPerTopic(10);
submitCriteria.setSignature("My New Signature");
submitCriteria.setSummaryMode(BLOCK_TOPICS_MODE_HOT_TOPICS);
submitCriteria.setSummaryTopicDays(2);
submitCriteria.setSummaryTopicLimit(3);
submitCriteria.setSummaryTopicReplies(4);
submitCriteria.setTopicsPerForum(5);
submitCriteria.setDateFormat("d-MM-yyyy HH:mm");
addKeys(driver, submitCriteria);
reset(driver, submitCriteria);
List<Topic> summaryTopics = viewSummary(driver);
int sizeSummaryTopics = viewSize(driver);
Topic summaryTopicDetail = getDetail(driver, "Fourth Test Topic");
assertTrue(summaryTopics != null);
assertEquals(6, summaryTopics.size());
assertEquals(6, sizeSummaryTopics);
assertEquals("Fourth Test Topic", summaryTopics.get(0).getSubject());
assertEquals("Fourth Test Topic", summaryTopicDetail.getSubject());
Topic newTopic = new Topic(new Forum("Third Test Forum", "Third Test Description", new Category("Second Test Category")), "Thirtytwo Test Topic", asList(new Post[] { new Post("Thirtytwo Test Body") }), NORMAL, null);
String message = createTopic(driver, newTopic);
assertTrue(message.equals("Thirtytwo Test Topic"));
List<Forum> forums = getForumsOfCategories(driver, firstTestCategory, secondTestCategory);
Date today = new Date();
List<Topic> topics = getTopicsOfForums(driver, forums.toArray(new Forum[0]));
assertEquals(24, topics.size());
assertEquals("Ninteen Test Topic", topics.get(0).getSubject());
assertEquals("root", topics.get(0).getPoster().getUserId());
assertEquals(32, topics.get(0).getReplies());
assertEquals(108, topics.get(0).getViewCount());
assertTrue(topics.get(0).getLastPostDate().compareTo(today) < 0);
assertEquals(10, topics.get(0).getPosts().size());
assertTrue(topics.get(0).getPosts().get(0).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen35</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(0).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(0).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(1).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen34</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(1).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(1).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(1).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(2).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen33</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(2).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(2).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(2).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(3).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen32</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(3).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(3).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(3).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(4).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen31</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(4).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(4).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(4).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(5).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen30</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(5).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(5).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(5).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(6).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen29</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(6).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(6).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(6).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(7).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen28</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(7).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(7).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(7).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(8).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen27</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(8).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(8).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(8).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(9).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen26</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(9).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(9).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(9).getPoster().getUserId());
assertEquals("Eighteen Test Topic", topics.get(1).getSubject());
assertEquals("root", topics.get(1).getPoster().getUserId());
assertEquals(0, topics.get(1).getReplies());
assertEquals(8, topics.get(1).getViewCount());
assertTrue(topics.get(1).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(1).getPosts().size());
assertTrue(topics.get(1).getPosts().get(0).getMessage().getSubject().startsWith("Eighteen Test Topic"));
assertTrue(topics.get(1).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(1).getPosts().get(0).getPoster().getUserId());
assertEquals("Seventeen Test Topic", topics.get(2).getSubject());
assertEquals("root", topics.get(2).getPoster().getUserId());
assertEquals(0, topics.get(2).getReplies());
assertEquals(8, topics.get(2).getViewCount());
assertTrue(topics.get(2).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(2).getPosts().size());
assertTrue(topics.get(2).getPosts().get(0).getMessage().getSubject().startsWith("Seventeen Test Topic"));
assertTrue(topics.get(2).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(2).getPosts().get(0).getPoster().getUserId());
assertEquals("Sixteen Test Topic", topics.get(3).getSubject());
assertEquals("root", topics.get(3).getPoster().getUserId());
assertEquals(0, topics.get(3).getReplies());
assertEquals(8, topics.get(3).getViewCount());
assertTrue(topics.get(3).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(3).getPosts().size());
assertTrue(topics.get(3).getPosts().get(0).getMessage().getSubject().startsWith("Sixteen Test Topic"));
assertTrue(topics.get(3).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(3).getPosts().get(0).getPoster().getUserId());
assertEquals("Fifteen Test Topic", topics.get(4).getSubject());
assertEquals("root", topics.get(4).getPoster().getUserId());
assertEquals(0, topics.get(4).getReplies());
assertEquals(8, topics.get(4).getViewCount());
assertTrue(topics.get(4).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(4).getPosts().size());
assertTrue(topics.get(4).getPosts().get(0).getMessage().getSubject().startsWith("Fifteen Test Topic"));
assertTrue(topics.get(4).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(4).getPosts().get(0).getPoster().getUserId());
assertEquals("Fourteen Test Topic", topics.get(5).getSubject());
assertEquals("root", topics.get(5).getPoster().getUserId());
assertEquals(0, topics.get(5).getReplies());
assertEquals(8, topics.get(5).getViewCount());
assertTrue(topics.get(5).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(5).getPosts().size());
assertTrue(topics.get(5).getPosts().get(0).getMessage().getSubject().startsWith("Fourteen Test Topic"));
assertTrue(topics.get(5).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(5).getPosts().get(0).getPoster().getUserId());
assertEquals("Thirteen Test Topic", topics.get(6).getSubject());
assertEquals("root", topics.get(6).getPoster().getUserId());
assertEquals(0, topics.get(6).getReplies());
assertEquals(8, topics.get(6).getViewCount());
assertTrue(topics.get(6).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(6).getPosts().size());
assertTrue(topics.get(6).getPosts().get(0).getMessage().getSubject().startsWith("Thirteen Test Topic"));
assertTrue(topics.get(6).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(6).getPosts().get(0).getPoster().getUserId());
assertEquals("Twelve Test Topic", topics.get(7).getSubject());
assertEquals("root", topics.get(7).getPoster().getUserId());
assertEquals(0, topics.get(7).getReplies());
assertEquals(8, topics.get(7).getViewCount());
assertTrue(topics.get(7).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(7).getPosts().size());
assertTrue(topics.get(7).getPosts().get(0).getMessage().getSubject().startsWith("Twelve Test Topic"));
assertTrue(topics.get(7).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(7).getPosts().get(0).getPoster().getUserId());
assertEquals("Eleven Test Topic", topics.get(8).getSubject());
assertEquals("root", topics.get(8).getPoster().getUserId());
assertEquals(0, topics.get(8).getReplies());
assertEquals(8, topics.get(8).getViewCount());
assertTrue(topics.get(8).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(8).getPosts().size());
assertTrue(topics.get(8).getPosts().get(0).getMessage().getSubject().startsWith("Eleven Test Topic"));
assertTrue(topics.get(8).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(8).getPosts().get(0).getPoster().getUserId());
assertEquals("Ten Test Topic", topics.get(9).getSubject());
assertEquals("root", topics.get(9).getPoster().getUserId());
assertEquals(0, topics.get(9).getReplies());
assertEquals(8, topics.get(9).getViewCount());
assertTrue(topics.get(9).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(9).getPosts().size());
assertTrue(topics.get(9).getPosts().get(0).getMessage().getSubject().startsWith("Ten Test Topic"));
assertTrue(topics.get(9).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(9).getPosts().get(0).getPoster().getUserId());
assertEquals("Second Test Topic", topics.get(10).getSubject());
assertEquals("root", topics.get(10).getPoster().getUserId());
assertEquals(0, topics.get(10).getReplies());
assertEquals(8, topics.get(10).getViewCount());
assertTrue(topics.get(10).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(10).getPosts().size());
assertTrue(topics.get(10).getPosts().get(0).getMessage().getSubject().startsWith("Second Test Topic"));
assertTrue(topics.get(10).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(10).getPosts().get(0).getPoster().getUserId());
assertEquals("Thirtyone Test Topic", topics.get(11).getSubject());
assertEquals("root", topics.get(11).getPoster().getUserId());
assertEquals(0, topics.get(11).getReplies());
assertEquals(8, topics.get(11).getViewCount());
assertTrue(topics.get(11).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(11).getPosts().size());
assertTrue(topics.get(11).getPosts().get(0).getMessage().getSubject().startsWith("Thirtyone Test Topic"));
assertTrue(topics.get(11).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(11).getPosts().get(0).getPoster().getUserId());
assertEquals("Thirty Test Topic", topics.get(12).getSubject());
assertEquals("root", topics.get(12).getPoster().getUserId());
assertEquals(0, topics.get(12).getReplies());
assertEquals(8, topics.get(12).getViewCount());
assertTrue(topics.get(12).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(12).getPosts().size());
assertTrue(topics.get(12).getPosts().get(0).getMessage().getSubject().startsWith("Thirty Test Topic"));
assertTrue(topics.get(12).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(12).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentynine Test Topic", topics.get(13).getSubject());
assertEquals("root", topics.get(13).getPoster().getUserId());
assertEquals(0, topics.get(13).getReplies());
assertEquals(8, topics.get(13).getViewCount());
assertTrue(topics.get(13).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(13).getPosts().size());
assertTrue(topics.get(13).getPosts().get(0).getMessage().getSubject().startsWith("Twentynine Test Topic"));
assertTrue(topics.get(13).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(13).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentyeight Test Topic", topics.get(14).getSubject());
assertEquals("root", topics.get(14).getPoster().getUserId());
assertEquals(0, topics.get(14).getReplies());
assertEquals(8, topics.get(14).getViewCount());
assertTrue(topics.get(14).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(14).getPosts().size());
assertTrue(topics.get(14).getPosts().get(0).getMessage().getSubject().startsWith("Twentyeight Test Topic"));
assertTrue(topics.get(14).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(14).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentyseven Test Topic", topics.get(15).getSubject());
assertEquals("root", topics.get(15).getPoster().getUserId());
assertEquals(0, topics.get(15).getReplies());
assertEquals(8, topics.get(15).getViewCount());
assertTrue(topics.get(15).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(15).getPosts().size());
assertTrue(topics.get(15).getPosts().get(0).getMessage().getSubject().startsWith("Twentyseven Test Topic"));
assertTrue(topics.get(15).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(15).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentysix Test Topic", topics.get(16).getSubject());
assertEquals("root", topics.get(16).getPoster().getUserId());
assertEquals(0, topics.get(16).getReplies());
assertEquals(6, topics.get(16).getViewCount());
assertTrue(topics.get(16).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(16).getPosts().size());
assertTrue(topics.get(16).getPosts().get(0).getMessage().getSubject().startsWith("Twentysix Test Topic"));
assertTrue(topics.get(16).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(16).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentyfive Test Topic", topics.get(17).getSubject());
assertEquals("root", topics.get(17).getPoster().getUserId());
assertEquals(0, topics.get(17).getReplies());
assertEquals(6, topics.get(17).getViewCount());
assertTrue(topics.get(17).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(17).getPosts().size());
assertTrue(topics.get(17).getPosts().get(0).getMessage().getSubject().startsWith("Twentyfive Test Topic"));
assertTrue(topics.get(17).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(17).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentyfour Test Topic", topics.get(18).getSubject());
assertEquals("root", topics.get(18).getPoster().getUserId());
assertEquals(0, topics.get(18).getReplies());
assertEquals(6, topics.get(18).getViewCount());
assertTrue(topics.get(18).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(18).getPosts().size());
assertTrue(topics.get(18).getPosts().get(0).getMessage().getSubject().startsWith("Twentyfour Test Topic"));
assertTrue(topics.get(18).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(18).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentythree Test Topic", topics.get(19).getSubject());
assertEquals("root", topics.get(19).getPoster().getUserId());
assertEquals(0, topics.get(19).getReplies());
assertEquals(6, topics.get(19).getViewCount());
assertTrue(topics.get(19).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(19).getPosts().size());
assertTrue(topics.get(19).getPosts().get(0).getMessage().getSubject().startsWith("Twentythree Test Topic"));
assertTrue(topics.get(19).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(19).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentytwo Test Topic", topics.get(20).getSubject());
assertEquals("root", topics.get(20).getPoster().getUserId());
assertEquals(0, topics.get(20).getReplies());
assertEquals(6, topics.get(20).getViewCount());
assertTrue(topics.get(20).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(20).getPosts().size());
assertTrue(topics.get(20).getPosts().get(0).getMessage().getSubject().startsWith("Twentytwo Test Topic"));
assertTrue(topics.get(20).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(20).getPosts().get(0).getPoster().getUserId());
assertEquals("Third Test Topic", topics.get(21).getSubject());
assertEquals("root", topics.get(21).getPoster().getUserId());
assertEquals(0, topics.get(21).getReplies());
assertEquals(8, topics.get(21).getViewCount());
assertTrue(topics.get(21).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(21).getPosts().size());
assertTrue(topics.get(21).getPosts().get(0).getMessage().getSubject().startsWith("Third Test Topic"));
assertTrue(topics.get(21).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(21).getPosts().get(0).getPoster().getUserId());
assertEquals("Fourth Test Topic", topics.get(22).getSubject());
assertEquals("root", topics.get(22).getPoster().getUserId());
assertEquals(0, topics.get(22).getReplies());
assertEquals(14, topics.get(22).getViewCount());
assertTrue(topics.get(22).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(22).getPosts().size());
assertTrue(topics.get(22).getPosts().get(0).getMessage().getSubject().startsWith("Fourth Test Topic"));
assertTrue(topics.get(22).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(22).getPosts().get(0).getPoster().getUserId());
assertEquals("Thirtytwo Test Topic", topics.get(23).getSubject());
assertEquals("root", topics.get(23).getPoster().getUserId());
assertEquals(0, topics.get(23).getReplies());
assertEquals(0, topics.get(23).getViewCount());
assertTrue(topics.get(23).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(23).getPosts().size());
assertTrue(topics.get(23).getPosts().get(0).getMessage().getSubject().startsWith("Thirtytwo Test Topic"));
assertTrue(topics.get(23).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(23).getPosts().get(0).getPoster().getUserId());
message = removeTopic(driver, new Topic(new Forum("Third Test Forum", "Third Test Description", new Category("Second Test Category")), "Thirtytwo Test Topic", asList(new Post[] { new Post("Thirtytwo Test Body") }), NORMAL, null));
assertTrue(message.equals(OK));
}
use of it.vige.rubia.ui.action.PreferenceController in project rubia-forums by flashboss.
the class PreferencesTest method stop.
@AfterClass
public static void stop() {
goTo(driver);
PreferenceController submitCriteria = new PreferenceController();
submitCriteria.setAlwaysAddSignature(false);
submitCriteria.setAlwaysAllowHtml(true);
submitCriteria.setNotifyOnReply(true);
submitCriteria.setPostOrder("ascending");
submitCriteria.setPostsPerTopic(15);
submitCriteria.setSignature("");
submitCriteria.setSummaryMode(BLOCK_TOPICS_MODE_LATEST_POSTS);
submitCriteria.setSummaryTopicDays(20);
submitCriteria.setSummaryTopicLimit(6);
submitCriteria.setSummaryTopicReplies(15);
submitCriteria.setTopicsPerForum(10);
submitCriteria.setDateFormat("EEE MMM d, yyyy HH:mm aaa");
submit(driver, submitCriteria);
String message = removeCategory(driver, new Category("First Test Category"), SELECT_CATEGORY_TYPE);
assertTrue(message.equals(REMOVED_CATEGORY_0_MESSAGE));
message = removeCategory(driver, new Category("Second Test Category"), SELECT_CATEGORY_TYPE);
assertTrue(message.equals(REMOVED_CATEGORY_1_MESSAGE));
}
use of it.vige.rubia.ui.action.PreferenceController in project rubia-forums by flashboss.
the class PreferencesTest method scenary1.
public void scenary1() {
Category firstTestCategory = new Category("First Test Category");
Category secondTestCategory = new Category("Second Test Category");
goTo(driver);
PreferenceController submitCriteria = new PreferenceController();
submitCriteria.setAlwaysAddSignature(true);
submitCriteria.setAlwaysAllowHtml(true);
submitCriteria.setNotifyOnReply(true);
submitCriteria.setPostOrder("descending");
submitCriteria.setPostsPerTopic(25);
submitCriteria.setSignature("My New Signature");
submitCriteria.setSummaryMode(BLOCK_TOPICS_MODE_HOT_TOPICS);
submitCriteria.setSummaryTopicDays(2);
submitCriteria.setSummaryTopicLimit(3);
submitCriteria.setSummaryTopicReplies(4);
submitCriteria.setTopicsPerForum(5);
submit(driver, submitCriteria);
List<Topic> summaryTopics = viewSummary(driver);
int sizeSummaryTopics = viewSize(driver);
Topic summaryTopicDetail = getDetail(driver, "Ninteen Test Topic");
assertTrue(summaryTopics != null);
assertEquals(1, summaryTopics.size());
assertEquals(1, sizeSummaryTopics);
assertEquals("Ninteen Test Topic", summaryTopics.get(0).getSubject());
assertEquals("Ninteen Test Topic", summaryTopicDetail.getSubject());
Topic newTopic = new Topic(new Forum("Third Test Forum", "Third Test Description", new Category("Second Test Category")), "Thirtytwo Test Topic", asList(new Post[] { new Post("Thirtytwo Test Body") }), NORMAL, null);
String message = createTopic(driver, newTopic);
assertTrue(message.equals("Thirtytwo Test Topic"));
List<Forum> forums = getForumsOfCategories(driver, firstTestCategory, secondTestCategory);
Date today = new Date();
List<Topic> topics = getTopicsOfForums(driver, forums.toArray(new Forum[0]));
assertTrue(topics != null);
assertEquals(19, topics.size());
assertEquals("Ninteen Test Topic", topics.get(0).getSubject());
assertEquals("root", topics.get(0).getPoster().getUserId());
assertEquals(32, topics.get(0).getReplies());
assertEquals(98, topics.get(0).getViewCount());
assertTrue(topics.get(0).getLastPostDate().compareTo(today) < 0);
assertEquals(25, topics.get(0).getPosts().size());
assertTrue(topics.get(0).getPosts().get(0).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen35</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(0).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(0).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(1).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen34</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(1).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(1).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(1).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(2).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen33</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(2).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(2).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(2).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(3).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen32</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(3).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(3).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(3).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(4).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen31</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(4).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(4).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(4).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(5).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen30</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(5).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(5).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(5).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(6).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen29</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(6).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(6).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(6).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(7).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen28</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(7).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(7).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(7).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(8).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen27</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(8).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(8).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(8).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(9).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen26</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(9).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(9).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(9).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(10).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen25</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(10).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(10).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(10).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(11).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen24</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(11).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(11).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(11).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(12).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen23</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(12).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(12).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(12).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(13).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen22</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(13).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(13).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(13).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(14).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen21</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(14).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(14).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(14).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(15).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen20</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(15).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(15).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(15).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(16).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen19</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(16).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(16).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(16).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(17).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen18</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(17).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(17).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(17).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(18).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen17</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(18).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(18).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(18).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(19).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen16</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(19).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(19).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(19).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(20).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen15</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(20).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(20).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(20).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(21).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen14</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(21).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(21).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(21).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(22).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen13</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(22).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(22).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(22).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(23).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen12</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(23).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(23).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(23).getPoster().getUserId());
assertTrue(topics.get(0).getPosts().get(24).getMessage().getSubject().startsWith(RE + "Ninteen Test Topic"));
assertEquals("<ul><li>Ninteen11</li><li>Test Body</li></ul>", topics.get(0).getPosts().get(24).getMessage().getText());
assertTrue(topics.get(0).getPosts().get(24).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(0).getPosts().get(24).getPoster().getUserId());
assertEquals("Eighteen Test Topic", topics.get(1).getSubject());
assertEquals("root", topics.get(1).getPoster().getUserId());
assertEquals(0, topics.get(1).getReplies());
assertEquals(0, topics.get(1).getViewCount());
assertTrue(topics.get(1).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(1).getPosts().size());
assertTrue(topics.get(1).getPosts().get(0).getMessage().getSubject().startsWith("Eighteen Test Topic"));
assertTrue(topics.get(1).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(1).getPosts().get(0).getPoster().getUserId());
assertEquals("Seventeen Test Topic", topics.get(2).getSubject());
assertEquals("root", topics.get(2).getPoster().getUserId());
assertEquals(0, topics.get(2).getReplies());
assertEquals(0, topics.get(2).getViewCount());
assertTrue(topics.get(2).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(2).getPosts().size());
assertTrue(topics.get(2).getPosts().get(0).getMessage().getSubject().startsWith("Seventeen Test Topic"));
assertTrue(topics.get(2).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(2).getPosts().get(0).getPoster().getUserId());
assertEquals("Sixteen Test Topic", topics.get(3).getSubject());
assertEquals("root", topics.get(3).getPoster().getUserId());
assertEquals(0, topics.get(3).getReplies());
assertEquals(0, topics.get(3).getViewCount());
assertTrue(topics.get(3).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(3).getPosts().size());
assertTrue(topics.get(3).getPosts().get(0).getMessage().getSubject().startsWith("Sixteen Test Topic"));
assertTrue(topics.get(3).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(3).getPosts().get(0).getPoster().getUserId());
assertEquals("Fifteen Test Topic", topics.get(4).getSubject());
assertEquals("root", topics.get(4).getPoster().getUserId());
assertEquals(0, topics.get(4).getReplies());
assertEquals(0, topics.get(4).getViewCount());
assertTrue(topics.get(4).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(4).getPosts().size());
assertTrue(topics.get(4).getPosts().get(0).getMessage().getSubject().startsWith("Fifteen Test Topic"));
assertTrue(topics.get(4).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(4).getPosts().get(0).getPoster().getUserId());
assertEquals("Fourteen Test Topic", topics.get(5).getSubject());
assertEquals("root", topics.get(5).getPoster().getUserId());
assertEquals(0, topics.get(5).getReplies());
assertEquals(0, topics.get(5).getViewCount());
assertTrue(topics.get(5).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(5).getPosts().size());
assertTrue(topics.get(5).getPosts().get(0).getMessage().getSubject().startsWith("Fourteen Test Topic"));
assertTrue(topics.get(5).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(5).getPosts().get(0).getPoster().getUserId());
assertEquals("Thirteen Test Topic", topics.get(6).getSubject());
assertEquals("root", topics.get(6).getPoster().getUserId());
assertEquals(0, topics.get(6).getReplies());
assertEquals(0, topics.get(6).getViewCount());
assertTrue(topics.get(6).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(6).getPosts().size());
assertTrue(topics.get(6).getPosts().get(0).getMessage().getSubject().startsWith("Thirteen Test Topic"));
assertTrue(topics.get(6).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(6).getPosts().get(0).getPoster().getUserId());
assertEquals("Twelve Test Topic", topics.get(7).getSubject());
assertEquals("root", topics.get(7).getPoster().getUserId());
assertEquals(0, topics.get(7).getReplies());
assertEquals(0, topics.get(7).getViewCount());
assertTrue(topics.get(7).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(7).getPosts().size());
assertTrue(topics.get(7).getPosts().get(0).getMessage().getSubject().startsWith("Twelve Test Topic"));
assertTrue(topics.get(7).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(7).getPosts().get(0).getPoster().getUserId());
assertEquals("Eleven Test Topic", topics.get(8).getSubject());
assertEquals("root", topics.get(8).getPoster().getUserId());
assertEquals(0, topics.get(8).getReplies());
assertEquals(0, topics.get(8).getViewCount());
assertTrue(topics.get(8).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(8).getPosts().size());
assertTrue(topics.get(8).getPosts().get(0).getMessage().getSubject().startsWith("Eleven Test Topic"));
assertTrue(topics.get(8).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(8).getPosts().get(0).getPoster().getUserId());
assertEquals("Ten Test Topic", topics.get(9).getSubject());
assertEquals("root", topics.get(9).getPoster().getUserId());
assertEquals(0, topics.get(9).getReplies());
assertEquals(0, topics.get(9).getViewCount());
assertTrue(topics.get(9).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(9).getPosts().size());
assertTrue(topics.get(9).getPosts().get(0).getMessage().getSubject().startsWith("Ten Test Topic"));
assertTrue(topics.get(9).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(9).getPosts().get(0).getPoster().getUserId());
assertEquals("Second Test Topic", topics.get(10).getSubject());
assertEquals("root", topics.get(10).getPoster().getUserId());
assertEquals(0, topics.get(10).getReplies());
assertEquals(0, topics.get(10).getViewCount());
assertTrue(topics.get(10).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(10).getPosts().size());
assertTrue(topics.get(10).getPosts().get(0).getMessage().getSubject().startsWith("Second Test Topic"));
assertTrue(topics.get(10).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(10).getPosts().get(0).getPoster().getUserId());
assertEquals("Thirtyone Test Topic", topics.get(11).getSubject());
assertEquals("root", topics.get(11).getPoster().getUserId());
assertEquals(0, topics.get(11).getReplies());
assertEquals(0, topics.get(11).getViewCount());
assertTrue(topics.get(11).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(11).getPosts().size());
assertTrue(topics.get(11).getPosts().get(0).getMessage().getSubject().startsWith("Thirtyone Test Topic"));
assertTrue(topics.get(11).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(11).getPosts().get(0).getPoster().getUserId());
assertEquals("Thirty Test Topic", topics.get(12).getSubject());
assertEquals("root", topics.get(12).getPoster().getUserId());
assertEquals(0, topics.get(12).getReplies());
assertEquals(0, topics.get(12).getViewCount());
assertTrue(topics.get(12).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(12).getPosts().size());
assertTrue(topics.get(12).getPosts().get(0).getMessage().getSubject().startsWith("Thirty Test Topic"));
assertTrue(topics.get(12).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(12).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentynine Test Topic", topics.get(13).getSubject());
assertEquals("root", topics.get(13).getPoster().getUserId());
assertEquals(0, topics.get(13).getReplies());
assertEquals(0, topics.get(13).getViewCount());
assertTrue(topics.get(13).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(13).getPosts().size());
assertTrue(topics.get(13).getPosts().get(0).getMessage().getSubject().startsWith("Twentynine Test Topic"));
assertTrue(topics.get(13).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(13).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentyeight Test Topic", topics.get(14).getSubject());
assertEquals("root", topics.get(14).getPoster().getUserId());
assertEquals(0, topics.get(14).getReplies());
assertEquals(0, topics.get(14).getViewCount());
assertTrue(topics.get(14).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(14).getPosts().size());
assertTrue(topics.get(14).getPosts().get(0).getMessage().getSubject().startsWith("Twentyeight Test Topic"));
assertTrue(topics.get(14).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(14).getPosts().get(0).getPoster().getUserId());
assertEquals("Twentyseven Test Topic", topics.get(15).getSubject());
assertEquals("root", topics.get(15).getPoster().getUserId());
assertEquals(0, topics.get(15).getReplies());
assertEquals(0, topics.get(15).getViewCount());
assertTrue(topics.get(15).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(15).getPosts().size());
assertTrue(topics.get(15).getPosts().get(0).getMessage().getSubject().startsWith("Twentyseven Test Topic"));
assertTrue(topics.get(15).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(15).getPosts().get(0).getPoster().getUserId());
assertEquals("Third Test Topic", topics.get(16).getSubject());
assertEquals("root", topics.get(16).getPoster().getUserId());
assertEquals(0, topics.get(16).getReplies());
assertEquals(0, topics.get(16).getViewCount());
assertTrue(topics.get(16).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(16).getPosts().size());
assertTrue(topics.get(16).getPosts().get(0).getMessage().getSubject().startsWith("Third Test Topic"));
assertTrue(topics.get(16).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(16).getPosts().get(0).getPoster().getUserId());
assertEquals("Fourth Test Topic", topics.get(17).getSubject());
assertEquals("root", topics.get(17).getPoster().getUserId());
assertEquals(0, topics.get(17).getReplies());
assertEquals(0, topics.get(17).getViewCount());
assertTrue(topics.get(17).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(17).getPosts().size());
assertTrue(topics.get(17).getPosts().get(0).getMessage().getSubject().startsWith("Fourth Test Topic"));
assertTrue(topics.get(17).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(17).getPosts().get(0).getPoster().getUserId());
assertEquals("Thirtytwo Test Topic", topics.get(18).getSubject());
assertEquals("root", topics.get(18).getPoster().getUserId());
assertEquals(0, topics.get(18).getReplies());
assertEquals(0, topics.get(18).getViewCount());
assertTrue(topics.get(18).getLastPostDate().compareTo(today) < 0);
assertEquals(1, topics.get(18).getPosts().size());
assertTrue(topics.get(18).getPosts().get(0).getMessage().getSubject().startsWith("Thirtytwo Test Topic"));
assertTrue(topics.get(18).getPosts().get(0).getCreateDate().compareTo(today) < 0);
assertEquals("root", topics.get(18).getPosts().get(0).getPoster().getUserId());
message = removeTopic(driver, new Topic(new Forum("Third Test Forum", "Third Test Description", new Category("Second Test Category")), "Thirtytwo Test Topic", asList(new Post[] { new Post("Thirtytwo Test Body") }), NORMAL, null));
assertTrue(message.equals(OK));
}
Aggregations