wuxw
2019-08-02 63a1ae838de8499904822b7712e7b2d0dc85ff4b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.java110;
 
import static org.junit.Assert.assertTrue;
 
import com.alibaba.fastjson.JSONObject;
import org.junit.Test;
 
/**
 * Unit test for simple App.
 */
public class AppTest 
{
    /**
     * Rigorous Test :-)
     */
    @Test
    public void shouldAnswerWithTrue()
    {
        assertTrue( true );
    }
 
    @Test
    public void jsonRemoveTest(){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("wuxw","123213");
        jsonObject.put("wangym","344444");
 
        System.out.printf(jsonObject.toJSONString());
 
        jsonObject.remove("wuxw");
 
        System.out.printf(jsonObject.toJSONString());
 
 
    }
}