package com.github.jsonzou.jmockdata.kanyuxia;

import com.alibaba.fastjson.JSON;
import com.github.jsonzou.jmockdata.JMockData;
import com.github.jsonzou.jmockdata.kanyuxia.bean.BxA;
import com.github.jsonzou.jmockdata.kanyuxia.bean.People;
import com.github.jsonzou.jmockdata.kanyuxia.bean.Teacher;
import com.github.jsonzou.jmockdata.test.testbean.MockDemoBeanAnyData;
import com.github.jsonzou.jmockdata.test.testbean.MockDemoBeanSelfRefData;
import org.junit.Test;

public class MockDataTest {

  @Test
  @SuppressWarnings("unchecked")
  public void test() throws Exception {
    People people1 = JMock.mockData(People.class);
    System.out.println(people1);
    System.out.println(  JMock.mockData(int.class));
    System.out.println(  JMock.mockData(int[].class));

    MockConfig mockConfig = new MockConfig();
    mockConfig.setStringSeed("hello", "world");
    // 任何类型
//    MockDemoBeanAnyData mockDemoBeanAnyData = JMock.mockData(MockDemoBeanAnyData.class, mockConfig);
//    System.out.println(mockDemoBeanAnyData);

    // 自引用
    //MockDemoBeanSelfRefData mockDemoBeanSelfRefData = JMock.mockData(MockDemoBeanSelfRefData.class, mockConfig);
    //System.out.println(mockDemoBeanSelfRefData);

    // 继承-有getter,setter
    //BxA bxa = JMock.mockData(BxA.class, mockConfig);
    //System.out.println(bxa);

    // 继承-无getter,setter
        Teacher teacher = JMock.mockData(Teacher.class,mockConfig);
        System.out.println(teacher);
  }

}

@@ -574,16 +574,25 @@
 ption %7B%0A
+//  %E5%B0%8F%E8%AF%95%E7%89%9B%E5%88%80%0A
     Peop
@@ -682,34 +682,32 @@
 tem.out.println(
-  
 JMock.mockData(i
@@ -741,18 +741,16 @@
 println(
-  
 JMock.mo
@@ -768,24 +768,35 @@
 %5D.class));%0A%0A
+//  %E6%94%B9%E5%8F%98%E9%BB%98%E8%AE%A4%E9%85%8D%E7%BD%AE%0A
     MockConf
@@ -881,22 +881,20 @@
 %22);%0A
-    
+%0A
 //
+ 
  %E4%BB%BB%E4%BD%95%E7%B1%BB%E5%9E%8B%0A//
     
@@ -889,18 +889,16 @@
  %E4%BB%BB%E4%BD%95%E7%B1%BB%E5%9E%8B%0A//
-  
   MockDe
@@ -990,18 +990,16 @@
 fig);%0A//
-  
   System
@@ -1038,25 +1038,20 @@
 );%0A%0A
-    
 //
+ 
  %E8%87%AA%E5%BC%95%E7%94%A8%0A
-    
 //
+  
 Mock
@@ -1147,38 +1147,36 @@
 s, mockConfig);%0A
-    
 //
+  
 System.out.print
@@ -1201,30 +1201,28 @@
 fRefData);%0A%0A
-    
 //
+  
  %E7%BB%A7%E6%89%BF-%E6%9C%89getter,
@@ -1228,22 +1228,21 @@
 ,setter%0A
- 
+//
    
-//
 BxA bxa 
@@ -1282,22 +1282,21 @@
 onfig);%0A
- 
+//
    
-//
 System.o
@@ -1313,20 +1313,16 @@
 (bxa);%0A%0A
-    
 // %E7%BB%A7%E6%89%BF-%E6%97%A0g
@@ -1334,19 +1334,16 @@
 ,setter%0A
-   
      Tea
@@ -1399,19 +1399,16 @@
 onfig);%0A
-   
      Sys

test and fixed