Author: jsong
Date: Tue Nov 23 17:26:34 2004
New Revision: 106368

Added:
   
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jws/
   
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jws/TestInstantiate.java
   (contents, props changed)
   
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Composition.jws
   
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Context.jws
   
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/ContextEvent.jws
   
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Event.jws
   
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Extension.jws
   
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Instantiate.jws
   
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Property.jws
Log:
Add jws into controlsWeb to test invoking controls from jws.


Added: 
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jws/TestInstantiate.java
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jws/TestInstantiate.java?view=auto&rev=106368
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jws/TestInstantiate.java
   Tue Nov 23 17:26:34 2004
@@ -0,0 +1,24 @@
+package org.apache.beehive.controls.test.jws;
+
+import org.apache.beehive.test.tools.milton.junit.SOAPReportTestCase;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
+
+
+
+/**
+ * Tests controls instantiation on a web app deployed on a Tomcat server
+ */
+public class TestInstantiate extends SOAPReportTestCase
+{
+       public TestInstantiate(String s){super(s);}
+    /**
+     * Tests instantiating a custom control programmatically
+     */
+       @Freq("detailed")
+    public void testDeclarativeInstantiate() throws Exception
+    {
+               
assertReport("/controlsWeb/jws/instantiate.jws","testDeclarativeInstantiate");
+    }
+
+}

Added: 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Composition.jws
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Composition.jws?view=auto&rev=106368
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Composition.jws
   Tue Nov 23 17:26:34 2004
@@ -0,0 +1,128 @@
+package jws;
+
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * 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.
+ */
+
+
+/*
+ * A jws that tests controls composition.
+ */
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.api.bean.ControlBean;
+import org.apache.beehive.controls.test.controls.composition.OuterControlBean;
+import org.apache.beehive.controls.test.driver.composition.DriveOuterControl;
+import org.apache.beehive.test.tools.milton.common.Report;
+
+
[EMAIL PROTECTED]
+public class Composition
+{
+    @Control
+    public OuterControlBean outercontrol;
+
+    @WebMethod
+    public Report testInstantiation()
+    {        
+       DriveOuterControl driver=new DriveOuterControl();
+       driver.setControl(outercontrol);
+       Report report=driver.doTestInstantiate();
+       
+        return report;
+    }
+
+    @WebMethod
+    public Report testInstantiationWithProperty()
+    {        
+       DriveOuterControl driver=new DriveOuterControl();
+       driver.setControl(outercontrol);
+       Report report=driver.doTestInstantiateWithProperty();
+       
+        return report;
+    }
+
+    @WebMethod
+    public Report testGetPropertyByContext()
+    {        
+       DriveOuterControl driver=new DriveOuterControl();
+       driver.setControl(outercontrol);
+       Report report=driver.doTestGetPropertyByContext();
+       
+        return report;
+    }  
+
+    @WebMethod
+    public Report testGetPropertyByGetter()
+    {        
+       DriveOuterControl driver=new DriveOuterControl();
+       driver.setControl(outercontrol);
+       Report report=driver.doTestGetPropertyByGetter();
+       
+        return report;
+    }
+
+    @WebMethod
+    public Report testSetPropertyBySetter()
+    {        
+       DriveOuterControl driver=new DriveOuterControl();
+       driver.setControl(outercontrol);
+       Report report=driver.doTestSetPropertyBySetter();
+       
+        return report;
+    }      
+
+    @WebMethod
+    public Report testGetReconfiguredPropertyByContext()
+    {        
+       DriveOuterControl driver=new DriveOuterControl();
+       driver.setControl(outercontrol);
+       Report report=driver.doTestGetReconfiguredPropertyByContext();
+       
+        return report;
+    }  
+
+    @WebMethod
+    public Report testEventHandler()
+    {        
+       DriveOuterControl driver=new DriveOuterControl();
+       driver.setControl(outercontrol);
+       Report report=driver.doTestEventHandler();
+       
+        return report;
+    }  
+
+    @WebMethod
+    public Report testEventListener()
+    {        
+       DriveOuterControl driver=new DriveOuterControl();
+       driver.setControl(outercontrol);
+       Report report=driver.doTestEventListener();
+       
+        return report;
+    }
+
+    @WebMethod
+    public Report testInnerClassListener()
+    {        
+       DriveOuterControl driver=new DriveOuterControl();
+       driver.setControl(outercontrol);
+       Report report=driver.doTestEventInnerClass();
+       
+        return report;
+    }
+}

Added: 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Context.jws
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Context.jws?view=auto&rev=106368
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Context.jws
       Tue Nov 23 17:26:34 2004
