Search in sources :

Example 11 with Category

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

the class OperationCategoryTest method verifyCreatedCategories.

@Test
public void verifyCreatedCategories() {
    List<Category> categories = getCategories(driver);
    List<Category> filteredCategories = new ArrayList<Category>();
    for (Category category : categories) {
        if (category.getTitle().equals("First Test Category") || category.getTitle().equals("Second Test Category"))
            filteredCategories.add(category);
    }
    assertEquals(filteredCategories.size(), 2);
    assertTrue(filteredCategories.get(0).getTitle().equals("First Test Category"));
    assertTrue(filteredCategories.get(1).getTitle().equals("Second Test Category"));
}
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) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 12 with Category

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

the class OperationCategoryTest method stop.

@AfterClass
public static void stop() {
    String 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) AfterClass(org.junit.AfterClass)

Example 13 with Category

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

the class OperationTopicTest 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") })));
    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));
    message = removeTopic(driver, new Topic(new Forum("Second Test Forum"), "Fifth Test with Truncation over 25 characters Topic", asList(new Post[] { new Post("Fifth Test with Truncation over 25 characters Body") })));
    assertTrue(message.equals(OK));
    message = removeForum(driver, new Forum("First Test Forum"), "Second Test Forum");
    assertTrue(message.equals(REMOVED_FORUM_0_MESSAGE));
    message = removeTopic(driver, new Topic(new Forum("Second Test Forum"), "Second Test Topic", asList(new Post[] { new Post("Second Test Body") })));
    assertTrue(message.equals(OK));
    message = removeForum(driver, new Forum("Second Test Forum"), SELECT_FORUM_TYPE);
    assertTrue(message.equals(REMOVED_FORUM_1_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) 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)

Example 14 with Category

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

the class MyForumsForumTest method verifyRegisteredCanceledForums.

@Test
public void verifyRegisteredCanceledForums() {
    Forum forum = new Forum("Fourth Test Forum", "Fourth Test Description", new Category("Second Test Category"));
    String message = registerForum(driver, forum, EMAIL_NO_NOTIFICATION, CANCEL);
    assertTrue(message.equals("Fourth Test Forum"));
    assertTrue(!isRegistered(driver, forum));
}
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) Forum(it.vige.rubia.model.Forum) ViewAllForumsSelectForum(it.vige.rubia.selenium.myforums.action.ViewAllForumsSelectForum) ViewAllForumsUpdateForum.viewAllForumsUpdateForum(it.vige.rubia.selenium.myforums.action.ViewAllForumsUpdateForum.viewAllForumsUpdateForum) 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) SubscriptionForum.registerForum(it.vige.rubia.selenium.forum.action.SubscriptionForum.registerForum) Test(org.junit.Test)

Example 15 with Category

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

the class MyForumsForumTest method verifyAllForumsForum.

@Test
public void verifyAllForumsForum() {
    Forum forum = new Forum("Third Test Forum", "Third Test Description", new Category("Second Test Category"));
    Forum result = ViewAllForumsSelectForum.selectForum(driver, forum);
    assertTrue(result != null);
    assertEquals(forum.getName(), result.getName());
    assertEquals(0, result.getTopics().size());
    assertEquals(forum.getCategory().getTitle(), result.getCategory().getTitle());
}
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) Forum(it.vige.rubia.model.Forum) ViewAllForumsSelectForum(it.vige.rubia.selenium.myforums.action.ViewAllForumsSelectForum) ViewAllForumsUpdateForum.viewAllForumsUpdateForum(it.vige.rubia.selenium.myforums.action.ViewAllForumsUpdateForum.viewAllForumsUpdateForum) 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) SubscriptionForum.registerForum(it.vige.rubia.selenium.forum.action.SubscriptionForum.registerForum) Test(org.junit.Test)

Aggregations

Category (it.vige.rubia.model.Category)71 Forum (it.vige.rubia.model.Forum)50 CreateCategory.createCategory (it.vige.rubia.selenium.adminpanel.action.CreateCategory.createCategory)48 RemoveCategory.removeCategory (it.vige.rubia.selenium.adminpanel.action.RemoveCategory.removeCategory)48 CreateForum.createForum (it.vige.rubia.selenium.adminpanel.action.CreateForum.createForum)40 Topic (it.vige.rubia.model.Topic)36 Post (it.vige.rubia.model.Post)34 RemoveForum.removeForum (it.vige.rubia.selenium.adminpanel.action.RemoveForum.removeForum)32 CreateTopic.createTopic (it.vige.rubia.selenium.forum.action.CreateTopic.createTopic)30 RemoveTopic.removeTopic (it.vige.rubia.selenium.forum.action.RemoveTopic.removeTopic)24 AfterClass (org.junit.AfterClass)16 BeforeClass (org.junit.BeforeClass)16 Attachment (it.vige.rubia.model.Attachment)15 Poll (it.vige.rubia.model.Poll)14 PollOption (it.vige.rubia.model.PollOption)12 Test (org.junit.Test)11 JSFUtil.handleException (it.vige.rubia.ui.JSFUtil.handleException)8 Poster (it.vige.rubia.model.Poster)7 CreatePost.createPost (it.vige.rubia.selenium.forum.action.CreatePost.createPost)7 ModuleException (it.vige.rubia.ModuleException)6