Upgrade to Jackson 2.3.3
fixes the long value bug as well...
This commit is contained in:
parent
34302a7cc5
commit
2076194d8f
8
pom.xml
8
pom.xml
|
@ -223,28 +223,28 @@
|
|||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<version>2.3.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||
<artifactId>jackson-dataformat-smile</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<version>2.3.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||
<artifactId>jackson-dataformat-yaml</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<version>2.3.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||
<artifactId>jackson-dataformat-cbor</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<version>2.3.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
|
|
@ -42,26 +42,6 @@ import static org.hamcrest.Matchers.nullValue;
|
|||
*/
|
||||
public class JsonVsCborTests extends ElasticsearchTestCase {
|
||||
|
||||
@Test
|
||||
public void testBugInJacksonCBOR() throws Exception {
|
||||
JsonFactory factory = new CBORFactory();
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
JsonGenerator generator = factory.createGenerator(out);
|
||||
generator.writeStartObject();
|
||||
generator.writeFieldName("field");
|
||||
generator.writeNumber(-1000000000001L);
|
||||
generator.writeEndObject();
|
||||
generator.close();
|
||||
|
||||
JsonParser parser = factory.createParser(out.toByteArray());
|
||||
parser.nextToken();
|
||||
parser.nextToken();
|
||||
parser.nextToken();
|
||||
// this is the bug, if it gets fixed when upgrading to a new Jackson version
|
||||
// we should re-enable using CBOR in our randomized testing (ElasticsearchTestCase#randomXContentType)
|
||||
assertThat(parser.getLongValue(), equalTo(0L));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void compareParsingTokens() throws IOException {
|
||||
BytesStreamOutput xsonOs = new BytesStreamOutput();
|
||||
|
|
|
@ -168,12 +168,7 @@ public abstract class ElasticsearchTestCase extends AbstractRandomizedTest {
|
|||
}
|
||||
|
||||
private static XContentType randomXContentType() {
|
||||
XContentType type = randomFrom(XContentType.values());
|
||||
// for now, CBOR is disabled, see JsonVsCborTests#testBugInJacksonCBOR
|
||||
if (type == XContentType.CBOR) {
|
||||
return XContentType.JSON;
|
||||
}
|
||||
return type;
|
||||
return randomFrom(XContentType.values());
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
|
|
Loading…
Reference in New Issue