@@ -0,0 +1,71 @@
+package jws;
+
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * 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.
+ */
+
+
+/*
+ * A jws that tests controls context.
+ */
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.api.bean.ControlBean;
+import org.apache.beehive.controls.test.controls.context.ServiceGetterBean;
+import org.apache.beehive.controls.test.driver.context.DriveServiceGetter;
+import org.apache.beehive.test.tools.milton.common.Report;
+
+
[EMAIL PROTECTED]
+public class Context
+{
+
+    @Control
+    public ServiceGetterBean serviceGetter;
+
+    @WebMethod
+    public Report testGetOtherService()
+    {        
+       DriveServiceGetter driver=new DriveServiceGetter();
+       driver.setControl(serviceGetter);
+       driver.setTestEnv(true,true,false);
+       Report report=driver.doTest();
+       
+        return report;
+    }
+
+    @WebMethod
+    public Report testGetOtherService2()
+    {        
+       Report report=new Report();
+       DriveServiceGetter driver=new DriveServiceGetter();
+       try{
+               ServiceGetterBean 
serviceGetter=(ServiceGetterBean)java.beans.Beans.instantiate(
+                       Thread.currentThread().getContextClassLoader() ,
+                       
"org.apache.beehive.controls.test.controls.context.ServiceGetterBean");
+               driver.setControl(serviceGetter);
+               driver.setTestEnv(true,true,false);
+               report=driver.doTest();
+        }
+        catch(Exception e){
+               
+               report.setStatus(Report.FAIL);
+               report.setExceptionStack(e);
+        }
+        return report;
+    }
+}

Added: 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/ContextEvent.jws
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/ContextEvent.jws?view=auto&rev=106368
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/ContextEvent.jws
  Tue Nov 23 17:26:34 2004
@@ -0,0 +1,103 @@
+package jws;
+
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * 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.
+ */
+
+
+/*
+ * A jws that tests controls context event.
+ */
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.api.bean.ControlBean;
+import org.apache.beehive.controls.test.controls.contextevent.RecorderBean;
+import org.apache.beehive.controls.test.driver.contextevent.DriveBeanRecorder;
+import org.apache.beehive.controls.test.driver.contextevent.DriveRecorder;
+import org.apache.beehive.test.tools.milton.common.Report;
+
+
[EMAIL PROTECTED]
+public class ContextEvent
+{
+
+    @Control
+    public RecorderBean recorder;
+
+   /* Test linstening to control life cycle events by adding listeners to
+    * control bean class.
+    * The control is instantiated declaratively
+    */
+    @WebMethod
+    public Report testListeners()
+    {        
+       DriveBeanRecorder driver=new DriveBeanRecorder();
+       driver.setControl(recorder);
+       Report report=driver.testBeanContextEvent();
+       report=driver.testResourceContextEvent();
+       
+       try{
+               Thread.currentThread().sleep(500);
+               report=driver.getResult();
+       }
+       catch(Exception e){
+               report.setStatus(Report.FAIL);
+               report.setExceptionStack(e);
+       }
+       
+        return report;
+    }
+
+   /* Test linstening to control life cycle events by EventHandler on control
+    * implementation class.
+    * The control is instantiated declaratively
+    */
+    @WebMethod
+    public Report testEventHandler()
+    {        
+       DriveRecorder driver=new DriveRecorder();
+       driver.setControl(recorder);
+       Report report=driver.doTest();
+       
+        return report;
+    }
+
+   /* Test linstening to control life cycle events by EventHandler on control
+    * implementation class.
+    * The control is instantiated programmatically
+    */
+    @WebMethod
+    public Report testEventHandler2()
+    {        
+       Report report =new Report();
+       DriveRecorder driver=new DriveRecorder();
+
+       try{
+               RecorderBean 
recorder=(RecorderBean)java.beans.Beans.instantiate(
+                       Thread.currentThread().getContextClassLoader() ,
+                       
"org.apache.beehive.controls.test.controls.contextevent.RecorderBean");
+               driver.setControl(recorder);
+               report=driver.doTest();
+        }
+        catch(Exception e){
+               
+               report.setStatus(Report.FAIL);
+               report.setExceptionStack(e);
+        }
+        return report;
+    }    
+}

Added: 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Event.jws
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Event.jws?view=auto&rev=106368
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Event.jws
 Tue Nov 23 17:26:34 2004
