Search in sources :

Example 26 with Post

use of it.vige.rubia.model.Post in project rubia-forums by flashboss.

the class ModerateTopicTest method moveSelectedUp.

@Test
public void moveSelectedUp() {
    Topic topic = new Topic(new Forum("Second Test Forum"), "Fourth Test Topic");
    goToSplitPanel(driver, topic);
    String message = moveTopicSelectedUp(driver, topic, null);
    assertEquals(ERR_NO_POST_SELECTED, message);
    topic.setPosts(asList(new Post[] { new Post("Fourth Test Body", asList(new Attachment("fourth", "Fourth Test File"), new Attachment("fifth", "Fifth Test with Truncation over 25 characters File"), new Attachment("sixth", "Sixth Test File"))), new Post("Thirtyeight Test Body"), new Post("Fourtyone 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("Second Test Forum");
    forum.setTopics(asList(new Topic[] { new Topic("Fourth 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("Second Test Forum"));
    topic.setSubject("Fourth Test Topic");
    message = removeTopic(driver, CONFIRM, topic);
    assertTrue(message.equals(SUCC_TOPIC_REMOVED));
    message = createTopic(driver, new Topic(new Forum("Second Test Forum"), "Fourth Test Topic", asList(new Post[] { new Post("Fourth Test Body", asList(new Attachment("fourth", "Fourth Test File"), new Attachment("fifth", "Fifth Test with Truncation over 25 characters File"), new Attachment("sixth", "Sixth Test File"))), new Post("Thirtyseven Test Body"), new Post("Thirtyeight Test Body"), new Post("Thirtynine Test Body"), new Post("Fourty Test Body"), new Post("Fourtyone Test Body"), new Post("Fourtytwo Test Body") }), IMPORTANT, new Poll("Fourth Test Question", asList(new PollOption[] { new PollOption("Seventh Test Answer"), new PollOption("Eight Test Answer") }), 0)));
    assertTrue(message.equals("Fourth 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 27 with Post

use of it.vige.rubia.model.Post in project rubia-forums by flashboss.

the class ModerateTopicTest 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 = removeTopic(driver, CANCEL, topic);
    assertTrue(message.equals(""));
    message = removeTopic(driver, CONFIRM, topic);
    assertTrue(message.equals(SUCC_TOPIC_REMOVED));
    topic = new Topic(new Forum("First Test Forum"), "Second Test Topic", asList(new Post[] { new Post("Second Test Body") }));
    message = removeTopic(driver, CONFIRM, topic);
    assertTrue(message.equals(SUCC_TOPIC_REMOVED));
    topic = new Topic(new Forum("Second Test Forum"), "Third Test Topic", asList(new Post[] { new Post("Third Test Body") }));
    message = removeTopic(driver, CONFIRM, topic);
    assertTrue(message.equals(SUCC_TOPIC_REMOVED));
    topic = new Topic(new Forum("Second Test Forum"), "Fourth Test Topic", asList(new Post[] { new Post("Fourth Test Body") }));
    message = removeTopic(driver, CONFIRM, topic);
    assertTrue(message.equals(SUCC_TOPIC_REMOVED));
    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 = removeTopic(driver, CONFIRM, topic);
    assertTrue(message.equals(SUCC_TOPIC_REMOVED));
    topic = new Topic(new Forum("Third Test Forum"), "Sixth Test Topic", asList(new Post[] { new Post("Sixth Test Body") }));
    message = removeTopic(driver, CONFIRM, topic);
    assertTrue(message.equals(SUCC_TOPIC_REMOVED));
    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) CreatePost.createPost(it.vige.rubia.selenium.forum.action.CreatePost.createPost) Post(it.vige.rubia.model.Post) 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) AfterClass(org.junit.AfterClass)

Example 28 with Post

use of it.vige.rubia.model.Post in project rubia-forums by flashboss.

the class MyForumsTopicTest method verifyProfile.

@Test
public void verifyProfile() {
    Topic topic = new Topic(new Forum("First Test Forum"), "First Test Topic", asList(new Post[] { new Post("First Test Body") }));
    Poster poster = ViewAllTopicsSelectTopic.selectProfile(driver, topic);
    assertTrue(poster != null);
    assertEquals("root", poster.getUserId());
    assertTrue(poster.getPostCount() >= 6);
}
Also used : ViewAllTopicsSelectPost(it.vige.rubia.selenium.myforums.action.ViewAllTopicsSelectPost) Post(it.vige.rubia.model.Post) Poster(it.vige.rubia.model.Poster) 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 29 with Post

use of it.vige.rubia.model.Post in project rubia-forums by flashboss.

the class MyForumsTopicTest method verifyPost.

@Test
public void verifyPost() {
    Post post = new Post();
    Message message = new Message();
    message.setSubject("First Test Topic");
    post.setMessage(message);
    Topic result = ViewAllTopicsSelectPost.selectPost(driver, post);
    assertTrue(result != null);
    assertEquals(1, result.getPosts().size());
    assertEquals("root", result.getPosts().get(0).getPoster().getUserId());
    assertEquals(message.getSubject(), result.getPosts().get(0).getMessage().getSubject());
    assertEquals("First Test Body", result.getPosts().get(0).getMessage().getText());
    assertEquals(message.getSubject(), result.getSubject());
}
Also used : Message(it.vige.rubia.model.Message) 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) Test(org.junit.Test)

Example 30 with Post

use of it.vige.rubia.model.Post in project rubia-forums by flashboss.

the class MyForumsTopicTest 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));
    message = createCategory(driver, new Category("Second Test Category"));
    assertTrue(message.equals(CREATED_CATEGORY_2_MESSAGE));
    message = createForum(driver, new Forum("First Test Forum", "First Test Description", new Category("First Test Category")));
    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"))) }), 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"));
    message = registerTopic(driver, new Topic("First Test Topic"), EMAIL_LINKED_NOTIFICATION, CONFIRM);
    assertTrue(message.equals("First Test Topic"));
    message = createTopic(driver, new Topic(new Forum("First Test Forum"), "Second Test Topic", asList(new Post[] { new Post("Second Test Body", asList(new Attachment("first", "First Test File"), new Attachment("second", "Second Test File"), new Attachment("third", "Third Test File"))) }), IMPORTANT, new Poll("Second Test Question", asList(new PollOption[] { new PollOption("Third Test Answer"), new PollOption("Fourth Test Answer") }), 8)));
    assertTrue(message.equals("Second Test Topic"));
    message = registerTopic(driver, new Topic("Second Test Topic"), EMAIL_EMBEDED_NOTIFICATION, CONFIRM);
    assertTrue(message.equals("Second Test Topic"));
    message = createForum(driver, new Forum("Second Test Forum", "Second Test Description", new Category("First Test Category")));
    assertTrue(message.equals(CREATED_FORUM_1_MESSAGE));
    message = createTopic(driver, new Topic(new Forum("Second Test Forum"), "Third Test Topic", asList(new Post[] { new Post("Third Test Body", asList(new Attachment("first", "First Test File"), new Attachment("second", "Second Test File"), new Attachment("third", "Third Test File"))) }), ADVICE, new Poll("Third Test Question", asList(new PollOption[] { new PollOption("Fifth Test with Truncation over 25 characters Answer"), new PollOption("Sixth Test Answer") }), 9)));
    assertTrue(message.equals("Third Test Topic"));
    message = registerTopic(driver, new Topic("Third Test Topic"), EMAIL_NO_NOTIFICATION, CONFIRM);
    assertTrue(message.equals("Third Test Topic"));
    message = createTopic(driver, new Topic(new Forum("Second Test Forum"), "Fourth Test Topic", asList(new Post[] { new Post("Fourth Test Body", asList(new Attachment("fourth", "Fourth Test File"), new Attachment("fifth", "Fifth Test with Truncation over 25 characters File"), new Attachment("sixth", "Sixth Test File"))) }), IMPORTANT, new Poll("Fourth Test Question", asList(new PollOption[] { new PollOption("Seventh Test Answer"), new PollOption("Eight Test Answer") }), 0)));
    assertTrue(message.equals("Fourth Test Topic"));
    message = registerTopic(driver, new Topic("Fourth Test Topic"), EMAIL_EMBEDED_NOTIFICATION, CONFIRM);
    assertTrue(message.equals("Fourth Test Topic"));
    message = createForum(driver, new Forum("Third Test Forum", "Third Test Description", new Category("Second Test Category")));
    assertTrue(message.equals(CREATED_FORUM_2_MESSAGE));
    message = createTopic(driver, 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", asList(new Attachment("seventh", "Seventh Test File"), new Attachment("eight", "Eight Test File"), new Attachment("ninth", "Ninth Test File"))) }), IMPORTANT, new Poll("Third Test Question", asList(new PollOption[] { new PollOption("Seventh Test Answer"), new PollOption("Eight Test Answer") }), 8)));
    assertTrue(message.equals("Fifth Test with Truncation over 25 characters Topic"));
    message = registerTopic(driver, new Topic("Fifth Test with Truncation over 25 characters Topic"), EMAIL_EMBEDED_NOTIFICATION, CONFIRM);
    assertTrue(message.equals("Fifth Test with Truncation over 25 characters Topic"));
    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"))) }), 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 : 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) 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) BeforeClass(org.junit.BeforeClass)

Aggregations

Post (it.vige.rubia.model.Post)98 Topic (it.vige.rubia.model.Topic)62 Forum (it.vige.rubia.model.Forum)52 CreateTopic.createTopic (it.vige.rubia.selenium.forum.action.CreateTopic.createTopic)43 CreateForum.createForum (it.vige.rubia.selenium.adminpanel.action.CreateForum.createForum)38 Category (it.vige.rubia.model.Category)34 RemoveTopic.removeTopic (it.vige.rubia.selenium.forum.action.RemoveTopic.removeTopic)32 RemoveForum.removeForum (it.vige.rubia.selenium.adminpanel.action.RemoveForum.removeForum)31 CreateCategory.createCategory (it.vige.rubia.selenium.adminpanel.action.CreateCategory.createCategory)28 RemoveCategory.removeCategory (it.vige.rubia.selenium.adminpanel.action.RemoveCategory.removeCategory)28 Attachment (it.vige.rubia.model.Attachment)25 Test (org.junit.Test)25 Poll (it.vige.rubia.model.Poll)21 Poster (it.vige.rubia.model.Poster)20 PollOption (it.vige.rubia.model.PollOption)19 CreatePost.createPost (it.vige.rubia.selenium.forum.action.CreatePost.createPost)17 Message (it.vige.rubia.model.Message)14 Date (java.util.Date)14 BeforeClass (org.junit.BeforeClass)12 WebElement (org.openqa.selenium.WebElement)12