harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r394923 [1/16] - in /incubator/harmony/enhanced/classlib/trunk/modules/beans: make/common/ src/test/java.injected/ src/test/java.injected/java/ src/test/java.injected/java/beans/ src/test/java/tests/ src/test/java/tests/api/ src/test/java/t...
Date Tue, 18 Apr 2006 12:11:45 GMT
Author: mloenko
Date: Tue Apr 18 05:11:09 2006
New Revision: 394923

URL: http://svn.apache.org/viewcvs?rev=394923&view=rev
Log:
integration HARMONY-88 beans tests

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/AllTests.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/ArrayPersistenceDelegateTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/ClassPersistenceDelegateTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/PrimitiveWrapperPersistenceDelegateTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/ProxyPersistenceDelegateTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/StringPersistenceDelegateTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/AllTests.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/AppletInitializerTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/BeanDescriptorTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/BeanInfoTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/BeansTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/CustomizedPersistenceDelegateTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/CustomizerTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/DefaultPersistenceDelegateTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/DependencyBean.xml
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/DesignModeTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/EncoderTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/EventHandlerTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/EventSetDescriptorTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/ExceptionListenerTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/ExpressionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/FeatureDescriptorTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/FozzzEditor.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/IndexedPropertyDescriptorTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/IntArray.xml
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/IntrospectionException.ser   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/IntrospectionExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/IntrospectorTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/MethodDescriptorTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/MockBean4Codec_BornFriendChange.xml
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/MockBean4Codec_ManyChanges.xml
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/MockBean4Codec_ManyChanges_2.xml
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/MockBean4Codec_NoChange.xml
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/MockBean4Owner_Owner.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/MockBean4Owner_SetOwner.xml
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/MockBean4Owner_SetOwnerWithWriteStatement.xml
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/MockBean4Owner_Target.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/MockBean4StaticField.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/MockBean4StaticField.xml
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/MockBean4StaticField_Original.xml
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/MockBean4StaticField_PD.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/MockFakeEvent.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/MockFooLabelBeanInfo.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/MockJavaBean.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/MockPropertyChangeEvent.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/MockPropertyChangeListener.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/ParameterDescriptorTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PersistenceDelegateTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyChangeEvent.ser   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyChangeEventTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyChangeListenerProxyTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyChangeListenerTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyChangeSupport.ser   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyChangeSupportTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyDescriptorTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyEditorManagerTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyEditorSupportTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyEditorTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyVetoException.ser   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyVetoExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/SampleBean_StringCodec.xml
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/SimpleBeanInfoTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/StatementTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/VetoableChangeListenerProxyTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/VetoableChangeListenerTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/VetoableChangeSupport.ser   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/VetoableChangeSupportTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/VisibilityTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/XMLDecoderTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/XMLEncoderTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/bad_int.xml
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/AllTests.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/BeanContextChildSupport.ser   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/BeanContextChildSupportTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/BeanContextEventTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/BeanContextMembershipEvent.ser   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/BeanContextMembershipEventTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/BeanContextServiceAvailableEvent.ser   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/BeanContextServiceAvailableEventTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/BeanContextServiceRevokedEvent.ser   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/BeanContextServiceRevokedEventTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/BeanContextServicesSupport.ser   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/BeanContextServicesSupportTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/BeanContextSupport.ser   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/BeanContextSupportTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/InterfacesTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/MethodInvocationRecords.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/Utils.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockBeanContext.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockBeanContextChild.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockBeanContextChildComponentProxy.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockBeanContextChildDelegateS.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockBeanContextChildS.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockBeanContextContainerProxy.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockBeanContextDelegateS.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockBeanContextMembershipListener.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockBeanContextMembershipListenerS.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockBeanContextProxy.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockBeanContextProxyS.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockBeanContextServiceProvider.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockBeanContextServiceProviderBeanInfo.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockBeanContextServiceProviderS.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockBeanContextServiceRevokedListener.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockBeanContextServices.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockBeanContextServicesListener.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockBeanContextServicesListenerS.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockPropertyChangeListener.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockPropertyChangeListenerS.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockVetoChangeListener.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockVetoableChangeListener.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockVetoableChangeListenerS.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/MockVisibility.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/beancontext/mock/mockdata.txt
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/int.xml
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/FakeFox.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/FakeFox01.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/FakeFox011.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/FakeFox01BeanInfo.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/FakeFox02.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/FakeFox02BeanInfo.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/Foz.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/FozDefault.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/Fozz.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/FozzEditor.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/Fozzz.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockAppletBean.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockAppletBean2.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockAppletBean2.ser   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockAppletInitializer.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockBean4Codec.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockBean4CodecAdv.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockBean4CodecBadGetter.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockBean4CodecBadSetter.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockBean4CodecPrimitives.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockBeanListener2.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockButton.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockExceptionListener.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockFakeListener.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockFoo.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockFoo2.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockFoo2BeanInfo.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockFoo2Parent.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockFoo2ParentBeanInfo.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockFooBeanInfo.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockFooButton.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockFooChild.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockFooChildBeanInfo.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockFooLabel.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockFooLiYang.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockFooLiYangBeanInfo.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockFooStop.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockFooSub.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockFooSubBeanInfo.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockFooSubSub.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockJavaBean2.bin   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockJavaBean2.res   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockPropertyChangeEvent.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockPropertyChangeListener2.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/MockSimpleBeanInfo.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/NonSerializedVCListener.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/SerializedVCListener.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/mock/harmony-logo.gif   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/null.xml
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/beans/
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/beans/AllTests.java
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/beans/make/common/build.xml

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/make/common/build.xml
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/beans/make/common/build.xml?rev=394923&r1=394922&r2=394923&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/make/common/build.xml (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/make/common/build.xml Tue Apr 18 05:11:09 2006
@@ -106,6 +106,31 @@
                                         <exclude name="**/VetoableChangeSupportTest.java" />
                                         <exclude name="**/XMLDecoderTest.java" />
                                         <exclude name="**/XMLEncoderTest.java" />
+
+                                        <exclude name="tests/api/java/beans/BeanDescriptorTest.java" />
+                                        <exclude name="tests/api/java/beans/CustomizedPersistenceDelegateTest.java" />
+                                        <exclude name="tests/api/java/beans/DefaultPersistenceDelegateTest.java" />
+                                        <exclude name="tests/api/java/beans/EncoderTest.java" />
+                                        <exclude name="tests/api/java/beans/EventSetDescriptorTest.java" />
+                                        <exclude name="tests/api/java/beans/ExpressionTest.java" />
+                                        <exclude name="tests/api/java/beans/FeatureDescriptorTest.java" />
+                                        <exclude name="tests/api/java/beans/IndexedPropertyDescriptorTest.java" />
+                                        <exclude name="tests/api/java/beans/IntrospectionExceptionTest.java" />
+                                        <exclude name="tests/api/java/beans/IntrospectorTest.java" />
+                                        <exclude name="tests/api/java/beans/MethodDescriptorTest.java" />
+                                        <exclude name="tests/api/java/beans/PersistenceDelegateTest.java" />
+                                        <exclude name="tests/api/java/beans/PropertyChangeEventTest.java" />
+                                        <exclude name="tests/api/java/beans/PropertyChangeListenerProxyTest.java" />
+                                        <exclude name="tests/api/java/beans/PropertyDescriptorTest.java" />
+                                        <exclude name="tests/api/java/beans/PropertyEditorManagerTest.java" />
+                                        <exclude name="tests/api/java/beans/PropertyEditorSupportTest.java" />
+                                        <exclude name="tests/api/java/beans/PropertyVetoExceptionTest.java" />
+                                        <exclude name="tests/api/java/beans/StatementTest.java" />
+                                        <exclude name="tests/api/java/beans/VetoableChangeListenerProxyTest.java" />
+                                        <exclude name="tests/api/java/beans/beancontext/BeanContextChildSupportTest.java" />
+                                        <exclude name="tests/api/java/beans/beancontext/BeanContextMembershipEventTest.java" />
+                                        <exclude name="tests/api/java/beans/beancontext/BeanContextServiceAvailableEventTest.java" />
+                                        <exclude name="tests/api/java/beans/beancontext/BeanContextServiceRevokedEventTest.java" />
 				</fileset>
 			</batchtest>
 		</junit>

Added: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/AllTests.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/AllTests.java?rev=394923&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/AllTests.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/AllTests.java Tue Apr 18 05:11: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.
+ */
+
+package java.beans;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Test suite that includes all tests for the java.beans package
+ */
+public class AllTests {
+
+	public static Test suite() {
+		TestSuite suite = new TestSuite("Test for java.beans");
+		// $JUnit-BEGIN$
+		suite.addTestSuite(ArrayPersistenceDelegateTest.class);
+		suite.addTestSuite(ClassPersistenceDelegateTest.class);
+		suite.addTestSuite(PrimitiveWrapperPersistenceDelegateTest.class);
+		suite.addTestSuite(ProxyPersistenceDelegateTest.class);
+		suite.addTestSuite(StringPersistenceDelegateTest.class);
+		// $JUnit-END$
+		return suite;
+	}
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/ArrayPersistenceDelegateTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/ArrayPersistenceDelegateTest.java?rev=394923&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/ArrayPersistenceDelegateTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/ArrayPersistenceDelegateTest.java Tue Apr 18 05:11:09 2006
@@ -0,0 +1,56 @@
+/* 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.
+ */
+
+package java.beans;
+
+import java.lang.reflect.Array;
+
+import junit.framework.TestCase;
+
+/**
+ * Test the internal class java.beans.ArrayPersistenceDelegate.
+ */
+public class ArrayPersistenceDelegateTest extends TestCase {
+
+	private ArrayPersistenceDelegate pd = null;
+
+	protected void setUp() throws Exception {
+		super.setUp();
+		pd = new ArrayPersistenceDelegate();
+	}
+
+	public void testMutates() {
+		assertFalse(pd.mutatesTo(new int[] { 1 }, null));
+		assertFalse(pd.mutatesTo(null, null));
+		assertFalse(pd.mutatesTo(new int[1], new int[2]));
+		assertTrue(pd.mutatesTo(new int[] { 1, 3 }, new int[] { 1, 2 }));
+	}
+
+	public void testInitialize() {
+		// TBD
+	}
+
+	public void testInstantiate_Normal() throws Exception {
+		Object obj = new int[] { 1, 2, 3 };
+		Expression exp = pd.instantiate(obj, new Encoder());
+		assertSame(obj, exp.getValue());
+		assertSame(Array.class, exp.getTarget());
+		assertEquals("newInstance", exp.getMethodName());
+		assertEquals(2, exp.getArguments().length);
+		assertSame(Integer.TYPE, exp.getArguments()[0]);
+		assertEquals(new Integer(3), exp.getArguments()[1]);
+	}
+
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/ClassPersistenceDelegateTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/ClassPersistenceDelegateTest.java?rev=394923&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/ClassPersistenceDelegateTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/ClassPersistenceDelegateTest.java Tue Apr 18 05:11:09 2006
@@ -0,0 +1,68 @@
+/* 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.
+ */
+
+package java.beans;
+
+import junit.framework.TestCase;
+
+/**
+ * Test the internal class java.beans.ClassPersistenceDelegate.
+ */
+public class ClassPersistenceDelegateTest extends TestCase {
+
+	private ClassPersistenceDelegate pd = null;
+
+	protected void setUp() throws Exception {
+		super.setUp();
+		pd = new ClassPersistenceDelegate();
+	}
+
+	public void testMutates() {
+		assertFalse(pd.mutatesTo(Class.class, null));
+		assertFalse(pd.mutatesTo(null, null));
+		assertFalse(pd.mutatesTo(Class.class, String.class));
+		assertTrue(pd.mutatesTo(String.class, String.class));
+	}
+
+	public void testInitialize() {
+		pd.initialize(null, null, null, null);
+	}
+
+	public void testInstantiate_Normal() throws Exception {
+		Expression exp = pd.instantiate(Integer.class, new Encoder());
+		assertSame(Integer.class, exp.getValue());
+		assertTrue(exp.getTarget() instanceof Class);
+		assertEquals("forName", exp.getMethodName());
+		assertEquals(1, exp.getArguments().length);
+		assertEquals("java.lang.Integer", exp.getArguments()[0]);
+	}
+
+	public void testInstantiate_Class() throws Exception {
+		Expression exp = pd.instantiate(Class.class, new Encoder());
+		assertSame(Class.class, exp.getValue());
+		assertTrue(exp.getTarget() instanceof Class);
+		assertEquals("forName", exp.getMethodName());
+		assertEquals(1, exp.getArguments().length);
+		assertEquals("java.lang.Class", exp.getArguments()[0]);
+	}
+
+	public void testInstantiate_String() throws Exception {
+		Expression exp = pd.instantiate(String.class, new Encoder());
+		assertSame(String.class, exp.getValue());
+		assertSame("", exp.getTarget());
+		assertEquals("getClass", exp.getMethodName());
+		assertEquals(0, exp.getArguments().length);
+	}
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/PrimitiveWrapperPersistenceDelegateTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/PrimitiveWrapperPersistenceDelegateTest.java?rev=394923&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/PrimitiveWrapperPersistenceDelegateTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/PrimitiveWrapperPersistenceDelegateTest.java Tue Apr 18 05:11:09 2006
@@ -0,0 +1,53 @@
+/* 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.
+ */
+
+package java.beans;
+
+import junit.framework.TestCase;
+
+/**
+ * Test the internal class java.beans.PrimitiveWrapperPersistenceDelegate.
+ */
+public class PrimitiveWrapperPersistenceDelegateTest extends TestCase {
+
+	private PrimitiveWrapperPersistenceDelegate pd = null;
+
+	protected void setUp() throws Exception {
+		super.setUp();
+		pd = new PrimitiveWrapperPersistenceDelegate();
+	}
+
+	public void testMutates() {
+		assertFalse(pd.mutatesTo(new Integer(1), null));
+		assertFalse(pd.mutatesTo(null, null));
+		assertFalse(pd.mutatesTo(new Integer(1), new Integer(2)));
+		assertTrue(pd.mutatesTo(new Integer(1), new Integer(1)));
+	}
+
+	public void testInitialize() {
+		pd.initialize(null, null, null, null);
+	}
+
+	public void testInstantiate_Normal() throws Exception {
+		Integer obj = new Integer(2);
+		Expression exp = pd.instantiate(obj, new Encoder());
+		assertSame(obj, exp.getValue());
+		assertSame(Integer.class, exp.getTarget());
+		assertEquals("new", exp.getMethodName());
+		assertEquals(1, exp.getArguments().length);
+		assertSame(obj, exp.getArguments()[0]);
+	}
+
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/ProxyPersistenceDelegateTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/ProxyPersistenceDelegateTest.java?rev=394923&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/ProxyPersistenceDelegateTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/ProxyPersistenceDelegateTest.java Tue Apr 18 05:11:09 2006
@@ -0,0 +1,59 @@
+/* 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.
+ */
+
+package java.beans;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import junit.framework.TestCase;
+
+/**
+ * Test the internal class java.beans.ProxyPersistenceDelegate.
+ */
+public class ProxyPersistenceDelegateTest extends TestCase {
+
+	private ProxyPersistenceDelegate pd = null;
+
+	protected void setUp() throws Exception {
+		super.setUp();
+		pd = new ProxyPersistenceDelegate();
+	}
+
+	public void testInstantiate_Normal() throws Exception {
+		InvocationHandler h = new Handler();
+		Object obj = Proxy.newProxyInstance(ClassLoader.getSystemClassLoader(),
+				new Class[] { Runnable.class, Cloneable.class }, h);
+
+		Expression exp = pd.instantiate(obj, new Encoder());
+		assertSame(obj, exp.getValue());
+		assertSame(Proxy.class, exp.getTarget());
+		assertEquals("newProxyInstance", exp.getMethodName());
+		assertEquals(3, exp.getArguments().length);
+		assertSame(obj.getClass().getClassLoader(), exp.getArguments()[0]);
+		Class[] interfaces = (Class[]) exp.getArguments()[1];
+		assertSame(Runnable.class, interfaces[0]);
+		assertSame(Cloneable.class, interfaces[1]);
+		assertSame(h, exp.getArguments()[2]);
+	}
+
+	public static class Handler implements InvocationHandler {
+		public Object invoke(Object proxy, Method method, Object[] args)
+				throws Throwable {
+			return null;
+		}
+	}
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/StringPersistenceDelegateTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/StringPersistenceDelegateTest.java?rev=394923&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/StringPersistenceDelegateTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java.injected/java/beans/StringPersistenceDelegateTest.java Tue Apr 18 05:11:09 2006
@@ -0,0 +1,51 @@
+/* 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.
+ */
+
+package java.beans;
+
+import junit.framework.TestCase;
+
+/**
+ * Test the internal class java.beans.StringPersistenceDelegate.
+ */
+public class StringPersistenceDelegateTest extends TestCase {
+
+	private StringPersistenceDelegate pd = null;
+
+	protected void setUp() throws Exception {
+		super.setUp();
+		pd = new StringPersistenceDelegate();
+	}
+
+	public void testMutates() {
+		assertFalse(pd.mutatesTo("", null));
+		assertFalse(pd.mutatesTo(null, null));
+		assertFalse(pd.mutatesTo("str1", "str2"));
+		assertTrue(pd.mutatesTo("str1", "str2"));
+	}
+
+	public void testInitialize() {
+		pd.initialize(null, null, null, null);
+	}
+
+	public void testInstantiate_Normal() throws Exception {
+		Expression exp = pd.instantiate("str", new Encoder());
+		assertSame("str", exp.getValue());
+		assertSame(String.class, exp.getTarget());
+		assertEquals("new", exp.getMethodName());
+		assertEquals(1, exp.getArguments().length);
+		assertEquals("str", exp.getArguments()[0]);
+	}
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/AllTests.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/AllTests.java?rev=394923&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/AllTests.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/AllTests.java Tue Apr 18 05:11:09 2006
@@ -0,0 +1,69 @@
+/* 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.
+ */
+
+package tests.api.java.beans;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+
+	public static Test suite() {
+		TestSuite suite = new TestSuite("Test for java.beans");
+		// $JUnit-BEGIN$
+		suite.addTestSuite(IntrospectorTest.class);
+		suite.addTestSuite(VisibilityTest.class);
+		suite.addTestSuite(PropertyChangeSupportTest.class);
+		suite.addTestSuite(DefaultPersistenceDelegateTest.class);
+		suite.addTestSuite(PersistenceDelegateTest.class);
+		suite.addTestSuite(CustomizedPersistenceDelegateTest.class);
+		suite.addTestSuite(PropertyChangeListenerProxyTest.class);
+		suite.addTestSuite(VetoableChangeListenerTest.class);
+		suite.addTestSuite(StatementTest.class);
+		suite.addTestSuite(PropertyChangeEventTest.class);
+		suite.addTestSuite(EncoderTest.class);
+		suite.addTestSuite(SimpleBeanInfoTest.class);
+		suite.addTestSuite(PropertyVetoExceptionTest.class);
+		suite.addTestSuite(BeanInfoTest.class);
+		suite.addTestSuite(XMLEncoderTest.class);
+		suite.addTestSuite(BeansTest.class);
+		suite.addTestSuite(BeanDescriptorTest.class);
+		suite.addTestSuite(MethodDescriptorTest.class);
+		suite.addTestSuite(PropertyChangeListenerTest.class);
+		suite.addTestSuite(PersistenceDelegateTest.class);
+		suite.addTestSuite(ExpressionTest.class);
+		suite.addTestSuite(IndexedPropertyDescriptorTest.class);
+		suite.addTestSuite(EventSetDescriptorTest.class);
+		suite.addTestSuite(IntrospectionExceptionTest.class);
+		suite.addTestSuite(CustomizerTest.class);
+		suite.addTestSuite(FeatureDescriptorTest.class);
+		suite.addTestSuite(DesignModeTest.class);
+		suite.addTestSuite(CustomizedPersistenceDelegateTest.class);
+		suite.addTestSuite(VetoableChangeListenerProxyTest.class);
+		suite.addTestSuite(VetoableChangeSupportTest.class);
+		suite.addTestSuite(PropertyEditorManagerTest.class);
+		suite.addTestSuite(ParameterDescriptorTest.class);
+		suite.addTestSuite(AppletInitializerTest.class);
+		suite.addTestSuite(PropertyEditorSupportTest.class);
+		suite.addTestSuite(PropertyEditorTest.class);
+		suite.addTestSuite(PropertyDescriptorTest.class);
+		suite.addTestSuite(ExceptionListenerTest.class);
+		suite.addTestSuite(XMLDecoderTest.class);
+		suite.addTestSuite(EventHandlerTest.class);
+
+		// $JUnit-END$
+		return suite;
+	}
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/AppletInitializerTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/AppletInitializerTest.java?rev=394923&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/AppletInitializerTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/AppletInitializerTest.java Tue Apr 18 05:11:09 2006
@@ -0,0 +1,42 @@
+/* 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.
+ */
+
+package tests.api.java.beans;
+
+import java.applet.Applet;
+import java.beans.AppletInitializer;
+import java.beans.beancontext.BeanContext;
+
+import junit.framework.TestCase;
+
+/**
+ * Test the signature of the interface AppletInitializer.
+ */
+public class AppletInitializerTest extends TestCase {
+
+    public void testSignature() {
+        DummyAppletInitializer o = new DummyAppletInitializer();
+        assertTrue(o instanceof AppletInitializer);
+    }
+    
+    static class DummyAppletInitializer implements AppletInitializer {
+
+        public void activate(Applet newApplet) {
+        }
+
+        public void initialize(Applet appletBean, BeanContext context) {
+        }
+    }
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/BeanDescriptorTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/BeanDescriptorTest.java?rev=394923&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/BeanDescriptorTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/BeanDescriptorTest.java Tue Apr 18 05:11:09 2006
@@ -0,0 +1,169 @@
+/* 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.
+ */
+
+package tests.api.java.beans;
+
+import java.awt.Component;
+import java.beans.BeanDescriptor;
+import java.beans.Customizer;
+import java.beans.PropertyChangeListener;
+import java.util.HashSet;
+
+import junit.framework.TestCase;
+
+/**
+ * Unit test for BeanDescriptor.
+ */
+public class BeanDescriptorTest extends TestCase {
+
+	/*
+	 * @see TestCase#setUp()
+	 */
+	protected void setUp() throws Exception {
+		super.setUp();
+	}
+
+	/*
+	 * @see TestCase#tearDown()
+	 */
+	protected void tearDown() throws Exception {
+		super.tearDown();
+	}
+
+	/*
+	 * Class under test for void BeanDescriptor(Class)
+	 */
+	public void testBeanDescriptorClass() {
+		String beanName = "BeanDescriptorTest.bean";
+		MockJavaBean bean = new MockJavaBean(beanName);
+		Class beanClass = bean.getClass();
+		BeanDescriptor bd = new BeanDescriptor(beanClass);
+
+		assertSame(beanClass, bd.getBeanClass());
+		String displayName = beanClass.getName().substring(
+				beanClass.getName().lastIndexOf('.') + 1);
+		assertEquals(displayName, bd.getDisplayName());
+		assertEquals(displayName, bd.getName());
+		assertEquals(displayName, bd.getShortDescription());
+
+		assertNotNull(bd.attributeNames());
+		assertFalse(bd.isExpert());
+		assertFalse(bd.isHidden());
+		assertFalse(bd.isPreferred());
+	}
+
+	public void testBeanDescriptorClass_Null() {
+		try {
+			BeanDescriptor bd = new BeanDescriptor(null);
+			fail("Should throw NullPointerException.");
+		} catch (NullPointerException e) {
+		}
+	}
+
+	/*
+	 * Class under test for void BeanDescriptor(Class, Class)
+	 */
+	public void testBeanDescriptorClassClass() {
+		/*
+		 * String beanName = "BeanDescriptorTest.bean"; MockJavaBean bean = new
+		 * MockJavaBean(beanName); Class beanClass = bean.getClass(); Customizer
+		 * customizer = new MyCustomizer(); Class cusClass =
+		 * customizer.getClass(); BeanDescriptor bd = new
+		 * BeanDescriptor(beanClass, cusClass);
+		 * 
+		 * assertSame(beanClass, bd.getBeanClass()); assertSame(cusClass,
+		 * bd.getCustomizerClass());
+		 * 
+		 * String displayName = beanClass.getName().substring(
+		 * beanClass.getName().lastIndexOf('.') + 1); assertEquals(displayName,
+		 * bd.getDisplayName()); assertEquals(displayName, bd.getName());
+		 * assertEquals(displayName, bd.getShortDescription());
+		 * 
+		 * assertNotNull(bd.attributeNames()); assertFalse(bd.isExpert());
+		 * assertFalse(bd.isHidden()); assertFalse(bd.isPreferred());
+		 */
+	}
+
+	public void testBeanDescriptorClassClass_BeanClassNull() {
+		/*
+		 * Class beanClass = null; Customizer customizer = new MyCustomizer();
+		 * Class cusClass = customizer.getClass(); try { BeanDescriptor bd = new
+		 * BeanDescriptor(beanClass, cusClass); fail("Should throw
+		 * NullPointerException"); } catch (NullPointerException e) { }
+		 */
+	}
+
+	public void testBeanDescriptorClassClass_CustomizerClassNull() {
+		String beanName = "BeanDescriptorTest.bean";
+		MockJavaBean bean = new MockJavaBean(beanName);
+		Class beanClass = bean.getClass();
+		Class cusClass = null;
+		BeanDescriptor bd = new BeanDescriptor(beanClass, cusClass);
+
+		assertSame(beanClass, bd.getBeanClass());
+		assertNull(bd.getCustomizerClass());
+
+		String displayName = beanClass.getName().substring(
+				beanClass.getName().lastIndexOf('.') + 1);
+		assertEquals(displayName, bd.getDisplayName());
+		assertEquals(displayName, bd.getName());
+		assertEquals(displayName, bd.getShortDescription());
+
+		assertNotNull(bd.attributeNames());
+		assertFalse(bd.isExpert());
+		assertFalse(bd.isHidden());
+		assertFalse(bd.isPreferred());
+	}
+
+	class MyCustomizer extends Component implements Customizer {
+
+		HashSet listeners;
+
+		Object bean;
+
+		public MyCustomizer() {
+			this.listeners = new HashSet();
+			this.bean = null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see java.beans.Customizer#addPropertyChangeListener(java.beans.PropertyChangeListener)
+		 */
+		public void addPropertyChangeListener(PropertyChangeListener listener) {
+			this.listeners.add(listener);
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see java.beans.Customizer#removePropertyChangeListener(java.beans.PropertyChangeListener)
+		 */
+		public void removePropertyChangeListener(PropertyChangeListener listener) {
+			this.listeners.remove(listener);
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see java.beans.Customizer#setObject(java.lang.Object)
+		 */
+		public void setObject(Object bean) {
+			this.bean = bean;
+		}
+
+	}
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/BeanInfoTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/BeanInfoTest.java?rev=394923&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/BeanInfoTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/BeanInfoTest.java Tue Apr 18 05:11:09 2006
@@ -0,0 +1,95 @@
+/* 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.
+ */
+
+package tests.api.java.beans;
+
+import java.awt.Image;
+import java.beans.BeanDescriptor;
+import java.beans.BeanInfo;
+import java.beans.EventSetDescriptor;
+import java.beans.MethodDescriptor;
+import java.beans.PropertyDescriptor;
+
+import junit.framework.TestCase;
+
+/**
+ * Test the signature of the interface BeanInfo.
+ */
+public class BeanInfoTest extends TestCase {
+
+    public void testSignature() {
+        DummyBeanInfo o = new DummyBeanInfo();
+        assertTrue(o instanceof BeanInfo);
+    }
+    
+    static class DummyBeanInfo implements BeanInfo {
+        
+        /* (non-Javadoc)
+         * @see java.beans.BeanInfo#getAdditionalBeanInfo()
+         */
+        public BeanInfo[] getAdditionalBeanInfo() {
+            return null;
+        }
+
+        /* (non-Javadoc)
+         * @see java.beans.BeanInfo#getBeanDescriptor()
+         */
+        public BeanDescriptor getBeanDescriptor() {
+            return null;
+        }
+
+        /* (non-Javadoc)
+         * @see java.beans.BeanInfo#getDefaultEventIndex()
+         */
+        public int getDefaultEventIndex() {
+            return 0;
+        }
+
+        /* (non-Javadoc)
+         * @see java.beans.BeanInfo#getDefaultPropertyIndex()
+         */
+        public int getDefaultPropertyIndex() {
+            return 0;
+        }
+
+        /* (non-Javadoc)
+         * @see java.beans.BeanInfo#getEventSetDescriptors()
+         */
+        public EventSetDescriptor[] getEventSetDescriptors() {
+            return null;
+        }
+
+        /* (non-Javadoc)
+         * @see java.beans.BeanInfo#getIcon(int)
+         */
+        public Image getIcon(int iconKind) {
+            return null;
+        }
+
+        /* (non-Javadoc)
+         * @see java.beans.BeanInfo#getMethodDescriptors()
+         */
+        public MethodDescriptor[] getMethodDescriptors() {
+            return null;
+        }
+
+        /* (non-Javadoc)
+         * @see java.beans.BeanInfo#getPropertyDescriptors()
+         */
+        public PropertyDescriptor[] getPropertyDescriptors() {
+            return null;
+        }
+    }
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/BeansTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/BeansTest.java?rev=394923&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/BeansTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/BeansTest.java Tue Apr 18 05:11:09 2006
@@ -0,0 +1,441 @@
+/* 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.
+ */
+
+package tests.api.java.beans;
+
+import java.awt.Component;
+import java.beans.AppletInitializer;
+import java.beans.Beans;
+import java.beans.beancontext.BeanContext;
+import java.beans.beancontext.BeanContextSupport;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import junit.framework.TestCase;
+import tests.api.java.beans.mock.MockAppletInitializer;
+
+/**
+ * Unit test for java.beans.Beans
+ */
+public class BeansTest extends TestCase {
+	private File fileURLCP = new File(System.getProperty("user.home"), "urlcp");
+
+	private File fileSer;
+
+	private File fileRes;
+
+	private File fileClass;
+
+	public BeansTest() {
+		File path = new File(fileURLCP, "tests/api/java/beans/mock");
+		path.mkdirs();
+		fileSer = new File(path, "MockJavaBean2.ser");
+		fileClass = new File(path, "MockJavaBean2.class");
+	}
+
+	protected void tearDown() throws Exception {
+		super.tearDown();
+		if (fileSer.exists()) {
+			fileSer.delete();
+		}
+
+		if (fileClass.exists()) {
+			fileClass.delete();
+		}
+		fileURLCP.delete();
+	}
+
+	/*
+	 * public Beans()
+	 */
+	public void testBeans() {
+		Beans beans = new Beans();
+	}
+
+	/*
+	 * public static Object getInstanceOf(Object bean, Class targetType)
+	 */
+	public void testGetInstanceOf() {
+		MockJavaBean bean = new MockJavaBean();
+		Class type = Component.class;
+		Object obj = Beans.getInstanceOf(bean, type);
+		assertSame(bean, obj);
+	}
+
+	public void testGetInstanceOf_BeanNull() {
+		Class type = Component.class;
+		Object obj = Beans.getInstanceOf(null, type);
+		assertNull(obj);
+	}
+
+	public void testGetInstanceOf_TargetTypeNull() {
+		MockJavaBean bean = new MockJavaBean();
+		Object obj = Beans.getInstanceOf(bean, null);
+		assertSame(bean, obj);
+	}
+
+	/*
+	 * Class under test for Object instantiate(ClassLoader, String)
+	 */
+	public void testInstantiateClassLoaderString_Class() throws IOException,
+			ClassNotFoundException, NoSuchMethodException, SecurityException,
+			IllegalAccessException, InvocationTargetException {
+		// copy class
+		InputStream bin = getClass().getResourceAsStream(
+				"/tests/api/java/beans/mock/MockJavaBean2.bin");
+		copyFile(bin, fileClass);
+
+		URLClassLoader loader = new URLClassLoader(new URL[] { fileURLCP
+				.toURL() });
+		Object bean = Beans.instantiate(loader,
+				"tests.api.java.beans.mock.MockJavaBean2");
+		assertEquals("as_class", (String) bean.getClass().getMethod(
+				"getPropertyOne", null).invoke(bean, null));
+		assertSame(loader, bean.getClass().getClassLoader());
+	}
+
+	public void testInstantiateClassLoaderString_Ser() throws IOException,
+			ClassNotFoundException, IllegalAccessException,
+			InvocationTargetException, NoSuchMethodException {
+		// copy class
+		InputStream bin = getClass().getResourceAsStream(
+				"/tests/api/java/beans/mock/MockJavaBean2.bin");
+		copyFile(bin, fileClass);
+
+		// copy ser
+		InputStream res = getClass().getResourceAsStream(
+				"/tests/api/java/beans/mock/MockJavaBean2.res");
+		copyFile(res, fileSer);
+
+		URLClassLoader loader = new URLClassLoader(new URL[] { fileURLCP
+				.toURL() });
+		Object bean = Beans.instantiate(loader,
+				"tests.api.java.beans.mock.MockJavaBean2");
+		assertEquals("as_object", (String) bean.getClass().getMethod(
+				"getPropertyOne", null).invoke(bean, null));
+		assertSame(loader, bean.getClass().getClassLoader());
+	}
+
+	public void testInstantiateClassLoaderString_ClassLoaderNull()
+			throws IOException, ClassNotFoundException {
+		Object bean = Beans.instantiate(null, MockJavaBean.class.getName());
+		assertEquals(bean.getClass(), MockJavaBean.class);
+		assertSame(ClassLoader.getSystemClassLoader(), bean.getClass()
+				.getClassLoader());
+	}
+
+	public void testInstantiateClassLoaderString_BeanNameNull()
+			throws IOException, ClassNotFoundException {
+		try {
+			Object bean = Beans.instantiate(null, null);
+			fail("Should throw NullPointerException");
+		} catch (NullPointerException e) {
+		}
+	}
+
+	/*
+	 * Class under test for Object instantiate(ClassLoader, String, BeanContext)
+	 */
+	public void testInstantiateClassLoaderStringBeanContext_Class()
+			throws ClassNotFoundException, ClassNotFoundException, IOException,
+			IllegalAccessException, InvocationTargetException,
+			NoSuchMethodException {
+		// copy class
+		InputStream bin = getClass().getResourceAsStream(
+				"/tests/api/java/beans/mock/MockJavaBean2.bin");
+		copyFile(bin, fileClass);
+
+		URLClassLoader loader = new URLClassLoader(new URL[] { fileURLCP
+				.toURL() });
+		BeanContext context = new BeanContextSupport();
+		Object bean = Beans.instantiate(loader,
+				"tests.api.java.beans.mock.MockJavaBean2", context);
+		assertEquals("as_class", (String) bean.getClass().getMethod(
+				"getPropertyOne", null).invoke(bean, null));
+		assertSame(loader, bean.getClass().getClassLoader());
+		assertTrue(context.contains(bean));
+	}
+
+	public void testInstantiateClassLoaderStringBeanContext_Ser()
+			throws IOException, ClassNotFoundException, IllegalAccessException,
+			InvocationTargetException, NoSuchMethodException {
+		// copy class
+		InputStream bin = getClass().getResourceAsStream(
+				"/tests/api/java/beans/mock/MockJavaBean2.bin");
+		copyFile(bin, fileClass);
+
+		// copy ser
+		InputStream res = getClass().getResourceAsStream(
+				"/tests/api/java/beans/mock/MockJavaBean2.res");
+		copyFile(res, fileSer);
+
+		URLClassLoader loader = new URLClassLoader(new URL[] { fileURLCP
+				.toURL() });
+		BeanContext context = new BeanContextSupport();
+		Object bean = Beans.instantiate(loader,
+				"tests.api.java.beans.mock.MockJavaBean2", context);
+		assertEquals("as_object", (String) bean.getClass().getMethod(
+				"getPropertyOne", null).invoke(bean, null));
+		assertSame(loader, bean.getClass().getClassLoader());
+		assertTrue(context.contains(bean));
+	}
+
+	public void testInstantiateClassLoaderStringBeanContext_ClassLoaderNull()
+			throws IOException, ClassNotFoundException {
+		BeanContext context = new BeanContextSupport();
+		Object bean = Beans.instantiate(null, MockJavaBean.class.getName(),
+				context);
+		assertEquals(bean.getClass(), MockJavaBean.class);
+		assertSame(ClassLoader.getSystemClassLoader(), bean.getClass()
+				.getClassLoader());
+		assertTrue(context.contains(bean));
+	}
+
+	public void testInstantiateClassLoaderStringBeanContext_BeanNameNull()
+			throws IOException, ClassNotFoundException {
+		BeanContext context = new BeanContextSupport();
+		URLClassLoader loader = new URLClassLoader(new URL[] { fileURLCP
+				.toURL() });
+		try {
+			Object bean = Beans.instantiate(loader, null, context);
+			fail("Should throw NullPointerException.");
+		} catch (NullPointerException e) {
+		}
+	}
+
+	public void testInstantiateClassLoaderStringBeanContext_ContextNull()
+			throws IOException, ClassNotFoundException {
+		URLClassLoader loader = new URLClassLoader(new URL[] { fileURLCP
+				.toURL() });
+		Object bean = Beans.instantiate(loader, MockJavaBean.class.getName(),
+				null);
+		assertEquals(bean.getClass(), MockJavaBean.class);
+	}
+
+	/*
+	 * Class under test for Object instantiate(ClassLoader, String, BeanContext,
+	 * AppletInitializer)
+	 */
+	public void testInstantiateClassLoaderStringBeanContextAppletInitializer_Class()
+			throws IOException, ClassNotFoundException, IllegalAccessException,
+			InvocationTargetException, NoSuchMethodException {
+		// copy class
+		InputStream bin = getClass().getResourceAsStream(
+				"/tests/api/java/beans/mock/MockJavaBean2.bin");
+		copyFile(bin, fileClass);
+		URLClassLoader loader = new URLClassLoader(new URL[] { fileURLCP
+				.toURL() });
+		String beanName = "tests.api.java.beans.mock.MockJavaBean2";
+		BeanContext context = new BeanContextSupport();
+		AppletInitializer appInit = new MockAppletInitializer();
+		Object bean = Beans.instantiate(loader, beanName, context, appInit);
+
+		assertEquals("as_class", (String) bean.getClass().getMethod(
+				"getPropertyOne", null).invoke(bean, null));
+		assertSame(loader, bean.getClass().getClassLoader());
+		assertTrue(context.contains(bean));
+	}
+
+	public void testInstantiateClassLoaderStringBeanContextAppletInitializer_Ser()
+			throws ClassNotFoundException, IOException,
+			InvocationTargetException, NoSuchMethodException,
+			IllegalAccessException {
+		// copy class
+		InputStream bin = getClass().getResourceAsStream(
+				"/tests/api/java/beans/mock/MockJavaBean2.bin");
+		copyFile(bin, fileClass);
+
+		// copy ser
+		InputStream res = getClass().getResourceAsStream(
+				"/tests/api/java/beans/mock/MockJavaBean2.res");
+		copyFile(res, fileSer);
+
+		URLClassLoader loader = new URLClassLoader(new URL[] { fileURLCP
+				.toURL() });
+		String beanName = "tests.api.java.beans.mock.MockJavaBean2";
+		BeanContext context = new BeanContextSupport();
+		AppletInitializer appInit = new MockAppletInitializer();
+		Object bean = Beans.instantiate(loader, beanName, context, appInit);
+
+		assertEquals("as_object", (String) bean.getClass().getMethod(
+				"getPropertyOne", null).invoke(bean, null));
+		assertSame(loader, bean.getClass().getClassLoader());
+		assertTrue(context.contains(bean));
+	}
+
+	public void testInstantiateClassLoaderStringBeanContextAppletInitializer_LoaderNull()
+			throws IOException, ClassNotFoundException {
+		String beanName = "tests.api.java.beans.MockJavaBean";
+		BeanContext context = new BeanContextSupport();
+		AppletInitializer appInit = new MockAppletInitializer();
+		Object bean = Beans.instantiate(null, beanName, context, appInit);
+		assertSame(ClassLoader.getSystemClassLoader(), bean.getClass()
+				.getClassLoader());
+		assertEquals(beanName, bean.getClass().getName());
+		assertTrue(context.contains(bean));
+	}
+
+	public void testInstantiateClassLoaderStringBeanContextAppletInitializer_BeanNull()
+			throws IOException, ClassNotFoundException {
+		URLClassLoader loader = new URLClassLoader(new URL[] { fileURLCP
+				.toURL() });
+		BeanContext context = new BeanContextSupport();
+		AppletInitializer appInit = new MockAppletInitializer();
+		try {
+			Object bean = Beans.instantiate(loader, null, context, appInit);
+			fail("Should throw NullPointerException.");
+		} catch (NullPointerException e) {
+		}
+	}
+
+	public void testInstantiateClassLoaderStringBeanContextAppletInitializer_ContextNull()
+			throws IOException, ClassNotFoundException {
+		URLClassLoader loader = new URLClassLoader(new URL[] { fileURLCP
+				.toURL() });
+		String beanName = "tests.api.java.beans.MockJavaBean";
+		AppletInitializer appInit = new MockAppletInitializer();
+		Object bean = Beans.instantiate(loader, beanName, null, appInit);
+		assertSame(ClassLoader.getSystemClassLoader(), bean.getClass()
+				.getClassLoader());
+		assertEquals(beanName, bean.getClass().getName());
+	}
+
+	public void testInstantiateClassLoaderStringBeanContextAppletInitializer_InitializerNull()
+			throws IOException, ClassNotFoundException {
+		URLClassLoader loader = new URLClassLoader(new URL[] { fileURLCP
+				.toURL() });
+		String beanName = "tests.api.java.beans.MockJavaBean";
+		BeanContext context = new BeanContextSupport();
+		Object bean = Beans.instantiate(loader, beanName, context, null);
+		assertSame(ClassLoader.getSystemClassLoader(), bean.getClass()
+				.getClassLoader());
+		assertEquals(beanName, bean.getClass().getName());
+	}
+
+	public void testInstantiateClassLoaderStringBeanContextAppletInitializer_AppletBean()
+			throws IOException, ClassNotFoundException {
+		/*
+		 * String beanName = MockAppletBean.class.getName(); BeanContext context =
+		 * new BeanContextSupport(); MockAppletInitializer appInit = new
+		 * MockAppletInitializer(); MockAppletBean bean = (MockAppletBean)
+		 * Beans.instantiate(null, beanName, context, appInit);
+		 * assertSame(ClassLoader.getSystemClassLoader(), bean.getClass()
+		 * .getClassLoader()); assertEquals(beanName,
+		 * bean.getClass().getName()); assertTrue(context.contains(bean));
+		 * assertTrue(appInit.activateHasBeenCalled());
+		 * assertTrue(appInit.initializeHasBeenCalled());
+		 * assertTrue(bean.initHasBeenCalled());
+		 */
+	}
+
+	public void testInstantiateClassLoaderStringBeanContextAppletInitializer_AppletBean_SER()
+			throws IOException, ClassNotFoundException {
+		/*
+		 * String beanName = MockAppletBean2.class.getName(); BeanContext
+		 * context = new BeanContextSupport(); MockAppletInitializer appInit =
+		 * new MockAppletInitializer(); MockAppletBean2 bean = (MockAppletBean2)
+		 * Beans.instantiate(null, beanName, context, appInit);
+		 * assertSame(ClassLoader.getSystemClassLoader(), bean.getClass()
+		 * .getClassLoader()); assertEquals(beanName,
+		 * bean.getClass().getName()); assertTrue(context.contains(bean));
+		 * assertTrue(appInit.activateHasBeenCalled());
+		 * assertTrue(appInit.initializeHasBeenCalled());
+		 * assertFalse(bean.initHasBeenCalled());
+		 */
+	}
+
+	public void testInstantiateClassLoaderStringBeanContextAppletInitializer_AppletBean_2()
+			throws IOException, ClassNotFoundException {
+		/*
+		 * String beanName = MockAppletBean.class.getName(); BeanContext context =
+		 * new BeanContextSupport(); MockAppletInitializer appInit = new
+		 * MockAppletInitializer(); MockAppletBean bean = (MockAppletBean)
+		 * Beans.instantiate(null, beanName, context, null);
+		 */
+	}
+
+	/*
+	 * public static boolean isInstanceOf(Object bean, Class targetType)
+	 */
+	public void testIsInstanceOf() {
+		MockJavaBean bean = new MockJavaBean();
+		assertTrue(Beans.isInstanceOf(bean, Serializable.class));
+	}
+
+	public void testIsInstanceOf_BeanNull() {
+		try {
+			boolean is = Beans.isInstanceOf(null, Serializable.class);
+			fail("Should throw NullPointerException.");
+		} catch (NullPointerException e) {
+		}
+	}
+
+	public void testIsInstanceOf_TypeNull() {
+		MockJavaBean bean = new MockJavaBean();
+		assertFalse(Beans.isInstanceOf(bean, null));
+	}
+
+	public void testIsInstanceOf_TypeInvalid() {
+		MockJavaBean bean = new MockJavaBean();
+		assertFalse(Beans.isInstanceOf(bean, String.class));
+	}
+
+	public void testSetDesignTime_true() {
+		Beans.setDesignTime(true);
+		assertTrue(Beans.isDesignTime());
+	}
+
+	public void testSetDesignTime_false() {
+		Beans.setDesignTime(false);
+		assertFalse(Beans.isDesignTime());
+	}
+
+	public void testSetGuiAvailable_true() {
+		Beans.setGuiAvailable(true);
+		assertTrue(Beans.isGuiAvailable());
+	}
+
+	public void testSetGuiAvailable_false() {
+		Beans.setGuiAvailable(false);
+		assertFalse(Beans.isGuiAvailable());
+	}
+
+	private void serialize(Object obj, File file) throws FileNotFoundException,
+			IOException {
+		ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(
+				file));
+		oos.writeObject(obj);
+		oos.close();
+	}
+
+	private void copyFile(InputStream src, File dest) throws IOException {
+		FileOutputStream fos = new FileOutputStream(dest);
+		int length = 0;
+		byte[] bytes = new byte[1024];
+		while ((length = src.read(bytes)) != -1) {
+			fos.write(bytes, 0, length);
+		}
+		fos.close();
+		src.close();
+	}
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/CustomizedPersistenceDelegateTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/CustomizedPersistenceDelegateTest.java?rev=394923&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/CustomizedPersistenceDelegateTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/CustomizedPersistenceDelegateTest.java Tue Apr 18 05:11:09 2006
@@ -0,0 +1,541 @@
+/* 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.
+ */
+
+package tests.api.java.beans;
+
+import java.beans.DefaultPersistenceDelegate;
+import java.beans.Encoder;
+import java.beans.Expression;
+import java.beans.PersistenceDelegate;
+import java.beans.Statement;
+import java.beans.XMLEncoder;
+import java.io.ByteArrayOutputStream;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.AbstractList;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Vector;
+
+import junit.framework.TestCase;
+
+/**
+ * Test some customized persistence delegate, not including the AWT and SWING
+ * ones.
+ */
+public class CustomizedPersistenceDelegateTest extends TestCase {
+
+	private MockEncoder enc = null;
+
+	protected void setUp() throws Exception {
+		super.setUp();
+		enc = new MockEncoder();
+	}
+
+	public void testStringPD() {
+		enc.writeObject("");
+		assertEquals("", enc.get(""));
+	}
+
+	public void testArrayPD() {
+		Integer[] ia = new Integer[] { new Integer(1), new Integer(11100) };
+		enc.writeObject(ia);
+		assertTrue(Arrays.equals(ia, (Integer[]) enc.get(ia)));
+	}
+
+	public void testClassPD() {
+		enc.writeObject(Integer.class);
+		assertSame(Integer.class, enc.get(Integer.class));
+		enc.writeObject(String.class);
+		assertSame(String.class, enc.get(String.class));
+		enc.writeObject(Class.class);
+		assertSame(Class.class, enc.get(Class.class));
+	}
+
+	/*
+	 * Test the PD for proxy classes. Please note that this testcase has the
+	 * side effect that a PD for the system classloader is registered in the
+	 * encoder and may affect other testcases because the registration is
+	 * static.
+	 */
+	public void testProxyPD() throws Exception {
+		MyInterface o = (MyInterface) Proxy.newProxyInstance(ClassLoader
+				.getSystemClassLoader(), new Class[] { MyInterface.class },
+				new MyHandler(1));
+		PersistenceDelegate pd = new PersistenceDelegate() {
+			public Expression instantiate(Object o, Encoder e) {
+				return new Expression(o, ClassLoader.class,
+						"getSystemClassLoader", null);
+			}
+		};
+		enc.setPersistenceDelegate(ClassLoader.getSystemClassLoader()
+				.getClass(), pd);
+		enc.writeObject(o);
+		MyInterface o2 = (MyInterface) enc.get(o);
+		assertEquals(o.getProp(), o2.getProp());
+	}
+
+	public void testPrimitivePD() {
+		// int
+		int[] ia = new int[] { 1, 2 };
+		enc.writeObject(ia);
+		assertTrue(Arrays.equals(ia, (int[]) enc.get(ia)));
+		ia = new int[0];
+		enc.writeObject(ia);
+		assertTrue(Arrays.equals(ia, (int[]) enc.get(ia)));
+
+		// short
+		short[] sa = new short[] { 1, 2 };
+		enc.writeObject(sa);
+		assertTrue(Arrays.equals(sa, (short[]) enc.get(sa)));
+		sa = new short[0];
+		enc.writeObject(sa);
+		assertTrue(Arrays.equals(sa, (short[]) enc.get(sa)));
+
+		// long
+		long[] la = new long[] { 1, 2 };
+		enc.writeObject(la);
+		assertTrue(Arrays.equals(la, (long[]) enc.get(la)));
+		la = new long[0];
+		enc.writeObject(la);
+		assertTrue(Arrays.equals(la, (long[]) enc.get(la)));
+
+		// float
+		float[] fa = new float[] { 1, 2 };
+		enc.writeObject(fa);
+		assertTrue(Arrays.equals(fa, (float[]) enc.get(fa)));
+		fa = new float[0];
+		enc.writeObject(fa);
+		assertTrue(Arrays.equals(fa, (float[]) enc.get(fa)));
+
+		// double
+		double[] da = new double[] { -1, 2.0 };
+		enc.writeObject(da);
+		assertTrue(Arrays.equals(da, (double[]) enc.get(da)));
+		da = new double[0];
+		enc.writeObject(da);
+		assertTrue(Arrays.equals(da, (double[]) enc.get(da)));
+
+		// boolean
+		boolean[] ba = new boolean[] { true, false };
+		enc.writeObject(ba);
+		assertTrue(Arrays.equals(ba, (boolean[]) enc.get(ba)));
+		ba = new boolean[0];
+		enc.writeObject(ba);
+		assertTrue(Arrays.equals(ba, (boolean[]) enc.get(ba)));
+
+		// char
+		char[] ca = new char[] { 'c', 'b' };
+		enc.writeObject(ca);
+		assertTrue(Arrays.equals(ca, (char[]) enc.get(ca)));
+		ca = new char[0];
+		enc.writeObject(ca);
+		assertTrue(Arrays.equals(ca, (char[]) enc.get(ca)));
+
+		// byte
+		byte[] bba = new byte[] { 112, 12 };
+		enc.writeObject(bba);
+		assertTrue(Arrays.equals(bba, (byte[]) enc.get(bba)));
+		bba = new byte[0];
+		enc.writeObject(bba);
+		assertTrue(Arrays.equals(bba, (byte[]) enc.get(bba)));
+	}
+
+	public void testMethodPD() throws Exception {
+		Method m = Object.class.getMethod("getClass", null);
+		enc.writeObject(m);
+		assertEquals(m, enc.get(m));
+	}
+
+	public void testFieldPD() throws Exception {
+		Field f = MyHandler.class.getField("i");
+		enc.writeObject(f);
+		assertEquals(f, enc.get(f));
+	}
+
+	static class MockPersistenceDelegate extends DefaultPersistenceDelegate {
+		private String name;
+
+		public MockPersistenceDelegate(String s) {
+			this.name = s;
+		}
+
+		protected void initialize(Class type, Object oldInstance,
+				Object newInstance, Encoder enc) {
+			// System.out.println(name + " initialize called: " + type);
+			// new Throwable().printStackTrace();
+			super.initialize(type, oldInstance, newInstance, enc);
+			// System.out.println(name + " initialize exited");
+		}
+
+		protected Expression instantiate(Object oldInstance, Encoder enc) {
+			// System.out.println(name + " instantiate called");
+			return super.instantiate(oldInstance, enc);
+		}
+
+		protected boolean mutatesTo(Object o1, Object o2) {
+			// System.out.println(name + " mutatesTo called");
+			return super.mutatesTo(o1, o2);
+		}
+	}
+
+	static class MockPersistenceDelegate2 extends PersistenceDelegate {
+		private String name;
+
+		public MockPersistenceDelegate2(String s) {
+			this.name = s;
+		}
+
+		protected void initialize(Class type, Object oldInstance,
+				Object newInstance, Encoder enc) {
+			// System.out.println(name + " initialize called: " + type);
+			// new Throwable().printStackTrace();
+			super.initialize(type, oldInstance, newInstance, enc);
+			// System.out.println(name + " initialize exited");
+		}
+
+		protected Expression instantiate(Object oldInstance, Encoder enc) {
+			// System.out.println(name + " instantiate called");
+			return null;
+		}
+
+		protected boolean mutatesTo(Object o1, Object o2) {
+			// System.out.println(name + " mutatesTo called");
+			return super.mutatesTo(o1, o2);
+		}
+	}
+
+	static class MockEncoder extends Encoder {
+		public void writeObject(Object o) {
+			// System.out.println("write object: " + o);
+			super.writeObject(o);
+		}
+
+		public PersistenceDelegate getPersistenceDelegate(Class type) {
+			// System.out.println("getPersistenceDelegate for " + type);
+			return super.getPersistenceDelegate(type);
+		}
+
+		public void writeExpression(Expression oldExp) {
+			// System.out.println("Expression: " + oldExp);
+			super.writeExpression(oldExp);
+		}
+
+		public void writeStatement(Statement oldStat) {
+			// System.out.println("Statement: " + oldStat);
+			if (oldStat.getMethodName().equals("add")) {
+				new Throwable().printStackTrace();
+			}
+			super.writeStatement(oldStat);
+		}
+
+		public Object get(Object o) {
+			// StackTraceElement[] stack = new Throwable().getStackTrace();
+			// new Throwable().printStackTrace();
+			// System.out.println("get object: " + o);
+			return super.get(o);
+		}
+	}
+
+	/*
+	 * Interface for the proxy class.
+	 */
+	public static interface MyInterface {
+		void setProp(int i);
+
+		int getProp();
+	}
+
+	/*
+	 * Mock grand parent.
+	 */
+	public static class MockGrandParent {
+		boolean b;
+
+		public boolean getPropb() {
+			return this.b;
+		}
+
+		public void setPropb(boolean b) {
+			this.b = b;
+		}
+	}
+
+	/*
+	 * Mock parent.
+	 */
+	public static class MockParent extends MockGrandParent {
+		String s;
+
+		int i;
+
+		public int getProp() {
+			return 2;
+		}
+
+		public void setProp(int i) {
+			this.i = i;
+		}
+
+		public String getProps() {
+			return this.s;
+		}
+
+		public void setProps(String s) {
+			this.s = s;
+		}
+	}
+
+	/*
+	 * Mock object.
+	 */
+	public static class MockObject extends AbstractList implements MyInterface,
+			List {
+		int i;
+
+		Vector v = new Vector();
+
+		public void add(int location, Object object) {
+			v.add(location, object);
+		}
+
+		public boolean add(Object object) {
+			return v.add(object);
+		}
+
+		public boolean addAll(Collection collection) {
+			return v.addAll(collection);
+		}
+
+		public boolean addAll(int location, Collection collection) {
+			return v.addAll(location, collection);
+		}
+
+		public void clear() {
+			v.clear();
+		}
+
+		public boolean contains(Object object) {
+			return v.contains(object);
+		}
+
+		public boolean containsAll(Collection collection) {
+			return v.containsAll(collection);
+		}
+
+		public Object get(int location) {
+			return v.get(location);
+		}
+
+		public int indexOf(Object object) {
+			return v.indexOf(object);
+		}
+
+		public boolean isEmpty() {
+			return v.isEmpty();
+		}
+
+		public Iterator iterator() {
+			return v.iterator();
+		}
+
+		public int lastIndexOf(Object object) {
+			return v.lastIndexOf(object);
+		}
+
+		public ListIterator listIterator() {
+			return v.listIterator();
+		}
+
+		public ListIterator listIterator(int location) {
+			return v.listIterator(location);
+		}
+
+		public Object remove(int location) {
+			return v.remove(location);
+		}
+
+		public boolean remove(Object object) {
+			return v.remove(object);
+		}
+
+		public boolean removeAll(Collection collection) {
+			return v.removeAll(collection);
+		}
+
+		public boolean retainAll(Collection collection) {
+			return v.retainAll(collection);
+		}
+
+		public Object set(int location, Object object) {
+			return v.set(location, object);
+		}
+
+		public int size() {
+			return v.size();
+		}
+
+		public List subList(int start, int end) {
+			return v.subList(start, end);
+		}
+
+		public Object[] toArray() {
+			return v.toArray();
+		}
+
+		public Object[] toArray(Object[] array) {
+			return v.toArray(array);
+		}
+
+		public int getProp() {
+			return i;
+		}
+
+		public void setProp(int i) {
+			this.i = i;
+		}
+	}
+
+	/*
+	 * Handler for the proxy class.
+	 */
+	public static class MyHandler implements InvocationHandler {
+
+		public int i;
+
+		public MyHandler() {
+			this.i = 0;
+		}
+
+		public MyHandler(int i) {
+			this.i = i;
+		}
+
+		public Object invoke(Object proxy, Method method, Object[] args)
+				throws Throwable {
+			if (method.getName().equals("setProp")) {
+				this.i = ((Integer) args[0]).intValue();
+				return null;
+			} else if (method.getName().equals("getProp")) {
+				return new Integer(i);
+			}
+			return null;
+		}
+
+		public void setI(int i) {
+			this.i = i;
+		}
+
+		public int getI() {
+			return this.i;
+		}
+	}
+
+	public static void main1(String[] args) throws Exception {
+		ByteArrayOutputStream os = new ByteArrayOutputStream();
+		XMLEncoder enc = new XMLEncoder(os);
+		MockEncoder enc2 = new MockEncoder();
+		enc2.setPersistenceDelegate(MyInterface.class,
+				new MockPersistenceDelegate("interface"));
+		enc2.setPersistenceDelegate(MockParent.class,
+				new MockPersistenceDelegate("parent class"));
+		enc2.setPersistenceDelegate(MockGrandParent.class,
+				new MockPersistenceDelegate("grand parent class"));
+
+		// Vector
+		Vector v = new Vector();
+		v.add("hehe");
+		// enc.writeObject(v);
+
+		// ArrayList
+		ArrayList al = new ArrayList();
+		al.add("hehe");
+		// enc.writeObject(al);
+
+		// Field
+		Field m = Integer.class.getDeclaredField("TYPE");
+		// enc.writeObject(m);
+
+		// Complex bean with indexed properties
+		ComplexBean cb = new ComplexBean();
+		cb.setI(0, true);
+		// enc.writeObject(cb);
+
+		MockObject o = new MockObject();
+		o.add("haha");
+		o.setProp(3);
+		// o.setProps("test");
+		// o.setPropb(true);
+		// Menu mm = new Menu("MyMenu");
+		// MenuItem mi = new MenuItem("menu1");
+		// mm.add(mi);
+		// enc.writeObject(mm);
+
+		// enc2.writeObject(o);
+		// enc.writeObject(o);
+		// new MockPersistenceDelegate2("PD").initialize(AbstractList.class, v,
+		// new Vector(), enc2);
+
+		enc.close();
+
+		System.out.println(os.toString());
+		// System.out.println(enc2.getPersistenceDelegate(MyInterface.class));
+		// System.out.println(enc2.getPersistenceDelegate(Vector.class));
+		// System.out.println(enc2.getPersistenceDelegate(List.class));
+		// System.out.println(enc2.getPersistenceDelegate(Collection.class));
+		// System.out.println(enc2
+		// .getPersistenceDelegate(AbstractCollection.class));
+		// System.out.println(enc2.getPersistenceDelegate(AbstractList.class));
+		// System.out.println(enc2.getPersistenceDelegate(Map.class));
+		// System.out.println(enc2.getPersistenceDelegate(Hashtable.class));
+		// System.out.println(enc2.getPersistenceDelegate(HashMap.class));
+		// System.out.println(enc2.getPersistenceDelegate(Component.class));
+
+	}
+
+	public static void main(String[] args) throws Exception {
+		XMLEncoder e = new XMLEncoder(System.out);
+		e.writeStatement(new Expression(Integer.class, "getField",
+				new Object[] { "TYPE" }));
+		// e.writeObject(Integer.TYPE);
+		e.close();
+	}
+
+	public static class ComplexBean {
+		boolean[] ba = new boolean[2];
+
+		public void setI(int i, boolean b) {
+			ba[i] = b;
+		}
+
+		public boolean getI(int i) {
+			return ba[i];
+		}
+		//        
+		// public void setI(boolean[] ba) {
+		// this.ba = ba;
+		// }
+		//        
+		// public boolean[] getI() {
+		// return ba;
+		// }
+	}
+}



Mime
View raw message