@@ -0,0 +1,109 @@
+package jws;
+
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * 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.
+ */
+
+
+/*
+ * A jws that tests controls event.
+ */
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.api.bean.ControlBean;
+import org.apache.beehive.controls.api.events.EventHandler;
+import org.apache.beehive.controls.test.controls.event.HelloBean;
+import org.apache.beehive.controls.test.driver.event.DriveListener;
+import org.apache.beehive.test.tools.milton.common.Report;
+
+
[EMAIL PROTECTED]
+public class Event
+{
+
+    private boolean eventSet1Received=false;
+    private boolean eventSet2Received=false;
+
+    @Control
+    public HelloBean helloBean;
+
+    /** EventHandler that receives EventSet1 from helloBean*/
+    @EventHandler (field="helloBean", eventSet= HelloBean.EventSet1.class,
+                                   eventName="method1")
+     public void helloBeanMessageHandler()
+     {
+       /*
+        System.out.println("***************************************");
+        System.out.println("event receive! nothing received");
+        System.out.println("***************************************");
+       */
+
+       eventSet1Received=true;
+     }
+
+
+    /** EventHandler that receives EventSet2 from helloBean*/
+    @EventHandler (field="helloBean", eventSet= HelloBean.EventSet2.class, 
eventName="set2Method2")
+     public int helloBeanMessageHandler2()
+     {
+        /*
+        
System.out.println("***************************************************");
+        System.out.println("event2 receive!");
+        
System.out.println("***************************************************");
+       */
+       
+       eventSet2Received=true;
+       return 0;
+     }
+
+    @WebMethod
+    public Report testListener()
+    {        
+       DriveListener driver=new DriveListener();
+       driver.setControl(helloBean);
+       Report report=driver.doTest();
+       
+       if (report.getStatus().equals(Report.PASS)){
+
+           try{
+               Thread.currentThread().sleep(1000);
+               report=driver.verifyResult();
+               }
+           catch(Exception e){
+               report.setStatus(Report.FAIL);
+               report.setExceptionStack(e);
+           }
+       }
+        return report;
+    }
+
+    /*
+     * JWS listens to the events from the controls by EventHandler
+     */
+    @WebMethod
+    public Report testEventHandler()
+    {        
+
+       /*FIX ME: we need wsm jws to support conversational jws, otherwise
+       we won't be able to test this on jws*/
+       
+       Report report=new Report();
+       report.setStatus(Report.FAIL);
+       return report;
+    }
+
+}

Added: 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Extension.jws
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Extension.jws?view=auto&rev=106368
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Extension.jws
     Tue Nov 23 17:26:34 2004
@@ -0,0 +1,148 @@
+package jws;
+
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * 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.
+ */
+
+
+/*
+ * A jws that tests controls extension.
+ */
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.api.bean.ControlBean;
+import org.apache.beehive.controls.test.controls.extension.SubControlBean;
+import org.apache.beehive.controls.test.driver.extension.DriveSubControl;
+import org.apache.beehive.test.tools.milton.common.Report;
+
+
[EMAIL PROTECTED]
+public class Extension
+{
+    @Control
+    public SubControlBean subcontrol;
+
+    @WebMethod
+    public Report testInheritedMethod()
+    {        
+       DriveSubControl driver=new DriveSubControl();
+       driver.setControl(subcontrol);
+       Report report=driver.doInvokeInheritedMethod();
+       
+        return report;
+    }
+
+    @WebMethod
+    public Report testExtendedMethod()
+    {        
+       DriveSubControl driver=new DriveSubControl();
+       driver.setControl(subcontrol);
+       Report report=driver.doInvokeExtendedMethod();
+       
+        return report;
+    }
+
+    @WebMethod
+    public Report testGetInheritedPropertyByContext()
+    {        
+       DriveSubControl driver=new DriveSubControl();
+       driver.setControl(subcontrol);
+       Report report=driver.doGetInheritedPropertyByContext();
+       
+        return report;
+    }  
+
+    @WebMethod
+    public Report testGetInheritedPropertyByGetter()
+    {        
+       DriveSubControl driver=new DriveSubControl();
+       driver.setControl(subcontrol);
+       Report report=driver.doGetInheritedPropertyByGetter();
+       
+        return report;
+    }
+
+    @WebMethod
+    public Report testSetInheritedPropertyBySetter()
+    {        
+       DriveSubControl driver=new DriveSubControl();
+       driver.setControl(subcontrol);
+       Report report=driver.doSetInheritedPropertyBySetter();
+       
+        return report;
+    }      
+
+    @WebMethod
+    public Report testGetExtendedPropertyByContext()
+    {        
+       DriveSubControl driver=new DriveSubControl();
+       driver.setControl(subcontrol);
+       Report report=driver.doGetExtendedPropertyByContext();
+       
+        return report;
+    }  
+
+    @WebMethod
+    public Report testGetExtendedPropertyByGetter()
+    {        
+       DriveSubControl driver=new DriveSubControl();
+       driver.setControl(subcontrol);
+       Report report=driver.doGetExtendedPropertyByGetter();
+       
+        return report;
+    }  
+
+    @WebMethod
+    public Report testSetExtendedPropertyBySetter()
+    {        
+       DriveSubControl driver=new DriveSubControl();
+       driver.setControl(subcontrol);
+       Report report=driver.doSetExtendedPropertyBySetter();
+       
+        return report;
+    }
+
+    @WebMethod
+    public Report testGetReconfiguredPropertyByContext()
+    {        
+       DriveSubControl driver=new DriveSubControl();
+       driver.setControl(subcontrol);
+       Report report=driver.doGetReconfiguredPropertyByContext();
+       
+        return report;
+    }
+
+    @WebMethod
+    public Report testGetReconfiguredPropertyByGetter()
+    {        
+       DriveSubControl driver=new DriveSubControl();
+       driver.setControl(subcontrol);
+       Report report=driver.doGetReconfiguredPropertyByGetter();
+       
+        return report;
+    }
+
+    @WebMethod
+    public Report testSetReconfiguredPropertyBySetter()
+    {        
+       DriveSubControl driver=new DriveSubControl();
+       driver.setControl(subcontrol);
+       Report report=driver.doSetReconfiguredPropertyBySetter();
+       
+        return report;
+    }    
+}

