You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by js...@apache.org on 2004/09/28 04:52:54 UTC
svn commit: rev 47374 - in incubator/beehive/trunk/controls/test/src: controls/org/apache/beehive/controls/test/controls/event drivers/org/apache/beehive/controls/test/driver/composition drivers/org/apache/beehive/controls/test/driver/context drivers/org/apache/beehive/controls/test/driver/contextevent drivers/org/apache/beehive/controls/test/driver/event drivers/org/apache/beehive/controls/test/driver/extension drivers/org/apache/beehive/controls/test/driver/instantiate drivers/org/apache/beehive/controls/test/driver/property
Author: jsong
Date: Mon Sep 27 19:52:53 2004
New Revision: 47374
Added:
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/event/Event2Listener.java (contents, props changed)
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/composition/
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/composition/DriveOuterControl.java (contents, props changed)
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/context/DriveServiceGetter.java (contents, props changed)
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/contextevent/
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/contextevent/DriveBeanRecorder.java (contents, props changed)
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/contextevent/DriveRecorder.java (contents, props changed)
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/event/
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/event/DriveListener.java (contents, props changed)
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/extension/
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/extension/DriveSubControl.java (contents, props changed)
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/instantiate/DriveSingleProperty.java (contents, props changed)
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/property/DriveClientAccess.java (contents, props changed)
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/property/DriveClientImpl.java (contents, props changed)
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/property/DriveImplAccess.java (contents, props changed)
Log:
Copy drivers from webapp to controls/test/src.
CR: self
checkin.tests pass.
Added: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/event/Event2Listener.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/event/Event2Listener.java Mon Sep 27 19:52:53 2004
@@ -0,0 +1,44 @@
+package org.apache.beehive.controls.test.controls.event;
+
+
+/**
+ * A listener class for Hello.EventSet2 event
+ */
+public class Event2Listener implements Hello.EventSet2
+{
+ private String method1Result="method1NotReceived";
+ private String method2Result="set2method2NotReceived";
+ private String overloadMethod1="overloadMethod1NotReceived";
+ private String overloadMethod2="overloadMethod2NotReceived";
+
+
+ public void method1(){
+ //Event received, flip the counter
+ method1Result="0";
+ }
+ public int set2Method2(){
+ //Event received, flip the counter
+ method2Result="0";
+ return 0;
+ }
+ public boolean set2OverloadedMethod(){
+ //Event received, flip the counter
+ overloadMethod1="0";
+ return true;
+ }
+ public boolean set2OverloadedMethod(int anArg){
+ //Event received, flip the counter
+ overloadMethod2="0";
+ return true;
+ }
+
+ public String getMethod2Result(){
+
+ return method2Result;
+ }
+
+ public String getAllResult(){
+
+ return method1Result+method2Result+overloadMethod1+overloadMethod2;
+ }
+}
Added: incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/composition/DriveOuterControl.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/composition/DriveOuterControl.java Mon Sep 27 19:52:53 2004
@@ -0,0 +1,257 @@
+package org.apache.beehive.controls.test.driver.composition;
+
+import org.apache.beehive.test.tools.milton.common.Report;
+import org.apache.beehive.controls.test.controls.composition.OuterControlBean;
+import org.apache.beehive.controls.test.controls.composition.InnerControlBean;
+
+/* This class contains the logic to test control composition.
+ * By invoking method on OuterControl, a control containing a nested control,
+ * features of control composition are verified.
+ */
+public class DriveOuterControl
+{
+
+ private OuterControlBean myControl;
+
+ public void setControl(OuterControlBean aControl){
+
+ myControl=aControl;
+ }
+
+ public Report doTestInstantiate(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the outer control is NULL");
+ }
+ else{
+ InnerControlBean declaredNestedControl=myControl.getDeclaredNestedControl();
+
+ if (declaredNestedControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the nested control instantiated declaratively is NULL");
+ }
+ else{
+ InnerControlBean programNestedControl=myControl.instantiateNestedControlProgrammatically();
+
+ if (programNestedControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the nested control instantiated programmatically is NULL");
+ }
+ else
+ report.setStatus(Report.PASS);
+ }
+
+ }
+ return report;
+ }
+
+ public Report doTestInstantiateWithProperty(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the outer control is NULL");
+ }
+ else{
+ InnerControlBean declaredNestedControl=myControl.getDeclaredNestedControl2();
+
+ if (declaredNestedControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the nested control instantiated declaratively is NULL");
+ }
+ else{
+ InnerControlBean programNestedControl=myControl.instantiateNestedControlWithProperty();
+
+ if (programNestedControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the nested control instantiated programmatically is NULL");
+ }
+ else
+ report.setStatus(Report.PASS);
+ }
+
+ }
+ return report;
+ }
+
+ public Report doTestGetPropertyByContext(){
+
+ Report report=doTestInstantiate();
+
+ if (report.getStatus().equals(Report.PASS)){
+
+ InnerControlBean declaredNestedControl=myControl.getDeclaredNestedControl();
+ String property_value=declaredNestedControl.getNameFromContext();
+ if(property_value!=null){
+ if (property_value.equals("Bob"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage("declarative instantiation:property retrieved from context is:"+property_value);
+ }
+ }
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage("declarative instantiation:property retrieved from context is NULL.");
+ }
+
+ if (report.getStatus().equals(Report.PASS)){
+
+ InnerControlBean programNestedControl=myControl.instantiateNestedControlProgrammatically();
+ String property_value2=programNestedControl.getNameFromContext();
+
+ if(property_value2!=null){
+ if (property_value.equals("Bob"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage("programmatic instantiation:property retrieved from context is:"+property_value);
+ }
+ }
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage("programmatic instantiation:property retrieved from context is NULL.");
+ }
+ }
+ }
+ return report;
+ }
+
+ public Report doTestGetPropertyByGetter(){
+
+ Report report=new Report();
+ report.setStatus(Report.FAIL);
+ report.setMessage("Control bean getter/setter not supported. Check latest development status.");
+ return report;
+ }
+
+ public Report doTestSetPropertyBySetter(){
+
+ Report report=new Report();
+ report.setStatus(Report.FAIL);
+ report.setMessage("Control bean getter/setter not supported. Check latest development status.");
+ return report;
+ }
+
+ public Report doTestGetReconfiguredPropertyByContext(){
+
+ Report report=doTestInstantiateWithProperty();
+
+ if (report.getStatus().equals(Report.PASS)){
+
+ InnerControlBean declaredNestedControl=myControl.getDeclaredNestedControl2();
+ String property_value=declaredNestedControl.getJobFromContext();
+ if(property_value!=null){
+ if (property_value.equals("farmer"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage("declarative instantiation:reconfigured property retrieved from context is:"+property_value);
+ }
+ }
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage("declarative instantiation:property retrieved from context is NULL.");
+ }
+
+ if (report.getStatus().equals(Report.PASS)){
+
+ InnerControlBean programNestedControl=myControl.instantiateNestedControlWithProperty();
+ String property_value2=programNestedControl.getJobFromContext();
+
+ if(property_value2!=null){
+ if (property_value.equals("farmer"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage("programmatic instantiation:reconfigured property retrieved from context is:"+property_value);
+ }
+ }
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage("programmatic instantiation:property retrieved from context is NULL.");
+ }
+ }
+ }
+
+ return report;
+ }
+
+ public Report doTestEventHandler(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the outer control is NULL");
+ }
+ else{
+ String wakeupResult=myControl.testActivityWakeup();
+ String readMessageResult=myControl.testActivityReadMessage();
+ String reportResult=myControl.testActivityReport();
+ String shoppingResult=myControl.testActionShopping();
+ String dostuffResult=myControl.testActionDostuff();
+
+ if (wakeupResult.equals("0") && readMessageResult.equals("0") && reportResult.equals("0")
+ && shoppingResult.equals("0") && dostuffResult.equals("0"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage("ActivityWakeup:"+wakeupResult+
+ ". ActivityReadMessage:"+ readMessageResult+
+ ". ActivityReport:"+reportResult+
+ ". ActionShopping:"+shoppingResult+
+ ". ActionDodtuff:"+dostuffResult);
+ }
+ }
+
+ return report;
+ }
+
+ public Report doTestEventListener(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the outer control is NULL");
+ }
+ else{
+ String eventListener=myControl.testEventListener();
+
+ if (eventListener.equals("0"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage("EventListener:"+ eventListener);
+ }
+ }
+
+ return report;
+ }
+
+ public Report doTestEventInnerClass(){
+
+ Report report=new Report();
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the outer control is NULL");
+ }
+ else{
+ String innerClassListener=myControl.testInnerClassListener();
+
+ if (innerClassListener.equals("0"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage("InnerClassListener:"+ innerClassListener);
+ }
+ }
+
+ return report;
+ }
+}
\ No newline at end of file
Added: incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/context/DriveServiceGetter.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/context/DriveServiceGetter.java Mon Sep 27 19:52:53 2004
@@ -0,0 +1,119 @@
+package org.apache.beehive.controls.test.driver.context;
+
+
+import java.beans.Beans;
+import java.beans.beancontext.BeanContextServices;
+import javax.servlet.ServletContext;
+//import javax.ejb.EJBContext;
+import org.apache.beehive.test.tools.milton.common.Report;
+import org.apache.beehive.controls.test.controls.context.ServiceGetterBean;
+
+/* This class contains the logic to test control context service.
+ * By invoking methods on ServiceGetterBean, features of context service are verified.
+ */
+
+public class DriveServiceGetter
+{
+ public static String ENV_SERVLET="servlet container";
+ public static String ENV_EJB="ejb container";
+ public static String ENV_JAVA="java environment";
+
+ private ServiceGetterBean myControl;
+ private boolean inJavaEnv=false;
+ private boolean inServletContainer=false;
+ private boolean inEJBContainer=false;
+
+ public void setControl(ServiceGetterBean aControl){
+
+ myControl=aControl;
+ }
+
+ public void setTestEnv(boolean javaEnv,boolean servletEnv, boolean ejbEnv){
+ inJavaEnv=javaEnv;
+ inServletContainer=servletEnv;
+ inEJBContainer=ejbEnv;
+ }
+
+ public Report doTest(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the control is NULL");
+ }
+ else if(!(inJavaEnv||inServletContainer||inEJBContainer)){
+ report.setStatus(Report.FAIL);
+ report.setMessage("Test environment is not specified. Please set "+
+ "specify if the test is in servlet container, ejb container "+
+ "or java environment only");
+ }
+ {
+ if (inEJBContainer)
+ report=doEJBcontainerTest();
+ else if(inServletContainer)
+ report= doServletContainerTest();
+ else
+ report= doJavaEnvTest();
+ }
+ return report;
+ }
+ private Report doJavaEnvTest(){
+
+ Report report=new Report();
+
+ String beanContext=myControl.getService(BeanContextServices.class, null);
+ String servletContext=myControl.getService(ServletContext.class, null);
+ //String ejbContext=serviceGetter.getService(EJBContext.class, null);
+
+ if (beanContext.equals("0") && servletContext.equals("-1"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage("get BeanContextServices:"+beanContext+
+ "get ServletContext:"+servletContext);
+ }
+
+ return report;
+ }
+
+ private Report doServletContainerTest(){
+
+ Report report=new Report();
+
+ String beanContext=myControl.getService(BeanContextServices.class, null);
+ String servletContext=myControl.getService(ServletContext.class, null);
+ //String ejbContext=serviceGetter.getService(EJBContext.class, null);
+
+ if (beanContext.equals("0") && servletContext.equals("0"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage("get BeanContextServices:"+beanContext+
+ "get ServletContext:"+servletContext);
+ }
+
+ return report;
+ }
+
+ private Report doEJBcontainerTest(){
+
+ Report report=new Report();
+
+ String beanContext=myControl.getService(BeanContextServices.class, null);
+ String servletContext=myControl.getService(ServletContext.class, null);
+ //String ejbContext=serviceGetter.getService(EJBContext.class, null);
+
+ if (beanContext.equals("0") && servletContext.equals("0"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage("get BeanContextServices:"+beanContext+
+ "get ServletContext:"+servletContext);
+ }
+
+ return report;
+
+ }
+
+}
Added: incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/contextevent/DriveBeanRecorder.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/contextevent/DriveBeanRecorder.java Mon Sep 27 19:52:53 2004
@@ -0,0 +1,46 @@
+package org.apache.beehive.controls.test.driver.contextevent;
+
+import org.apache.beehive.test.tools.milton.common.Report;
+import org.apache.beehive.controls.test.controls.contextevent.RecorderBean;
+
+/* This class contains the logic to test control context events.
+ * By invoking methods on RecorderBean, features of control lifecycle events are verified.
+ */
+public class DriveBeanRecorder
+{
+
+ private RecorderBean myControl;
+
+ public void setControl(RecorderBean aControl){
+
+ myControl=aControl;
+ }
+
+
+ public Report doTest(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the custom control is NULL");
+ }
+ else{
+ /**Bug: CR190273
+
+ ControlBeanContext peerContext = myRecorder.getPeerContext();
+ PeerContext.addCallbackListener( new ControlBeanContext.Callback()
+ { public void onCreate() { //do recording };
+ public void onAcquire() { //do recording};
+ public void onRelease() { //do recording }; });
+ */
+
+ /* Before CR190273 is fixed, just simply fail this test*/
+
+ report.setStatus(Report.FAIL);
+ report.setMessage("Failed by CR190273. Please check the latest development");
+ }
+
+ return report;
+ }
+}
Added: incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/contextevent/DriveRecorder.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/contextevent/DriveRecorder.java Mon Sep 27 19:52:53 2004
@@ -0,0 +1,43 @@
+package org.apache.beehive.controls.test.driver.contextevent;
+
+import org.apache.beehive.test.tools.milton.common.Report;
+import org.apache.beehive.controls.test.controls.contextevent.RecorderBean;
+
+/* This class contains the logic to test control context event.
+ * By invoking methods on RecorderBean, features of control lifecycle events are verified.
+ */
+
+public class DriveRecorder
+{
+
+ private RecorderBean myControl;
+
+ public void setControl(RecorderBean aControl){
+
+ myControl=aControl;
+ }
+
+
+ public Report doTest(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the custom control is NULL");
+ }
+ else{
+
+ String record=myControl.getRecord();
+
+ if (record.equals("initonCreateonAcquire"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage("The events recorded by control impl:"+record);
+ }
+ }
+
+ return report;
+ }
+}
Added: incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/event/DriveListener.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/event/DriveListener.java Mon Sep 27 19:52:53 2004
@@ -0,0 +1,92 @@
+package org.apache.beehive.controls.test.driver.event;
+
+import org.apache.beehive.test.tools.milton.common.Report;
+import org.apache.beehive.controls.test.controls.event.Hello;
+import org.apache.beehive.controls.test.controls.event.HelloBean;
+import org.apache.beehive.controls.test.controls.event.Event2Listener;
+
+/* This class contains the logic to test control event.
+ * By registering a listener to HelloBean, events raised by control are received and recorded.
+ */
+public class DriveListener
+{
+
+ private HelloBean myControl;
+
+ private boolean innerClassReceiveEvent=false;
+ private Event2Listener event2listener;
+
+ public void setControl(HelloBean aControl){
+
+ myControl=aControl;
+ }
+
+
+ public Report doTest(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the custom control is NULL");
+ }
+ else{
+ try{
+ /*Register an inner class as listener for event1*/
+ myControl.addEventSet1Listener(
+ new Hello.EventSet1()
+ {
+ public void method1()
+ {
+ innerClassReceiveEvent=true;
+ }
+ });
+
+ /* Creates a listener for event2 and register it*/
+ event2listener=new Event2Listener();
+ myControl.addEventSet2Listener(event2listener);
+
+ /* Invokes methods on myHelloBean to trigger the events*/
+ myControl.triggerEvents();
+
+ report.setStatus(Report.PASS);
+ }
+ catch(Exception e){
+ report.setStatus(Report.FAIL);
+ report.setExceptionStack(e);
+ }
+ }
+
+ return report;
+ }
+
+ public Report verifyResult(){
+
+ Report report=new Report();
+ String failuredetail="";
+ if (!innerClassReceiveEvent){
+ report.setStatus(Report.FAIL);
+ failuredetail="Innner Class didn't receive event.";
+ }
+
+ if (event2listener==null){
+ report.setStatus(Report.FAIL);
+ failuredetail=failuredetail+"Event2Listerner is NULL";
+ }
+ else{
+ String listenerResult=event2listener.getAllResult();
+
+ if (listenerResult.equals("0000"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ failuredetail=failuredetail+"Listener Result:"+listenerResult;
+ }
+
+ }
+ report.setMessage(failuredetail);
+
+ return report;
+ }
+
+}
Added: incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/extension/DriveSubControl.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/extension/DriveSubControl.java Mon Sep 27 19:52:53 2004
@@ -0,0 +1,299 @@
+package org.apache.beehive.controls.test.driver.extension;
+
+import org.apache.beehive.test.tools.milton.common.Report;
+import org.apache.beehive.controls.test.controls.extension.SubControlBean;
+
+/* This class contains the logic to test control extensibility.
+ * By invoking methods on a SubControlBean, features of control extensibility are verified.
+ */
+
+public class DriveSubControl
+{
+
+ private SubControlBean myControl;
+
+ public void setControl(SubControlBean aControl){
+
+ myControl=aControl;
+ }
+
+ public Report doInvokeInheritedMethod(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the control is NULL");
+ }
+ else {
+ String s=myControl.hello();
+ if (s.equals("Hello from super control"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage(s);
+ }
+ }
+ return report;
+ }
+
+ public Report doInvokeExtendedMethod(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the control is NULL");
+ }
+ else {
+ String s=myControl.hello2();
+ if (s==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the invoked method returns NULL");
+ }
+ else if (s.equals("Hello from subcontrol"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage(s);
+ }
+ }
+ return report;
+ }
+
+ public Report doGetInheritedPropertyByContext(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the control is NULL");
+ }
+ else {
+ String s=myControl.accessInheritedProperty();
+ if (s==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the retrieved property is NULL");
+ }
+ else if (s.equals("In_ExtensibleControl_Interface"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage(s);
+ }
+ }
+ return report;
+ }
+
+ public Report doGetInheritedPropertyByGetter(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the control is NULL");
+ }
+ else {
+ /*
+ String s=myControl.getWhereaboutPosition();
+ if (s.equals("In_ExtensibleControl_Interface"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage(s);
+ }
+ */
+ /* BUG: getter/setter in generated bean class is busted!
+ Just fail this test until it is fixed*/
+ report.setStatus(Report.FAIL);
+ report.setMessage("Control bean getter/setter is broken. Check the latest development please.");
+ }
+ return report;
+ }
+
+ public Report doSetInheritedPropertyBySetter(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the control is NULL");
+ }
+ else {
+ /*
+ myControl.setWhereaboutPosition("new position");
+ String s=myControl.accessInheritedProperty();
+ if (s.equals("new position"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage(s);
+ }
+ */
+ /* BUG: getter/setter in generated bean class is busted!
+ Just fail this test until it is fixed*/
+ report.setStatus(Report.FAIL);
+ report.setMessage("Control bean getter/setter is broken. Check the latest development please.");
+ }
+ return report;
+ }
+
+ public Report doGetReconfiguredPropertyByGetter(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the control is NULL");
+ }
+ else {
+ /*
+ String s=myControl.getWhereAboutLayer();
+ if (s.equals("On_SubControl_Interface_Layer"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage(s);
+ }
+ */
+ /* BUG: getter/setter in generated bean class is busted!
+ Just fail this test until it is fixed*/
+ report.setStatus(Report.FAIL);
+ report.setMessage("Control bean getter/setter is broken. Check the latest development please.");
+ }
+ return report;
+ }
+
+ public Report doSetReconfiguredPropertyBySetter(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the control is NULL");
+ }
+ else {
+ /*
+ myControl.getWhereAboutLayer("new layer");
+ String s=myControl.getLayerByContext();
+ if (s.equals("new position"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage(s);
+ }
+ */
+ /* BUG: getter/setter in generated bean class is busted!
+ Just fail this test until it is fixed*/
+ report.setStatus(Report.FAIL);
+ report.setMessage("Control bean getter/setter is broken. Check the latest development please.");
+ }
+ return report;
+ }
+
+
+ public Report doGetReconfiguredPropertyByContext(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the control is NULL");
+ }
+ else {
+ String s=myControl.getLayerByContext();
+ if (s.equals("On_SubControl_Interface_Layer"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage(s);
+ }
+ }
+ return report;
+ }
+
+
+ public Report doGetExtendedPropertyByContext(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the control is NULL");
+ }
+ else {
+
+ String new_property_value=myControl.getExtendedPropertyByContext();
+
+ if (new_property_value.equals("New Property Declared by Sub Control"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage("Extended property retrieved from context:"+new_property_value);
+ }
+ }
+ return report;
+ }
+
+ public Report doGetExtendedPropertyByGetter(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the control is NULL");
+ }
+ else {
+ /*
+ String s=myControl.getNewPropertyMessage();
+ if (s.equals("New Property Declared by Sub Control"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage(s);
+ }
+ */
+ /* BUG: getter/setter in generated bean class is busted!
+ Just fail this test until it is fixed*/
+ report.setStatus(Report.FAIL);
+ report.setMessage("Control bean getter/setter is broken. Check the latest development please.");
+ }
+ return report;
+ }
+
+ public Report doSetExtendedPropertyBySetter(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the control is NULL");
+ }
+ else {
+ /*
+ String s=myControl.setNewPropertyMessage("new message for new property");
+ if (s.equals("On_SubControl_Interface_Layer"))
+ report.setStatus(Report.PASS);
+ else{
+ report.setStatus(Report.FAIL);
+ report.setMessage(s);
+ }
+ */
+ /* BUG: getter/setter in generated bean class is busted!
+ Just fail this test until it is fixed*/
+ report.setStatus(Report.FAIL);
+ report.setMessage("Control bean getter/setter is broken. Check the latest development please.");
+ }
+ return report;
+ }
+
+/*
+ public Report doInvokeOverwrittenMethod(){
+
+ Report report=new Report();
+
+ return report;
+ }
+*/
+
+}
Added: incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/instantiate/DriveSingleProperty.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/instantiate/DriveSingleProperty.java Mon Sep 27 19:52:53 2004
@@ -0,0 +1,37 @@
+package org.apache.beehive.controls.test.driver.instantiate;
+
+import org.apache.beehive.test.tools.milton.common.Report;
+import org.apache.beehive.controls.test.controls.property.SinglePropertyBean;
+
+/* This class contains the logic to test instantiating controls with propertSet.
+ * A Report object is generated for test result.
+ */
+
+public class DriveSingleProperty
+{
+ public static String EXPECTED_GREETING="Good evening!";
+ private SinglePropertyBean myControl;
+
+ public void setControl(SinglePropertyBean aControl){
+
+ myControl=aControl;
+ }
+
+ public Report doTest(){
+
+ Report report=new Report();
+
+ if (myControl==null)
+ report.setStatus(Report.FAIL);
+ else
+ {
+ if (myControl.sayHello().equals(EXPECTED_GREETING))
+ report.setStatus(Report.PASS);
+ else
+ report.setStatus(Report.FAIL);
+
+ }
+ return report;
+ }
+
+}
Added: incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/property/DriveClientAccess.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/property/DriveClientAccess.java Mon Sep 27 19:52:53 2004
@@ -0,0 +1,44 @@
+package org.apache.beehive.controls.test.driver.property;
+
+import org.apache.beehive.test.tools.milton.common.Report;
+import org.apache.beehive.controls.test.controls.property.SinglePropertyBean;
+
+/* This class contains the logic to test control property.
+ * It tries to reset the control's property by the setter method on the generated control
+ * bean class, and retrieves the value via control context.
+ */
+public class DriveClientAccess
+{
+ public static String EXPECTED_GREETING="Hello";
+ private SinglePropertyBean myControl;
+
+ public void setControl(SinglePropertyBean aControl){
+
+ myControl=aControl;
+ }
+
+ public Report doTest(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the control is NULL");
+ }
+ else
+ { /*
+ control bean getter/setter is busted.
+ before it is fixed, just fail this test.
+
+ if (myControl.getGreetingGreetWord().equals(EXPECTED_GREETING))
+ report.setStatus(Report.PASS);
+ else
+ report.setStatus(Report.FAIL);
+ */
+ report.setStatus(Report.FAIL);
+ report.setMessage("control bean getter/setter is broken. Check the latest dev status.");
+ }
+ return report;
+ }
+
+}
Added: incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/property/DriveClientImpl.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/property/DriveClientImpl.java Mon Sep 27 19:52:53 2004
@@ -0,0 +1,48 @@
+package org.apache.beehive.controls.test.driver.property;
+
+import org.apache.beehive.test.tools.milton.common.Report;
+import org.apache.beehive.controls.test.controls.property.SinglePropertyBean;
+
+/* This class contains the logic to test control property.
+ * It tries to get control's property by the getter method on the generated control bean class.
+ */
+
+public class DriveClientImpl
+{
+ public static String EXPECTED_GREETING="Good morning!";
+ private SinglePropertyBean myControl;
+
+ public void setControl(SinglePropertyBean aControl){
+
+ myControl=aControl;
+ }
+
+ public Report doTest(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the control is NULL");
+ }
+ else
+ {
+ /*
+ Before control bean getter/setter is fix, just fail this test
+
+ myControl.setGreetingGreetWord(EXPECTED_GREETING);
+ String s=myControl.sayHello();
+
+ if (s.equals(EXPECTED_GREETING))
+ report.setStatus(Report.PASS);
+ else
+ report.setStatus(Report.FAIL);
+ */
+ report.setStatus(Report.FAIL);
+ report.setMessage("control bean getter/setter is broken. Check the latest dev status.");
+
+ }
+ return report;
+ }
+
+}
Added: incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/property/DriveImplAccess.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/property/DriveImplAccess.java Mon Sep 27 19:52:53 2004
@@ -0,0 +1,40 @@
+package org.apache.beehive.controls.test.driver.property;
+
+import org.apache.beehive.test.tools.milton.common.Report;
+import org.apache.beehive.controls.test.controls.property.SinglePropertyBean;
+
+/* This class contains the logic to test control property.
+ * It tries to get control property via control context.
+ */
+
+public class DriveImplAccess
+{
+ public static String EXPECTED_GREETING="Hello";
+ private SinglePropertyBean myControl;
+
+ public void setControl(SinglePropertyBean aControl){
+
+ myControl=aControl;
+ }
+
+ public Report doTest(){
+
+ Report report=new Report();
+
+ if (myControl==null){
+ report.setStatus(Report.FAIL);
+ report.setMessage("the control is NULL");
+ }
+ else
+ {
+
+ if (myControl.sayHello().equals(EXPECTED_GREETING))
+ report.setStatus(Report.PASS);
+ else
+ report.setStatus(Report.FAIL);
+
+ }
+ return report;
+ }
+
+}