use of it.vige.rubia.model.PollOption in project rubia-forums by flashboss.
the class SearchTopicTest 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));
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 with a large subject name triing to truncate over the 25 character 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 with a large subject name triing to truncate over the 25 character Topic"));
message = createTopic(driver, new Topic(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 = registerForum(driver, forum, EMAIL_LINKED_NOTIFICATION, CONFIRM);
assertTrue(message.equals("First Test Forum"));
forum = new Forum("Second Test Forum", "Second Test Description", new Category("First Test Category"));
message = createForum(driver, forum);
assertTrue(message.equals(CREATED_FORUM_1_MESSAGE));
message = createTopic(driver, new Topic(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 = createTopic(driver, new Topic(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 = registerForum(driver, forum, EMAIL_EMBEDED_NOTIFICATION, CONFIRM);
assertTrue(message.equals("Second Test Forum"));
forum = new Forum("Third Test Forum", "Third Test Description", new Category("Second Test Category"));
message = createForum(driver, forum);
assertTrue(message.equals(CREATED_FORUM_2_MESSAGE));
message = registerForum(driver, forum, EMAIL_NO_NOTIFICATION, CONFIRM);
assertTrue(message.equals("Third Test Forum"));
forum = new Forum("Fourth Test Forum", "Fourth Test Description", new Category("Second Test Category"));
message = createForum(driver, forum);
assertTrue(message.equals(CREATED_FORUM_3_MESSAGE));
forum = new Forum("Fifth Test with Truncation over 25 characters Forum", "Fifth Test with Truncation over 25 characters Description", new Category("Second Test Category"));
message = createForum(driver, forum);
assertTrue(message.equals(CREATED_FORUM_4_MESSAGE));
message = registerForum(driver, forum, EMAIL_NO_NOTIFICATION, CONFIRM);
assertTrue(message.equals("Fifth Test with Truncation over 25 characters Forum"));
}
use of it.vige.rubia.model.PollOption 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"));
}
use of it.vige.rubia.model.PollOption in project rubia-forums by flashboss.
the class OperationPollTest method verifyUpdatePoll.
@Test
public void verifyUpdatePoll() {
Topic topic = new Topic(new Forum("Second Test Forum"), "Fourth Test Topic");
goTo(driver, topic);
Poll pollToUpdate = getPollOfCurrentTopic(driver);
pollToUpdate.setTitle("Second Test Question");
pollToUpdate = updatePoll(driver, pollToUpdate);
pollToUpdate.getOptions().get(0).setQuestion("Third Test Answer");
pollToUpdate.getOptions().get(1).setQuestion("Fourth Test Answer");
Poll updatedPoll = updateOptions(driver, pollToUpdate);
assertEquals("Second Test Question", updatedPoll.getTitle());
assertEquals(0, updatedPoll.getVotesSum());
List<PollOption> options = updatedPoll.getOptions();
assertEquals("Third Test Answer", options.get(0).getQuestion());
assertEquals("Fourth Test Answer", options.get(1).getQuestion());
assertEquals(0, options.get(0).getVotes());
assertEquals(0, options.get(1).getVotes());
assertEquals(2, options.size());
pollToUpdate.setTitle("Fourth Test Question");
updatePoll(driver, pollToUpdate);
pollToUpdate.getOptions().get(0).setQuestion("Seventh Test Answer");
pollToUpdate.getOptions().get(1).setQuestion("Eight Test Answer");
updatedPoll = updateOptions(driver, pollToUpdate);
assertEquals("Fourth Test Question", updatedPoll.getTitle());
assertEquals(0, updatedPoll.getVotesSum());
options = updatedPoll.getOptions();
assertEquals("Seventh Test Answer", options.get(0).getQuestion());
assertEquals("Eight Test Answer", options.get(1).getQuestion());
assertEquals(0, options.get(0).getVotes());
assertEquals(0, options.get(1).getVotes());
assertEquals(2, options.size());
}
use of it.vige.rubia.model.PollOption in project rubia-forums by flashboss.
the class OperationPollTest method verifyCreatedPolls.
@Test
public void verifyCreatedPolls() {
List<Poll> polls = getPollsOfTopics(driver, new Topic("First Test Topic"), new Topic("Second Test Topic"), new Topic("Third Test Topic"), new Topic("Fourth Test Topic"));
assertEquals(4, polls.size());
Poll secondTestPoll = polls.get(0);
assertEquals("Second Test Question", secondTestPoll.getTitle());
assertEquals(secondTestPoll.getVotesSum(), 0);
List<PollOption> options = secondTestPoll.getOptions();
assertEquals("Third Test Answer", options.get(0).getQuestion());
assertEquals("Fourth Test Answer", options.get(1).getQuestion());
assertEquals(0, options.get(0).getVotes());
assertEquals(0, options.get(1).getVotes());
assertEquals(2, options.size());
Poll firstTestPoll = polls.get(1);
assertEquals("First Test Question", firstTestPoll.getTitle());
assertEquals(0, firstTestPoll.getVotesSum());
options = firstTestPoll.getOptions();
assertEquals("First Test Answer", options.get(0).getQuestion());
assertEquals("Second Test Answer", options.get(1).getQuestion());
assertEquals(0, options.get(0).getVotes());
assertEquals(0, options.get(1).getVotes());
assertEquals(2, options.size());
Poll thirdTestPoll = polls.get(2);
assertEquals("Third Test Question", thirdTestPoll.getTitle());
assertEquals(0, thirdTestPoll.getVotesSum());
options = thirdTestPoll.getOptions();
assertEquals("Fifth Test with Truncation over 25 characters Answer", options.get(0).getQuestion());
assertEquals("Sixth Test Answer", options.get(1).getQuestion());
assertEquals(0, options.get(0).getVotes());
assertEquals(0, options.get(1).getVotes());
assertEquals(2, options.size());
Poll fourthTestPoll = polls.get(3);
assertEquals("Fourth Test Question", fourthTestPoll.getTitle());
assertEquals(0, fourthTestPoll.getVotesSum());
options = fourthTestPoll.getOptions();
assertEquals("Seventh Test Answer", options.get(0).getQuestion());
assertEquals("Eight Test Answer", options.get(1).getQuestion());
assertEquals(0, options.get(0).getVotes());
assertEquals(0, options.get(1).getVotes());
assertEquals(2, options.size());
}
use of it.vige.rubia.model.PollOption in project rubia-forums by flashboss.
the class MyForumsForumTest 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));
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"))) }), 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 = createTopic(driver, new Topic(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 = registerForum(driver, forum, EMAIL_LINKED_NOTIFICATION, CONFIRM);
assertTrue(message.equals("First Test Forum"));
forum = new Forum("Second Test Forum", "Second Test Description", new Category("First Test Category"));
message = createForum(driver, forum);
assertTrue(message.equals(CREATED_FORUM_1_MESSAGE));
message = createTopic(driver, new Topic(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 = createTopic(driver, new Topic(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 = registerForum(driver, forum, EMAIL_EMBEDED_NOTIFICATION, CONFIRM);
assertTrue(message.equals("Second Test Forum"));
forum = new Forum("Third Test Forum", "Third Test Description", new Category("Second Test Category"));
message = createForum(driver, forum);
assertTrue(message.equals(CREATED_FORUM_2_MESSAGE));
message = registerForum(driver, forum, EMAIL_NO_NOTIFICATION, CONFIRM);
assertTrue(message.equals("Third Test Forum"));
forum = new Forum("Fourth Test Forum", "Fourth Test Description", new Category("Second Test Category"));
message = createForum(driver, forum);
assertTrue(message.equals(CREATED_FORUM_3_MESSAGE));
forum = new Forum("Fifth Test with Truncation over 25 characters Forum", "Fifth Test Description", new Category("Second Test Category"));
message = createForum(driver, forum);
assertTrue(message.equals(CREATED_FORUM_4_MESSAGE));
message = registerForum(driver, forum, EMAIL_NO_NOTIFICATION, CONFIRM);
assertTrue(message.equals("Fifth Test with Truncation over 25 characters Forum"));
}
Aggregations