Added: 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Instantiate.jws
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Instantiate.jws?view=auto&rev=106368
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Instantiate.jws
   Tue Nov 23 17:26:34 2004
@@ -0,0 +1,102 @@
+package jws;
+
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * 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.
+ */
+
+
+/*
+ * A jws that tests controls instantiation.
+ */
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.api.bean.ControlBean;
+import org.apache.beehive.controls.test.controls.instantiate.HelloControlBean;
+import org.apache.beehive.controls.test.controls.property.SingleProperty;
+import org.apache.beehive.controls.test.controls.property.SinglePropertyBean;
+import org.apache.beehive.controls.test.driver.instantiate.DriveHelloControl;
+import org.apache.beehive.controls.test.driver.instantiate.DriveSingleProperty;
+import org.apache.beehive.test.tools.milton.common.Report;
+
+
[EMAIL PROTECTED]
+public class Instantiate
+{
+
+    @Control
+    public HelloControlBean hellobean;
+
+    @Control
+    @SingleProperty.Greeting(GreetWord="Good evening!")
+    public SinglePropertyBean myPropertyBean;
+
+    @WebMethod
+    public Report testDeclarativeInstantiate()
+    {        
+       DriveHelloControl driver=new DriveHelloControl();
+       driver.setControl(hellobean);
+       Report report=driver.doTest();
+       return report;
+    }
+
+    @WebMethod
+    public Report testDeclarativeInstantiateWithProperty()
+    {        
+       DriveHelloControl driver=new DriveHelloControl();
+       driver.setControl(hellobean);
+       Report report=driver.doTest();
+       return report;
+    }
+
+    @WebMethod
+    public Report testProgrammaticInstantiate()
+    {        
+       Report report=new Report();
+       DriveHelloControl driver=new DriveHelloControl();
+       try{
+               HelloControlBean 
hellobean=(HelloControlBean)java.beans.Beans.instantiate(
+                       Thread.currentThread().getContextClassLoader() ,
+                       
"org.apache.beehive.controls.test.controls.instantiate.HelloControlBean");
+               driver.setControl(hellobean);
+               report=driver.doTest();
+        }
+        catch(Exception e){
+               
+               report.setStatus(Report.FAIL);
+               report.setExceptionStack(e);
+        }
+       return report;
+    }
+
+    @WebMethod
+    public Report testProgrammaticInstantiateWithProperty()
+    {        
+       /*BUG:CR190302
+
+       PropertyMap greetAttr = new (PropertyMap(SingleProperty.Greeting.class);
+       greetAttr.setProperty("GreetWord","Good afternoon!");
+       SinglePropertyBean spbean = (SinglePropertyBean)
+             Controls.instantiate(cl, 
"org.apache.beehive.controls.test.controls.properties.SinglePropertyBean", 
greetAttr);
+       
+       Before CR190302 is fixed, this test just simply fails.
+       */
+       Report report=new Report();
+       report.setStatus(Report.FAIL);
+        return report;
+    }
+    
+}

