use of it.vige.rubia.model.Forum in project rubia-forums by flashboss.
the class SearchTopicTest method stop.
@AfterClass
public static void stop() {
String message = removeTopic(driver, new Topic(new Forum("First Test Forum"), "First Test with a large subject name triing to truncate over the 25 character Topic", asList(new Post[] { new Post("First Test Body") })));
assertTrue(message.equals(OK));
message = removeTopic(driver, new Topic(new Forum("First Test Forum"), "Second Test Topic", asList(new Post[] { new Post("Second Test Body") })));
assertTrue(message.equals(OK));
message = removeTopic(driver, new Topic(new Forum("Second Test Forum"), "Third Test Topic", asList(new Post[] { new Post("Third Test Body") })));
assertTrue(message.equals(OK));
message = removeTopic(driver, new Topic(new Forum("Second Test Forum"), "Fourth Test Topic", asList(new Post[] { new Post("Fourth Test Body") })));
assertTrue(message.equals(OK));
Forum forum = new Forum("First Test Forum");
message = unregisterForum(driver, forum);
assertTrue(message.equals(OK));
message = removeForum(driver, forum, "Second Test Forum");
assertTrue(message.equals(REMOVED_FORUM_0_MESSAGE));
forum = new Forum("Second Test Forum");
message = unregisterForum(driver, forum);
assertTrue(message.equals(OK));
message = removeForum(driver, forum, SELECT_FORUM_TYPE);
assertTrue(message.equals(REMOVED_FORUM_1_MESSAGE));
forum = new Forum("Third Test Forum");
message = viewAllForumsRemoveForum(driver, forum);
assertTrue(message.equals(OK));
message = removeForum(driver, forum, SELECT_FORUM_TYPE);
assertTrue(message.equals(REMOVED_FORUM_2_MESSAGE));
forum = new Forum("Fourth Test Forum");
message = removeForum(driver, forum, SELECT_FORUM_TYPE);
assertTrue(message.equals(REMOVED_FORUM_3_MESSAGE));
forum = new Forum("Fifth Test with Truncation over 25 characters Forum");
message = viewAllEditForumsRemoveForum(driver, forum);
assertTrue(message.equals(OK));
message = removeForum(driver, forum, SELECT_FORUM_TYPE);
assertTrue(message.equals(REMOVED_FORUM_4_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 ExternalLinksTest method verifyAtomTopic.
@Test
public void verifyAtomTopic() {
Topic topic = new Topic(new Forum("First Test Forum"), "First Test Topic");
Topic result = ViewAtomLink.getPage(driver, topic);
assertNotNull(result);
assertEquals("First Test Category", result.getForum().getCategory().getTitle());
assertEquals(topic.getForum().getName(), result.getForum().getName());
assertEquals(2, result.getPosts().size());
assertEquals("root", result.getPosts().get(0).getPoster().getUserId());
assertEquals("root", result.getPosts().get(1).getPoster().getUserId());
assertEquals("First Test Topic", result.getPosts().get(0).getMessage().getSubject());
assertEquals(RE + "First Test Topic", result.getPosts().get(1).getMessage().getSubject());
assertEquals("First Test Body", result.getPosts().get(0).getMessage().getText());
assertEquals("Second Test Body", result.getPosts().get(1).getMessage().getText());
assertNotNull(result.getPosts().get(0).getCreateDate());
assertNotNull(result.getPosts().get(1).getCreateDate());
assertEquals("First Test Topic", result.getSubject());
assertEquals("First Test Question", result.getPoll().getTitle());
assertEquals(2, result.getPoll().getOptions().size());
assertEquals("First Test Answer", result.getPoll().getOptions().get(0).getQuestion());
assertEquals("Second Test Answer", result.getPoll().getOptions().get(1).getQuestion());
assertNotNull(result.getPosts().get(0).getAttachments());
assertEquals(3, result.getPosts().get(0).getAttachments().size());
assertEquals("First Test File", ((Attachment) result.getPosts().get(0).getAttachments().toArray()[0]).getComment());
assertEquals("Second Test File", ((Attachment) result.getPosts().get(0).getAttachments().toArray()[1]).getComment());
assertEquals("Third Test File", ((Attachment) result.getPosts().get(0).getAttachments().toArray()[2]).getComment());
assertNotNull(result.getPosts().get(1).getAttachments());
assertEquals(1, result.getPosts().get(1).getAttachments().size());
assertEquals("Fourth Test File", ((Attachment) result.getPosts().get(1).getAttachments().toArray()[0]).getComment());
}
use of it.vige.rubia.model.Forum in project rubia-forums by flashboss.
the class ExternalLinksTest method verifyRSSTopic.
@Test
public void verifyRSSTopic() {
Topic topic = new Topic(new Forum("First Test Forum"), "First Test Topic");
Topic result = ViewRSSLink.getPage(driver, topic);
assertNotNull(result);
assertEquals("First Test Category", result.getForum().getCategory().getTitle());
assertEquals(topic.getForum().getName(), result.getForum().getName());
assertEquals(2, result.getPosts().size());
assertEquals("root", result.getPosts().get(0).getPoster().getUserId());
assertEquals("root", result.getPosts().get(1).getPoster().getUserId());
assertEquals("First Test Topic", result.getPosts().get(0).getMessage().getSubject());
assertEquals(RE + "First Test Topic", result.getPosts().get(1).getMessage().getSubject());
assertEquals("First Test Body", result.getPosts().get(0).getMessage().getText());
assertEquals("Second Test Body", result.getPosts().get(1).getMessage().getText());
assertNotNull(result.getPosts().get(0).getCreateDate());
assertNotNull(result.getPosts().get(1).getCreateDate());
assertEquals("First Test Topic", result.getSubject());
}
use of it.vige.rubia.model.Forum in project rubia-forums by flashboss.
the class ExternalLinksTest method verifyAtomForum.
@Test
public void verifyAtomForum() {
Forum forum = new Forum("First Test Forum");
Forum result = ViewAtomLink.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("First Test Question", result.getTopics().get(0).getPoll().getTitle());
assertEquals(2, result.getTopics().get(0).getPoll().getOptions().size());
assertEquals("First Test Answer", result.getTopics().get(0).getPoll().getOptions().get(0).getQuestion());
assertEquals("Second Test Answer", result.getTopics().get(0).getPoll().getOptions().get(1).getQuestion());
assertEquals(2, result.getTopics().get(0).getPosts().size());
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());
assertNotNull(result.getTopics().get(0).getPosts().get(0).getAttachments());
assertEquals(1, result.getTopics().get(0).getPosts().get(0).getAttachments().size());
assertEquals("Fourth Test File", ((Attachment) result.getTopics().get(0).getPosts().get(0).getAttachments().toArray()[0]).getComment());
assertNotNull(result.getTopics().get(0).getPosts().get(1).getAttachments());
assertEquals(3, result.getTopics().get(0).getPosts().get(1).getAttachments().size());
assertEquals("First Test File", ((Attachment) result.getTopics().get(0).getPosts().get(1).getAttachments().toArray()[0]).getComment());
assertEquals("Second Test File", ((Attachment) result.getTopics().get(0).getPosts().get(1).getAttachments().toArray()[1]).getComment());
assertEquals("Third Test File", ((Attachment) result.getTopics().get(0).getPosts().get(1).getAttachments().toArray()[2]).getComment());
}
use of it.vige.rubia.model.Forum in project rubia-forums by flashboss.
the class ExternalLinksTest method setUp.
@BeforeClass
public static void setUp() {
driver.get(HOME_URL);
String message = createCategory(driver, new Category("First Test Category"));
assertTrue(message.equals(CREATED_CATEGORY_1_MESSAGE));
Forum forum = new Forum("First Test Forum", "First Test Description", new Category("First Test Category"));
message = createForum(driver, forum);
assertTrue(message.equals(CREATED_FORUM_0_MESSAGE));
message = createTopic(driver, new Topic(new Forum("First Test Forum"), "First Test Topic", asList(new Post[] { new Post("First Test Body", asList(new Attachment("first", "First Test File"), new Attachment("second", "Second Test File"), new Attachment("third", "Third Test File"))), new Post("Second Test Body", asList(new Attachment("Fourth", "Fourth Test File"))) }), NORMAL, new Poll("First Test Question", asList(new PollOption[] { new PollOption("First Test Answer"), new PollOption("Second Test Answer") }), 4)));
assertTrue(message.equals("First Test Topic"));
}
Aggregations