Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New failing test management using Jupiter extension #4696

Merged
merged 10 commits into from
Sep 19, 2024
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.fasterxml.jackson.failing;
package com.fasterxml.jackson.databind.tofix;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.testutil.DatabindTestUtil;
import com.fasterxml.jackson.databind.testutil.failure.JacksonTestFailureExpected;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand All @@ -17,6 +19,7 @@ record MyRecord(String first) { }

private final ObjectMapper mapper = newJsonMapper();

@JacksonTestFailureExpected
@Test
void testDuplicatePropertyDeserialization() throws Exception {
final String json = a2q("{'first':'value','first':'value2'}");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.fasterxml.jackson.databind.failing;
package com.fasterxml.jackson.databind.tofix;

import java.util.Collections;

Expand All @@ -7,6 +7,7 @@
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.records.RecordUpdate3079Test;
import com.fasterxml.jackson.databind.testutil.DatabindTestUtil;
import com.fasterxml.jackson.databind.testutil.failure.JacksonTestFailureExpected;

import static org.junit.jupiter.api.Assertions.*;

Expand All @@ -17,6 +18,7 @@ public class RecordUpdate3079FailingTest extends DatabindTestUtil
private final ObjectMapper MAPPER = newJsonMapper();

// [databind#3079]: Should be able to Record value directly
@JacksonTestFailureExpected
@Test
public void testDirectRecordUpdate() throws Exception
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.fasterxml.jackson.failing;
package com.fasterxml.jackson.databind.tofix;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

import com.fasterxml.jackson.databind.testutil.failure.JacksonTestFailureExpected;
import org.junit.jupiter.api.Test;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
Expand Down Expand Up @@ -43,6 +44,7 @@ public Bean(int a, int b, Map<String,Object> x) {

private final ObjectMapper MAPPER = newJsonMapper();

@JacksonTestFailureExpected
@Test
void anyBeanWithSort() throws Exception
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.fasterxml.jackson.failing;
package com.fasterxml.jackson.databind.tofix;

import com.fasterxml.jackson.databind.testutil.failure.JacksonTestFailureExpected;
import org.junit.jupiter.api.Test;

import com.fasterxml.jackson.annotation.JsonAnySetter;
Expand Down Expand Up @@ -36,6 +37,7 @@ public void any(String key, Object value) { }
private final ObjectMapper MAPPER = newJsonMapper();

// [databind#1401]
@JacksonTestFailureExpected
@Test
void creatorNoSetter() throws Exception
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.fasterxml.jackson.failing;
package com.fasterxml.jackson.databind.tofix;

import java.util.Objects;

import com.fasterxml.jackson.databind.testutil.failure.JacksonTestFailureExpected;
import org.junit.jupiter.api.Test;

import com.fasterxml.jackson.annotation.*;
Expand Down Expand Up @@ -34,6 +35,7 @@ public Inner(@JsonProperty("field") String field) {
}

// [databind#2572]
@JacksonTestFailureExpected
@Test
void emptyForTypeThatCannotBeInstantiated() throws Exception {
ObjectMapper mapper = jsonMapperBuilder()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.fasterxml.jackson.failing;
package com.fasterxml.jackson.databind.tofix;

import java.beans.ConstructorProperties;

import com.fasterxml.jackson.databind.testutil.failure.JacksonTestFailureExpected;
import org.junit.jupiter.api.Test;

import com.fasterxml.jackson.annotation.JsonBackReference;
Expand Down Expand Up @@ -74,6 +75,7 @@ public ChildObject2(String id, String name,
" 'child': { 'id': 'def', 'name':'Bert' }\n" +
"}");

@JacksonTestFailureExpected
@Test
void withParentCreator() throws Exception {
ParentWithCreator result = MAPPER.readValue(PARENT_CHILD_JSON,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.fasterxml.jackson.failing;
package com.fasterxml.jackson.databind.tofix;

import java.beans.ConstructorProperties;

import com.fasterxml.jackson.databind.testutil.failure.JacksonTestFailureExpected;
import org.junit.jupiter.api.Test;

import com.fasterxml.jackson.annotation.JsonBackReference;
Expand Down Expand Up @@ -90,6 +91,7 @@ Content build() {

private final ObjectMapper MAPPER = newJsonMapper();

@JacksonTestFailureExpected
@Test
void buildWithBackRefs2686() throws Exception {
Container container = new Container();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.fasterxml.jackson.failing;
package com.fasterxml.jackson.databind.tofix;

import org.junit.jupiter.api.Test;

Expand All @@ -7,6 +7,7 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.testutil.DatabindTestUtil;
import com.fasterxml.jackson.databind.testutil.failure.JacksonTestFailureExpected;

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

Expand All @@ -33,6 +34,7 @@ public void setValue(int v) {

private final ObjectMapper MAPPER = newJsonMapper();

@JacksonTestFailureExpected
@Test
void creator2438() throws Exception {
// note: by default, duplicate-detection not enabled, so should not
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.fasterxml.jackson.failing;
package com.fasterxml.jackson.databind.tofix;

import java.util.Map;

Expand All @@ -8,6 +8,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.json.JsonMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.testutil.failure.JacksonTestFailureExpected;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
Expand All @@ -16,6 +17,7 @@
public class CustomObjectKeyDeserializer4680Test
{

@JacksonTestFailureExpected
@Test
void testCustomKeyDeserializer()
throws Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.fasterxml.jackson.failing;
package com.fasterxml.jackson.databind.tofix;

import java.util.Collection;
import java.util.Collections;
Expand All @@ -10,6 +10,7 @@
import com.fasterxml.jackson.databind.json.JsonMapper;
import com.fasterxml.jackson.databind.testutil.DatabindTestUtil;
import com.fasterxml.jackson.databind.testutil.NoCheckSubTypeValidator;
import com.fasterxml.jackson.databind.testutil.failure.JacksonTestFailureExpected;

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

Expand All @@ -25,6 +26,7 @@ static class ListWrapper {
public Collection<String> stuff = Collections.emptyList();
}

@JacksonTestFailureExpected
@Test
void collectionWithOverride() throws Exception {
final ObjectMapper mapper = JsonMapper.builder()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.fasterxml.jackson.failing;
package com.fasterxml.jackson.databind.tofix;

import org.junit.jupiter.api.Test;

import com.fasterxml.jackson.annotation.*;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.testutil.DatabindTestUtil;
import com.fasterxml.jackson.databind.testutil.failure.JacksonTestFailureExpected;

import static org.junit.jupiter.api.Assertions.*;

Expand Down Expand Up @@ -41,6 +42,7 @@ public static class SubA2039 extends SubType2039 {
public boolean bool;
}

@JacksonTestFailureExpected
@Test
void externalWithUnwrapped2039() throws Exception {
final ObjectMapper mapper = newJsonMapper();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.fasterxml.jackson.failing;
package com.fasterxml.jackson.databind.tofix;

import org.junit.jupiter.api.Test;

import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.InjectableValues;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.testutil.DatabindTestUtil;
import com.fasterxml.jackson.databind.testutil.failure.JacksonTestFailureExpected;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand Down Expand Up @@ -45,6 +46,7 @@ public Internal2465(String val) {
}

// [databind#2465]
@JacksonTestFailureExpected
@Test
void injectWithCreator() throws Exception {
ObjectMapper mapper = jsonMapperBuilder()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.fasterxml.jackson.failing;
package com.fasterxml.jackson.databind.tofix;

import java.util.Objects;

Expand All @@ -10,6 +10,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.json.JsonMapper;
import com.fasterxml.jackson.databind.testutil.DatabindTestUtil;
import com.fasterxml.jackson.databind.testutil.failure.JacksonTestFailureExpected;

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

Expand Down Expand Up @@ -40,6 +41,7 @@ public String getField2() {
}

// [databind#2678]
@JacksonTestFailureExpected
@Test
void readValueInjectables() throws Exception {
final InjectableValues injectableValues =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.fasterxml.jackson.failing;
package com.fasterxml.jackson.databind.tofix;

import org.junit.jupiter.api.Test;

Expand All @@ -8,6 +8,7 @@

import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.testutil.DatabindTestUtil;
import com.fasterxml.jackson.databind.testutil.failure.JacksonTestFailureExpected;

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

Expand Down Expand Up @@ -49,6 +50,7 @@ public Object findInjectableValue(
}

// [databind#4218]
@JacksonTestFailureExpected
@Test
void injectFail4218() throws Exception
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.fasterxml.jackson.failing;
package com.fasterxml.jackson.databind.tofix;

import java.util.List;

Expand All @@ -9,6 +9,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.exc.MismatchedInputException;
import com.fasterxml.jackson.databind.testutil.DatabindTestUtil;
import com.fasterxml.jackson.databind.testutil.failure.JacksonTestFailureExpected;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
Expand Down Expand Up @@ -206,6 +207,7 @@ public static class Shrimp {
/**
* Fails : Original test
*/
@JacksonTestFailureExpected
@Test
void original() throws Exception {
String json = "{" +
Expand Down Expand Up @@ -238,6 +240,7 @@ void original() throws Exception {
/**
* Fails : Lean version that fails and Without getters and setters
*/
@JacksonTestFailureExpected
@Test
void leanWithoutGetterAndSetters() throws Exception {
String json = a2q("{" +
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.fasterxml.jackson.failing;
package com.fasterxml.jackson.databind.tofix;

import org.junit.jupiter.api.Test;

Expand All @@ -7,6 +7,7 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.testutil.DatabindTestUtil;
import com.fasterxml.jackson.databind.testutil.failure.JacksonTestFailureExpected;

import static org.junit.jupiter.api.Assertions.assertNotNull;

Expand All @@ -29,6 +30,7 @@ static class Room2803 {
private final ObjectMapper MAPPER = newJsonMapper();

// [databind#2803]
@JacksonTestFailureExpected
@Test
void ignoreProps2803() throws Exception {
final String DOC = "{\"lobby\":{\"id\":\"L1\"}}";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.fasterxml.jackson.failing;
package com.fasterxml.jackson.databind.tofix;

import java.util.Objects;

import com.fasterxml.jackson.databind.testutil.failure.JacksonTestFailureExpected;
import org.junit.jupiter.api.Test;

import com.fasterxml.jackson.annotation.*;
Expand All @@ -14,6 +15,7 @@
// different from 2.10 in that no exception thrown and databind quietly just
// left `null` for Beans as `null` even if "EMPTY" was indicated by configuration.
class JsonSetter2572Test extends DatabindTestUtil {

static class Outer {
@JsonProperty("inner")
final Inner inner;
Expand All @@ -34,6 +36,7 @@ public Inner(@JsonProperty("field") String field) {
}
}

@JacksonTestFailureExpected
@Test
void setterWithEmpty() throws Exception {
/*
Expand All @@ -48,7 +51,6 @@ void setterWithEmpty() throws Exception {
Outer result = mapper.readValue(json, Outer.class);
assertNotNull(result);
assertNotNull(result.inner); // converted to "empty" bean

//System.err.println("Final -> "+mapper.writeValueAsString(result));
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.fasterxml.jackson.failing;
package com.fasterxml.jackson.databind.tofix;

import org.junit.jupiter.api.Test;

Expand All @@ -8,6 +8,7 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.testutil.DatabindTestUtil;
import com.fasterxml.jackson.databind.testutil.failure.JacksonTestFailureExpected;

import static org.junit.jupiter.api.Assertions.assertNotNull;

Expand Down Expand Up @@ -57,6 +58,7 @@ private static class WrapperC {
* private interface C extends A, B {}
* </pre>
*/
@JacksonTestFailureExpected
@Test
void failureWithTypeIdConflict() throws Exception {
WrapperC c = MAPPER.readValue(a2q("{'c': {'type': 'c_impl'}}"), WrapperC.class);
Expand Down
Loading