Changeset 8 for references/src
- Timestamp:
- 09/30/19 15:37:05 (5 years ago)
- Location:
- references/src
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
references/src/main/java/geniusweb/references/PartyWithProfile.java
r1 r8 8 8 @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 9 9 public class PartyWithProfile { 10 private final Party Refparty;10 private final PartyWithParameters party; 11 11 private final ProfileRef profile; 12 12 13 13 @JsonCreator 14 public PartyWithProfile(@JsonProperty("party") Party Refparty,14 public PartyWithProfile(@JsonProperty("party") PartyWithParameters party, 15 15 @JsonProperty("profile") ProfileRef profile) { 16 16 if (party == null || profile == null) { … … 22 22 } 23 23 24 public Party RefgetParty() {24 public PartyWithParameters getParty() { 25 25 return party; 26 26 -
references/src/test/java/geniusweb/references/PartyWithProfileTest.java
r1 r8 17 17 import com.fasterxml.jackson.databind.ObjectMapper; 18 18 19 import geniusweb.references.PartyRef;20 import geniusweb.references.PartyWithProfile;21 import geniusweb.references.ProfileRef;22 19 import tudelft.utilities.junit.GeneralTests; 23 20 … … 26 23 private PartyRef party1, party1a, party2, party3; 27 24 private ProfileRef profile1, profile2; 28 private PartyWithProfile partyprof1, partyprof1a, partyprof2, partyprof3; 29 private final String serialized = "{\"party\":\"ws:party1\",\"profile\":\"ws:profile1\"}"; 25 private PartyWithProfile partyprof1, partyprof1a, partyprof2, partyprof3, 26 partyprof4; 27 private final String serialized = "{\"party\":{\"partyref\":\"ws:party1\",\"parameters\":{}},\"profile\":\"ws:profile1\"}"; 30 28 31 29 @Before … … 39 37 profile2 = new ProfileRef(new URI("ws:profile2")); 40 38 41 partyprof1 = new PartyWithProfile(party1, profile1); 42 partyprof1a = new PartyWithProfile(party1, profile1); 43 partyprof2 = new PartyWithProfile(party2, profile1); 44 partyprof3 = new PartyWithProfile(party1, profile2); 39 Parameters settings1 = new Parameters(); 40 Parameters settings2 = new Parameters(); 41 settings2.put("a", 1); 42 43 PartyWithParameters party1withparams1 = new PartyWithParameters(party1, 44 settings1); 45 PartyWithParameters party1withparams2 = new PartyWithParameters(party1, 46 settings2); 47 PartyWithParameters party2withparams1 = new PartyWithParameters(party2, 48 settings1); 49 50 partyprof1 = new PartyWithProfile(party1withparams1, profile1); 51 partyprof1a = new PartyWithProfile(party1withparams1, profile1); 52 partyprof2 = new PartyWithProfile(party2withparams1, profile1); 53 partyprof3 = new PartyWithProfile(party1withparams1, profile2); 54 partyprof4 = new PartyWithProfile(party1withparams2, profile1); 45 55 46 56 } … … 49 59 public List<List<PartyWithProfile>> getGeneralTestData() { 50 60 return Arrays.asList(Arrays.asList(partyprof1, partyprof1a), 51 Arrays.asList(partyprof2), Arrays.asList(partyprof3)); 61 Arrays.asList(partyprof2), Arrays.asList(partyprof3), 62 Arrays.asList(partyprof4)); 52 63 } 53 64 … … 55 66 public List<String> getGeneralTestStrings() { 56 67 return Arrays.asList( 57 "PartyWithProfile.PartyRef.ws:party1.,ProfileRef.ws:profile1..", 58 "PartyWithProfile.PartyRef.ws:party2.,ProfileRef.ws:profile1..", 59 "PartyWithProfile.PartyRef.ws:party1.,ProfileRef.ws:profile2.."); 68 "PartyWithProfile.PartyRef.ws:party1.,ProfileRef.ws:profile1.*", 69 "PartyWithProfile.PartyRef.ws:party2.,ProfileRef.ws:profile1.*", 70 "PartyWithProfile.PartyRef.ws:party1.,ProfileRef.ws:profile2.*", 71 "PartyWithProfile.PartyRef.ws:party1.\\{a=1\\},ProfileRef.ws:profile1.*"); 60 72 } 61 73 … … 66 78 @Test(expected = IllegalArgumentException.class) 67 79 public void nullTest() throws URISyntaxException { 68 new PartyWithProfile((Party Ref) null, (ProfileRef) null);80 new PartyWithProfile((PartyWithParameters) null, (ProfileRef) null); 69 81 } 70 82
Note:
See TracChangeset
for help on using the changeset viewer.