Changeset 22 for events/src/test/java/actions/VoteTest.java
- Timestamp:
- 09/22/20 16:26:36 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
events/src/test/java/actions/VoteTest.java
r21 r22 6 6 import java.util.Arrays; 7 7 import java.util.HashMap; 8 import java.util.LinkedList;9 8 import java.util.List; 10 9 import java.util.Map; … … 39 38 private final static Value VALUE2 = new NumberValue("10"); 40 39 // issue 2 is NUMBER and thus serializes with leading '=' 41 private final String votestring = "{\"vote\":{\"actor\":\"party1\",\"bid\":{\"issuevalues\":{\"issue2\":10,\"issue1\":\"value1\"}},\"minPower\":1 }}";40 private final String votestring = "{\"vote\":{\"actor\":\"party1\",\"bid\":{\"issuevalues\":{\"issue2\":10,\"issue1\":\"value1\"}},\"minPower\":1,\"maxPower\":2}}"; 42 41 43 private static Vote vote1, vote1a, vote2, vote3, vote4 ;42 private static Vote vote1, vote1a, vote2, vote3, vote4, vote5; 44 43 45 44 static { … … 47 46 issuevalues.put(ISSUE2, VALUE2); 48 47 bid = new Bid(issuevalues); 49 vote1 = new Vote(id, bid, 1 );50 vote1a = new Vote(id, bid, 1 );48 vote1 = new Vote(id, bid, 1, 2); 49 vote1a = new Vote(id, bid, 1, 2); 51 50 52 vote2 = new Vote(id2, bid, 1 );51 vote2 = new Vote(id2, bid, 1, 2); 53 52 54 53 // values swapped, so different issuevalues. … … 56 55 issuevaluesb.put(ISSUE2, VALUE2); 57 56 bidb = new Bid(issuevaluesb); 58 vote3 = new Vote(id, bidb, 1 );57 vote3 = new Vote(id, bidb, 1, 2); 59 58 60 vote4 = new Vote(id, bid, 2); 59 vote4 = new Vote(id, bid, 2, 2); 60 vote5 = new Vote(id, bid, 1, 3); 61 61 62 62 } … … 64 64 @Override 65 65 public List<List<Vote>> getGeneralTestData() { 66 List<List<Vote>> list = new LinkedList<>(); 67 list.add(Arrays.asList(vote1, vote1a)); 68 list.add(Arrays.asList(vote2)); 69 list.add(Arrays.asList(vote3)); 70 list.add(Arrays.asList(vote4)); 71 return list; 66 return Arrays.asList(Arrays.asList(vote1, vote1a), Arrays.asList(vote2), 67 Arrays.asList(vote3), Arrays.asList(vote4), 68 Arrays.asList(vote5)); 72 69 } 73 70 74 71 @Override 75 72 public List<String> getGeneralTestStrings() { 76 return Arrays.asList("Vote.*party1.*issue2=10.*issue1=.value1.*1.*", 77 "Vote.*party2.*issue2=10.*issue1=.value1.*1.*", 78 "Vote.*party1.*issue2=10.*issue1=10.*1.*", 79 "Vote.*party1.*issue2=10.*issue1=.value1.*2.*"); 73 return Arrays.asList("Vote.*party1.*issue2=10.*issue1=.value1.*1.*2.*", 74 "Vote.*party2.*issue2=10.*issue1=.value1.*1.*2.*", 75 "Vote.*party1.*issue2=10.*issue1=10.*1.*2.*", 76 "Vote.*party1.*issue2=10.*issue1=.value1.*2.*2.*", 77 "Vote.*party1.*issue2=10.*issue1=.value1.*1.*3.*"); 80 78 } 81 79
Note:
See TracChangeset
for help on using the changeset viewer.