Search in sources :

Example 91 with Forum

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"));
}
Also used : CreatePost.createPost(it.vige.rubia.selenium.forum.action.CreatePost.createPost) Post(it.vige.rubia.model.Post) Poll(it.vige.rubia.model.Poll) Attachment(it.vige.rubia.model.Attachment) PollOption(it.vige.rubia.model.PollOption) MoveTopic.moveTopic(it.vige.rubia.selenium.moderate.action.MoveTopic.moveTopic) RemoveTopic.removeTopic(it.vige.rubia.selenium.moderate.action.RemoveTopic.removeTopic) CreateTopic.createTopic(it.vige.rubia.selenium.forum.action.CreateTopic.createTopic) Topic(it.vige.rubia.model.Topic) LockTopic.lockTopic(it.vige.rubia.selenium.moderate.action.LockTopic.lockTopic) Forum(it.vige.rubia.model.Forum) RemoveForum.removeForum(it.vige.rubia.selenium.adminpanel.action.RemoveForum.removeForum) CreateForum.createForum(it.vige.rubia.selenium.adminpanel.action.CreateForum.createForum) Test(org.junit.Test)

Example 92 with Forum

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));
}
Also used : CreateCategory.createCategory(it.vige.rubia.selenium.adminpanel.action.CreateCategory.createCategory) RemoveCategory.removeCategory(it.vige.rubia.selenium.adminpanel.action.RemoveCategory.removeCategory) Category(it.vige.rubia.model.Category) ViewAllTopicsSelectPost(it.vige.rubia.selenium.myforums.action.ViewAllTopicsSelectPost) Post(it.vige.rubia.model.Post) ViewAllTopicsUpdateTopic.viewAllTopicsUpdateTopic(it.vige.rubia.selenium.myforums.action.ViewAllTopicsUpdateTopic.viewAllTopicsUpdateTopic) RemoveTopic.removeTopic(it.vige.rubia.selenium.forum.action.RemoveTopic.removeTopic) ViewAllTopicsSelectTopic(it.vige.rubia.selenium.myforums.action.ViewAllTopicsSelectTopic) ViewAllTopicsRemoveTopic.viewAllTopicsRemoveTopic(it.vige.rubia.selenium.myforums.action.ViewAllTopicsRemoveTopic.viewAllTopicsRemoveTopic) CreateTopic.createTopic(it.vige.rubia.selenium.forum.action.CreateTopic.createTopic) Topic(it.vige.rubia.model.Topic) SubscriptionTopic.registerTopic(it.vige.rubia.selenium.forum.action.SubscriptionTopic.registerTopic) SubscriptionTopic.unregisterTopic(it.vige.rubia.selenium.forum.action.SubscriptionTopic.unregisterTopic) Forum(it.vige.rubia.model.Forum) RemoveForum.removeForum(it.vige.rubia.selenium.adminpanel.action.RemoveForum.removeForum) CreateForum.createForum(it.vige.rubia.selenium.adminpanel.action.CreateForum.createForum) AfterClass(org.junit.AfterClass)

Example 93 with Forum

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));
}
Also used : ViewAllTopicsSelectPost(it.vige.rubia.selenium.myforums.action.ViewAllTopicsSelectPost) Post(it.vige.rubia.model.Post) Poll(it.vige.rubia.model.Poll) Attachment(it.vige.rubia.model.Attachment) PollOption(it.vige.rubia.model.PollOption) ViewAllTopicsUpdateTopic.viewAllTopicsUpdateTopic(it.vige.rubia.selenium.myforums.action.ViewAllTopicsUpdateTopic.viewAllTopicsUpdateTopic) RemoveTopic.removeTopic(it.vige.rubia.selenium.forum.action.RemoveTopic.removeTopic) ViewAllTopicsSelectTopic(it.vige.rubia.selenium.myforums.action.ViewAllTopicsSelectTopic) ViewAllTopicsRemoveTopic.viewAllTopicsRemoveTopic(it.vige.rubia.selenium.myforums.action.ViewAllTopicsRemoveTopic.viewAllTopicsRemoveTopic) CreateTopic.createTopic(it.vige.rubia.selenium.forum.action.CreateTopic.createTopic) Topic(it.vige.rubia.model.Topic) SubscriptionTopic.registerTopic(it.vige.rubia.selenium.forum.action.SubscriptionTopic.registerTopic) SubscriptionTopic.unregisterTopic(it.vige.rubia.selenium.forum.action.SubscriptionTopic.unregisterTopic) Forum(it.vige.rubia.model.Forum) RemoveForum.removeForum(it.vige.rubia.selenium.adminpanel.action.RemoveForum.removeForum) CreateForum.createForum(it.vige.rubia.selenium.adminpanel.action.CreateForum.createForum) Test(org.junit.Test)

Example 94 with Forum

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());
}
Also used : Forum(it.vige.rubia.model.Forum) RemoveForum.removeForum(it.vige.rubia.selenium.adminpanel.action.RemoveForum.removeForum) CreateForum.createForum(it.vige.rubia.selenium.adminpanel.action.CreateForum.createForum) Test(org.junit.Test)

Example 95 with Forum

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));
}
Also used : CreateCategory.createCategory(it.vige.rubia.selenium.adminpanel.action.CreateCategory.createCategory) RemoveCategory.removeCategory(it.vige.rubia.selenium.adminpanel.action.RemoveCategory.removeCategory) Category(it.vige.rubia.model.Category) Post(it.vige.rubia.model.Post) CreateTopic.createTopic(it.vige.rubia.selenium.forum.action.CreateTopic.createTopic) Topic(it.vige.rubia.model.Topic) RemoveTopic.removeTopic(it.vige.rubia.selenium.forum.action.RemoveTopic.removeTopic) Forum(it.vige.rubia.model.Forum) RemoveForum.removeForum(it.vige.rubia.selenium.adminpanel.action.RemoveForum.removeForum) CreateForum.createForum(it.vige.rubia.selenium.adminpanel.action.CreateForum.createForum) AfterClass(org.junit.AfterClass)

Aggregations

Forum (it.vige.rubia.model.Forum)100 CreateForum.createForum (it.vige.rubia.selenium.adminpanel.action.CreateForum.createForum)65 Topic (it.vige.rubia.model.Topic)63 RemoveForum.removeForum (it.vige.rubia.selenium.adminpanel.action.RemoveForum.removeForum)55 Post (it.vige.rubia.model.Post)52 Category (it.vige.rubia.model.Category)50 CreateTopic.createTopic (it.vige.rubia.selenium.forum.action.CreateTopic.createTopic)49 CreateCategory.createCategory (it.vige.rubia.selenium.adminpanel.action.CreateCategory.createCategory)40 RemoveCategory.removeCategory (it.vige.rubia.selenium.adminpanel.action.RemoveCategory.removeCategory)40 RemoveTopic.removeTopic (it.vige.rubia.selenium.forum.action.RemoveTopic.removeTopic)34 Test (org.junit.Test)33 Poll (it.vige.rubia.model.Poll)23 Attachment (it.vige.rubia.model.Attachment)21 PollOption (it.vige.rubia.model.PollOption)21 SecureActionForum (it.vige.rubia.auth.SecureActionForum)16 CreatePost.createPost (it.vige.rubia.selenium.forum.action.CreatePost.createPost)15 Poster (it.vige.rubia.model.Poster)14 JSFUtil.handleException (it.vige.rubia.ui.JSFUtil.handleException)14 BeforeClass (org.junit.BeforeClass)14 AfterClass (org.junit.AfterClass)13