Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 2474 invoked from network); 20 Mar 2006 16:33:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Mar 2006 16:33:30 -0000 Received: (qmail 87003 invoked by uid 500); 20 Mar 2006 16:33:26 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 86653 invoked by uid 500); 20 Mar 2006 16:33:24 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 86157 invoked by uid 99); 20 Mar 2006 16:33:21 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Mar 2006 08:33:21 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 20 Mar 2006 08:32:59 -0800 Received: (qmail 1009 invoked by uid 65534); 20 Mar 2006 16:32:37 -0000 Message-ID: <20060320163237.1008.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r387239 [15/21] - in /incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math: ./ Harmony/ doc/ doc/images/ make/ src/ src/common/ src/common/javasrc/ src/common/javasrc/java/ src/common/javasrc/java/applet/ src/common/javasrc/ja... Date: Mon, 20 Mar 2006 16:31:33 -0000 To: harmony-commits@incubator.apache.org From: geirm@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleBean.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleBean.java?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleBean.java (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleBean.java Mon Mar 20 08:31:09 2006 @@ -0,0 +1,172 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.3.6.3 $ + */ +package java.beans.auxiliary; + +import java.util.Iterator; +import java.util.TooManyListenersException; +import java.util.Vector; + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.3.6.3 $ + */ + +public class SampleBean { + + private String text = null; + private String otherText = null; + private SampleBean bean = null; + private int x = 0; + private double[] smth; + private Object[] smthObjs; + private Vector listeners; + + public SampleBean() { + this.text = null; + } + + public SampleBean(String text) { + this.text = text; + this.otherText = "Constructor with args"; + } + + protected SampleBean(String text, SampleBean bean) { + this.text = text; + this.bean = bean; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public SampleBean getObject() { + return bean; + } + + public void setObject(SampleBean bean) { + this.bean = bean; + } + + public String getOtherText() { + return otherText; + } + + public void setOtherText(String value) { + this.otherText = value; + } + + public int getX() { + return x; + } + + public void setX(int value) { + this.x = value; + } + + public double getSmthByIdx(int i) { + return smth[i]; + } + + public void setSmthByIdx(int i, double value) { + smth[i] = value; + } + + public double[] getSmth() { + return this.smth; + } + + public void setSmth(double[] value) { + this.smth = value; + } + + public Object getObjectByIdx(int i) { + return smthObjs[i]; + } + + public void setObjectByIdx(int i, Object value) { + this.smthObjs[i] = value; + } + + public Object[] getObjects() { + return smthObjs; + } + + public void setObjects(Object[] value) { + this.smthObjs = value; + } + + public boolean equals(Object other) { + if(other instanceof SampleBean) { + SampleBean sb = (SampleBean) other; + if((sb.bean == null) && (bean == null)) { + return true; + } else if((sb.bean != null) && (bean != null)) { + return true; + } else return false; + } + return false; + } + + public static SampleBean create(String text, SampleBean bean) { + return new SampleBean(text, bean); + } + + public void addSampleListener(SampleListener listener) + throws TooManyListenersException { + if(listeners == null) { + listeners = new Vector(); + } + + if(listeners.size() >= 100) { + throw new TooManyListenersException( + "Number of listeners could not exceed 100"); + } else { + listeners.add(listener); + } + } + + public void removeSampleListener(SampleListener listener) { + if(listeners != null) { + listeners.remove(listener); + } + } + + public SampleListener[] getSampleListeners() { + if(listeners != null) { + SampleListener[] result = new SampleListener[listeners.size()]; + + Iterator i = listeners.iterator(); + + int idx = 0; + while(i.hasNext()) { + result[idx++] = (SampleListener) i.next(); + } + + return result; + } else { + return new SampleListener[] {}; + } + } +} Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleEvent.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleEvent.java?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleEvent.java (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleEvent.java Mon Mar 20 08:31:09 2006 @@ -0,0 +1,54 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.3.6.3 $ + */ +package java.beans.auxiliary; + +import java.util.EventObject; + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.3.6.3 $ + */ + +public class SampleEvent extends EventObject { + + private int i = 7; + private static int j = 7; + + public SampleEvent(Object object) { + super(object); + } + + public int getI() { + return i; + } + + public void setI(int j) { + j = i; + } + + public static int getJ() { + return j; + } + + public static void setJ(int i) { + j = i; + } +} Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleException.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleException.java?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleException.java (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleException.java Mon Mar 20 08:31:09 2006 @@ -0,0 +1,32 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.3 $ + */ +package java.beans.auxiliary; + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.3 $ + */ + +public class SampleException extends Exception { + + public SampleException(String msg) { + } +} Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleListener.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleListener.java?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleListener.java (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleListener.java Mon Mar 20 08:31:09 2006 @@ -0,0 +1,32 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.3 $ + */ +package java.beans.auxiliary; + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.3 $ + */ +import java.util.EventListener; + +public interface SampleListener extends EventListener { + + public void fireSampleEvent(SampleEvent event); +} Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleProperty.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleProperty.java?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleProperty.java (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SampleProperty.java Mon Mar 20 08:31:09 2006 @@ -0,0 +1,29 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.2 $ + */ +package java.beans.auxiliary; + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.2 $ + */ + +public class SampleProperty { +} Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SamplePropertyEditor.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SamplePropertyEditor.java?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SamplePropertyEditor.java (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SamplePropertyEditor.java Mon Mar 20 08:31:09 2006 @@ -0,0 +1,31 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.2 $ + */ +package java.beans.auxiliary; + +import java.beans.PropertyEditorSupport; + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.2 $ + */ + +public class SamplePropertyEditor extends PropertyEditorSupport { +} Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SerializableBean.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SerializableBean.java?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SerializableBean.java (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SerializableBean.java Mon Mar 20 08:31:09 2006 @@ -0,0 +1,80 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.3.6.3 $ + */ +package java.beans.auxiliary; + +import java.io.Serializable; + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.3.6.3 $ + */ + +public class SerializableBean implements Serializable { + + private int value; + private String text = null; + private Integer iValue = null; + private int[] intArray; + private String[] strArray; + + public SerializableBean() { + } + + public SerializableBean(String text) { + this.text = text; + } + + public String getText() { + return this.text; + } + + public Integer getIValue() { + return iValue; + } + + public void setIValue(Integer iValue) { + this.iValue = iValue; + } + + public int getValue() { + return value; + } + + public void setValue(int value) { + this.value = value; + } + + public int[] getIntArray() { + return intArray; + } + + public void setIntArray(int[] intArray) { + this.intArray = intArray; + } + + public String[] getStrArray() { + return strArray; + } + + public void setStrArray(String[] strArray) { + this.strArray = strArray; + } +} Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SerializablePropertyChangeListener.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SerializablePropertyChangeListener.java?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SerializablePropertyChangeListener.java (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/SerializablePropertyChangeListener.java Mon Mar 20 08:31:09 2006 @@ -0,0 +1,37 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.3 $ + */ +package java.beans.auxiliary; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.io.Serializable; + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.3 $ + */ + +public class SerializablePropertyChangeListener + implements PropertyChangeListener, Serializable { + + public void propertyChange(PropertyChangeEvent event) { + } +} Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/StandardBean.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/StandardBean.java?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/StandardBean.java (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/StandardBean.java Mon Mar 20 08:31:09 2006 @@ -0,0 +1,55 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.3 $ + */ +package java.beans.auxiliary; + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.3 $ + */ + +public class StandardBean { + + private String text = "none"; + private StandardBean bean = null; + + public StandardBean() { + } + + public StandardBean(String text) { + this.text = text; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public StandardBean getPeer() { + return bean; + } + + public void setPeer(StandardBean bean) { + this.bean = bean; + } +} Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/StandardBean2.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/StandardBean2.java?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/StandardBean2.java (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/StandardBean2.java Mon Mar 20 08:31:09 2006 @@ -0,0 +1,29 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.2 $ + */ +package java.beans.auxiliary; + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.2 $ + */ + +public class StandardBean2 { +} Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/StandardBean2BeanInfo.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/StandardBean2BeanInfo.java?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/StandardBean2BeanInfo.java (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/auxiliary/StandardBean2BeanInfo.java Mon Mar 20 08:31:09 2006 @@ -0,0 +1,43 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.3 $ + */ +package java.beans.auxiliary; + +import java.beans.BeanInfo; +import java.beans.SimpleBeanInfo; + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.3 $ + */ + +public class StandardBean2BeanInfo extends SimpleBeanInfo { + + public BeanInfo[] getAdditionalBeanInfo() { + try { + return new BeanInfo[] { + (BeanInfo) GrannyBeanBeanInfo.class.newInstance(), + (BeanInfo) GrannyBeanBeanInfo.class.newInstance() + }; + } catch (Exception e) { + return null; + } + } +} Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/beancontext/BeanContextChildSupportTest.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/beancontext/BeanContextChildSupportTest.java?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/beancontext/BeanContextChildSupportTest.java (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/beancontext/BeanContextChildSupportTest.java Mon Mar 20 08:31:09 2006 @@ -0,0 +1,154 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Sergey A. Krivenko + * @version $Revision: 1.2.4.2 $ + */ +package java.beans.beancontext; + +import java.beans.beancontext.BeanContextChildSupport; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Test class for java.beans.beancontext.BeanContextChildSupport.

+ * + * @author Sergey A. Krivenko + * @version $Revision: 1.2.4.2 $ + */ + +public class BeanContextChildSupportTest extends TestCase { + + /** STANDARD BEGINNING **/ + + /** + * No arguments constructor to enable serialization.

+ */ + public BeanContextChildSupportTest() { + super(); + } + + /** + * Constructs this test case with the given name.

+ * + * @param name - The name for this test case.

+ */ + public BeanContextChildSupportTest(String name) { + super(name); + } + + /** TEST CONSTRUCTORS **/ + + /** * Test constructor with BeanContextChild parameter.

+ * + * @see BeanContextChildSupport#BeanContextChildSupport(BeanContextChild) + */ + public void testConstructorBeanContextChild() { + try { + BeanContextChildSupport sup = new BeanContextChildSupport(null); + } + catch (Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** * Test constructor with no parameters.

+ * + * @see BeanContextChildSupport#BeanContextChildSupport() + */ + public void testConstructor() { + try { + BeanContextChildSupport sup = new BeanContextChildSupport(); + } + catch (Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** TEST METHODS **/ + + /** + * Test method getBeanContextChildPeer() with no parameters.

+ */ + public void testGetBeanContextChildPeer() { + try { + BeanContextChildSupport sup = new BeanContextChildSupport(); + + if (!sup.getBeanContextChildPeer().equals(sup)) { + fail("The objects should be equal"); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method setBeanContext() with BeanContext parameter.

+ */ + public void testSetBeanContextBeanContext() { + try { + BeanContextChildSupport sup = new BeanContextChildSupport(); + sup.setBeanContext(new BeanContextSupport()); + + if (sup.getBeanContext() == null) { + fail("BeanContext should not be null"); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method isDelegated() with no parameters.

+ */ + public void testIsDelegated() { + try { + BeanContextChildSupport sup = new BeanContextChildSupport(); + + if (sup.isDelegated()) { + fail("Child is not supposed to be delegated"); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** UTILITY METHODS **/ + + /** STANDARD ENDING **/ + + /** + * Start testing from the command line.

+ */ + public static Test suite() { + return new TestSuite(BeanContextChildSupportTest.class); + } + + /** + * Start testing from the command line.

+ * + * @param args - Command line parameters.

+ */ + public static void main(String args[]) { + junit.textui.TestRunner.run(suite()); + } +} \ No newline at end of file Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/beancontext/BeanContextServicesSupportTest.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/beancontext/BeanContextServicesSupportTest.java?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/beancontext/BeanContextServicesSupportTest.java (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/beancontext/BeanContextServicesSupportTest.java Mon Mar 20 08:31:09 2006 @@ -0,0 +1,328 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Sergey A. Krivenko + * @version $Revision: 1.5.2.2 $ + */ +package java.beans.beancontext; + +import java.beans.beancontext.BeanContextServicesSupport; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Test class for java.beans.beancontext.BeanContextServicesSupport.

+ * + * @author Sergey A. Krivenko + * @version $Revision: 1.5.2.2 $ + */ + +public class BeanContextServicesSupportTest extends TestCase { + + /** STANDARD BEGINNING **/ + + /** + * No arguments constructor to enable serialization.

+ */ + public BeanContextServicesSupportTest() { + super(); + } + + /** + * Constructs this test case with the given name.

+ * + * @param name - The name for this test case.

+ */ + public BeanContextServicesSupportTest(String name) { + super(name); + } + + /** TEST CONSTRUCTORS **/ + + /** + * Test constructor with BeanContextServices, Locale, boolean, + * boolean parameters.

+ * + * @see BeanContextServicesSupport#BeanContextServicesSupport( + * BeanContextServices, Locale, boolean, boolean) + */ + public void testConstructorBeanContextServicesLocalebooleanboolean() { + try { + BeanContextServicesSupport sup = + new BeanContextServicesSupport(null, null, true, true); + } + catch (Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test constructor with BeanContextServices, Locale, boolean parameters + * + * @see BeanContextServicesSupport#BeanContextServicesSupport( + * BeanContextServices, Locale, boolean) + */ + public void testConstructorBeanContextServicesLocaleboolean() { + try { + BeanContextServicesSupport sup = + new BeanContextServicesSupport(null, null, true); + } + catch (Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test constructor with BeanContextServices, Locale parameters.

+ * + * @see BeanContextServicesSupport#BeanContextServicesSupport( + * BeanContextServices, Locale) + */ + public void testConstructorBeanContextServicesLocale() { + try { + BeanContextServicesSupport sup = + new BeanContextServicesSupport(null, null); + } + catch (Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test constructor with BeanContextServices parameter.

+ * + * @see BeanContextServicesSupport#BeanContextServicesSupport( + * BeanContextServices) + */ + public void testConstructorBeanContextServices() { + try { + BeanContextServicesSupport sup = + new BeanContextServicesSupport(null); + } + catch (Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** * Test constructor with no parameters.

+ * + * @see BeanContextServicesSupport#BeanContextServicesSupport() + */ + public void testConstructor() { + try { + BeanContextServicesSupport sup = new BeanContextServicesSupport(); + } + catch (Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** TEST METHODS **/ + + /** + * Test method createBCSChild() with Object, Object parameters.

+ */ + public void testCreateBCSChildObjectObject() { + try { + + // Just call the method + BeanContextServicesSupport sup = new BeanContextServicesSupport(); + sup.createBCSChild(new Object(), new Object()); + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method addService() with Class, BeanContextServiceProvider, boolean parameters.

+ */ + public void testAddServiceClassBeanContextServiceProviderboolean() { + try { + + // Instantiate services and add service + BeanContextServicesSupport sup = new BeanContextServicesSupport(); + sup.addService(Object.class, getProvider(), true); + + if (sup.services.size() != 1) { + fail("One service should be registered"); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method revokeService() with Class, BeanContextServiceProvider, boolean parameters.

+ */ + public void testRevokeServiceClassBeanContextServiceProviderboolean() { + try { + + // Instantiate services, add and remove service + BeanContextServicesSupport sup = new BeanContextServicesSupport(); + BeanContextServiceProvider pr = getProvider(); + sup.addService(Object.class, pr, true); + sup.revokeService(Object.class, pr, true); + + if (sup.services.size() != 0) { + fail("No service should be registered"); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method addService() with Class, BeanContextServiceProvider parameters.

+ */ + public void testAddServiceClassBeanContextServiceProvider() { + try { + + // Instantiate services and add service + BeanContextServicesSupport sup = new BeanContextServicesSupport(); + sup.addService(Object.class, getProvider()); + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method hasService() with Class parameter.

+ */ + public void testHasServiceClass() { + try { + + // Instantiate services and add service + BeanContextServicesSupport sup = new BeanContextServicesSupport(); + Class cl = new Object().getClass(); + sup.addService(cl, getProvider(), true); + + if (!sup.hasService(cl)) { + fail("Service not found"); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method getBeanContextServicesPeer() with no parameters.

+ */ + public void testGetBeanContextServicesPeer() { + try { + + // Instantiate services + BeanContextServicesSupport sup = new BeanContextServicesSupport(); + + if (!sup.getBeanContextServicesPeer().equals(sup)) { + fail("The objects are not equal"); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method releaseBeanContextResources() with no parameters.

+ */ + public void testReleaseBeanContextResources() { + try { + + // Instantiate services + BeanContextServicesSupport sup = new BeanContextServicesSupport(); + sup.releaseBeanContextResources(); + + if (sup.proxy != null) { + fail("The resources are not released"); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method initializeBeanContextResources() with no parameters.

+ */ + public void testInitializeBeanContextResources() { + try { + + // Instantiate services + BeanContextServicesSupport sup = new BeanContextServicesSupport(); + sup.initializeBeanContextResources(); + + //if (sup.proxy == null) { + //fail("The resources are not initialized"); + //} + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** UTILITY METHODS **/ + + /** + * Fake implementation of provider + */ + private BeanContextServiceProvider getProvider() { + + return new BeanContextServiceProvider() { + + public java.util.Iterator getCurrentServiceSelectors(BeanContextServices bcs, + Class serviceClass) { + + return bcs.getCurrentServiceSelectors(serviceClass); + } + + public Object getService(BeanContextServices bcs, Object requestor, + Class serviceClass, Object serviceSelector) { + + return null; + } + + public void releaseService(BeanContextServices bcs, Object requestor, + Object service) { + } + }; + } + + /** STANDARD ENDING **/ + + /** + * Start testing from the command line.

+ */ + public static Test suite() { + return new TestSuite(BeanContextServicesSupportTest.class); + } + + /** + * Start testing from the command line.

+ * + * @param args - Command line parameters.

+ */ + public static void main(String args[]) { + junit.textui.TestRunner.run(suite()); + } +} \ No newline at end of file Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/beancontext/BeanContextSupportTest.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/beancontext/BeanContextSupportTest.java?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/beancontext/BeanContextSupportTest.java (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/beancontext/BeanContextSupportTest.java Mon Mar 20 08:31:09 2006 @@ -0,0 +1,704 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Sergey A. Krivenko + * @version $Revision: 1.4.4.2 $ + */ +package java.beans.beancontext; + +import java.beans.beancontext.BeanContextSupport; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Test class for java.beans.beancontext.BeanContextSupport.

+ * + * @author Sergey A. Krivenko + * @version $Revision: 1.4.4.2 $ + */ + +public class BeanContextSupportTest extends TestCase { + + /** STANDARD BEGINNING **/ + + /** + * No arguments constructor to enable serialization.

+ */ + public BeanContextSupportTest() { + super(); + } + + /** + * Constructs this test case with the given name.

+ * + * @param name - The name for this test case.

+ */ + public BeanContextSupportTest(String name) { + super(name); + } + + /** TEST CONSTRUCTORS **/ + + /** * Test constructor with BeanContext, Locale, boolean, boolean parameters.

+ * + * @see BeanContextSupport#BeanContextSupport(BeanContext, Locale, boolean, boolean) + */ + public void testConstructorBeanContextLocalebooleanboolean() { + try { + BeanContextSupport sup = new BeanContextSupport(null, null, true, true); + } + catch (Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** * Test constructor with BeanContext, Locale, boolean parameters.

+ * + * @see BeanContextSupport#BeanContextSupport(BeanContext, Locale, boolean) + */ + public void testConstructorBeanContextLocaleboolean() { + try { + BeanContextSupport sup = new BeanContextSupport(null, null, true); + } + catch (Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** * Test constructor with BeanContext, Locale parameters.

+ * + * @see BeanContextSupport#BeanContextSupport(BeanContext, Locale) + */ + public void testConstructorBeanContextLocale() { + try { + BeanContextSupport sup = new BeanContextSupport(null, null); + } + catch (Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** * Test constructor with BeanContext parameter.

+ * + * @see BeanContextSupport#BeanContextSupport(BeanContext) + */ + public void testConstructorBeanContext() { + try { + BeanContextSupport sup = new BeanContextSupport(null); + } + catch (Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** * Test constructor with no parameters.

+ * + * @see BeanContextSupport#BeanContextSupport() + */ + public void testConstructor() { + try { + BeanContextSupport sup = new BeanContextSupport(); + } + catch (Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** TEST METHODS **/ + + /** + * Test method createBCSChild() with Object, Object parameters.

+ */ + public void testCreateBCSChildObjectObject() { + try { + BeanContextSupport sup = new BeanContextSupport(); + sup.createBCSChild(new BeanContextSupport(), new BeanContextSupport()); + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method setLocale() with Locale parameter.

+ */ + public void testSetLocaleLocale() { + try { + BeanContextSupport sup = new BeanContextSupport(); + sup.setLocale(null); + + if (!sup.getLocale().equals(java.util.Locale.getDefault())) { + fail("BeanContext should have default locale"); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method bcsChildren() with no parameters.

+ */ + public void testBcsChildren() { + try { + BeanContextSupport sup = new BeanContextSupport(); + sup.add(new BeanContextChildSupport()); + + for (java.util.Iterator it = sup.bcsChildren(); it.hasNext(); ) { + Object next = it.next(); + + if (!(next instanceof BeanContextSupport.BCSChild)) { + fail("Children must be instances of " + + "BeanContextSupport.BCSChild class " + + "but at least one of them: " + next.getClass()); + } + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method retainAll() with Collection parameter.

+ */ + public void testRetainAllCollection() { + try { + + /*// Create an instance and add one child + BeanContextSupport sup = new BeanContextSupport(); + BeanContextChildSupport ch = new BeanContextChildSupport(); + sup.add(ch); + + // Create collection with an instance of the child that was added + java.util.Collection col = new java.util.ArrayList(); + col.add(ch); + + // Remove all children that are not in the collection + // The collection must remain unchanged + if (sup.retainAll(col)) { + fail("False should be returned"); + } + + // Just one child must be present + if (sup.size() != 1) { + fail("The size of the collection must be 1"); + } + + // Add a new child in the collection and remove the old one + col.clear(); + col.add(new Object()); + + // Remove all children that are not in the collection + // The collection must have 0 elements after that + if (!sup.retainAll(col)) { + fail("True should be returned"); + } + + // No children must be present + if (sup.size() != 0) { + fail("The size of the collection must be 0"); + }*/ + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method removeAll() with Collection parameter.

+ */ + public void testRemoveAllCollection() { + try { + + /*// Create an instance and add one child + BeanContextSupport sup = new BeanContextSupport(); + BeanContextChildSupport ch = new BeanContextChildSupport(); + sup.add(ch); + + // Create collection with an instance of an arbitrary child + java.util.Collection col = new java.util.ArrayList(); + col.add(new Object()); + + // Remove all children that are in the collection + // The collection should not change after that + if (sup.removeAll(col)) { + fail("False should be returned"); + } + + // Add a child that is a member of the BeanContext + col.add(ch); + + // Remove all children that are in the collection + // The collection should change after that + if (!sup.removeAll(col)) { + fail("True should be returned"); + } + + // No children must be present + if (sup.size() != 0) { + fail("The size of the collection must be 0 but is " + sup.size()); + }*/ + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method containsAll() with Collection parameter.

+ */ + public void testContainsAllCollection() { + try { + + /*// Create an instance and add two children + BeanContextSupport sup = new BeanContextSupport(); + BeanContextChildSupport ch = new BeanContextChildSupport(); + Object obj = new Object(); + sup.add(ch); + sup.add(obj); + + // Create collection with BCS children that just were added + java.util.Collection col = new java.util.ArrayList(); + + for (java.util.Iterator it = sup.bcsChildren(); it.hasNext(); ) { + col.add(it.next()); + } + + // Two collections have the same elements + if (!sup.containsAll(col)) { + fail("True should be returned"); + } + + sup.remove(obj); + + // Now they are different + if (sup.containsAll(col)) { + fail("False should be returned"); + }*/ + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method addAll() with Collection parameter.

+ */ + public void testAddAllCollection() { + try { + + /*// Create an instance and add two children + BeanContextSupport sup = new BeanContextSupport(); + + // Create collection with two elements + java.util.Collection col = new java.util.ArrayList(); + col.add(new BeanContextChildSupport()); + col.add(new Object()); + + // Place two children into the BeanContext + if (!sup.addAll(col)) { + fail("True should be returned"); + } + + // Two children must be present + if (sup.size() != 2) { + fail("The size of the collection must be 2 but is " + sup.size()); + }*/ + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method remove() with Object, boolean parameters.

+ */ + public void testRemoveObjectboolean() { + try { + + // Create an instance and add one child + BeanContextSupport sup = new BeanContextSupport(); + BeanContextChildSupport ch = new BeanContextChildSupport(); + sup.add(ch); + + // Remove unexisting child + if (sup.remove(new Object(), true)) { + fail("False should be returned"); + } + + // Remove it + if (!sup.remove(ch, true)) { + fail("True should be returned"); + } + + // No children must be present + if (sup.size() != 0) { + fail("The size of the collection must be 0 but is " + sup.size()); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method remove() with Object parameter.

+ */ + public void testRemoveObject() { + try { + + // Create an instance and add one child + BeanContextSupport sup = new BeanContextSupport(); + BeanContextChildSupport ch = new BeanContextChildSupport(); + sup.add(ch); + + // Remove unexisting child + if (sup.remove(new Object())) { + fail("False should be returned"); + } + + // Remove it + if (!sup.remove(ch)) { + fail("True should be returned"); + } + + // No children must be present + if (sup.size() != 0) { + fail("The size of the collection must be 0 but is " + sup.size()); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method containsKey() with Object parameter.

+ */ + public void testContainsKeyObject() { + try { + + // Create an instance and add a child + BeanContextSupport sup = new BeanContextSupport(); + BeanContextChildSupport ch = new BeanContextChildSupport(); + sup.add(ch); + + // We should find the child now + if (!sup.containsKey(ch)) { + fail("True should be returned"); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method contains() with Object parameter.

+ */ + public void testContainsObject() { + try { + + // Create an instance and add a child + BeanContextSupport sup = new BeanContextSupport(); + BeanContextChildSupport ch = new BeanContextChildSupport(); + sup.add(ch); + + BeanContextSupport.BCSChild bcs = + (BeanContextSupport.BCSChild) sup.bcsChildren().next(); + + // We should find the child now + if (!sup.contains(bcs)) { + // fail("True should be returned"); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method add() with Object parameter.

+ */ + public void testAddObject() { + try { + + // Create an instance and add a child + BeanContextSupport sup = new BeanContextSupport(); + sup.add(new Object()); + + // Just one child must be present + if (sup.size() != 1) { + fail("The size of the collection must be 1 but is " + sup.size()); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method toArray() with no parameters.

+ */ + public void testToArray() { + try { + + // Create an instance and add two children + BeanContextSupport sup = new BeanContextSupport(); + sup.add("obj1"); + sup.add("obj2"); + + // Convert to array + Object[] array = sup.toArray(); + + // Check length + if (array.length != 2) { + fail("The size of the collection must be 2 but is " + array.length); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method copyChildren() with no parameters.

+ */ + public void testCopyChildren() { + try { + + // Create an instance and add two children + BeanContextSupport sup = new BeanContextSupport(); + sup.add("obj1"); + sup.add("obj2"); + + // Convert to array + Object[] array = sup.copyChildren(); + + // Check length + if (array.length != 2) { + fail("The size of the collection must be 2 but is " + array.length); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method removeBeanContextMembershipListener() with BeanContextMembershipListener parameter.

+ */ + public void testRemoveBeanContextMembershipListenerBeanContextMembershipListener() { + try { + + // Create BeanContext and BeanContextMembershipListener instances + BeanContextSupport sup = new BeanContextSupport(); + BeanContextMembershipListener l = getBeanContextMembershipListener(); + sup.addBeanContextMembershipListener(l); + sup.removeBeanContextMembershipListener(l); + + // Check if it's there + if (sup.bcmListeners.contains(l)) { + fail("Listener should not be present"); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method addBeanContextMembershipListener() with BeanContextMembershipListener parameter.

+ */ + public void testAddBeanContextMembershipListenerBeanContextMembershipListener() { + try { + + // Create BeanContext and BeanContextMembershipListener instances + BeanContextSupport sup = new BeanContextSupport(); + BeanContextMembershipListener l = getBeanContextMembershipListener(); + sup.addBeanContextMembershipListener(l); + + // Check if it's there + if (!sup.bcmListeners.contains(l)) { + fail("Listener should be present"); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method getBeanContextPeer() with no parameters.

+ */ + public void testGetBeanContextPeer() { + try { + + // Create BeanContext instance + BeanContextSupport sup = new BeanContextSupport(); + + // The peer and this context should be equal + if (!sup.getBeanContextPeer().equals(sup)) { + fail("The peer and the BeanContext should be equal"); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method vetoableChange() with PropertyChangeEvent parameter.

+ */ + public void testVetoableChangePropertyChangeEvent() { + try { + + /** @todo: not implemented yet in the class **/ + // Create BeanContext instance + BeanContextSupport sup = new BeanContextSupport(); + //sup.vetoableChange(null); + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method propertyChange() with PropertyChangeEvent parameter.

+ */ + public void testPropertyChangePropertyChangeEvent() { + try { + + /** @todo: not implemented yet in the class **/ + // Create BeanContext instance + BeanContextSupport sup = new BeanContextSupport(); + //sup.propertyChange(null); + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method isEmpty() with no parameters.

+ */ + public void testIsEmpty() { + try { + + // Create BeanContext instance + BeanContextSupport sup = new BeanContextSupport(); + + if (!sup.isEmpty()) { + fail("The collection of children should be empty"); + } + + sup.add(new Object()); + + if (sup.isEmpty()) { + fail("The collection of children should not be empty"); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method clear() with no parameters.

+ */ + public void testClear() { + try { + + /*// Create BeanContext instance + BeanContextSupport sup = new BeanContextSupport(); + + // Add a child and then clear + sup.add(new Object()); + sup.clear(); + + if (!sup.isEmpty()) { + fail("The collection of children should be empty"); + }*/ + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** + * Test method size() with no parameters.

+ */ + public void testSize() { + try { + + // Create BeanContext instance + BeanContextSupport sup = new BeanContextSupport(); + + if (sup.size() != 0) { + fail("The size of the collection should be equal to 0"); + } + + sup.add(new Object()); + + if (sup.size() != 1) { + fail("The size of the collection should be equal to 1"); + } + } + catch(Exception e) { + fail("Unexpected exception: " + e + " caused by: " + e.getCause()); + } + } + + /** UTILITY METHODS **/ + + /** + * Create BeanContextMembershipListener instance + */ + private BeanContextMembershipListener getBeanContextMembershipListener() { + return new BeanContextMembershipListener() { + + public void childrenAdded(BeanContextMembershipEvent bcme) { + ; + } + + public void childrenRemoved(BeanContextMembershipEvent bcme) { + ; + } + }; + } + + /** STANDARD ENDING **/ + + /** + * Start testing from the command line.

+ */ + public static Test suite() { + return new TestSuite(BeanContextSupportTest.class); + } + + /** + * Start testing from the command line.

+ * + * @param args - Command line parameters.

+ */ + public static void main(String args[]) { + junit.textui.TestRunner.run(suite()); + } +} \ No newline at end of file Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/editors/AnotherSamplePropertyEditor.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/editors/AnotherSamplePropertyEditor.java?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/editors/AnotherSamplePropertyEditor.java (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/editors/AnotherSamplePropertyEditor.java Mon Mar 20 08:31:09 2006 @@ -0,0 +1,31 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.2 $ + */ +package java.beans.editors; + +import java.beans.PropertyEditorSupport; + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.2 $ + */ + +public class AnotherSamplePropertyEditor extends PropertyEditorSupport { +} Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/gif/test.gif URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/gif/test.gif?rev=387239&view=auto ============================================================================== Binary file - no diff available. Propchange: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/gif/test.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/infos/SampleBeanBeanInfo.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/infos/SampleBeanBeanInfo.java?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/infos/SampleBeanBeanInfo.java (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/infos/SampleBeanBeanInfo.java Mon Mar 20 08:31:09 2006 @@ -0,0 +1,44 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.3 $ + */ +package java.beans.infos; + +import java.beans.MethodDescriptor; +import java.beans.SimpleBeanInfo; +import java.beans.auxiliary.SampleBean; + +/** + * @author Maxim V. Berkultsev + * @version $Revision: 1.2.6.3 $ + */ + +public class SampleBeanBeanInfo extends SimpleBeanInfo { + + public MethodDescriptor[] getMethodDescriptors() { + try { + return new MethodDescriptor[] { + new MethodDescriptor(SampleBean.class.getDeclaredMethod("getX", + null)) + }; + } catch (Exception e) { + return null; + } + } +} Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test1.xml URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test1.xml?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test1.xml (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test1.xml Mon Mar 20 08:31:09 2006 @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + Hello + + + + + \ No newline at end of file Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test2.xml URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test2.xml?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test2.xml (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test2.xml Mon Mar 20 08:31:09 2006 @@ -0,0 +1,32 @@ + + + + + + + + 100.0 + + + 100.0 + + + + \ No newline at end of file Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test3.xml URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test3.xml?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test3.xml (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test3.xml Mon Mar 20 08:31:09 2006 @@ -0,0 +1,29 @@ + + + + + + + 123 + 123 + 123 + + + \ No newline at end of file Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test4.xml URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test4.xml?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test4.xml (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test4.xml Mon Mar 20 08:31:09 2006 @@ -0,0 +1,29 @@ + + + + + + + + + + + + \ No newline at end of file Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test5.xml URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test5.xml?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test5.xml (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test5.xml Mon Mar 20 08:31:09 2006 @@ -0,0 +1,29 @@ + + + + + + + + + + + + \ No newline at end of file Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test6.xml URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test6.xml?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test6.xml (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test6.xml Mon Mar 20 08:31:09 2006 @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + Constructor with args + + + Hello3 + + + + + Constructor with args + + + Hello2 + + + + + + + + + + + + + + 1.0 + + + + + + + \ No newline at end of file Added: incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test7.xml URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test7.xml?rev=387239&view=auto ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test7.xml (added) +++ incubator/harmony/enhanced/classlib/trunk/modules/regex-beans-math/test/common/unit/java/beans/xml/Test7.xml Mon Mar 20 08:31:09 2006 @@ -0,0 +1,35 @@ + + + + + + + + + aa + + + + + aa + bb + + + \ No newline at end of file