The following issues were found

src/test/java/com/alibaba/json/bvt/serializer/label/LabelIncludeTest2.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: 13

              
public class LabelIncludeTest2 extends TestCase {

    public void test_includes() throws Exception {
        VO vo = new VO();
        vo.setId(123);
        vo.setName("wenshao");
        vo.setPassword("ooxxx");
        

            

Reported by PMD.

The class 'VO' is suspected to be a Data Class (WOC=0.000%, NOPA=0, NOAM=6, WMC=6)
Design

Line: 23

                      Assert.assertEquals("{\"id\":123,\"name\":\"wenshao\"}", text);
    }

    private static class VO {

        private int    id;
        private String name;
        private String password;


            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/serializer/prettyFormat/ArrayListTest.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

              
public class ArrayListTest extends TestCase {

    public void test_array() throws Exception {
        List<Entity> list = new ArrayList<Entity>();
        list.add(new Entity(123, "aaa"));
        list.add(new Entity(234, "bbb"));
        list.add(new Entity(3, "ccc"));
        String text = JSON.toJSONString(list, SerializerFeature.PrettyFormat, SerializerFeature.UseSingleQuotes);

            

Reported by PMD.

The class 'Entity' is suspected to be a Data Class (WOC=0.000%, NOPA=0, NOAM=4, WMC=6)
Design

Line: 23

                      Assert.assertEquals("[\n\t{\n\t\t'id':123,\n\t\t'name':'aaa'\n\t},\n\t{\n\t\t'id':234,\n\t\t'name':'bbb'\n\t},\n\t{\n\t\t'id':3,\n\t\t'name':'ccc'\n\t}\n]", text);
    }

    public static class Entity {

        private int    id;
        private String name;

        public Entity(){

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/serializer/stream/StreamWriterTest_writeChar.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 StreamWriterTest_writeChar extends TestCase {
    public void test_0() throws Exception {
        StringWriter out = new StringWriter();
        
        SerializeWriter writer = new SerializeWriter(out, 10);
        Assert.assertEquals(10, writer.getBufferLength());
        

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 24

                      writer.close();
        
        String text = out.toString();
        Assert.assertEquals(26, text.length());
        
        for (int i = 0; i < 26; ++i) {
            Assert.assertEquals(text.charAt(i), (char)('a' + i));
        }
    }

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/serializer/stream/StreamWriterTest_writeChar1.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 StreamWriterTest_writeChar1 extends TestCase {
    public void test_0() throws Exception {
        StringWriter out = new StringWriter();
        
        SerializeWriter writer = new SerializeWriter(out, 10);
        Assert.assertEquals(10, writer.getBufferLength());
        

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 24

                      writer.close();
        
        String text = out.toString();
        Assert.assertEquals(26, text.length());
        
        for (int i = 0; i < 26; ++i) {
            Assert.assertEquals(text.charAt(i), (char)('a' + i));
        }
    }

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/serializer/stream/StreamWriterTest_writeFieldValue_int_1.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: 13

              

public class StreamWriterTest_writeFieldValue_int_1 extends TestCase {
    public void test_0() throws Exception {
        StringWriter out = new StringWriter();
        
        SerializeWriter writer = new SerializeWriter(out, 10);
        Assert.assertEquals(10, writer.getBufferLength());
        

            

Reported by PMD.

Avoid unused imports such as 'com.alibaba.fastjson.serializer.SerializerFeature'
Design

Line: 9

              import junit.framework.TestCase;

import com.alibaba.fastjson.serializer.SerializeWriter;
import com.alibaba.fastjson.serializer.SerializerFeature;


public class StreamWriterTest_writeFieldValue_int_1 extends TestCase {
    public void test_0() throws Exception {
        StringWriter out = new StringWriter();

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/serializer/stream/StreamWriterTest_writeJSONStringTo.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: 15

              

public class StreamWriterTest_writeJSONStringTo extends TestCase {
    public void test_0() throws Exception {
        StringWriter out = new StringWriter();
        
        Map<String, Object> map = new LinkedHashMap<String, Object>();
        map.put("a", 123);
        

            

Reported by PMD.

Avoid unused imports such as 'com.alibaba.fastjson.serializer.SerializeWriter'
Design

Line: 11

              import junit.framework.TestCase;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializeWriter;


public class StreamWriterTest_writeJSONStringTo extends TestCase {
    public void test_0() throws Exception {
        StringWriter out = new StringWriter();

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/serializer/stream/StreamWriterTest_writeValueString2.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: 13

              

public class StreamWriterTest_writeValueString2 extends TestCase {
    public void test_0() throws Exception {
        StringWriter out = new StringWriter();
        
        SerializeWriter writer = new SerializeWriter(out, 10);
        Assert.assertEquals(10, writer.getBufferLength());
        

            

Reported by PMD.

Avoid unused imports such as 'com.alibaba.fastjson.serializer.SerializerFeature'
Design

Line: 9

              import junit.framework.TestCase;

import com.alibaba.fastjson.serializer.SerializeWriter;
import com.alibaba.fastjson.serializer.SerializerFeature;


public class StreamWriterTest_writeValueString2 extends TestCase {
    public void test_0() throws Exception {
        StringWriter out = new StringWriter();

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/stream/JSONWriterTest_6.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: 15

              
public class JSONWriterTest_6 extends TestCase {

    public void test_writer() throws Exception {
        StringWriter out = new StringWriter();
        JSONWriter writer = new JSONWriter(out);
        writer.config(SerializerFeature.WriteNullStringAsEmpty, true);

        writer.startObject();

            

Reported by PMD.

Avoid unused imports such as 'java.util.Collections'
Design

Line: 4

              package com.alibaba.json.bvt.stream;

import java.io.StringWriter;
import java.util.Collections;

import junit.framework.TestCase;

import org.junit.Assert;


            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/support/jaxrs/mock/service/FastJsonRestfulServiceTest.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: 33

              @Path("fastjson")
public interface FastJsonRestfulServiceTest {

	@POST
	@Path("/test1")
	@Produces(MediaType.APPLICATION_JSON)
	@Consumes(MediaType.APPLICATION_JSON)
	public JSONObject test1(FastJsonTestVO vo);
	

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 39

              	@Consumes(MediaType.APPLICATION_JSON)
	public JSONObject test1(FastJsonTestVO vo);
	
	@POST
	@Path("/test2")
	@Produces(MediaType.APPLICATION_JSON)
	@Consumes(MediaType.APPLICATION_JSON)
	public JSONObject test2(List<FastJsonParentTestVO> vos);
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/deser/DoubleFieldDeserializerTest.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

              
public class DoubleFieldDeserializerTest extends TestCase {

    public void test_0() throws Exception {
        Entity a = JSON.parseObject("{\"value\":123.45}", Entity.class);
        Assert.assertTrue(123.45D == a.getValue());
    }

    public static class Entity {

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 13

              
    public void test_0() throws Exception {
        Entity a = JSON.parseObject("{\"value\":123.45}", Entity.class);
        Assert.assertTrue(123.45D == a.getValue());
    }

    public static class Entity {

        public Double value;

            

Reported by PMD.