Skip to content

Commit

Permalink
Modify #792 test, to be solved via #813
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jun 2, 2015
1 parent 47a8d25 commit 06cc8ef
Showing 1 changed file with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.fasterxml.jackson.databind.introspect;
package com.fasterxml.jackson.failing;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
Expand All @@ -7,7 +7,7 @@
import com.fasterxml.jackson.databind.introspect.AnnotatedParameter;
import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector;

public class ImplicitNameMatchTest extends BaseMapTest
public class ImplicitNameMatch792Test extends BaseMapTest
{
// Simple introspector that gives generated "ctorN" names for constructor
// parameters
Expand Down Expand Up @@ -49,13 +49,27 @@ static class Bean2

public int getValue() { return x; }
}

static class ReadWriteBean
{
private int value;

private ReadWriteBean(@JsonProperty(value="value",
access=JsonProperty.Access.READ_WRITE) int v) {
value = v;
}

public int testValue() { return value; }
}

/*
/**********************************************************
/* Test methods
/**********************************************************
*/

private final ObjectMapper MAPPER = objectMapper();

public void testBindingOfImplicitCreatorNames() throws Exception
{
ObjectMapper m = new ObjectMapper();
Expand All @@ -66,8 +80,13 @@ public void testBindingOfImplicitCreatorNames() throws Exception

public void testImplicitWithSetterGetter() throws Exception
{
ObjectMapper m = new ObjectMapper();
String json = m.writeValueAsString(new Bean2());
String json = MAPPER.writeValueAsString(new Bean2());
assertEquals(aposToQuotes("{'stuff':3}"), json);
}

public void testReadWriteWithPrivateField() throws Exception
{
String json = MAPPER.writeValueAsString(new ReadWriteBean(3));
assertEquals("{\"value\":3}", json);
}
}

0 comments on commit 06cc8ef

Please sign in to comment.