Search in sources :

Example 6 with Forum

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));
}
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) ViewPageTopicSearch.getPosterLastPost(it.vige.rubia.selenium.search.action.ViewPageTopicSearch.getPosterLastPost) Post(it.vige.rubia.model.Post) RemoveTopic.removeTopic(it.vige.rubia.selenium.forum.action.RemoveTopic.removeTopic) ViewPageTopicSearch.searchTopic(it.vige.rubia.selenium.search.action.ViewPageTopicSearch.searchTopic) CreateTopic.createTopic(it.vige.rubia.selenium.forum.action.CreateTopic.createTopic) Topic(it.vige.rubia.model.Topic) ViewPageTopicSearch.getTopic(it.vige.rubia.selenium.search.action.ViewPageTopicSearch.getTopic) Forum(it.vige.rubia.model.Forum) ViewAllForumsRemoveForum.viewAllForumsRemoveForum(it.vige.rubia.selenium.myforums.action.ViewAllForumsRemoveForum.viewAllForumsRemoveForum) RemoveForum.removeForum(it.vige.rubia.selenium.adminpanel.action.RemoveForum.removeForum) SubscriptionForum.unregisterForum(it.vige.rubia.selenium.forum.action.SubscriptionForum.unregisterForum) CreateForum.createForum(it.vige.rubia.selenium.adminpanel.action.CreateForum.createForum) ViewAllForumsRemoveForum.viewAllEditForumsRemoveForum(it.vige.rubia.selenium.myforums.action.ViewAllForumsRemoveForum.viewAllEditForumsRemoveForum) ViewPageTopicSearch.getLastPostOfCurrentForum(it.vige.rubia.selenium.search.action.ViewPageTopicSearch.getLastPostOfCurrentForum) SubscriptionForum.registerForum(it.vige.rubia.selenium.forum.action.SubscriptionForum.registerForum) AfterClass(org.junit.AfterClass)

Example 7 with Forum

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());
}
Also used : 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) Test(org.junit.Test)

Example 8 with Forum

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());
}
Also used : 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) Test(org.junit.Test)

Example 9 with Forum

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());
}
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 10 with Forum

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"));
}
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) Poll(it.vige.rubia.model.Poll) Attachment(it.vige.rubia.model.Attachment) PollOption(it.vige.rubia.model.PollOption) 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) BeforeClass(org.junit.BeforeClass)

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