use of it.vige.rubia.model.Forum in project rubia-forums by flashboss.
the class ModerateTopicTest method moveFromSelectedDown.
@Test
public void moveFromSelectedDown() {
Topic topic = new Topic(new Forum("Third Test Forum"), "Sixth Test Topic");
goToSplitPanel(driver, topic);
String message = moveTopicFromSelectedDown(driver, topic, null);
assertEquals(ERR_NO_POST_SELECTED, message);
topic.setPosts(asList(new Post[] { new Post("Fifty Test Body"), new Post("Fiftyone Test Body"), new Post("Fiftytwo Test Body") }));
message = moveTopicSelectedDown(driver, topic, null);
assertEquals(ERR_DEST_FORUM, message);
Forum forum = new Forum("First Test Forum");
message = moveTopicSelectedDown(driver, null, forum);
assertEquals(ERR_NO_SUBJECT_GIVEN, message);
forum.setTopics(asList(new Topic[] { new Topic("New Test Topic") }));
message = moveTopicSelectedDown(driver, null, forum);
assertEquals(SUCC_TOPIC_SPLITTED, message);
forum.setName("Third Test Forum");
forum.setTopics(asList(new Topic[] { new Topic("Sixth Test Topic") }));
topic.setForum(new Forum("First Test Forum"));
topic.setSubject("New Test Topic");
goToSplitPanel(driver, topic);
message = moveTopicSelectedDown(driver, topic, forum);
assertEquals(ERR_SPLIT_ALL, message);
message = removeTopic(driver, CONFIRM, topic);
assertTrue(message.equals(SUCC_TOPIC_REMOVED));
topic.setForum(new Forum("Third Test Forum"));
topic.setSubject("Sixth Test Topic");
message = removeTopic(driver, CONFIRM, topic);
assertTrue(message.equals(SUCC_TOPIC_REMOVED));
message = createTopic(driver, new Topic(new Forum("Third Test Forum"), "Sixth Test Topic", asList(new Post[] { new Post("Sixth Test Body", asList(new Attachment("ten", "Ten Test File"), new Attachment("eleven", "Eleven Test File"), new Attachment("twelve", "Twelve Test File"))), new Post("Fourtynine Test Body"), new Post("Fifty Test Body"), new Post("Fiftyone Test Body"), new Post("Fiftytwo Test Body"), new Post("Fiftythree Test Body"), new Post("Fiftyfour Test Body") }), IMPORTANT, new Poll("Fourth Test Question", asList(new PollOption[] { new PollOption("Ninth Test Answer"), new PollOption("Ten Test Answer") }), 8)));
assertTrue(message.equals("Sixth Test Topic"));
}
use of it.vige.rubia.model.Forum in project rubia-forums by flashboss.
the class MyForumsTopicTest method stop.
@AfterClass
public static void stop() {
Topic topic = new Topic(new Forum("First Test Forum"), "First Test Topic", asList(new Post[] { new Post("First Test Body") }));
String message = unregisterTopic(driver, topic);
assertTrue(message.equals(OK));
message = removeTopic(driver, topic);
assertTrue(message.equals(OK));
topic = new Topic(new Forum("First Test Forum"), "Second Test Topic", asList(new Post[] { new Post("Second Test Body") }));
message = unregisterTopic(driver, topic);
assertTrue(message.equals(OK));
message = removeTopic(driver, topic);
assertTrue(message.equals(OK));
topic = new Topic(new Forum("Second Test Forum"), "Third Test Topic", asList(new Post[] { new Post("Third Test Body") }));
message = unregisterTopic(driver, topic);
assertTrue(message.equals(OK));
message = removeTopic(driver, topic);
assertTrue(message.equals(OK));
topic = new Topic(new Forum("Second Test Forum"), "Fourth Test Topic", asList(new Post[] { new Post("Fourth Test Body") }));
message = viewAllTopicsRemoveTopic(driver, topic);
assertTrue(message.equals(OK));
message = removeTopic(driver, topic);
assertTrue(message.equals(OK));
topic = new Topic(new Forum("Third Test Forum"), "Fifth Test with Truncation over 25 characters Topic", asList(new Post[] { new Post("Fifth Test with Truncation over 25 characters Body") }));
message = viewAllTopicsRemoveTopic(driver, topic);
assertTrue(message.equals(OK));
message = removeTopic(driver, topic);
assertTrue(message.equals(OK));
topic = new Topic(new Forum("Third Test Forum"), "Sixth Test Topic", asList(new Post[] { new Post("Sixth Test Body") }));
message = removeTopic(driver, topic);
assertTrue(message.equals(OK));
message = removeForum(driver, new Forum("First Test Forum"), "Second Test Forum");
assertTrue(message.equals(REMOVED_FORUM_0_MESSAGE));
message = removeForum(driver, new Forum("Second Test Forum"), SELECT_FORUM_TYPE);
assertTrue(message.equals(REMOVED_FORUM_1_MESSAGE));
message = removeForum(driver, new Forum("Third Test Forum"), SELECT_FORUM_TYPE);
assertTrue(message.equals(REMOVED_FORUM_2_MESSAGE));
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.model.Forum in project rubia-forums by flashboss.
the class MyForumsTopicTest method verifyRegisteredCanceledTopics.
@Test
public void verifyRegisteredCanceledTopics() {
Topic topic = new Topic(new Forum("Third Test Forum"), "Sixth Test Topic", asList(new Post[] { new Post("Sixth Test Body", asList(new Attachment("ten", "Ten Test File"), new Attachment("eleven", "Eleven Test File"), new Attachment("twelve", "Twelve Test File"))) }), IMPORTANT, new Poll("Fourth Test Question", asList(new PollOption[] { new PollOption("Ninth Test Answer"), new PollOption("Ten Test Answer") }), 8));
goTo(driver, topic);
String message = registerTopic(driver, topic, EMAIL_NO_NOTIFICATION, CANCEL);
assertTrue(message.equals("Sixth Test Topic"));
assertTrue(!isRegistered(driver, topic));
}
use of it.vige.rubia.model.Forum in project rubia-forums by flashboss.
the class ExternalLinksTest method verifyRSSForum.
@Test
public void verifyRSSForum() {
Forum forum = new Forum("First Test Forum");
Forum result = ViewRSSLink.getPage(driver, forum);
assertNotNull(result);
assertEquals("First Test Category", result.getCategory().getTitle());
assertEquals(forum.getName(), result.getName());
assertEquals(1, result.getTopics().size());
assertEquals("First Test Topic", result.getTopics().get(0).getSubject());
assertEquals(result.getTopics().get(0).getPosts().size(), 2);
assertEquals("root", result.getTopics().get(0).getPosts().get(0).getPoster().getUserId());
assertEquals("root", result.getTopics().get(0).getPosts().get(1).getPoster().getUserId());
assertNotNull(result.getTopics().get(0).getPosts().get(0).getCreateDate());
assertNotNull(result.getTopics().get(0).getPosts().get(1).getCreateDate());
assertEquals(RE + "First Test Topic", result.getTopics().get(0).getPosts().get(0).getMessage().getSubject());
assertEquals("First Test Topic", result.getTopics().get(0).getPosts().get(1).getMessage().getSubject());
assertEquals("Second Test Body", result.getTopics().get(0).getPosts().get(0).getMessage().getText());
assertEquals("First Test Body", result.getTopics().get(0).getPosts().get(1).getMessage().getText());
}
use of it.vige.rubia.model.Forum in project rubia-forums by flashboss.
the class ExternalLinksTest method stop.
@AfterClass
public static void stop() {
String message = removeTopic(driver, new Topic(new Forum("First Test Forum"), "First Test Topic", asList(new Post[] { new Post("First Test Body"), new Post("Second Test Body") })));
assertTrue(message.equals(OK));
Forum forum = new Forum("First Test Forum");
message = removeForum(driver, forum, SELECT_FORUM_TYPE);
assertTrue(message.equals(REMOVED_FORUM_0_MESSAGE));
message = removeCategory(driver, new Category("First Test Category"), SELECT_CATEGORY_TYPE);
assertTrue(message.equals(REMOVED_CATEGORY_0_MESSAGE));
}
Aggregations