Author: jsong
Date: Fri Jul 30 16:42:47 2004
New Revision: 31006
Added:
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/test.xml
Modified:
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/NestProps.java
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/NestPropsImpl.jcs
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/Props.java
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/PropsExtension.jcx
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/PropsImpl.jcs
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SingleProperty.java
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SingleProperty2.java
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SingleProperty2Impl.jcs
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SinglePropertyImpl.jcs
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/property/DrivePropsBeans.java
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/extension/SubControlTest.java
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/instantiate/TestInstantiate.java
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientAccessTest.java
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientImplTest.java
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ImplAccessTest.java
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/PropTest.java
Log:
adding more tests on controls inheritance and change java doc.
Modified:
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/NestProps.java
==============================================================================
---
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/NestProps.java
(original)
+++
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/NestProps.java
Fri Jul 30 16:42:47 2004
@@ -1,4 +1,4 @@
-package org.apache.beehive.controls.test.controls.properties;
+package org.apache.beehive.controls.test.controls.property;
import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
Modified:
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/NestPropsImpl.jcs
==============================================================================
---
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/NestPropsImpl.jcs
(original)
+++
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/NestPropsImpl.jcs
Fri Jul 30 16:42:47 2004
@@ -1,4 +1,4 @@
-package org.apache.beehive.controls.test.controls.properties;
+package org.apache.beehive.controls.test.controls.property;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
Modified:
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/Props.java
==============================================================================
---
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/Props.java
(original)
+++
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/Props.java
Fri Jul 30 16:42:47 2004
@@ -1,4 +1,4 @@
-package org.apache.beehive.controls.test.controls.properties;
+package org.apache.beehive.controls.test.controls.property;
import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
Modified:
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/PropsExtension.jcx
==============================================================================
---
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/PropsExtension.jcx
(original)
+++
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/PropsExtension.jcx
Fri Jul 30 16:42:47 2004
@@ -1,4 +1,4 @@
-package org.apache.beehive.controls.test.controls.properties;
+package org.apache.beehive.controls.test.controls.property;
import org.apache.beehive.controls.api.bean.ControlExtension;
Modified:
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/PropsImpl.jcs
==============================================================================
---
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/PropsImpl.jcs
(original)
+++
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/PropsImpl.jcs
Fri Jul 30 16:42:47 2004
@@ -1,4 +1,4 @@
-package org.apache.beehive.controls.test.controls.properties;
+package org.apache.beehive.controls.test.controls.property;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
Modified:
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SingleProperty.java
==============================================================================
---
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SingleProperty.java
(original)
+++
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SingleProperty.java
Fri Jul 30 16:42:47 2004
@@ -1,4 +1,4 @@
-package org.apache.beehive.controls.test.controls.properties;
+package org.apache.beehive.controls.test.controls.property;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Modified:
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SingleProperty2.java
==============================================================================
---
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SingleProperty2.java
(original)
+++
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SingleProperty2.java
Fri Jul 30 16:42:47 2004
@@ -1,4 +1,4 @@
-package org.apache.beehive.controls.test.controls.properties;
+package org.apache.beehive.controls.test.controls.property;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Modified:
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SingleProperty2Impl.jcs
==============================================================================
---
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SingleProperty2Impl.jcs
(original)
+++
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SingleProperty2Impl.jcs
Fri Jul 30 16:42:47 2004
@@ -1,4 +1,4 @@
-package org.apache.beehive.controls.test.controls.properties;
+package org.apache.beehive.controls.test.controls.property;
import org.apache.beehive.controls.api.bean.ControlImplementation;
import org.apache.beehive.controls.api.context.Context;
Modified:
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SinglePropertyImpl.jcs
==============================================================================
---
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SinglePropertyImpl.jcs
(original)
+++
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SinglePropertyImpl.jcs
Fri Jul 30 16:42:47 2004
@@ -1,4 +1,4 @@
-package org.apache.beehive.controls.test.controls.properties;
+package org.apache.beehive.controls.test.controls.property;
import org.apache.beehive.controls.api.bean.ControlImplementation;
import org.apache.beehive.controls.api.context.Context;
Modified:
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/property/DrivePropsBeans.java
==============================================================================
---
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/property/DrivePropsBeans.java
(original)
+++
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/property/DrivePropsBeans.java
Fri Jul 30 16:42:47 2004
@@ -10,15 +10,15 @@
import org.apache.beehive.controls.api.properties.PropertyMap;
import org.apache.beehive.controls.test.controls.util.TestBeanContext;
-import org.apache.beehive.controls.test.controls.properties.Props;
-import org.apache.beehive.controls.test.controls.properties.Props.ArrayProps;
-import org.apache.beehive.controls.test.controls.properties.Props.SimpleEnum;
-import org.apache.beehive.controls.test.controls.properties.Props.SimpleProps;
-import org.apache.beehive.controls.test.controls.properties.Props.TestAnnot;
-import org.apache.beehive.controls.test.controls.properties.PropsBean;
-import org.apache.beehive.controls.test.controls.properties.PropsExtension;
-import org.apache.beehive.controls.test.controls.properties.PropsExtensionBean;
-import org.apache.beehive.controls.test.controls.properties.NestPropsBean;
+import org.apache.beehive.controls.test.controls.property.Props;
+import org.apache.beehive.controls.test.controls.property.Props.ArrayProps;
+import org.apache.beehive.controls.test.controls.property.Props.SimpleEnum;
+import org.apache.beehive.controls.test.controls.property.Props.SimpleProps;
+import org.apache.beehive.controls.test.controls.property.Props.TestAnnot;
+import org.apache.beehive.controls.test.controls.property.PropsBean;
+import org.apache.beehive.controls.test.controls.property.PropsExtension;
+import org.apache.beehive.controls.test.controls.property.PropsExtensionBean;
+import org.apache.beehive.controls.test.controls.property.NestPropsBean;
/* This class contains the logic to test HelloControlBean
It will exercise the control in a certain way and generate a
Modified:
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/extension/SubControlTest.java
==============================================================================
---
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/extension/SubControlTest.java
(original)
+++
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/extension/SubControlTest.java
Fri Jul 30 16:42:47 2004
@@ -9,7 +9,8 @@
import org.apache.beehive.controls.test.controls.extension.SubControlBean;
/**
- * A TeseCase that tests control inheritance by instantiating a subcontrol and
invoking the methods.
+ * A TeseCase that tests control inheritance by instantiating a subcontrol and
invoking the methods
+ * and getting/setting the properties.
*/
public class SubControlTest extends TestCase
{
@@ -73,10 +74,11 @@
}
/**
- * Tests accessing the propertySet declared on ExtensibleControl from a
subcontrol instance.
+ * Tests getting propertySet inherited from ExtensibleControl from a
subcontrol instance.
+ * The property is retrieved via control context.
* The subcontrol is instantiated declaratively
*/
- public void testInheritedProperty() throws Exception
+ public void testGettingInheritedPropertyByContext() throws Exception
{
Assert.assertNotNull(subcontrol);
String s=subcontrol.accessInheritedProperty();
@@ -85,10 +87,11 @@
}
/**
- * Tests accessing the propertySet declared on ExtensibleControl from a
subcontrol instance
+ * Tests getting the propertySet inherited from ExtensibleControl from a
subcontrol instance
+ * The property is retrieved via control context.
* The subcontrol is instantiated programmatically
*/
- public void testInheritedProperty2() throws Exception
+ public void testGettingInheritedPropertyByContext2() throws Exception
{
SubControlBean
sub=(SubControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
@@ -98,13 +101,70 @@
}
- /** BUG: getter/setter in generated bean class is busted! comment out all
tests using getter/setter*/
+ /** BUG: getter/setter in generated bean class is busted! comment out
all tests using getter/setter*/
/**
- * Tests accessing the property declared on ExtensibleControl but reset on
SubControl IF
+ * Tests getting an inherited property from a subcontrol instance.
+ * The property is retrieved via getter.
* The subcontrol is instantiated declaratively
*
- public void testResetProperty() throws Exception
+ public void testGettingInheritedPropertyByGetter() throws Exception
+ {
+ Assert.assertNotNull(subcontrol);
+ String s=subcontrol.getWhereaboutPosition();
+ Assert.assertEquals("In_ExtensibleControl_Interface",s);
+
+ }
+
+ /**
+ * Tests getting an inherited property from a subcontrol instance
+ * The property is retrieved via getter.
+ * The subcontrol is instantiated programmatically
+ *
+ public void testGettingInheritedPropertyByGetter2() throws Exception
+ {
+ SubControlBean
sub=(SubControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
+
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
+
+ Assert.assertNotNull(sub);
+
Assert.assertEquals("In_ExtensibleControl_Interface",sub.getWhereaboutPosition());
+
+ }
+
+ /**
+ * Tests setting an inherited property from a subcontrol instance.
+ * The property is retrieved via getter.
+ * The subcontrol is instantiated declaratively
+ *
+ public void testSettingInheritedPropertyBySetter() throws Exception
+ {
+ Assert.assertNotNull(subcontrol);
+ String s=subcontrol.setWhereaboutPosition("new position");
+ Assert.assertEquals("In_ExtensibleControl_Interface",s);
+
+ }
+
+ /**
+ * Tests setting an inherited property from a subcontrol instance
+ * The property is retrieved via getter.
+ * The subcontrol is instantiated programmatically
+ *
+ public void testSettingInheritedPropertyBySetter2() throws Exception
+ {
+ SubControlBean
sub=(SubControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
+
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
+
+ Assert.assertNotNull(sub);
+
Assert.assertEquals("In_ExtensibleControl_Interface",sub.getWhereaboutPosition());
+
+ }
+
+ /**
+ * Tests getting a reconfigured inherited property.(The property is
declared on super control
+ * but reconfigured on sub control interface).
+ * The subcontrol is instantiated declaratively
+ *
+ public void testGetReconfiguredPropertyByGetter() throws Exception
{
String s=subcontrol.getWhereAboutLayer();
Assert.assertEquals(s,"On_SubControl_Interface_Layer");
@@ -112,10 +172,36 @@
}
/**
- * Tests accessing the property declared on ExtensibleControl but reset on
SubControl IF
+ * Tests getting a reconfigured inherited property.(The property is
declared on super control
+ * but reconfigured on sub control interface).
* The subcontrol is instantiated programmatically
*
- public void testResetProperty2() throws Exception
+ public void testGetReconfiguredPropertyByGetter2() throws Exception
+ {
+ SubControlBean
sub=(SubControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
+
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
+
+ Assert.assertNotNull(sub);
+
Assert.assertEquals(sub.getWhereAboutLayer(),"On_SubControl_Interface_Layer");
+
+ }
+
+ /**
+ * Tests setting the reconfigured and inherited property using bean setter
+ * The subcontrol is instantiated declaratively
+ *
+ public void testSetReconfiguredPropertyBySetter() throws Exception
+ {
+ String s=subcontrol.getWhereAboutLayer();
+ Assert.assertEquals(s,"On_SubControl_Interface_Layer");
+
+ }
+
+ /**
+ * Tests setting the reconfigured and inherited property using bean
setter
+ * The subcontrol is instantiated programmatically
+ *
+ public void testSetReconfiguredPropertyBySetter2() throws Exception
{
SubControlBean
sub=(SubControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
@@ -125,11 +211,55 @@
}
+ */
+
+ /**
+ * Tests getting the reconfigured and inherited property.(A property
declared on super control,
+ * but reconfigured on sub control)
+ * The reset property is retrieve by context.
+ * The subcontrol is instantiated declaratively
+ */
+ public void testGetReconfiguredPropertyByContext() throws Exception
+ {
+ Assert.assertNotNull(subcontrol);
+ String s=subcontrol.getLayerByContext();
+ Assert.assertEquals("On_SubControl_Interface_Layer",s);
+
+ }
+
+ /**
+ * Tests getting the reconfigured and inherited property.(A property
declared on super control,
+ * but reconfigured on sub control)
+ * The reset property is retrieve by context.
+ * The subcontrol is instantiated programmatically
+ */
+ public void testGetReconfiguredPropertyByContext2() throws Exception
+ {
+ SubControlBean
sub=(SubControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
+
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
+
+ Assert.assertNotNull(sub);
+
Assert.assertEquals("On_SubControl_Interface_Layer",sub.getLayerByContext());
+
+ }
+
+ /* More tests to be added on getting property value reconfigured on
subcontrol
+ * by declaration.
+ * The above tests testGetReconfiguredPropertyByContext(2) gets the
value using an
+ * inherited method.
+ * Once testExtendedMethod passes, we need to add one or two tests to
+ * get the reconfigured value using an extended method on subcontrol
+ *
+ * Like: testGetReconfigurePropertyBySubImpl
+ * While the above two methods are really:
testGetReconfiguredPropertyBySuperImpl
+ */
+
/**
- * Tests accessing the property declared SubControl interface
+ * Tests getting the property declared SubControl interface.
+ * The value is retrieved by getter on subcontrol bean
* The subcontrol is instantiated declaratively
*
- public void testNewProperty() throws Exception
+ public void testGetExtendedPropertyByGetter() throws Exception
{
String s=subcontrol.getNewPropertyMessage();
Assert.assertEquals(s,"New Property Declared by Sub Control");
@@ -137,16 +267,74 @@
}
/**
- * Tests accessing the property declared on SubControl interface
+ * Tests getting the property declared on SubControl interface
+ * The value is retrieved by getter on the subcontrol bean.
* The subcontrol is instantiated programmatically
*
- public void testNewProperty2() throws Exception
+ public void testGetExtendedPropertyByGetter2() throws Exception
{
SubControlBean
sub=(SubControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
Assert.assertNotNull(sub);
Assert.assertEquals(sub.getNewPropertyMessage(),"New Property
Declared by Sub Control");
+
+ }
+
+ /**
+ * Tests getting the property declared on SubControl interface.
+ * The value is retrieved by control context.
+ * The subcontrol is instantiated declaratively.
+ *
+ public void testGetExtendedPropertyByContext() throws Exception
+ {
+ //one new method needs to be added on SubControl
+ //getNewPropertyByContext()
+ }
+
+ /**
+ * Tests getting the property declared on SubControl interface.
+ * The property is retrieved by control context.
+ * The subcontrol is instantiated programmatically.
+ *
+ public void testGetExtendedPropertyByContext2() throws Exception
+ {
+ //one new method needs to be added on SubControl
+ //getNewPropertyByContext()
+ }
+
+ /**
+ * Tests setting the property declared SubControl interface.
+ * The value is changed by setter on subcontrol bean
+ * The subcontrol is instantiated declaratively
+ *
+ public void testSetExtendedPropertyBySetter() throws Exception
+ {
+ String s=subcontrol.getNewPropertyMessage();
+ Assert.assertEquals(s,"New Property Declared by Sub Control");
+
+ }
+
+ /**
+ * Tests setting the property declared on SubControl interface
+ * The value is changed by setter on the subcontrol bean.
+ * The subcontrol is instantiated programmatically
+ *
+ public void testSetExtendedPropertyBySetter2() throws Exception
+ {
+ SubControlBean
sub=(SubControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
+
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
+
+ Assert.assertNotNull(sub);
+ Assert.assertEquals(sub.getNewPropertyMessage(),"New Property
Declared by Sub Control");
+
+ }
+
+ /**
+ * Invokes a method overwritten by subcontrol
+ *
+ public void testOverwrittenMethod() throws Exception
+ {
}
Modified:
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/instantiate/TestInstantiate.java
==============================================================================
---
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/instantiate/TestInstantiate.java
(original)
+++
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/instantiate/TestInstantiate.java
Fri Jul 30 16:42:47 2004
@@ -7,8 +7,8 @@
import org.apache.beehive.controls.api.bean.ControlBean;
import org.apache.beehive.controls.test.controls.instantiate.HelloControlBean;
-import org.apache.beehive.controls.test.controls.properties.SinglePropertyBean;
-import org.apache.beehive.controls.test.controls.properties.SingleProperty;
+import org.apache.beehive.controls.test.controls.property.SinglePropertyBean;
+import org.apache.beehive.controls.test.controls.property.SingleProperty;
/**
* A TestCase that tests instantiating controls in different ways
Modified:
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientAccessTest.java
==============================================================================
---
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientAccessTest.java
(original)
+++
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientAccessTest.java
Fri Jul 30 16:42:47 2004
@@ -1,9 +1,9 @@
-package org.apache.beehive.controls.test.java.properties;
+package org.apache.beehive.controls.test.java.property;
import java.beans.Beans;
import org.apache.beehive.controls.api.bean.Control;
import org.apache.beehive.controls.api.bean.ControlBean;
-import
org.apache.beehive.controls.test.controls.properties.SingleProperty2Bean;
+import org.apache.beehive.controls.test.controls.property.SingleProperty2Bean;
import junit.framework.Assert;
import junit.framework.TestCase;
@@ -25,10 +25,10 @@
/** BUG: getter/setter in generated bean is busted. comment out all
tests using getter/setter*/
/**
- * SingleProperty2 declares a propertySet, this method shall access this
propertySet
- * SingleProperty2Bean is instantiate by declaration
+ * Accesses property value by getter of the control bean instance.
+ * The ccontrol bean is instantiated declaratively
*
- public void testHelloImpByDeclare() throws Exception
+ public void testGetterByDeclare() throws Exception
{
String s=myControl.getGreetingGreetWord();
@@ -36,14 +36,14 @@
}
/**
- * SingleProperty2 declares a propertySet, this method shall access this
propertySet
- * SingleProperty2Bean is instantiate by program
+ * Accesses property value by getter og control bean instance.
+ * The control bean is instantiated programmatically
*
- public void testHelloImpByProgram() throws Exception
+ public void testGetterByProgram() throws Exception
{
Report report =new Report();
SingleProperty2Bean
sbean=(SingleProperty2Bean)Beans.instantiate(Thread.currentThread().getContextClassLoader(),
-
"org.apache.beehive.controls.test.controls.properties.SingleProperty2Bean");
+
"org.apache.beehive.controls.test.controls.property.SingleProperty2Bean");
String s=sbean.getGreetingGreetWord();
Assert.assertEquals(s,"Hello");
Modified:
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientImplTest.java
==============================================================================
---
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientImplTest.java
(original)
+++
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientImplTest.java
Fri Jul 30 16:42:47 2004
@@ -1,4 +1,4 @@
-package org.apache.beehive.controls.test.java.properties;
+package org.apache.beehive.controls.test.java.property;
import junit.framework.Assert;
import junit.framework.TestCase;
@@ -6,12 +6,12 @@
import java.beans.Beans;
import org.apache.beehive.controls.api.bean.Control;
import org.apache.beehive.controls.api.bean.ControlBean;
-import org.apache.beehive.controls.test.controls.properties.SinglePropertyBean;
+import org.apache.beehive.controls.test.controls.property.SinglePropertyBean;
import org.apache.beehive.test.tools.milton.common.Report;
/**
- * Test access a control's propertySet by both impl and client
+ * A TestCase that tests accessing control's propertySet by both impl and
client
*/
public class ClientImplTest extends TestCase
{
@@ -19,7 +19,7 @@
/**
* A control that declares some propertySet in its control interface
- * its impl accesses these propertySet.
+ * It's sayHello method allows accessing the value via control context.
*/
@Control
public SinglePropertyBean myControl;
@@ -28,11 +28,11 @@
/**BUG: getter/setter in generated bean is busted comment out all tests
using getter/setter*/
/**
- * Resets the propertySet value by the setter on control bean;
- * Retrieves the new value via control's impl
+ * Resets control's property value by setter of the bean instance and
+ * retrieves the new value using control context on control's impl.
* This method instantiates HelloBean by declaration
*
- public void testHelloImpByDeclare() throws Exception
+ public void testResetPropertyByDeclare() throws Exception
{
myBean.setGreetingGreetWord("Good morning!");
@@ -41,15 +41,15 @@
}
/**
- * Resets the propertySet value by the setter on control bean;
- * Retrieves the new value via control's impl
+ * Resets control's property value by setter of the bean instance and
+ * retrieves the new value using control context on control's impl.
* This method instantiates HelloBean by program
*
- public void testHelloImpByProgram() throws Exception
+ public void testResetPropertyByProgram() throws Exception
{
Report report =new Report();
SinglePropertyBean
sbean=(SinglePropertyBean)Beans.instantiate(Thread.currentThread().getContextClassLoader(),
-
"org.apache.beehive.controls.test.controls.properties.SingleProperty");
+
"org.apache.beehive.controls.test.controls.property.SingleProperty");
hbean.setGreetingGreetWord("Good morning!");
String s=sbean.sayHello();
Assert.assertEquals("Good morning!",s);
Modified:
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ImplAccessTest.java
==============================================================================
---
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ImplAccessTest.java
(original)
+++
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ImplAccessTest.java
Fri Jul 30 16:42:47 2004
@@ -1,16 +1,16 @@
-package org.apache.beehive.controls.test.java.properties;
+package org.apache.beehive.controls.test.java.property;
import java.beans.Beans;
import org.apache.beehive.controls.api.bean.Control;
import org.apache.beehive.controls.api.bean.ControlBean;
-import org.apache.beehive.controls.test.controls.properties.SinglePropertyBean;
+import org.apache.beehive.controls.test.controls.property.SinglePropertyBean;
import junit.framework.Assert;
import junit.framework.TestCase;
import org.apache.beehive.test.tools.milton.common.Report;
/**
- * Tests control accessing propertySet from its impl
+ * A TestCase that tests accessing property values via control context in
control impl
*/
public class ImplAccessTest extends TestCase
@@ -18,40 +18,39 @@
public ImplAccessTest( String s ) { super( s ); }
/**
- * A control that declares some propertySet in its control interface
- * its impl accesses these propertySet.
+ * A control that declares some propertySets in its control interface.
+ * It has a method that allow accessing these property values via
control context.
*/
@Control
public SinglePropertyBean myControl;
/**
- * SinglePropertyImpl retrievs PropertySet in its sayHello method.
- * Invokes SinglePropertyBean.sayHello() should return the PropertySet
- * declared on Hello.java
- * This method instantiates HelloBean by declaration
+ * Tests accessing property values via control context.
+ * By invoking sayHello method, the property value is retrieved via
control context.
+ * The control bean is instantiated by declaration.
*/
- public void testHelloImpByDeclare() throws Exception
+ public void testContextAccessByDeclare() throws Exception
{
/*
Report report =new Report();
Assert.assertEquals(report.getStatus(), Report.PASS);
*/
+ Assert.assertNotNull(myControl);
String s=myControl.sayHello();
Assert.assertEquals("Hello",s);
}
/**
- * SinglePropertyImpl retrievs PropertySet in its sayHello method.
- * Invokes SinglePropertyBean.sayHello() should return the PropertySet
- * declared on Hello.java
- * This method instantiates SinglePropertyBean by program
+ * Tests accessing property values via control context.
+ * By invoking sayHello method, the property value is retrieved via
control context.
+ * The control bean is instantiated programmatically.
*/
- public void testHelloImpByProgram() throws Exception
+ public void testContextAccessByProgram() throws Exception
{
- Report report =new Report();
+ //Report report =new Report();
SinglePropertyBean
sbean=(SinglePropertyBean)Beans.instantiate(Thread.currentThread().getContextClassLoader(),
-
"org.apache.beehive.controls.test.controls.properties.SinglePropertyBean");
+
"org.apache.beehive.controls.test.controls.property.SinglePropertyBean");
String s=sbean.sayHello();
Assert.assertEquals("Hello",s);
}
Modified:
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/PropTest.java
==============================================================================
---
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/PropTest.java
(original)
+++
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/PropTest.java
Fri Jul 30 16:42:47 2004
@@ -1,4 +1,4 @@
-package org.apache.beehive.controls.test.java.properties;
+package org.apache.beehive.controls.test.java.property;
import java.beans.Beans;
import org.apache.beehive.controls.api.bean.ControlBean;
@@ -7,9 +7,9 @@
import junit.framework.TestCase;
import org.apache.beehive.controls.test.controls.util.TestBeanContext;
-import org.apache.beehive.controls.test.controls.properties.PropsBean;
-import org.apache.beehive.controls.test.controls.properties.PropsExtensionBean;
-import org.apache.beehive.controls.test.controls.properties.NestPropsBean;
+import org.apache.beehive.controls.test.controls.property.PropsBean;
+import org.apache.beehive.controls.test.controls.property.PropsExtensionBean;
+import org.apache.beehive.controls.test.controls.property.NestPropsBean;
import org.apache.beehive.controls.test.driver.property.DrivePropsBeans;
@@ -43,7 +43,7 @@
*/
public void testClientAccess() throws Exception
{
- PropsBean propBean =
(PropsBean)createTestBean("org.apache.beehive.controls.test.controls.properties.PropsBean");
+ PropsBean propBean =
(PropsBean)createTestBean("org.apache.beehive.controls.test.controls.property.PropsBean");
DrivePropsBeans driver=new DrivePropsBeans();
Report report =driver.testClientAccess(propBean);
@@ -57,7 +57,7 @@
public void testImplAccess() throws Exception
{
PropsExtensionBean propExtBean =
(PropsExtensionBean)createTestBean("org.apache.beehive.controls.test.controls.properties.PropsExtensionBean");
- NestPropsBean nestBean =
(NestPropsBean)createTestBean("org.apache.beehive.controls.test.controls.properties.NestPropsBean");
+ NestPropsBean nestBean =
(NestPropsBean)createTestBean("org.apache.beehive.controls.test.controls.property.NestPropsBean");
DrivePropsBeans driver=new DrivePropsBeans();
Report report =driver.testImplAccess(propExtBean,nestBean);
@@ -71,7 +71,7 @@
*/
public void testClientAccessInContainer() throws Exception
{
- PropsBean propBean =
(PropsBean)createTestBean("org.apache.beehive.controls.test.controls.properties.PropsBean");
+ PropsBean propBean =
(PropsBean)createTestBean("org.apache.beehive.controls.test.controls.property.PropsBean");
DrivePropsBeans driver=new DrivePropsBeans();
Report report =driver.testClientAccessInContainer(propBean);
@@ -84,7 +84,7 @@
public void testImplAccessInContainer() throws Exception
{
PropsExtensionBean propExtBean =
(PropsExtensionBean)createTestBean("org.apache.beehive.controls.test.controls.properties.PropsExtensionBean");
- NestPropsBean nestBean =
(NestPropsBean)createTestBean("org.apache.beehive.controls.test.controls.properties.NestPropsBean");
+ NestPropsBean nestBean =
(NestPropsBean)createTestBean("org.apache.beehive.controls.test.controls.property.NestPropsBean");
DrivePropsBeans driver=new DrivePropsBeans();
Report report
=driver.testImplAccessInContainer(propExtBean,nestBean);
Added:
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/test.xml
==============================================================================
--- (empty file)
+++
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/test.xml
Fri Jul 30 16:42:47 2004
@@ -0,0 +1,34 @@
+<project name="org.apache.beehive.controls.test.java.property"
default="org-apache-beehive-controls-test-java-property" >
+ <target name="org-apache-beehive-controls-test-java-property" >
+ <test-suite testunit="org-apache-beehive-controls-test-java-property" >
+ <test name="Test Controls Property" timeoutSeconds="300" >
+ <test-metadata>
+ <freq>daily</freq>
+ <status>active</status>
+ </test-metadata>
+ <junit
testclass="org.apache.beehive.controls.test.java.property.PropTest" />
+ </test>
+ <test name="Test Accessing Control Property by Getter"
timeoutSeconds="300" >
+ <test-metadata>
+ <freq>daily</freq>
+ <status>active</status>
+ </test-metadata>
+ <junit
testclass="org.apache.beehive.controls.test.java.property.ClientAccessTest" />
+ </test>
+ <test name="Test Accessing Control Property by Control Context"
timeoutSeconds="300" >
+ <test-metadata>
+ <freq>daily</freq>
+ <status>active</status>
+ </test-metadata>
+ <junit
testclass="org.apache.beehive.controls.test.java.property.ImplAccessTest" />
+ </test>
+ <test name="Test Resetting Control Property by setter"
timeoutSeconds="300" >
+ <test-metadata>
+ <freq>daily</freq>
+ <status>active</status>
+ </test-metadata>
+ <junit
testclass="org.apache.beehive.controls.test.java.property.ImplClientTest" />
+ </test>
+ </test-suite>
+ </target>
+</project>