package com.alibaba.json.bvt.jdk7;

import java.nio.file.Path;
import java.nio.file.Paths;

import org.junit.Assert;

import com.alibaba.fastjson.JSON;

import junit.framework.TestCase;

public class PathTest extends TestCase {
    public void test_for_path() throws Exception {
        Model model = new Model();
        model.path = Paths.get("/root/fastjson");
        
        String text = JSON.toJSONString(model);
        
        Assert.assertEquals("{\"path\":\"/root/fastjson\"}", text);
        
        Model model2 = JSON.parseObject(text, Model.class);
        Assert.assertEquals(model.path.toString(), model2.path.toString());
    }
    
    public void test_for_null() throws Exception {
        String text = "{\"path\":null}";
        
        Model model2 = JSON.parseObject(text, Model.class);
        Assert.assertNull(model2.path);
    }
    
    public static class Model {
        public Path path;
    }
}

@@ -85,16 +85,50 @@
 Paths;%0A%0A
+import junit.framework.TestCase;%0A%0A
 import o
@@ -184,42 +184,8 @@
 N;%0A%0A
-import junit.framework.TestCase;%0A%0A
 publ
@@ -422,25 +422,178 @@
         
-%0A        
+System.out.println(text);%0A        //windows%E4%B8%8B%EF%BC%8C%E8%BE%93%E5%87%BA%E4%B8%BA %0A        //Assert.assertEquals(%22%7B%5C%22path%5C%22:%5C%22%5C%5Croot%5C%5Cfastjson%5C%22%7D%22, text);%0A        %0A        //linux ,mac%0A        //
 Assert.a

修复 Map<fieldName,Field> 缓存，+getFieldFromCache;修复 PathTest.java 下 assert bug,