Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ val buildSettings = Seq[Setting[_]](
Test / compile := ((Test / compile) dependsOn (Test / jcheckStyle)).value
)

val junitInterface = "com.github.sbt" % "junit-interface" % "0.13.3" % "test"
val junitJupiter = "org.junit.jupiter" % "junit-jupiter" % "5.11.4" % "test"
val junitVintage = "org.junit.vintage" % "junit-vintage-engine" % "5.11.4" % "test"

// Project settings
lazy val root = Project(id = "msgpack-java", base = file("."))
Expand Down Expand Up @@ -83,7 +84,8 @@ lazy val msgpackCore = Project(id = "msgpack-core", base = file("msgpack-core"))
Test / fork := true,
libraryDependencies ++= Seq(
// msgpack-core should have no external dependencies
junitInterface,
junitJupiter,
junitVintage,
"org.wvlet.airframe" %% "airframe-json" % AIRFRAME_VERSION % "test",
"org.wvlet.airframe" %% "airspec" % AIRFRAME_VERSION % "test",
// Add property testing support with forAll methods
Expand All @@ -110,7 +112,8 @@ lazy val msgpackJackson =
),
libraryDependencies ++= Seq(
"com.fasterxml.jackson.core" % "jackson-databind" % "2.18.2",
junitInterface,
junitJupiter,
junitVintage,
"org.apache.commons" % "commons-math3" % "3.6.1" % "test"
),
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
import java.util.Map;
import java.util.Set;
import java.util.LinkedHashMap;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class MessagePackDataformatForFieldIdTest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
package org.msgpack.jackson.dataformat;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.nio.charset.Charset;

import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.containsString;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.hamcrest.MatcherAssert.assertThat;

public class MessagePackDataformatForPojoTest
extends MessagePackDataformatTestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.fasterxml.jackson.databind.AnnotationIntrospector;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.msgpack.core.MessagePack;

import java.io.IOException;
Expand All @@ -35,8 +35,8 @@
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.hamcrest.MatcherAssert.assertThat;

public class MessagePackFactoryTest
extends MessagePackDataformatTestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.module.SimpleModule;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.msgpack.core.ExtensionTypeHeader;
import org.msgpack.core.MessagePack;
import org.msgpack.core.MessageUnpacker;
Expand Down Expand Up @@ -53,13 +53,14 @@
import java.util.concurrent.TimeUnit;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.hamcrest.MatcherAssert.assertThat;

public class MessagePackGeneratorTest
extends MessagePackDataformatTestBase
Expand Down Expand Up @@ -349,7 +350,7 @@ public void testBigDecimal()
}
}

@Test(expected = IOException.class)
@Test
public void testEnableFeatureAutoCloseTarget()
throws IOException
{
Expand All @@ -358,7 +359,9 @@ public void testEnableFeatureAutoCloseTarget()
ObjectMapper objectMapper = new ObjectMapper(messagePackFactory);
List<Integer> integers = Arrays.asList(1);
objectMapper.writeValue(out, integers);
objectMapper.writeValue(out, integers);
assertThrows(IOException.class, () -> {
objectMapper.writeValue(out, integers);
});
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
package org.msgpack.jackson.dataformat;

import com.fasterxml.jackson.core.JsonProcessingException;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;

public class MessagePackMapperTest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.module.SimpleModule;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.msgpack.core.MessagePack;
import org.msgpack.core.MessagePacker;
import org.msgpack.value.ExtensionValue;
Expand All @@ -52,10 +52,11 @@

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assertions.assertThrows;

public class MessagePackParserTest
extends MessagePackDataformatTestBase
Expand Down Expand Up @@ -450,7 +451,7 @@ public void setup(File f)
return tempFile;
}

@Test(expected = IOException.class)
@Test
public void testEnableFeatureAutoCloseSource()
throws Exception
{
Expand All @@ -459,7 +460,9 @@ public void testEnableFeatureAutoCloseSource()
FileInputStream in = new FileInputStream(tempFile);
ObjectMapper objectMapper = new ObjectMapper(factory);
objectMapper.readValue(in, new TypeReference<List<Integer>>() {});
objectMapper.readValue(in, new TypeReference<List<Integer>>() {});
assertThrows(IOException.class, () -> {
objectMapper.readValue(in, new TypeReference<List<Integer>>() {});
});
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package org.msgpack.jackson.dataformat;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.msgpack.core.MessagePack;
import org.msgpack.core.MessagePacker;
import org.msgpack.core.MessageUnpacker;
Expand All @@ -26,7 +26,7 @@
import java.io.IOException;
import java.time.Instant;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class TimestampExtensionModuleTest
{
Expand All @@ -46,7 +46,7 @@ private static class TripleInstants
public Instant c;
}

@Before
@BeforeEach
public void setUp()
throws Exception
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.msgpack.jackson.dataformat.MessagePackFactory;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.msgpack.jackson.dataformat.MessagePackFactory;
import static org.msgpack.jackson.dataformat.MessagePackDataformatTestBase.NormalPojo;
import static org.msgpack.jackson.dataformat.MessagePackDataformatTestBase.Suit;
Expand Down
Loading