Added: 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Property.jws
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Property.jws?view=auto&rev=106368
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Property.jws
      Tue Nov 23 17:26:34 2004
@@ -0,0 +1,178 @@
+package jws;
+
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * 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.
+ */
+
+
+/*
+ * A jws that tests controls property.
+ */
+
+import java.beans.Beans;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.api.bean.ControlBean;
+import org.apache.beehive.controls.test.controls.property.PropertyControlBean;
+import org.apache.beehive.controls.test.driver.property.DriveGetters;
+import org.apache.beehive.controls.test.driver.property.DriveSetters;
+import org.apache.beehive.controls.test.driver.property.DriveContextAccess;
+import org.apache.beehive.test.tools.milton.common.Report;
+
+
[EMAIL PROTECTED]
+public class Property
+{
+
+    @Control
+    public PropertyControlBean myControl;
+
+    /*
+     * Get a control property by getters on the control bean class.
+     * The control is instantiated declaratively.
+     */
+    @WebMethod
+    public Report testGetters()
+    {        
+       Report report=new Report();
+       DriveGetters driver=new DriveGetters();
+       try{
+               driver.setControl(myControl);
+               report=driver.doTest();
+        }
+        catch(Exception e){
+               
+               report.setStatus(Report.FAIL);
+               report.setExceptionStack(e);
+        }
+        return report;
+    }
+
+    /*
+     * Get a control property by getters on the control bean class.
+     * The control is instantiated programmatically.
+     */
+    @WebMethod
+    public Report testGetters2()
+    {        
+       Report report=new Report();
+       DriveGetters driver=new DriveGetters();
+       try{
+               PropertyControlBean 
thebean=(PropertyControlBean)Beans.instantiate(
+                       Thread.currentThread().getContextClassLoader() ,
+                       
"org.apache.beehive.controls.test.controls.property.PropertyControlBean");
+               driver.setControl(thebean);
+               report=driver.doTest();
+        }
+        catch(Exception e){
+               
+               report.setStatus(Report.FAIL);
+               report.setExceptionStack(e);
+        }
+        return report;
+    }
+
+    /*
+     * Set a control property by setters on the control bean class.
+     * The control is instantiated declaratively.
+     */
+    @WebMethod
+    public Report testSetters()
+    {        
+       Report report=new Report();
+       try{
+               DriveSetters driver=new DriveSetters();
+               driver.setControl(myControl);
+               report=driver.doTest();
+        }
+        catch(Exception e){
+               
+               report.setStatus(Report.FAIL);
+               report.setExceptionStack(e);
+        }
+        return report;
+    }
+
+    /*
+     * Set a control property by setters on the control bean class.
+     * The control is instantiated programmatically.
+     */
+    @WebMethod
+    public Report testSetters2()
+    {        
+       Report report=new Report();
+       DriveSetters driver =new DriveSetters();
+       try{
+               PropertyControlBean 
thebean=(PropertyControlBean)Beans.instantiate(
+                       Thread.currentThread().getContextClassLoader(),
+                       
"org.apache.beehive.controls.test.controls.property.PropertyControlBean");
+               driver.setControl(thebean);
+               report=driver.doTest();
+        }
+        catch(Exception e){
+               
+               report.setStatus(Report.FAIL);
+               report.setExceptionStack(e);
+        }
+        return report;
+    }
+
+    /*
+     * Get a control property by control context.
+     * The control is instantiated declaratively.
+     */
+    @WebMethod
+    public Report testContext()
+    {        
+       Report report=new Report();
+       try{
+               DriveContextAccess driver=new DriveContextAccess();
+               driver.setControl(myControl);
+               report=driver.doTest();
+        }
+        catch(Exception e){
+               
+               report.setStatus(Report.FAIL);
+               report.setExceptionStack(e);
+        }
+        return report;
+    }
+
+    /*
+     * Get a control property by control context.
+     * The control is instantiated programmatically.
+     */
+    @WebMethod
+    public Report testContext2()
+    {        
+       Report report=new Report();
+       DriveContextAccess driver=new DriveContextAccess();
+       try{
+               PropertyControlBean 
thebean=(PropertyControlBean)Beans.instantiate(
+                       Thread.currentThread().getContextClassLoader(),
+                       
"org.apache.beehive.controls.test.controls.property.PropertyControlBean");
+               driver.setControl(thebean);
+               report=driver.doTest();
+        }
+        catch(Exception e){
+               
+               report.setStatus(Report.FAIL);
+               report.setExceptionStack(e);
+        }
+        return report;
+    }
+    
+}

Reply via email to