Skip to content

Commit 0773bde

Browse files
committed
Merge branch '2.19'
2 parents 0478375 + 5bb7171 commit 0773bde

File tree

149 files changed

+1014
-423
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+1014
-423
lines changed

src/test/java/tools/jackson/dataformat/xml/FeatureDefaultsTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
package tools.jackson.dataformat.xml;
22

3+
import org.junit.jupiter.api.Test;
4+
35
import tools.jackson.databind.ObjectReader;
46
import tools.jackson.databind.ObjectWriter;
57

6-
public class FeatureDefaultsTest extends XmlTestBase
8+
import static org.junit.jupiter.api.Assertions.assertNotSame;
9+
10+
public class FeatureDefaultsTest extends XmlTestUtil
711
{
812
private final XmlMapper MAPPER = newMapper();
913

14+
@Test
1015
public void testDeserDefaults() throws Exception
1116
{
1217
ObjectReader r = MAPPER.reader();
1318
assertNotSame(r, r.with(XmlReadFeature.EMPTY_ELEMENT_AS_NULL));
1419
}
1520

21+
@Test
1622
public void testSerDefaults() throws Exception
1723
{
1824
ObjectWriter w = MAPPER.writer();

src/test/java/tools/jackson/dataformat/xml/JDKSerializationForXMLMapperTest.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
package tools.jackson.dataformat.xml;
22

3-
import java.io.ByteArrayInputStream;
4-
import java.io.ByteArrayOutputStream;
5-
import java.io.ObjectInputStream;
6-
import java.io.ObjectOutputStream;
3+
import java.io.*;
74

8-
public class JDKSerializationForXMLMapperTest extends XmlTestBase
5+
import org.junit.jupiter.api.Test;
6+
7+
import static org.junit.jupiter.api.Assertions.assertEquals;
8+
9+
public class JDKSerializationForXMLMapperTest extends XmlTestUtil
910
{
11+
@Test
1012
public void testMapperSerialization() throws Exception
1113
{
1214
XmlMapper mapper1 = new XmlMapper(XmlFactory.builder()

src/test/java/tools/jackson/dataformat/xml/MapperCopyTest.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,23 @@
22

33
import java.io.*;
44

5+
import org.junit.jupiter.api.Test;
6+
57
import com.fasterxml.jackson.annotation.JsonRootName;
68

79
import tools.jackson.databind.*;
810

9-
public class MapperCopyTest extends XmlTestBase
11+
import static org.junit.jupiter.api.Assertions.*;
12+
13+
public class MapperCopyTest extends XmlTestUtil
1014
{
1115
@JsonRootName("AnnotatedName")
1216
static class Pojo282
1317
{
1418
public int a = 3;
1519
}
1620

21+
@Test
1722
public void testMapperCopy()
1823
{
1924
XmlMapper mapper1 = mapperBuilder()
@@ -41,12 +46,13 @@ public void testMapperCopy()
4146
SerializationConfig sc2 = mapper2.serializationConfig();
4247
assertNotSame(sc1, sc2);
4348
assertEquals(
44-
"serialization features did not get copied",
4549
sc1.getSerializationFeatures(),
46-
sc2.getSerializationFeatures()
50+
sc2.getSerializationFeatures(),
51+
"serialization features did not get copied"
4752
);
4853
}
4954

55+
@Test
5056
public void testMapperSerialization() throws Exception
5157
{
5258
XmlMapper mapper1 = mapperBuilder()
@@ -67,6 +73,7 @@ public void testMapperSerialization() throws Exception
6773
}
6874

6975
// [dataformat-xml#282]
76+
@Test
7077
public void testCopyWith() throws Exception
7178
{
7279
XmlMapper xmlMapper = newMapper();

src/test/java/tools/jackson/dataformat/xml/MediaItem.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package tools.jackson.dataformat.xml;
22

3-
import java.util.*;
3+
import java.util.ArrayList;
4+
import java.util.List;
45

56
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
67

78
@JsonPropertyOrder({"content", "images"})
8-
class MediaItem
9+
public class MediaItem
910
{
1011
public enum Player { JAVA, FLASH; }
1112
public enum Size { SMALL, LARGE; }

src/test/java/tools/jackson/dataformat/xml/RoundtripContentTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
package tools.jackson.dataformat.xml;
22

3+
import org.junit.jupiter.api.Test;
4+
35
import tools.jackson.databind.ObjectReader;
46
import tools.jackson.databind.ObjectWriter;
57

6-
public class RoundtripContentTest extends XmlTestBase
8+
import static org.junit.jupiter.api.Assertions.assertEquals;
9+
import static org.junit.jupiter.api.Assertions.assertNotNull;
10+
11+
public class RoundtripContentTest extends XmlTestUtil
712
{
813
// Let's use globally shared instance for funsies
914
private final XmlMapper MAPPER = XmlMapper.shared();
1015

16+
@Test
1117
public void testRoundtrip() throws Exception
1218
{
1319
MediaItem.Content content = new MediaItem.Content();

src/test/java/tools/jackson/dataformat/xml/VersionInfoTest.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
package tools.jackson.dataformat.xml;
22

3+
import org.junit.jupiter.api.Test;
4+
35
import tools.jackson.core.Version;
46
import tools.jackson.core.Versioned;
57

6-
public class VersionInfoTest extends XmlTestBase
8+
import static org.junit.jupiter.api.Assertions.assertEquals;
9+
import static org.junit.jupiter.api.Assertions.assertFalse;
10+
11+
public class VersionInfoTest extends XmlTestUtil
712
{
13+
@Test
814
public void testMapperVersions()
915
{
1016
assertVersion(new XmlMapper());
@@ -20,7 +26,7 @@ public void testMapperVersions()
2026
private void assertVersion(Versioned vers)
2127
{
2228
final Version v = vers.version();
23-
assertFalse("Should find version information (got "+v+")", v.isUnknownVersion());
29+
assertFalse(v.isUnknownVersion(), "Should find version information (got "+v+")");
2430
Version exp = PackageVersion.VERSION;
2531
assertEquals(exp.toFullString(), v.toFullString());
2632
assertEquals(exp, v);

src/test/java/tools/jackson/dataformat/xml/XmlTestBase.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
public abstract class XmlTestBase
1919
extends TestCase
2020
{
21-
2221
protected static final String DEFAULT_NEW_LINE;
2322

2423
static {

src/test/java/tools/jackson/dataformat/xml/XmlTestUtil.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
88
import tools.jackson.core.*;
99
import tools.jackson.databind.AnnotationIntrospector;
10-
import tools.jackson.databind.type.TypeFactory;
1110
import tools.jackson.dataformat.xml.annotation.JacksonXmlProperty;
1211
import tools.jackson.module.jakarta.xmlbind.JakartaXmlBindAnnotationIntrospector;
1312

14-
import static org.junit.jupiter.api.Assertions.*;
13+
import static org.junit.jupiter.api.Assertions.assertEquals;
14+
import static org.junit.jupiter.api.Assertions.fail;
1515

1616
public abstract class XmlTestUtil
1717
{
@@ -278,7 +278,7 @@ protected String getAndVerifyText(JsonParser jp)
278278
if (str.length() != actLen) {
279279
fail("Internal problem (jp.token == "+jp.currentToken()+"): jp.getText().length() ['"+str+"'] == "+str.length()+"; jp.getTextLength() == "+actLen);
280280
}
281-
assertEquals("String access via getText(), getTextXxx() must be the same", str, str2);
281+
assertEquals(str, str2, "String access via getText(), getTextXxx() must be the same");
282282

283283
return str;
284284
}

src/test/java/tools/jackson/dataformat/xml/adapters/TestIssue47Attribute.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
import org.junit.jupiter.api.Test;
66

7-
import tools.jackson.dataformat.xml.*;
7+
import tools.jackson.dataformat.xml.XmlMapper;
8+
import tools.jackson.dataformat.xml.XmlTestUtil;
89
import tools.jackson.dataformat.xml.annotation.JacksonXmlProperty;
910

10-
import static org.junit.jupiter.api.Assertions.*;
11+
import static org.junit.jupiter.api.Assertions.assertNotNull;
1112

1213
public class TestIssue47Attribute extends XmlTestUtil
1314
{

src/test/java/tools/jackson/dataformat/xml/deser/CaseInsensitiveDeserTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@
1010

1111
import tools.jackson.databind.*;
1212
import tools.jackson.databind.exc.UnrecognizedPropertyException;
13-
import tools.jackson.dataformat.xml.XmlTestBase;
13+
import tools.jackson.dataformat.xml.XmlTestUtil;
1414
import tools.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
1515
import tools.jackson.dataformat.xml.annotation.JacksonXmlProperty;
1616
import tools.jackson.dataformat.xml.annotation.JacksonXmlText;
1717

18+
import static org.junit.jupiter.api.Assertions.*;
19+
1820
// note: Copied from `jackson-databind`; related to [dataformat-xml#273]
19-
public class CaseInsensitiveDeserTest extends XmlTestBase
21+
public class CaseInsensitiveDeserTest extends XmlTestUtil
2022
{
2123
static class BaseResponse {
2224
public int errorCode;
@@ -105,6 +107,7 @@ public void testCaseInsensitiveBasic() throws Exception
105107
}
106108
}
107109

110+
@Test
108111
public void testCreatorWithInsensitive() throws Exception
109112
{
110113
final String DOC = "<root><VALUE>3</VALUE></root>";

0 commit comments

Comments
 (0)