public A init() { f1 = AEnum.FOO; f2 = AEnum.BAR; f3 = new AEnum[]{AEnum.FOO,null}; f4 = new AEnum[][]{{AEnum.FOO,null},null}; f5 = new AList<AEnum>().append(AEnum.FOO); f6 = new AList<AEnum>().append(AEnum.FOO); f7 = new ASet<AEnum>().append(AEnum.FOO); f8 = new ASet<AEnum>().append(AEnum.FOO); return this; } }
public B init() { f1 = BEnum.FOO; f2 = BEnum.BAR; f3 = new BEnum[]{BEnum.FOO,null}; f4 = new BEnum[][]{{BEnum.FOO,null},null}; f5 = new AList<BEnum>().append(BEnum.FOO); f6 = new AList<BEnum>().append(BEnum.FOO); f7 = new ASet<BEnum>().append(BEnum.FOO); f8 = new ASet<BEnum>().append(BEnum.FOO); return this; } }
@Test public void testInt1d3dList() throws Exception { proxy.setInt1d3dList(new AList<int[][][]>().append(new int[][][]{{{1,2},null},null}).append(null)); assertObjectEquals("[[[[1,2],null],null],null]", proxy.getInt1d3dList()); assertEquals("[[[[1,2],null],null],null]", cf.get("A/int1d3dList")); assertInstanceOf(int[][][].class, proxy.getInt1d3dList().get(0)); }
@Test public void testEnum1d3dList() throws Exception { proxy.setEnum1d3dList(new AList<TestEnum[][][]>().append(new TestEnum[][][]{{{TestEnum.TWO,null},null},null}).append(null)); assertObjectEquals("[[[['TWO',null],null],null],null]", proxy.getEnum1d3dList()); assertEquals("[[[['TWO',null],null],null],null]", cf.get("A/enum1d3dList")); assertInstanceOf(TestEnum.class, proxy.getEnum1d3dList().get(0)[0][0][0]); }
@Test public void testTypedBean1d3dListMap() throws Exception { proxy.setTypedBean1d3dListMap(new AMap<String,List<TypedBean[][][]>>().append("foo",new AList<TypedBean[][][]>().append(new TypedBean[][][]{{{new TypedBeanImpl().init(),null},null},null}).append(null))); assertObjectEquals("{foo:[[[[{_type:'TypedBeanImpl',a:1,b:'foo'},null],null],null],null]}", proxy.getTypedBean1d3dListMap()); assertEquals("{foo:[[[[{_type:'TypedBeanImpl',a:1,b:'foo'},null],null],null],null]}", cf.get("A/typedBean1d3dListMap")); assertInstanceOf(TypedBeanImpl.class, proxy.getTypedBean1d3dListMap().get("foo").get(0)[0][0][0]); }
@Test public void testBean1d3dListMap() throws Exception { proxy.setBean1d3dListMap(new AMap<String,List<ABean[][][]>>().append("foo",new AList<ABean[][][]>().append(new ABean[][][]{{{new ABean().init(),null},null},null}).append(null))); assertObjectEquals("{foo:[[[[{a:1,b:'foo'},null],null],null],null]}", proxy.getBean1d3dListMap()); assertEquals("{foo:[[[[{a:1,b:'foo'},null],null],null],null]}", cf.get("A/bean1d3dListMap")); assertInstanceOf(ABean.class, proxy.getBean1d3dListMap().get("foo").get(0)[0][0][0]); }
public static E1 create() { E1 t = new E1(); t.x1 = new E2(); t.x2 = new AMap<String,Integer>().append("f1",1).append("f2",2); t.x3 = new E2[] {new E2()}; t.x4 = new AList<E2>().append(new E2()); t.x5 = new ObjectMap[] {new ObjectMap().append("f1","1").append("f2","2")}; t.x6 = new AList<ObjectMap>().append(new ObjectMap().append("f1","1").append("f2","2")); return t; } }
/** * Test method for {@link ResponseInfo#examples(java.lang.Object[])}. */ @Test public void testExamples() { ResponseInfo t = new ResponseInfo(); t.examples(new AMap<String,Object>().append("1",new AList<String>().append("a"))); t.examples("{2:{c1:'c2'}}"); t.examples("{}"); t.examples((Object)null); assertObjectEquals("{'1':['a'],'2':{c1:'c2'}}", t.getExamples()); }