/external/jackson-databind/src/test/java/com/fasterxml/jackson/databind/contextual/ |
D | TestContextualDeserialization.java | 197 ContextualBean bean = mapper.readValue("{\"a\":\"1\",\"b\":\"2\"}", ContextualBean.class); in testSimple() local 198 assertEquals("a=1", bean.a.value); in testSimple() 199 assertEquals("b=2", bean.b.value); in testSimple() 202 bean = mapper.readValue("{\"a\":\"3\",\"b\":\"4\"}", ContextualBean.class); in testSimple() 203 assertEquals("a=3", bean.a.value); in testSimple() 204 assertEquals("b=4", bean.b.value); in testSimple() 210 ContextualBean bean = mapper.readValue("{\"a\":\"1\",\"b\":\"2\"}", ContextualBean.class); in testSimpleWithAnnotations() local 211 assertEquals("NameA=1", bean.a.value); in testSimpleWithAnnotations() 212 assertEquals("NameB=2", bean.b.value); in testSimpleWithAnnotations() 215 bean = mapper.readValue("{\"a\":\"x\",\"b\":\"y\"}", ContextualBean.class); in testSimpleWithAnnotations() [all …]
|
/external/snakeyaml/src/test/java/org/yaml/snakeyaml/javabeans/ |
D | ConstructEmptyBeanTest.java | 30 EmptyBean bean = (EmptyBean) yaml in testEmptyBean() local 32 assertNotNull(bean); in testEmptyBean() 33 assertNull(bean.getFirstName()); in testEmptyBean() 34 assertEquals(5, bean.getHatSize()); in testEmptyBean() 42 EmptyBean bean = beanLoader.loadAs( in testEmptyBean1() local 45 assertNotNull(bean); in testEmptyBean1() 46 assertNull(bean.getFirstName()); in testEmptyBean1() 47 assertEquals(5, bean.getHatSize()); in testEmptyBean1() 55 EmptyBean bean = beanLoader.loadAs("!!Bla-bla-bla {}", EmptyBean.class); in testEmptyBean2() local 56 assertNotNull(bean); in testEmptyBean2() [all …]
|
/external/jackson-databind/src/test/java/com/fasterxml/jackson/databind/deser/creators/ |
D | TestCreators.java | 306 ConstructorBean bean = MAPPER.readValue("{ \"x\" : 42 }", ConstructorBean.class); in testSimpleConstructor() local 307 assertEquals(42, bean.x); in testSimpleConstructor() 321 DoubleConstructorBean bean = MAPPER.readValue(exp.toString(), DoubleConstructorBean.class); in testSimpleDoubleConstructor() local 322 assertEquals(exp, bean.d); in testSimpleDoubleConstructor() 327 BooleanConstructorBean bean = MAPPER.readValue(" true ", BooleanConstructorBean.class); in testSimpleBooleanConstructor() local 328 assertEquals(Boolean.TRUE, bean.b); in testSimpleBooleanConstructor() 348 FactoryBean bean = MAPPER.readValue("{ \"f\" : 0.25 }", FactoryBean.class); in testSimpleFactory() local 349 assertEquals(0.25, bean.d); in testSimpleFactory() 355 LongFactoryBean bean = MAPPER.readValue(String.valueOf(VALUE), LongFactoryBean.class); in testLongFactory() local 356 assertEquals(VALUE, bean.value); in testLongFactory() [all …]
|
D | SingleArgCreatorTest.java | 95 ExplicitFactoryBeanA bean = new ExplicitFactoryBeanA(str, false); in create() local 96 bean.value = str; in create() 97 return bean; in create() 152 SingleNamedStringBean bean = MAPPER.readValue(quote("foobar"), in testNamedSingleArg() local 154 assertEquals("foobar", bean._ss); in testNamedSingleArg() 161 StringyBean bean = mapper.readValue(quote("foobar"), StringyBean.class); in testSingleStringArgWithImplicitName() local 162 assertEquals("foobar", bean.getValue()); in testSingleStringArgWithImplicitName() 170 … StringyBeanWithProps bean = mapper.readValue("{\"value\":\"x\"}", StringyBeanWithProps.class); in testSingleImplicitlyNamedNotDelegating() local 171 assertEquals("x", bean.getValue()); in testSingleImplicitlyNamedNotDelegating() 177 SingleNamedButStillDelegating bean = MAPPER.readValue(quote("xyz"), in testSingleExplicitlyNamedButDelegating() local [all …]
|
/external/jackson-databind/src/test/java/com/fasterxml/jackson/databind/views/ |
D | TestViewDeserialization.java | 67 Bean bean = mapper in testSimple() local 69 assertEquals(3, bean.a); in testSimple() 70 assertEquals("foo", bean.aa); in testSimple() 71 assertEquals(9, bean.b); in testSimple() 74 bean = mapper.readerWithView(ViewAA.class) in testSimple() 78 assertEquals(3, bean.a); in testSimple() 79 assertEquals("foo", bean.aa); in testSimple() 81 assertEquals(0, bean.b); in testSimple() 83 bean = mapper.readerWithView(ViewA.class) in testSimple() 86 assertEquals(1, bean.a); in testSimple() [all …]
|
/external/jackson-databind/src/main/java/com/fasterxml/jackson/databind/deser/ |
D | BeanDeserializer.java | 248 …public Object deserialize(JsonParser p, DeserializationContext ctxt, Object bean) throws IOExcepti… in deserialize() argument 251 p.setCurrentValue(bean); in deserialize() 253 injectValues(ctxt, bean); in deserialize() 256 return deserializeWithUnwrapped(p, ctxt, bean); in deserialize() 259 return deserializeWithExternalTypeId(p, ctxt, bean); in deserialize() 267 return bean; in deserialize() 273 return bean; in deserialize() 279 return deserializeWithView(p, ctxt, bean, view); in deserialize() 288 prop.deserializeAndSet(p, ctxt, bean); in deserialize() 290 wrapAndThrow(e, bean, propName, ctxt); in deserialize() [all …]
|
/external/jackson-databind/src/test/java/com/fasterxml/jackson/databind/deser/inject/ |
D | TestInjectables.java | 103 InjectedBean bean = mapper.readValue("{\"value\":3}", InjectedBean.class); in testSimple() local 104 assertEquals(3, bean.value); in testSimple() 105 assertEquals("stuffValue", bean.stuff); in testSimple() 106 assertEquals("xyz", bean.otherStuff); in testSimple() 107 assertEquals(37L, bean.third); in testSimple() 112 CtorBean bean = MAPPER.readerFor(CtorBean.class) in testWithCtors() local 116 assertEquals(55, bean.age); in testWithCtors() 117 assertEquals("Bubba", bean.name); in testWithCtors() 122 CtorBean2 bean = MAPPER.readerFor(CtorBean2.class) in testTwoInjectablesViaCreator() local 127 assertEquals(Integer.valueOf(13), bean.age); in testTwoInjectablesViaCreator() [all …]
|
/external/jackson-databind/src/test/java/com/fasterxml/jackson/databind/seq/ |
D | ReadRecoveryTest.java | 31 Bean bean = it.nextValue(); in testRootBeans() local 32 assertEquals(3, bean.a); in testRootBeans() 35 bean = it.nextValue(); in testRootBeans() 54 Bean bean = it.nextValue(); in testSimpleRootRecovery() local 56 assertNotNull(bean); in testSimpleRootRecovery() 57 assertEquals(3, bean.a); in testSimpleRootRecovery() 67 bean = it.nextValue(); in testSimpleRootRecovery() 68 assertNotNull(bean); in testSimpleRootRecovery() 69 assertEquals(1, bean.a); in testSimpleRootRecovery() 70 assertEquals(2, bean.b); in testSimpleRootRecovery() [all …]
|
/external/jackson-databind/src/test/java/com/fasterxml/jackson/databind/jsontype/ |
D | TestPropertyTypeInfo.java | 89 FieldWrapperBean bean = mapper.readValue(json, FieldWrapperBean.class); in testSimpleField() local 90 assertNotNull(bean.value); in testSimpleField() 91 assertEquals(StringWrapper.class, bean.value.getClass()); in testSimpleField() 92 assertEquals(((StringWrapper) bean.value).str, "foo"); in testSimpleField() 100 FieldWrapperBean bean = mapper.readValue(json, FieldWrapperBean.class); in testSimpleMethod() local 101 assertNotNull(bean.value); in testSimpleMethod() 102 assertEquals(IntWrapper.class, bean.value.getClass()); in testSimpleMethod() 103 assertEquals(((IntWrapper) bean.value).i, 37); in testSimpleMethod() 116 FieldWrapperBean bean = list.get(0); in testSimpleListField() local 117 assertEquals(OtherBean.class, bean.value.getClass()); in testSimpleListField() [all …]
|
D | TestSubtypes.java | 238 SubB bean = new SubB(); in testSerialization() local 239 assertEquals("{\"@type\":\"TypeB\",\"b\":1}", MAPPER.writeValueAsString(bean)); in testSerialization() 244 assertEquals("{\"@type\":\"typeB\",\"b\":1}", mapper.writeValueAsString(bean)); in testSerialization() 266 … SuperType bean = mapper.readValue("{\"@type\":\"TestSubtypes$SubC\", \"c\":1}", SuperType.class); in testDeserializationNonNamed() local 267 assertSame(SubC.class, bean.getClass()); in testDeserializationNonNamed() 268 assertEquals(1, ((SubC) bean).c); in testDeserializationNonNamed() 277 SuperType bean = mapper.readValue("{\"@type\":\"TypeB\", \"b\":13}", SuperType.class); in testDeserializatioNamed() local 278 assertSame(SubB.class, bean.getClass()); in testDeserializatioNamed() 279 assertEquals(13, ((SubB) bean).b); in testDeserializatioNamed() 282 bean = mapper.readValue("{\"@type\":\"TypeD\", \"d\":-4}", SuperType.class); in testDeserializatioNamed() [all …]
|
/external/jackson-databind/src/main/java/com/fasterxml/jackson/databind/deser/impl/ |
D | BeanAsArrayDeserializer.java | 110 final Object bean = _valueInstantiator.createUsingDefault(ctxt); in deserialize() local 112 p.setCurrentValue(bean); in deserialize() 119 return bean; in deserialize() 127 prop.deserializeAndSet(p, ctxt, bean); in deserialize() 129 wrapAndThrow(e, bean, prop.getName(), ctxt); in deserialize() 147 return bean; in deserialize() 151 public Object deserialize(JsonParser p, DeserializationContext ctxt, Object bean) in deserialize() argument 155 p.setCurrentValue(bean); in deserialize() 165 injectValues(ctxt, bean); in deserialize() 172 return bean; in deserialize() [all …]
|
/external/snakeyaml/src/test/java/org/yaml/snakeyaml/issues/issue124/ |
D | DumpTest.java | 29 Bean124 bean = new Bean124(); in testDumperOptionsSideEffect() local 30 String output0 = yaml.dump(bean); in testDumperOptionsSideEffect() 34 String output1 = yaml.dumpAsMap(bean); in testDumperOptionsSideEffect() 37 String output2 = yaml.dump(bean); in testDumperOptionsSideEffect() 44 Bean124 bean = new Bean124(); in testDumperDifferentTag() local 45 String output1 = yaml.dumpAs(bean, new Tag("!!foo.bar"), FlowStyle.BLOCK); in testDumperDifferentTag() 51 Bean124 bean = new Bean124(); in testDumperFlowStyle() local 52 String output1 = yaml.dumpAs(bean, new Tag("!!foo.bar"), FlowStyle.FLOW); in testDumperFlowStyle() 58 Bean124 bean = new Bean124(); in testDumperAutoStyle() local 59 String output1 = yaml.dumpAs(bean, new Tag("!!foo.bar"), FlowStyle.AUTO); in testDumperAutoStyle() [all …]
|
/external/jackson-databind/src/test/java/com/fasterxml/jackson/databind/deser/ |
D | PropertyAliasTest.java | 88 AliasBean bean; in testSimpleAliases() local 91 bean = MAPPER.readValue(aposToQuotes("{'Name':'Foobar','a':3,'xyz':37}"), in testSimpleAliases() 93 assertEquals("Foobar", bean.name); in testSimpleAliases() 94 assertEquals(3, bean._a); in testSimpleAliases() 95 assertEquals(37, bean._xyz); in testSimpleAliases() 98 bean = MAPPER.readValue(aposToQuotes("{'name':'Foobar','a':3,'Xyz':37}"), in testSimpleAliases() 100 assertEquals("Foobar", bean.name); in testSimpleAliases() 101 assertEquals(3, bean._a); in testSimpleAliases() 102 assertEquals(37, bean._xyz); in testSimpleAliases() 105 bean = MAPPER.readValue(aposToQuotes("{'name':'Foobar','A':3,'xyz':37}"), in testSimpleAliases() [all …]
|
D | TestOverloaded.java | 108 ArrayListBean bean = MAPPER.readValue in testSpecialization() local 110 assertNotNull(bean.list); in testSpecialization() 111 assertEquals(3, bean.list.size()); in testSpecialization() 112 assertEquals(ArrayList.class, bean.list.getClass()); in testSpecialization() 113 assertEquals("a", bean.list.get(0)); in testSpecialization() 114 assertEquals("b", bean.list.get(1)); in testSpecialization() 115 assertEquals("c", bean.list.get(2)); in testSpecialization() 124 WasNumberBean bean = MAPPER.readValue in testOverride() local 126 assertNotNull(bean); in testOverride() 127 assertEquals("abc", bean.value); in testOverride() [all …]
|
/external/jackson-databind/src/test/java/com/fasterxml/jackson/databind/ser/ |
D | FieldSerializationTest.java | 138 SimpleFieldBean bean = new SimpleFieldBean(); in testSimpleAutoDetect() local 140 bean.x = 13; in testSimpleAutoDetect() 141 Map<String,Object> result = writeAndMap(MAPPER, bean); in testSimpleAutoDetect() 150 SimpleFieldBean2 bean = new SimpleFieldBean2(); in testSimpleAnnotation() local 151 bean.values = new String[] { "a", "b" }; in testSimpleAnnotation() 152 Map<String,Object> result = writeAndMap(MAPPER, bean); in testSimpleAnnotation() 162 TransientBean bean = new TransientBean(); in testTransientAndStatic() local 163 Map<String,Object> result = writeAndMap(MAPPER, bean); in testTransientAndStatic() 170 NoAutoDetectBean bean = new NoAutoDetectBean(); in testNoAutoDetect() local 171 bean._z = -4; in testNoAutoDetect() [all …]
|
/external/snakeyaml/src/test/java/org/yaml/snakeyaml/issues/issue9/ |
D | BeanHolder.java | 22 private IBean bean = new Bean1(); field in BeanHolder 28 public BeanHolder(IBean bean) { in BeanHolder() argument 30 this.bean = bean; in BeanHolder() 34 return bean; in getBean() 37 public void setBean(IBean bean) { in setBean() argument 38 this.bean = bean; in setBean() 44 builder.append(this.bean); in toString()
|
/external/snakeyaml/src/test/java/org/yaml/snakeyaml/issues/issue49/ |
D | CalendarTest.java | 32 CalendarBean bean = new CalendarBean(); in testDumpDstIgnored() local 33 bean.setName("lunch"); in testDumpDstIgnored() 37 bean.setCalendar(cal); in testDumpDstIgnored() 39 String output = yaml.dumpAsMap(bean); in testDumpDstIgnored() 45 assertEquals(bean.getCalendar(), parsed.getCalendar()); in testDumpDstIgnored() 82 CalendarBean bean = new CalendarBean(); in check() local 83 bean.setName("lunch"); in check() 87 bean.setCalendar(cal); in check() 89 String output = yaml.dumpAsMap(bean); in check() 95 assertFalse("TimeZone must deviate.", bean.getCalendar().equals(parsed.getCalendar())); in check() [all …]
|
/external/snakeyaml/src/test/java/org/yaml/snakeyaml/representer/ |
D | FilterPropertyToDumpTest.java | 31 BeanToRemoveProperty bean = new BeanToRemoveProperty(); in testFilterPropertyInJavaBeanDumper() local 32 bean.setNumber(24); in testFilterPropertyInJavaBeanDumper() 33 bean.setId("ID124"); in testFilterPropertyInJavaBeanDumper() 35 String dump = d.dumpAsMap(bean); in testFilterPropertyInJavaBeanDumper() 41 BeanToRemoveProperty bean = new BeanToRemoveProperty(); in testFilterPropertyInYaml() local 42 bean.setNumber(25); in testFilterPropertyInYaml() 43 bean.setId("ID125"); in testFilterPropertyInYaml() 45 String dump = yaml.dumpAsMap(bean); in testFilterPropertyInYaml() 51 BeanToRemoveProperty bean = new BeanToRemoveProperty(); in testDoNotFilterPropertyIncludeReadOnly() local 52 bean.setNumber(26); in testDoNotFilterPropertyIncludeReadOnly() [all …]
|
D | RepresenterTest.java | 27 MyBean bean = new MyBean(); in testRepresenter() local 28 bean.setName("Gnome"); in testRepresenter() 29 bean.setValid(true); in testRepresenter() 30 bean.setPrimitive(true); in testRepresenter() 34 yaml.dump(bean)); in testRepresenter() 68 MyBean2 bean = new MyBean2("Gnome", true); in testRepresenterNoConstructorAvailable() local 73 yaml.dump(bean)); in testRepresenterNoConstructorAvailable() 105 MyBean3 bean = new MyBean3("Gnome", false); in testRepresenterGetterWithException() local 110 String str = yaml.dump(bean); in testRepresenterGetterWithException() 169 EmptyBean bean = new EmptyBean(); in testRepresenterEmptyBean() local [all …]
|
/external/snakeyaml/src/test/java/examples/staticstate/ |
D | StaticFieldsWrapperTest.java | 35 JavaBeanWithStaticState bean = new JavaBeanWithStaticState(); in testWrapper() local 36 bean.setName("Bahrack"); in testWrapper() 37 bean.setAge(-47); in testWrapper() 41 String output = yaml.dump(new Wrapper(bean)); in testWrapper() 57 JavaBeanWithStaticState bean = new JavaBeanWithStaticState(); in testLocalTag() local 58 bean.setName("Bahrack"); in testLocalTag() 59 bean.setAge(-47); in testLocalTag() 65 String output = yaml.dump(new Wrapper(bean)); in testLocalTag() 83 JavaBeanWithStaticState bean = new JavaBeanWithStaticState(); in testRootBean() local 84 bean.setName("Bahrack"); in testRootBean() [all …]
|
/external/jackson-databind/src/main/java/com/fasterxml/jackson/databind/exc/ |
D | InvalidDefinitionException.java | 45 BeanDescription bean, BeanPropertyDefinition prop) { in InvalidDefinitionException() argument 47 _type = (bean == null) ? null : bean.getType(); in InvalidDefinitionException() 48 _beanDesc = bean; in InvalidDefinitionException() 53 BeanDescription bean, BeanPropertyDefinition prop) { in InvalidDefinitionException() argument 55 _type = (bean == null) ? null : bean.getType(); in InvalidDefinitionException() 56 _beanDesc = bean; in InvalidDefinitionException() 61 BeanDescription bean, BeanPropertyDefinition prop) { in from() argument 62 return new InvalidDefinitionException(p, msg, bean, prop); in from() 71 BeanDescription bean, BeanPropertyDefinition prop) { in from() argument 72 return new InvalidDefinitionException(g, msg, bean, prop); in from()
|
/external/jackson-databind/src/test/java/com/fasterxml/jackson/databind/deser/jdk/ |
D | JDKScalarsTest.java | 506 WrappersBean bean = MAPPER.readValue("{\"booleanValue\":\"\"}", WrappersBean.class); in testEmptyStringForBooleanWrapper() local 507 assertNull(bean.booleanValue); in testEmptyStringForBooleanWrapper() 512 WrappersBean bean = MAPPER.readValue("{\"byteValue\":\"\"}", WrappersBean.class); in testEmptyStringForIntegerWrappers() local 513 assertNull(bean.byteValue); in testEmptyStringForIntegerWrappers() 516 bean = MAPPER.readValue("{\"charValue\":\"\"}", WrappersBean.class); in testEmptyStringForIntegerWrappers() 517 assertNull(bean.charValue); in testEmptyStringForIntegerWrappers() 519 bean = MAPPER.readValue("{\"shortValue\":\"\"}", WrappersBean.class); in testEmptyStringForIntegerWrappers() 520 assertNull(bean.shortValue); in testEmptyStringForIntegerWrappers() 521 bean = MAPPER.readValue("{\"intValue\":\"\"}", WrappersBean.class); in testEmptyStringForIntegerWrappers() 522 assertNull(bean.intValue); in testEmptyStringForIntegerWrappers() [all …]
|
/external/jackson-databind/src/test/java/com/fasterxml/jackson/databind/ |
D | TestRootName.java | 36 Bean bean = mapper.readValue(json, Bean.class); in testRootViaMapper() local 37 assertNotNull(bean); in testRootViaMapper() 126 Bean bean = mapper.readerFor(Bean.class).readValue(json); in testRootViaWriterAndReader() local 127 assertNotNull(bean); in testRootViaWriterAndReader() 167 Bean bean = reader.readValue(json); in testRootUsingExplicitConfig() local 168 assertNotNull(bean); in testRootUsingExplicitConfig() 181 bean = wrapping.readerFor(Bean.class).withRootName("").readValue(json); in testRootUsingExplicitConfig() 182 assertNotNull(bean); in testRootUsingExplicitConfig() 183 assertEquals(3, bean.a); in testRootUsingExplicitConfig() 185 bean = wrapping.readerFor(Bean.class).withoutRootName().readValue("{\"a\":4}"); in testRootUsingExplicitConfig() [all …]
|
/external/jackson-databind/src/test/java/com/fasterxml/jackson/databind/struct/ |
D | TestUnwrapped.java | 171 Unwrapping bean = MAPPER.readValue("{\"name\":\"Tatu\",\"y\":7,\"x\":-13}", in testSimpleUnwrappedDeserialize() local 173 assertEquals("Tatu", bean.name); in testSimpleUnwrappedDeserialize() 174 Location loc = bean.location; in testSimpleUnwrappedDeserialize() 182 …TwoUnwrappedProperties bean = MAPPER.readValue("{\"first\":\"Joe\",\"y\":7,\"last\":\"Smith\",\"x\… in testDoubleUnwrapping() local 184 Location loc = bean.location; in testDoubleUnwrapping() 188 Name name = bean.name; in testDoubleUnwrapping() 196 DeepUnwrapping bean = MAPPER.readValue("{\"x\":3,\"name\":\"Bob\",\"y\":27}", in testDeepUnwrapping() local 198 Unwrapping uw = bean.unwrapped; in testDeepUnwrapping() 209 UnwrappingWithCreator bean = MAPPER.readValue("{\"x\":1,\"y\":2,\"name\":\"Tatu\"}", in testUnwrappedDeserializeWithCreator() local 211 assertEquals("Tatu", bean.name); in testUnwrappedDeserializeWithCreator() [all …]
|
/external/jackson-databind/src/test/java/com/fasterxml/jackson/databind/deser/builder/ |
D | BuilderInfiniteLoop1978Test.java | 29 Bean bean = new Bean(id); in build() local 30 bean.setThing( temp ); in build() 31 return bean; in build() 67 SubBean bean = new SubBean(); in build() local 68 bean.element1 = element1; in build() 69 bean.element2 = element2; in build() 70 return bean; in build() 92 Bean bean = mapper.readValue( json, Bean.class ); in testInfiniteLoop1978() local 93 assertNotNull(bean); in testInfiniteLoop1978()
|