Skip to content

Commit 645abde

Browse files
committed
Revert MessagePackFormatFactory -> MessagePackFactory
1 parent d9dfb06 commit 645abde

File tree

8 files changed

+30
-31
lines changed

8 files changed

+30
-31
lines changed

msgpack-jackson/src/main/java/org/msgpack/jackson/dataformat/MessagePackFormatFactory.java renamed to msgpack-jackson/src/main/java/org/msgpack/jackson/dataformat/MessagePackFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import java.io.Writer;
3131
import java.util.Arrays;
3232

33-
public class MessagePackFormatFactory
33+
public class MessagePackFactory
3434
extends JsonFactory
3535
{
3636
private static final long serialVersionUID = 2578263992015504347L;

msgpack-jackson/src/test/java/org/msgpack/jackson/dataformat/ExampleOfTypeInformationSerDe.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public void test()
151151
objectContainer.getObjects().put("pi", pi);
152152
}
153153

154-
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
154+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
155155
byte[] bytes = objectMapper.writeValueAsBytes(objectContainer);
156156
ObjectContainer restored = objectMapper.readValue(bytes, ObjectContainer.class);
157157

msgpack-jackson/src/test/java/org/msgpack/jackson/dataformat/MessagePackDataformatTestBase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
public class MessagePackDataformatTestBase
3737
{
38-
protected MessagePackFormatFactory factory;
38+
protected MessagePackFactory factory;
3939
protected ByteArrayOutputStream out;
4040
protected ByteArrayInputStream in;
4141
protected ObjectMapper objectMapper;
@@ -47,7 +47,7 @@ public class MessagePackDataformatTestBase
4747
@Before
4848
public void setup()
4949
{
50-
factory = new MessagePackFormatFactory();
50+
factory = new MessagePackFactory();
5151
objectMapper = new ObjectMapper(factory);
5252
out = new ByteArrayOutputStream();
5353
in = new ByteArrayInputStream(new byte[4096]);

msgpack-jackson/src/test/java/org/msgpack/jackson/dataformat/MessagePackFormatFactoryTest.java renamed to msgpack-jackson/src/test/java/org/msgpack/jackson/dataformat/MessagePackFactoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import static org.junit.Assert.assertEquals;
2626

27-
public class MessagePackFormatFactoryTest
27+
public class MessagePackFactoryTest
2828
extends MessagePackDataformatTestBase
2929
{
3030
@Test

msgpack-jackson/src/test/java/org/msgpack/jackson/dataformat/MessagePackGeneratorTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ else if (key.equals("num")) {
236236
public void testMessagePackGeneratorDirectly()
237237
throws Exception
238238
{
239-
MessagePackFormatFactory messagePackFactory = new MessagePackFormatFactory();
239+
MessagePackFactory messagePackFactory = new MessagePackFactory();
240240
File tempFile = createTempFile();
241241

242242
JsonGenerator generator = messagePackFactory.createGenerator(tempFile, JsonEncoding.UTF8);
@@ -263,7 +263,7 @@ public void testMessagePackGeneratorDirectly()
263263
public void testWritePrimitives()
264264
throws Exception
265265
{
266-
MessagePackFormatFactory messagePackFactory = new MessagePackFormatFactory();
266+
MessagePackFactory messagePackFactory = new MessagePackFactory();
267267
File tempFile = createTempFile();
268268

269269
JsonGenerator generator = messagePackFactory.createGenerator(tempFile, JsonEncoding.UTF8);
@@ -286,7 +286,7 @@ public void testWritePrimitives()
286286
public void testBigDecimal()
287287
throws IOException
288288
{
289-
ObjectMapper mapper = new ObjectMapper(new MessagePackFormatFactory());
289+
ObjectMapper mapper = new ObjectMapper(new MessagePackFactory());
290290

291291
{
292292
double d0 = 1.23456789;
@@ -334,7 +334,7 @@ public void testEnableFeatureAutoCloseTarget()
334334
throws IOException
335335
{
336336
OutputStream out = createTempFileOutputStream();
337-
MessagePackFormatFactory messagePackFactory = new MessagePackFormatFactory();
337+
MessagePackFactory messagePackFactory = new MessagePackFactory();
338338
ObjectMapper objectMapper = new ObjectMapper(messagePackFactory);
339339
List<Integer> integers = Arrays.asList(1);
340340
objectMapper.writeValue(out, integers);
@@ -347,7 +347,7 @@ public void testDisableFeatureAutoCloseTarget()
347347
{
348348
File tempFile = createTempFile();
349349
OutputStream out = new FileOutputStream(tempFile);
350-
MessagePackFormatFactory messagePackFactory = new MessagePackFormatFactory();
350+
MessagePackFactory messagePackFactory = new MessagePackFactory();
351351
ObjectMapper objectMapper = new ObjectMapper(messagePackFactory);
352352
objectMapper.configure(JsonGenerator.Feature.AUTO_CLOSE_TARGET, false);
353353
List<Integer> integers = Arrays.asList(1);
@@ -369,7 +369,7 @@ public void testWritePrimitiveObjectViaObjectMapper()
369369
File tempFile = createTempFile();
370370
OutputStream out = new FileOutputStream(tempFile);
371371

372-
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
372+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
373373
objectMapper.configure(JsonGenerator.Feature.AUTO_CLOSE_TARGET, false);
374374
objectMapper.writeValue(out, 1);
375375
objectMapper.writeValue(out, "two");
@@ -393,7 +393,7 @@ public void testInMultiThreads()
393393
int threadCount = 8;
394394
final int loopCount = 4000;
395395
ExecutorService executorService = Executors.newFixedThreadPool(threadCount);
396-
final ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
396+
final ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
397397
objectMapper.configure(JsonGenerator.Feature.AUTO_CLOSE_TARGET, false);
398398
final List<ByteArrayOutputStream> buffers = new ArrayList<ByteArrayOutputStream>(threadCount);
399399
List<Future<Exception>> results = new ArrayList<Future<Exception>>();

msgpack-jackson/src/test/java/org/msgpack/jackson/dataformat/MessagePackParserTest.java

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import org.junit.Test;
2828
import org.msgpack.core.MessagePack;
2929
import org.msgpack.core.MessagePacker;
30-
import org.msgpack.core.buffer.OutputStreamBufferOutput;
3130

3231
import java.io.ByteArrayOutputStream;
3332
import java.io.File;
@@ -288,7 +287,7 @@ else if (k.equals("child_map_age")) {
288287
public void testMessagePackParserDirectly()
289288
throws IOException
290289
{
291-
MessagePackFormatFactory factory = new MessagePackFormatFactory();
290+
MessagePackFactory factory = new MessagePackFactory();
292291
File tempFile = File.createTempFile("msgpackTest", "msgpack");
293292
tempFile.deleteOnExit();
294293

@@ -354,7 +353,7 @@ public void testMessagePackParserDirectly()
354353
public void testReadPrimitives()
355354
throws Exception
356355
{
357-
MessagePackFormatFactory factory = new MessagePackFormatFactory();
356+
MessagePackFactory factory = new MessagePackFactory();
358357
File tempFile = createTempFile();
359358

360359
FileOutputStream out = new FileOutputStream(tempFile);
@@ -396,7 +395,7 @@ public void testBigDecimal()
396395
packer.packDouble(Double.MIN_NORMAL);
397396
packer.flush();
398397

399-
ObjectMapper mapper = new ObjectMapper(new MessagePackFormatFactory());
398+
ObjectMapper mapper = new ObjectMapper(new MessagePackFactory());
400399
mapper.configure(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS, true);
401400
List<Object> objects = mapper.readValue(out.toByteArray(), new TypeReference<List<Object>>() {});
402401
assertEquals(5, objects.size());
@@ -431,7 +430,7 @@ public void testEnableFeatureAutoCloseSource()
431430
throws Exception
432431
{
433432
File tempFile = createTestFile();
434-
MessagePackFormatFactory factory = new MessagePackFormatFactory();
433+
MessagePackFactory factory = new MessagePackFactory();
435434
FileInputStream in = new FileInputStream(tempFile);
436435
ObjectMapper objectMapper = new ObjectMapper(factory);
437436
objectMapper.readValue(in, new TypeReference<List<Integer>>() {});
@@ -444,7 +443,7 @@ public void testDisableFeatureAutoCloseSource()
444443
{
445444
File tempFile = createTestFile();
446445
FileInputStream in = new FileInputStream(tempFile);
447-
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
446+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
448447
objectMapper.configure(JsonParser.Feature.AUTO_CLOSE_SOURCE, false);
449448
objectMapper.readValue(in, new TypeReference<List<Integer>>() {});
450449
objectMapper.readValue(in, new TypeReference<List<Integer>>() {});
@@ -456,7 +455,7 @@ public void testParseBigDecimal()
456455
{
457456
ArrayList<BigDecimal> list = new ArrayList<BigDecimal>();
458457
list.add(new BigDecimal(Long.MAX_VALUE));
459-
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
458+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
460459
byte[] bytes = objectMapper.writeValueAsBytes(list);
461460

462461
ArrayList<BigDecimal> result = objectMapper.readValue(
@@ -481,7 +480,7 @@ public void testReadPrimitiveObjectViaObjectMapper()
481480
packer.close();
482481

483482
FileInputStream in = new FileInputStream(tempFile);
484-
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
483+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
485484
objectMapper.configure(JsonParser.Feature.AUTO_CLOSE_SOURCE, false);
486485
assertEquals("foo", objectMapper.readValue(in, new TypeReference<String>() {}));
487486
long l = objectMapper.readValue(in, new TypeReference<Long>() {});
@@ -511,7 +510,7 @@ public void testBinaryKey()
511510
packer.packLong(42);
512511
packer.close();
513512

514-
ObjectMapper mapper = new ObjectMapper(new MessagePackFormatFactory());
513+
ObjectMapper mapper = new ObjectMapper(new MessagePackFactory());
515514
Map<String, Object> object = mapper.readValue(new FileInputStream(tempFile), new TypeReference<Map<String, Object>>() {});
516515
assertEquals(2, object.size());
517516
assertEquals(3.14, object.get("foo"));
@@ -533,7 +532,7 @@ public void testBinaryKeyInNestedObject()
533532
packer.packInt(1);
534533
packer.close();
535534

536-
ObjectMapper mapper = new ObjectMapper(new MessagePackFormatFactory());
535+
ObjectMapper mapper = new ObjectMapper(new MessagePackFactory());
537536
List<Object> objects = mapper.readValue(out.toByteArray(), new TypeReference<List<Object>>() {});
538537
assertEquals(2, objects.size());
539538
@SuppressWarnings(value = "unchecked")
@@ -555,7 +554,7 @@ public void testByteArrayKey()
555554
messagePacker.packBinaryHeader(1).writePayload(k1).packInt(3);
556555
messagePacker.close();
557556

558-
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
557+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
559558
SimpleModule module = new SimpleModule();
560559
module.addKeyDeserializer(byte[].class, new KeyDeserializer()
561560
{
@@ -592,7 +591,7 @@ public void testIntegerKey()
592591
}
593592
messagePacker.close();
594593

595-
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
594+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
596595
SimpleModule module = new SimpleModule();
597596
module.addKeyDeserializer(Integer.class, new KeyDeserializer()
598597
{
@@ -623,7 +622,7 @@ public void testFloatKey()
623622
}
624623
messagePacker.close();
625624

626-
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
625+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
627626
SimpleModule module = new SimpleModule();
628627
module.addKeyDeserializer(Float.class, new KeyDeserializer()
629628
{
@@ -653,7 +652,7 @@ public void testBooleanKey()
653652
messagePacker.packBoolean(false).packInt(3);
654653
messagePacker.close();
655654

656-
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFormatFactory());
655+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
657656
SimpleModule module = new SimpleModule();
658657
module.addKeyDeserializer(Boolean.class, new KeyDeserializer()
659658
{

msgpack-jackson/src/test/java/org/msgpack/jackson/dataformat/benchmark/MessagePackDataformatHugeDataBenchmarkTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import com.fasterxml.jackson.core.type.TypeReference;
2121
import com.fasterxml.jackson.databind.ObjectMapper;
2222
import org.junit.Test;
23-
import org.msgpack.jackson.dataformat.MessagePackFormatFactory;
23+
import org.msgpack.jackson.dataformat.MessagePackFactory;
2424

2525
import java.io.File;
2626
import java.io.FileOutputStream;
@@ -34,7 +34,7 @@ public class MessagePackDataformatHugeDataBenchmarkTest
3434
private static final int COUNT = 6;
3535
private static final int WARMUP_COUNT = 4;
3636
private final ObjectMapper origObjectMapper = new ObjectMapper();
37-
private final ObjectMapper msgpackObjectMapper = new ObjectMapper(new MessagePackFormatFactory());
37+
private final ObjectMapper msgpackObjectMapper = new ObjectMapper(new MessagePackFactory());
3838
private static final List<Object> value;
3939
private static final byte[] packedByOriginal;
4040
private static final byte[] packedByMsgPack;
@@ -61,7 +61,7 @@ public class MessagePackDataformatHugeDataBenchmarkTest
6161
packedByOriginal = bytes;
6262

6363
try {
64-
bytes = new ObjectMapper(new MessagePackFormatFactory()).writeValueAsBytes(value);
64+
bytes = new ObjectMapper(new MessagePackFactory()).writeValueAsBytes(value);
6565
}
6666
catch (JsonProcessingException e) {
6767
e.printStackTrace();

msgpack-jackson/src/test/java/org/msgpack/jackson/dataformat/benchmark/MessagePackDataformatPojoBenchmarkTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.fasterxml.jackson.core.JsonProcessingException;
2020
import com.fasterxml.jackson.databind.ObjectMapper;
2121
import org.junit.Test;
22-
import org.msgpack.jackson.dataformat.MessagePackFormatFactory;
22+
import org.msgpack.jackson.dataformat.MessagePackFactory;
2323
import static org.msgpack.jackson.dataformat.MessagePackDataformatTestBase.NormalPojo;
2424
import static org.msgpack.jackson.dataformat.MessagePackDataformatTestBase.Suit;
2525

@@ -41,7 +41,7 @@ public class MessagePackDataformatPojoBenchmarkTest
4141
private final List<byte[]> pojosSerWithOrig = new ArrayList<byte[]>(LOOP_MAX);
4242
private final List<byte[]> pojosSerWithMsgPack = new ArrayList<byte[]>(LOOP_MAX);
4343
private final ObjectMapper origObjectMapper = new ObjectMapper();
44-
private final ObjectMapper msgpackObjectMapper = new ObjectMapper(new MessagePackFormatFactory());
44+
private final ObjectMapper msgpackObjectMapper = new ObjectMapper(new MessagePackFactory());
4545

4646
public MessagePackDataformatPojoBenchmarkTest()
4747
{

0 commit comments

Comments
 (0)