update jackson to 2.6.1

This commit is contained in:
Xavier Léauté 2015-08-25 13:27:12 -07:00
parent ac4a856a17
commit 51f6a9a2c9
4 changed files with 6 additions and 22 deletions

View File

@ -30,7 +30,6 @@ import io.druid.timeline.partition.NoneShardSpec;
import io.druid.timeline.partition.ShardSpec;
import org.joda.time.Interval;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.IOException;
@ -40,7 +39,7 @@ import java.util.Map;
public class HadoopConverterTaskSerDeTest
{
private static ObjectMapper objectMapper;
private static ObjectMapper objectMapper = new DefaultObjectMapper();
private static final String TASK_ID = "task id";
private static final String DATA_SOURCE = "datasource";
private static final Interval INTERVAL = Interval.parse("2010/2011");
@ -69,17 +68,6 @@ public class HadoopConverterTaskSerDeTest
private static final String OUTPUT_PATH = "/dev/null";
private static final String CLASSPATH_PREFIX = "something:where:I:need:stuff";
@BeforeClass
public static void setUpStatic()
{
objectMapper = new DefaultObjectMapper();
objectMapper.registerSubtypes(
HadoopConverterTask.class,
HadoopConverterTask.ConverterSubTask.class,
ShardSpec.class
);
}
@Test
public void testSimpleConverterTaskSerDe() throws IOException
{

View File

@ -70,7 +70,7 @@
<jetty.version>9.2.13.v20150730</jetty.version>
<jersey.version>1.19</jersey.version>
<druid.api.version>0.3.11</druid.api.version>
<jackson.version>2.4.4</jackson.version>
<jackson.version>2.6.1</jackson.version>
<log4j.version>2.2</log4j.version>
<slf4j.version>1.7.10</slf4j.version>
<hadoop.compile.version>2.3.0</hadoop.compile.version>

View File

@ -21,6 +21,7 @@ import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.KeyDeserializer;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.module.SimpleModule;
@ -39,6 +40,7 @@ import java.io.IOException;
*/
class JodaStuff
{
@SuppressWarnings("unchecked")
static SimpleModule register(SimpleModule module)
{
module.addKeyDeserializer(DateTime.class, new DateTimeKeyDeserializer());
@ -46,7 +48,8 @@ class JodaStuff
module.addSerializer(DateTime.class, ToStringSerializer.instance);
module.addDeserializer(Interval.class, new JodaStuff.IntervalDeserializer());
module.addSerializer(Interval.class, ToStringSerializer.instance);
module.addDeserializer(Period.class, new PeriodDeserializer());
JsonDeserializer<?> periodDeserializer = new PeriodDeserializer(true);
module.addDeserializer(Period.class, (JsonDeserializer<Period>) periodDeserializer);
module.addSerializer(Period.class, ToStringSerializer.instance);
module.addDeserializer(Duration.class, new DurationDeserializer());
module.addSerializer(Duration.class, ToStringSerializer.instance);

View File

@ -33,7 +33,6 @@ import io.druid.jackson.DefaultObjectMapper;
import io.druid.query.extraction.LookupExtractionFn;
import io.druid.query.extraction.MapLookupExtractor;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
@ -81,12 +80,6 @@ public class LookupExtractionFnTest
this.injective = injective;
}
@BeforeClass
public static void setUpStatic()
{
OBJECT_MAPPER.registerSubtypes(LookupExtractionFn.class);
}
@Test
public void testSimpleSerDe() throws IOException
{