Package org.internna.iwebmvc.model

Examples of org.internna.iwebmvc.model.Poll.addOption()


    public void testParse() {
        assertNull(pollParser.parse(null));
        Poll p = new Poll();
        assertEquals(p, pollParser.parse(p));
        p.setOptions(new ArrayList<PollOption>(1));
        p.addOption(new PollOption());
        p = pollParser.parse(p);
        assertEquals(p, p.getOptions().iterator().next().getPoll());
    }

    @Test
View Full Code Here


        copy.setId(aPollOption.getId());
        copy.setAnswer(new I18nText());
        for (LocalizedValue value : aPollOption.getAnswer().getData())
            copy.getAnswer().add(value);
        copy.getAnswer().add(new Locale("it"), "x");
        p.addOption(copy);
        PollOption newOption = new PollOption();
        newOption.setAnswer(new I18nText());
        newOption.getAnswer().add(new Locale("en"), "a");
        newOption.getAnswer().add(new Locale("en"), "b");
        p.addOption(newOption);
View Full Code Here

        p.addOption(copy);
        PollOption newOption = new PollOption();
        newOption.setAnswer(new I18nText());
        newOption.getAnswer().add(new Locale("en"), "a");
        newOption.getAnswer().add(new Locale("en"), "b");
        p.addOption(newOption);
        p = pollParser.parse(p);
        assertTrue(p.getOptions().size() == 2);
        assertTrue(p.getOptions().iterator().next().getAnswer().getData().size() == 2);
        p.setQuestion(new I18nText());
        p.getQuestion().add(new Locale("en"), "What's your favorite european football club?");
View Full Code Here

                            oldPollOption.setOrder(option.getOrder());
                            for (int answerIndex = 0; answerIndex < oldPollOption.getAnswer().getData().size(); answerIndex++)
                                oldPollOption.getAnswer().getData().get(answerIndex).setTranslation(option.getAnswer().getData().get(answerIndex).getTranslation());
                        }
                    }
                } else old.addOption(option);
            }
            List<PollOption> removed = new ArrayList<PollOption>();
            for (PollOption option : old.getOptions()) {
                boolean remove = true;
                for (PollOption newOption : poll.getOptions()) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.