001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package org.apache.harmony.beans.tests.support.mock;
019:
020: public class MockBean4Codec extends MockBean4CodecPrimitives {
021:
022: public static MockBean4Codec getInstanceOfManyChanges() {
023: MockBean4Codec bean = new MockBean4Codec();
024: bean.setB((byte) 127);
025: bean.setBackRef(bean);
026: bean.setBobj(new Byte((byte) 127));
027: bean.setBool(false);
028: bean.setBoolobj(Boolean.TRUE);
029: bean.getBornFriend().setClazz(Exception.class);
030: bean.getBornFriend().getZarr()[0] = 888;
031: bean.setC('Z');
032: bean.setClazz(String.class);
033: bean.setCobj(new Character('z'));
034: bean.setD(123.456);
035: bean.setDobj(new Double(123.456));
036: bean.setF(12.34F);
037: bean.setFobj(new Float(12.34F));
038: bean.setFriend(new MockBean4Codec());
039: bean.getFriend().setClazz(MockBean4Codec.class);
040: bean.setI(999);
041: bean.setIobj(new Integer(999));
042: bean.setL(8888888);
043: bean.setLobj(new Long(8888888));
044: bean.setName("Li Yang");
045: bean.setNill(null);
046: bean.setS((short) 55);
047: bean.setSobj(new Short((short) 55));
048: bean.setZarr(new int[] { 3, 2, 1 });
049: bean.setZarrarr(new String[][] { { "6", "6", "6" } });
050: return bean;
051: }
052:
053: public static MockBean4Codec getInstanceOfManyChanges2() {
054: MockBean4Codec bean = new MockBean4Codec();
055: bean.getBornFriend().setClazz(Exception.class);
056: return bean;
057: }
058:
059: String name;
060:
061: MockBean4Codec friend;
062:
063: MockBean4CodecPrimitives bornFriend = new MockBean4CodecPrimitives();
064:
065: MockBean4Codec backRef;
066:
067: public MockBean4Codec() {
068: super ();
069: }
070:
071: /**
072: * @return Returns the friend.
073: */
074: public MockBean4Codec getFriend() {
075: return friend;
076: }
077:
078: /**
079: * @param friend
080: * The friend to set.
081: */
082: public void setFriend(MockBean4Codec friend) {
083: this .friend = friend;
084: }
085:
086: /**
087: * @return Returns the name.
088: */
089: public String getName() {
090: return name;
091: }
092:
093: /**
094: * @param name
095: * The name to set.
096: */
097: public void setName(String name) {
098: this .name = name;
099: }
100:
101: /**
102: * @return Returns the backRef.
103: */
104: public MockBean4Codec getBackRef() {
105: return backRef;
106: }
107:
108: /**
109: * @param backRef
110: * The backRef to set.
111: */
112: public void setBackRef(MockBean4Codec backRef) {
113: this .backRef = backRef;
114: }
115:
116: /**
117: * @return Returns the bornFriend.
118: */
119: public MockBean4CodecPrimitives getBornFriend() {
120: return bornFriend;
121: }
122:
123: /**
124: * @param bornFriend
125: * The bornFriend to set.
126: */
127: public void setBornFriend(MockBean4CodecPrimitives bornFriend) {
128: this.bornFriend = bornFriend;
129: }
130: }
|