Changeset 7 for party/src


Ignore:
Timestamp:
09/25/19 16:49:06 (5 years ago)
Author:
bart
Message:

Fix consistency check LinearAdditiveUtilitySpace

File:
1 edited

Legend:

Unmodified
Added
Removed
  • party/src/test/java/geniusweb/party/inform/NegotiationInfoTest.java

    r1 r7  
    88import java.util.Arrays;
    99import java.util.Date;
     10import java.util.HashMap;
    1011import java.util.List;
     12import java.util.Map;
    1113
    1214import org.junit.Before;
     
    4345        private Settings negoinfo4;
    4446        private final Date date = new Date(999);
     47        private final static ObjectMapper jackson = new ObjectMapper();
    4548
    4649        @Before
     
    4851                        JsonMappingException, IOException {
    4952                // we can't mock because we want to test the serializer
    50                 ObjectMapper jackson = new ObjectMapper();
    5153                ProfileRef profile1 = new ProfileRef(new URI("ws:profile1"));
    5254                // jackson.readValue(serialized, Profile.class);
     
    98100        @Test
    99101        public void testSerialize() throws JsonProcessingException {
    100                 ObjectMapper jackson = new ObjectMapper();
    101102
    102103                String json = jackson.writeValueAsString(negoinfo1);
     
    108109        public void testDeserialize()
    109110                        throws JsonParseException, JsonMappingException, IOException {
    110                 ObjectMapper jackson = new ObjectMapper();
    111111                Settings p = (Settings) jackson.readValue(asJson, Inform.class);
    112112                System.out.println(p);
    113113                assertEquals(negoinfo1, p);
    114114        }
     115       
     116        @Test
     117        public void testGeneralDict() throws JsonParseException, JsonMappingException, IOException {
     118                Map val = jackson.readValue("{\"a\":1,\"b\":{\"x\":3},\"c\":[1,2,3]}", HashMap.class);
     119                System.out.println(val);
     120        }
    115121
    116122}
Note: See TracChangeset for help on using the changeset viewer.