Skip to content

Commit

Permalink
add testcase for snake naming strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Jul 27, 2016
1 parent 8dc8ce6 commit 5d12065
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.alibaba.json.bvt.parser.deser;

import org.junit.Assert;

import com.alibaba.fastjson.JSON;

import junit.framework.TestCase;


public class SmartMatchTest_snake extends TestCase {

public void test_0() throws Exception {
String text = "{\"person_id\":1001}";

VO vo = JSON.parseObject(text, VO.class);
Assert.assertEquals(1001, vo.personId);
}

public static class VO {
public int personId;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.alibaba.json.bvt.parser.deser;

import org.junit.Assert;

import com.alibaba.fastjson.JSON;

import junit.framework.TestCase;


public class SmartMatchTest_snake2 extends TestCase {

public void test_0() throws Exception {
String text = "{\"_id\":1001}";

VO vo = JSON.parseObject(text, VO.class);
Assert.assertEquals(1001, vo.id);
}

public static class VO {
public int id;
}
}

0 comments on commit 5d12065

Please sign in to comment.