Skip to content

Commit

Permalink
junit 4.12
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Apr 4, 2017
1 parent c5b0eb9 commit ac3411b
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 37 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -21,7 +21,7 @@
<inceptionYear>2012</inceptionYear>

<properties>
<junit.version>4.11</junit.version>
<junit.version>4.12</junit.version>
<gpg.skip>true</gpg.skip>
<javadoc.skip>false</javadoc.skip>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
36 changes: 0 additions & 36 deletions src/test/java/com/alibaba/json/bvt/serializer/JSONFieldTest6.java

This file was deleted.

@@ -0,0 +1,36 @@
package com.alibaba.json.bvt.serializer;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import junit.framework.TestCase;
import org.junit.Assert;

public class JSONFieldTest_unwrapped_0 extends TestCase {

public void test_jsonField() throws Exception {
VO vo = new VO();
vo.id = 123;
vo.localtion = new Localtion(127, 37);

String text = JSON.toJSONString(vo);
Assert.assertEquals("{\"id\":123,\"latitude\":37,\"longitude\":127}", text);

}

public static class VO {
public int id;

@JSONField(unwrapped = true)
public Localtion localtion;
}

public static class Localtion {
public int longitude;
public int latitude;

public Localtion(int longitude, int latitude) {
this.longitude = longitude;
this.latitude = latitude;
}
}
}
@@ -0,0 +1,36 @@
package com.alibaba.json.bvt.serializer;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import junit.framework.TestCase;
import org.junit.Assert;

public class JSONFieldTest_unwrapped_1 extends TestCase {

public void test_jsonField() throws Exception {
VO vo = new VO();
vo.id = 123;
vo.localtion = new Localtion(127, 37);

String text = JSON.toJSONString(vo);
Assert.assertEquals("{\"id\":123,\"latitude\":37,\"longitude\":127}", text);

}

public static class VO {
public int id;

@JSONField(unwrapped = true)
public Localtion localtion;
}

public static class Localtion {
public int longitude;
public int latitude;

public Localtion(int longitude, int latitude) {
this.longitude = longitude;
this.latitude = latitude;
}
}
}

0 comments on commit ac3411b

Please sign in to comment.