The following issues were found

src/test/java/com/alibaba/json/bvt/serializer/enum_/EnumFieldsTest4.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 11

              import junit.framework.TestCase;

public class EnumFieldsTest4 extends TestCase {
    public void test_enum() throws Exception {
        Model model = new Model();
        model.types = new Type[]{Type.A, null};
        
        String text = JSON.toJSONString(model, SerializerFeature.WriteMapNullValue);
        Assert.assertEquals("{\"types\":[\"A\",null]}", text);

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 20

                  }
    
    public static class Model {
        public Type[] types;
    }

    private static enum Type {
                             A, B, C
    }

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/serializer/enum_/EnumFieldsTest6.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 11

              import junit.framework.TestCase;

public class EnumFieldsTest6 extends TestCase {
    public void test_enum() throws Exception {
        Model model = new Model();
        model.types = new Object[]{Type.A, null};
        
        String text = JSON.toJSONString(model, SerializerFeature.WriteMapNullValue);
        Assert.assertEquals("{\"types\":[\"A\",null]}", text);

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 20

                  }
    
    public static class Model {
        public Object[] types;
    }

    private static enum Type {
                             A, B, C
    }

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/serializer/exception/ExceptionTest.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 10

               * Created by wenshao on 29/01/2017.
 */
public class ExceptionTest extends TestCase {
    public void test_exception() throws Exception {
        IllegalAccessError ex = new IllegalAccessError();

        String text = JSON.toJSONString(ex);
        assertTrue(JSON.parse(text) instanceof IllegalAccessError);
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 14

                      IllegalAccessError ex = new IllegalAccessError();

        String text = JSON.toJSONString(ex);
        assertTrue(JSON.parse(text) instanceof IllegalAccessError);
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/serializer/features/MapSortFieldTest.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 14

               * Created by wenshao on 14/02/2017.
 */
public class MapSortFieldTest extends TestCase {
    public void test_mapSortField() throws Exception {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("id", 123);
        map.put("name", "wenshao");

        String json = JSON.toJSONString(map, SerializerFeature.MapSortField);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 20

                      map.put("name", "wenshao");

        String json = JSON.toJSONString(map, SerializerFeature.MapSortField);
        assertEquals("{\"id\":123,\"name\":\"wenshao\"}", json);
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/serializer/features/WriteNonStringValueAsStringTestBooleanField.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 12

              
public class WriteNonStringValueAsStringTestBooleanField extends TestCase {

    public void test_0() throws Exception {
        VO vo = new VO();
        vo.id = true;

        Assert.assertEquals("{\"id\":\"true\"}", JSON.toJSONString(vo, SerializerFeature.WriteNonStringValueAsString));
        Assert.assertEquals("{\"id\":true}", JSON.toJSONString(vo));

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 22

              
    public static class VO {

        public boolean id;
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/serializer/features/WriteNonStringValueAsStringTestDoubleField.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 11

              import junit.framework.TestCase;

public class WriteNonStringValueAsStringTestDoubleField extends TestCase {
    public void test_0() throws Exception {
        VO vo = new VO();
        vo.id = 100;
        
        String text = JSON.toJSONString(vo, SerializerFeature.WriteNonStringValueAsString);
         Assert.assertEquals("{\"id\":\"100.0\"}", text);

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 20

                  }
    
    public static class VO {
        public double id;
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/serializer/features/WriteNonStringValueAsStringTestFloatField.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 11

              import junit.framework.TestCase;

public class WriteNonStringValueAsStringTestFloatField extends TestCase {
    public void test_0() throws Exception {
        VO vo = new VO();
        vo.id = 100;
        
        String text = JSON.toJSONString(vo, SerializerFeature.WriteNonStringValueAsString);
         Assert.assertEquals("{\"id\":\"100.0\"}", text);

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 20

                  }
    
    public static class VO {
        public float id;
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/serializer/features/WriteNonStringValueAsStringTestFloatField2.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 10

              import org.junit.Assert;

public class WriteNonStringValueAsStringTestFloatField2 extends TestCase {
    public void test_0() throws Exception {
        VO vo = new VO();
        vo.id = 100;
        
        String text = JSON.toJSONString(vo, SerializerFeature.WriteNonStringValueAsString);
         Assert.assertEquals("{\"id\":\"100.00\"}", text);

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 20

                  
    public static class VO {
        @JSONField(format = "0.00")
        public float id;
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/serializer/features/WriteNonStringValueAsStringTestIntField.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 11

              import junit.framework.TestCase;

public class WriteNonStringValueAsStringTestIntField extends TestCase {
    public void test_0() throws Exception {
        VO vo = new VO();
        vo.id = 100;
        
        String text = JSON.toJSONString(vo, SerializerFeature.WriteNonStringValueAsString);
         Assert.assertEquals("{\"id\":\"100\"}", text);

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 20

                  }
    
    public static class VO {
        public int id;
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/serializer/features/WriteNonStringValueAsStringTestLongField.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 11

              import junit.framework.TestCase;

public class WriteNonStringValueAsStringTestLongField extends TestCase {
    public void test_0() throws Exception {
        VO vo = new VO();
        vo.id = 100;
        
        String text = JSON.toJSONString(vo, SerializerFeature.WriteNonStringValueAsString);
         Assert.assertEquals("{\"id\":\"100\"}", text);

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 20

                  }
    
    public static class VO {
        public long id;
    }
}

            

Reported by PMD.