r3558 - in trunk: pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model pollen-votecounting-strategy-normal/src/test/java/org/chorem/pollen/votecounting pollen-votecounting-strategy-number/src/test/java/org/chorem/pollen/votecounting pollen-votecounting-strategy-percentage/src/test/java/org/chorem/pollen/votecounting
Author: tchemit Date: 2012-06-26 00:53:17 +0200 (Tue, 26 Jun 2012) New Revision: 3558 Url: http://chorem.org/repositories/revision/pollen/3558 Log: ref #590 implements generic votecounting for groups (need now to test it...) Added: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/GroupOfVoter.java trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/GroupVoteCountingResult.java trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/SimpleVoter.java Modified: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/AbstractVoteCountingStrategy.java trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/VoteCountingService.java trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/VoteCountingResult.java trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/Voter.java trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/VoterBuilder.java trunk/pollen-votecounting-strategy-normal/src/test/java/org/chorem/pollen/votecounting/NormalStrategyTest.java trunk/pollen-votecounting-strategy-number/src/test/java/org/chorem/pollen/votecounting/NumberStrategyTest.java trunk/pollen-votecounting-strategy-percentage/src/test/java/org/chorem/pollen/votecounting/PercentageStrategyTest.java Modified: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/AbstractVoteCountingStrategy.java =================================================================== --- trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/AbstractVoteCountingStrategy.java 2012-06-25 22:51:43 UTC (rev 3557) +++ trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/AbstractVoteCountingStrategy.java 2012-06-25 22:53:17 UTC (rev 3558) @@ -77,10 +77,15 @@ public VoteCountingResult resultToList(Voter voter, Map<String, ChoiceScore> resultByChoice) { + List<ChoiceScore> score = toChoiceScore(resultByChoice); + return VoteCountingResult.newResult(score); + } + + public List<ChoiceScore> toChoiceScore(Map<String, ChoiceScore> resultByChoice) { List<ChoiceScore> score = Lists.newArrayList(resultByChoice.values()); Collections.sort(score); Collections.reverse(score); - return VoteCountingResult.newResult(voter, score); + return score; } public Set<String> getAllChoiceIds(Set<Voter> voters) { Modified: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/VoteCountingService.java =================================================================== --- trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/VoteCountingService.java 2012-06-25 22:51:43 UTC (rev 3557) +++ trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/VoteCountingService.java 2012-06-25 22:53:17 UTC (rev 3558) @@ -23,9 +23,15 @@ package org.chorem.pollen.votecounting; import com.google.common.base.Preconditions; +import com.google.common.collect.Maps; +import org.chorem.pollen.votecounting.model.ChoiceScore; +import org.chorem.pollen.votecounting.model.GroupOfVoter; +import org.chorem.pollen.votecounting.model.GroupVoteCountingResult; import org.chorem.pollen.votecounting.model.VoteCountingResult; +import org.chorem.pollen.votecounting.model.VoteForChoice; import org.chorem.pollen.votecounting.model.Voter; +import java.util.Map; import java.util.Set; /** @@ -68,4 +74,68 @@ return result; } + /** + * Execute a vote counting for a given strategy (by his id) and the + * given {@code voters}. + * + * @param strategyId the id of the vote counting strategy to use + * @param voter the votes to vote count + * @return vote counting result + */ + public GroupVoteCountingResult voteCountByGroup(int strategyId, Set<Voter> voter) { + + Preconditions.checkNotNull(provider); + Preconditions.checkNotNull(voter); + + VoteCountingStrategy strategy = provider.getStrategy(strategyId); + Preconditions.checkNotNull(strategy); + + // Create a groupVoter including of the root voters + GroupOfVoter group = GroupOfVoter.newVoter(null, 1.0, null, voter); + + + Map<GroupOfVoter, VoteCountingResult> groupResults = Maps.newHashMap(); + voteCount(strategy, group, groupResults); + + // get result for main group (and remove it from groups) + VoteCountingResult mainResult = groupResults.remove(group); + + GroupVoteCountingResult result = GroupVoteCountingResult.newResult( + mainResult, groupResults); + return result; + } + + protected void voteCount(VoteCountingStrategy strategy, + GroupOfVoter group, + Map<GroupOfVoter, VoteCountingResult> results) { + + // all childs of this group + Set<Voter> voters = group.getVoters(); + + // treat before all his group childs + for (Voter voter : voters) { + if (voter instanceof GroupOfVoter) { + + // treat group child before all + voteCount(strategy, (GroupOfVoter) voter, results); + } + } + + // once here, all childs has been treated, can votecount this group + VoteCountingResult voteCountingResult = strategy.votecount(voters); + + // store the result for this group + results.put(group, voteCountingResult); + + // result of the group is now the voteForChoice for it + + for (ChoiceScore choiceScore : voteCountingResult.getScores()) { + VoteForChoice voteForChoice = VoteForChoice.newVote( + choiceScore.getChoiceId(), + //FIXME-tchemit-2012-06-26 Which is the value to set as choice for each result? + choiceScore.getScoreValue().doubleValue()); + group.addVoteForChoice(voteForChoice); + } + + } } Added: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/GroupOfVoter.java =================================================================== --- trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/GroupOfVoter.java (rev 0) +++ trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/GroupOfVoter.java 2012-06-25 22:53:17 UTC (rev 3558) @@ -0,0 +1,117 @@ +/* + * #%L + * Pollen :: VoteCounting Api + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.votecounting.model; + +import com.google.common.collect.Sets; + +import java.util.Set; + +/** + * Group of voters. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.5 + */ +public class GroupOfVoter implements Voter { + + /** Id of the group of voters. */ + private String voterId; + + /** Weight of the group of voters. */ + private double weight; + + /** All votes for this group of voters. */ + private Set<VoteForChoice> voteForChoices; + + /** Set of voters for this group. */ + private Set<Voter> voters; + + /** Result for this group. */ + private VoteCountingResult result; + + public static GroupOfVoter newVoter(String voterId, + double weight, + Set<VoteForChoice> voteForChoices, + Set<Voter> voters) { + GroupOfVoter result = new GroupOfVoter(); + result.setVoterId(voterId); + result.setWeight(weight); + result.setVoteForChoices(voteForChoices); + result.setVoters(voters); + return result; + } + + @Override + public String getVoterId() { + return voterId; + } + + @Override + public double getWeight() { + return weight; + } + + @Override + public Set<VoteForChoice> getVoteForChoices() { + if (voteForChoices == null) { + voteForChoices = Sets.newHashSet(); + } + return voteForChoices; + } + + public Set<Voter> getVoters() { + return voters; + } + + public VoteCountingResult getResult() { + return result; + } + + @Override + public void setVoterId(String voterId) { + this.voterId = voterId; + } + + @Override + public void setWeight(double weight) { + this.weight = weight; + } + + @Override + public void addVoteForChoice(VoteForChoice voteForChoice) { + getVoteForChoices().add(voteForChoice); + } + + @Override + public void setVoteForChoices(Set<VoteForChoice> voteForChoices) { + this.voteForChoices = voteForChoices; + } + + public void setVoters(Set<Voter> voters) { + this.voters = voters; + } + + public void setResult(VoteCountingResult result) { + this.result = result; + } +} Property changes on: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/GroupOfVoter.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/GroupVoteCountingResult.java =================================================================== --- trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/GroupVoteCountingResult.java (rev 0) +++ trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/GroupVoteCountingResult.java 2012-06-25 22:53:17 UTC (rev 3558) @@ -0,0 +1,63 @@ +/* + * #%L + * Pollen :: VoteCounting Api + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.votecounting.model; + +import java.util.Map; + +/** + * TODO + * + * @author tchemit <chemit@codelutin.com> + * @since 1.5 + */ +public class GroupVoteCountingResult { + + protected VoteCountingResult mainResult; + + protected Map<GroupOfVoter, VoteCountingResult> groupResults; + + public static GroupVoteCountingResult newResult( + VoteCountingResult mainResult, + Map<GroupOfVoter, VoteCountingResult> groupResults) { + GroupVoteCountingResult result = new GroupVoteCountingResult(); + result.setMainResult(mainResult); + result.setGroupResults(groupResults); + return result; + } + + public VoteCountingResult getMainResult() { + return mainResult; + } + + public void setMainResult(VoteCountingResult mainResult) { + this.mainResult = mainResult; + } + + public Map<GroupOfVoter, VoteCountingResult> getGroupResults() { + return groupResults; + } + + public void setGroupResults(Map<GroupOfVoter, VoteCountingResult> groupResults) { + this.groupResults = groupResults; + } +} Property changes on: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/GroupVoteCountingResult.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/SimpleVoter.java =================================================================== --- trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/SimpleVoter.java (rev 0) +++ trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/SimpleVoter.java 2012-06-25 22:53:17 UTC (rev 3558) @@ -0,0 +1,94 @@ +/* + * #%L + * Pollen :: VoteCounting Api + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.votecounting.model; + +import com.google.common.collect.Sets; + +import java.util.Set; + +/** + * Physical voter. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.5 + */ +public class SimpleVoter implements Voter { + + /** Id of the voter. */ + private String voterId; + + /** Weight of the voter. */ + private double weight; + + /** All votes for this voter (or group of voter). */ + private Set<VoteForChoice> voteForChoices; + + public static SimpleVoter newVoter(String voterId, + double weight, + Set<VoteForChoice> voteForChoices) { + SimpleVoter result = new SimpleVoter(); + result.setVoterId(voterId); + result.setWeight(weight); + result.setVoteForChoices(voteForChoices); + return result; + } + + @Override + public String getVoterId() { + return voterId; + } + + @Override + public double getWeight() { + return weight; + } + + @Override + public void addVoteForChoice(VoteForChoice voteForChoice) { + getVoteForChoices().add(voteForChoice); + } + + @Override + public Set<VoteForChoice> getVoteForChoices() { + if (voteForChoices == null) { + voteForChoices = Sets.newHashSet(); + } + return voteForChoices; + } + + @Override + public void setVoterId(String voterId) { + this.voterId = voterId; + } + + @Override + public void setWeight(double weight) { + this.weight = weight; + } + + @Override + public void setVoteForChoices(Set<VoteForChoice> voteForChoices) { + this.voteForChoices = voteForChoices; + } + +} Property changes on: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/SimpleVoter.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/VoteCountingResult.java =================================================================== --- trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/VoteCountingResult.java 2012-06-25 22:51:43 UTC (rev 3557) +++ trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/VoteCountingResult.java 2012-06-25 22:53:17 UTC (rev 3558) @@ -32,37 +32,15 @@ */ public class VoteCountingResult { - /** - * Group of voters which obtains this result. - * <p/> - * <strong>Note:</strong> If this is the result of a poll (says a normal - * votecouting), this value is null, only used for a grouped votecouting. - */ - private Voter voter; - - /** - * Results for each choice. - * <p/> - * <strong>Note:</strong> - */ + /** Results for each choice. */ private List<ChoiceScore> scores; - public static VoteCountingResult newResult(Voter voter, - List<ChoiceScore> scores) { + public static VoteCountingResult newResult(List<ChoiceScore> scores) { VoteCountingResult result = new VoteCountingResult(); - result.setVoter(voter); result.setScores(scores); return result; } - public Voter getVoter() { - return voter; - } - - public void setVoter(Voter voter) { - this.voter = voter; - } - public List<ChoiceScore> getScores() { return scores; } Modified: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/Voter.java =================================================================== --- trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/Voter.java 2012-06-25 22:51:43 UTC (rev 3557) +++ trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/Voter.java 2012-06-25 22:53:17 UTC (rev 3558) @@ -30,61 +30,20 @@ * @author tchemit <chemit@codelutin.com> * @since 1.5 */ -public class Voter { +public interface Voter { - /** Id of the voter (or the group of voters). */ - private String voterId; + String getVoterId(); - /** Weight of the voter (or group of voters). */ - private double weight; + double getWeight(); - /** All votes for this voter (or group of voter). */ - private Set<VoteForChoice> voteForChoices; + void addVoteForChoice(VoteForChoice voteForChoice); - /** Set of voters (only when the voter is a group of voters). */ - private Set<Voter> voters; + Set<VoteForChoice> getVoteForChoices(); - public static Voter newVoter(String voterId, - double weight, - Set<VoteForChoice> voteForChoices, - Set<Voter> voters) { - Voter result = new Voter(); - result.setVoterId(voterId); - result.setWeight(weight); - result.setVoteForChoices(voteForChoices); - result.setVoters(voters); - return result; - } + void setVoterId(String voterId); - public String getVoterId() { - return voterId; - } + void setWeight(double weight); - public double getWeight() { - return weight; - } + void setVoteForChoices(Set<VoteForChoice> voteForChoices); - public Set<VoteForChoice> getVoteForChoices() { - return voteForChoices; - } - - public Set<Voter> getVoters() { - return voters; - } - - public void setVoterId(String voterId) { - this.voterId = voterId; - } - - public void setWeight(double weight) { - this.weight = weight; - } - - public void setVoteForChoices(Set<VoteForChoice> voteForChoices) { - this.voteForChoices = voteForChoices; - } - - public void setVoters(Set<Voter> voters) { - this.voters = voters; - } } Modified: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/VoterBuilder.java =================================================================== --- trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/VoterBuilder.java 2012-06-25 22:51:43 UTC (rev 3557) +++ trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/VoterBuilder.java 2012-06-25 22:53:17 UTC (rev 3558) @@ -41,16 +41,14 @@ public VoterBuilder newVoter(String voterId, double weight) { flushVoter(); - voter = Voter.newVoter(voterId, weight, - Sets.<VoteForChoice>newHashSet(), null); + voter = SimpleVoter.newVoter(voterId, weight, null); return this; } public VoterBuilder addVoteForChoice(String choiceId, Double voteValue) { Preconditions.checkState(voter != null); - VoteForChoice voteForChoice = VoteForChoice.newVote(choiceId, - voteValue); - voter.getVoteForChoices().add(voteForChoice); + VoteForChoice voteForChoice = VoteForChoice.newVote(choiceId, voteValue); + voter.addVoteForChoice(voteForChoice); return this; } Modified: trunk/pollen-votecounting-strategy-normal/src/test/java/org/chorem/pollen/votecounting/NormalStrategyTest.java =================================================================== --- trunk/pollen-votecounting-strategy-normal/src/test/java/org/chorem/pollen/votecounting/NormalStrategyTest.java 2012-06-25 22:51:43 UTC (rev 3557) +++ trunk/pollen-votecounting-strategy-normal/src/test/java/org/chorem/pollen/votecounting/NormalStrategyTest.java 2012-06-25 22:53:17 UTC (rev 3558) @@ -94,7 +94,6 @@ VoteCountingResult result = strategy.votecount(voters); Assert.assertNotNull(result); - Assert.assertNull(result.getVoter()); List<ChoiceScore> scores = result.getScores(); Assert.assertNotNull(scores); Assert.assertEquals(3, scores.size()); @@ -133,7 +132,6 @@ VoteCountingResult result = strategy.votecount(voters); Assert.assertNotNull(result); - Assert.assertNull(result.getVoter()); List<ChoiceScore> scores = result.getScores(); Assert.assertNotNull(scores); Assert.assertEquals(3, scores.size()); @@ -169,7 +167,6 @@ VoteCountingResult result = strategy.votecount(voters); Assert.assertNotNull(result); - Assert.assertNull(result.getVoter()); List<ChoiceScore> scores = result.getScores(); Assert.assertNotNull(scores); Assert.assertEquals(3, scores.size()); @@ -207,7 +204,6 @@ VoteCountingResult result = strategy.votecount(voters); Assert.assertNotNull(result); - Assert.assertNull(result.getVoter()); List<ChoiceScore> scores = result.getScores(); Assert.assertNotNull(scores); Assert.assertEquals(3, scores.size()); @@ -245,7 +241,6 @@ VoteCountingResult result = strategy.votecount(voters); Assert.assertNotNull(result); - Assert.assertNull(result.getVoter()); List<ChoiceScore> scores = result.getScores(); Assert.assertNotNull(scores); Assert.assertEquals(3, scores.size()); Modified: trunk/pollen-votecounting-strategy-number/src/test/java/org/chorem/pollen/votecounting/NumberStrategyTest.java =================================================================== --- trunk/pollen-votecounting-strategy-number/src/test/java/org/chorem/pollen/votecounting/NumberStrategyTest.java 2012-06-25 22:51:43 UTC (rev 3557) +++ trunk/pollen-votecounting-strategy-number/src/test/java/org/chorem/pollen/votecounting/NumberStrategyTest.java 2012-06-25 22:53:17 UTC (rev 3558) @@ -94,7 +94,6 @@ VoteCountingResult result = strategy.votecount(voters); Assert.assertNotNull(result); - Assert.assertNull(result.getVoter()); List<ChoiceScore> scores = result.getScores(); Assert.assertNotNull(scores); Assert.assertEquals(3, scores.size()); @@ -130,7 +129,6 @@ VoteCountingResult result = strategy.votecount(voters); Assert.assertNotNull(result); - Assert.assertNull(result.getVoter()); List<ChoiceScore> scores = result.getScores(); Assert.assertNotNull(scores); Assert.assertEquals(3, scores.size()); @@ -166,7 +164,6 @@ VoteCountingResult result = strategy.votecount(voters); Assert.assertNotNull(result); - Assert.assertNull(result.getVoter()); List<ChoiceScore> scores = result.getScores(); Assert.assertNotNull(scores); Assert.assertEquals(3, scores.size()); @@ -204,7 +201,6 @@ VoteCountingResult result = strategy.votecount(voters); Assert.assertNotNull(result); - Assert.assertNull(result.getVoter()); List<ChoiceScore> scores = result.getScores(); Assert.assertNotNull(scores); Assert.assertEquals(3, scores.size()); @@ -242,7 +238,6 @@ VoteCountingResult result = strategy.votecount(voters); Assert.assertNotNull(result); - Assert.assertNull(result.getVoter()); List<ChoiceScore> scores = result.getScores(); Assert.assertNotNull(scores); Assert.assertEquals(3, scores.size()); Modified: trunk/pollen-votecounting-strategy-percentage/src/test/java/org/chorem/pollen/votecounting/PercentageStrategyTest.java =================================================================== --- trunk/pollen-votecounting-strategy-percentage/src/test/java/org/chorem/pollen/votecounting/PercentageStrategyTest.java 2012-06-25 22:51:43 UTC (rev 3557) +++ trunk/pollen-votecounting-strategy-percentage/src/test/java/org/chorem/pollen/votecounting/PercentageStrategyTest.java 2012-06-25 22:53:17 UTC (rev 3558) @@ -94,7 +94,6 @@ VoteCountingResult result = strategy.votecount(voters); Assert.assertNotNull(result); - Assert.assertNull(result.getVoter()); List<ChoiceScore> scores = result.getScores(); Assert.assertNotNull(scores); Assert.assertEquals(3, scores.size()); @@ -133,7 +132,6 @@ VoteCountingResult result = strategy.votecount(voters); Assert.assertNotNull(result); - Assert.assertNull(result.getVoter()); List<ChoiceScore> scores = result.getScores(); Assert.assertNotNull(scores); Assert.assertEquals(3, scores.size()); @@ -169,7 +167,6 @@ VoteCountingResult result = strategy.votecount(voters); Assert.assertNotNull(result); - Assert.assertNull(result.getVoter()); List<ChoiceScore> scores = result.getScores(); Assert.assertNotNull(scores); Assert.assertEquals(3, scores.size()); @@ -207,7 +204,6 @@ VoteCountingResult result = strategy.votecount(voters); Assert.assertNotNull(result); - Assert.assertNull(result.getVoter()); List<ChoiceScore> scores = result.getScores(); Assert.assertNotNull(scores); Assert.assertEquals(3, scores.size()); @@ -242,7 +238,6 @@ VoteCountingResult result = strategy.votecount(voters); Assert.assertNotNull(result); - Assert.assertNull(result.getVoter()); List<ChoiceScore> scores = result.getScores(); Assert.assertNotNull(scores); Assert.assertEquals(3, scores.size());
participants (1)
-
tchemit@users.chorem.org