Author: jsong
Date: Fri Aug 13 12:34:18 2004
New Revision: 36364

Added:
   
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/
   
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/context/
   
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/context/TestContext.java
   
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/contextevent/
   
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/contextevent/TestLifecycleEvent.java
   
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/event/
   
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/event/TestEvent.java
   
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/extension/
   
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/extension/TestSubControl.java
   
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/instantiate/
   
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/instantiate/TestInstantiate.java
   
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/property/
   
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/property/TestProperty.java
Modified:
   incubator/beehive/trunk/controls/test/build.xml
   incubator/beehive/trunk/controls/test/common/path.properties
Log:
Add JUNIT test client for testing controls invoked by pageflow.
Update controls/test/common/path.properties to include httpunit.jar into 
classpath.


Modified: incubator/beehive/trunk/controls/test/build.xml
==============================================================================
--- incubator/beehive/trunk/controls/test/build.xml     (original)
+++ incubator/beehive/trunk/controls/test/build.xml     Fri Aug 13 12:34:18 2004
@@ -148,6 +148,7 @@
             <classpath>
                <pathelement location="${milton.jar}"/>
                <pathelement location="${mantis.jar}"/>
+               <pathelement location="${httpunit.jar}"/>
                <pathelement path="${build.tests.driver}"/>
             </classpath>
         </javac>

Modified: incubator/beehive/trunk/controls/test/common/path.properties
==============================================================================
--- incubator/beehive/trunk/controls/test/common/path.properties        
(original)
+++ incubator/beehive/trunk/controls/test/common/path.properties        Fri Aug 
13 12:34:18 2004
@@ -23,4 +23,5 @@
 jakarta.jar=${external.dir}/jakarta/jakarta-regexp-1.2.jar
 jaxp.jar=${external.dir}/jaxp/jaxp.jar
 xerces.jar=${external.dir}/xerces/xerces-1.4.4.jar
-xbean.jar=${external.dir}/xmlbeans/apache-xbeans.jar
\ No newline at end of file
+xbean.jar=${external.dir}/xmlbeans/apache-xbeans.jar
+httpunit.jar=${external.dir}/httpunit/httpunit.jar
\ No newline at end of file

Added: 
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/context/TestContext.java
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/context/TestContext.java
       Fri Aug 13 12:34:18 2004
@@ -0,0 +1,37 @@
+package org.apache.beehive.controls.test.jpf.context;
+
+import org.apache.beehive.test.tools.milton.junit.HtmlReportTestCase;
+import org.apache.beehive.mantis.annotations.tch.Freq;
+import org.apache.beehive.mantis.annotations.tch.Status;
+
+
+
+/**
+ * Tests controls context when instantiated by a pageflow running on a Tomcat 
server
+ */
+public class TestContext extends HtmlReportTestCase
+{
+       public TestContext(String s){
+               super(s);
+       }
+    /**
+     * Tests getting other services from control context.
+     * The control is instantiated declaratively
+     */
+       @Freq("checkin")
+    public void testOtherServicesByDeclare() throws Exception
+    {
+               
assertReport("/controlsWeb/context/getotherservice/Controller.jpf");
+    }
+
+    /**
+     * Tests getting other services from control context.
+     * The control is instantiated programmatically
+     */
+       @Freq("checkin")
+    public void testOtherServicesByProgram() throws Exception
+    {
+               
assertReport("/controlsWeb/context/getotherservice2/Controller.jpf");
+    }
+
+}

Added: 
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/contextevent/TestLifecycleEvent.java
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/contextevent/TestLifecycleEvent.java
   Fri Aug 13 12:34:18 2004
@@ -0,0 +1,48 @@
+package org.apache.beehive.controls.test.jpf.contextevent;
+
+import org.apache.beehive.test.tools.milton.junit.HtmlReportTestCase;
+import org.apache.beehive.mantis.annotations.tch.Freq;
+import org.apache.beehive.mantis.annotations.tch.Status;
+
+
+
+/**
+ * Tests control context events
+ */
+public class TestLifecycleEvent extends HtmlReportTestCase
+{
+       public TestLifecycleEvent(String s){
+               super(s);
+       }
+    /**
+     * Verifies control implmentation receiving control lifecycle events.
+     * The control is instantiated declaratively by the pageflow
+     */
+       @Freq("checkin")
+    public void testReceivedByImpl() throws Exception
+    {
+               
assertReport("/controlsWeb/contextevent/implrecord/Controller.jpf");
+    }
+
+    /**
+     * Verifies control implmentation receiving control lifecycle events.
+     * The control is instantiated programmatically by the pageflow
+     */
+       @Freq("checkin")
+    public void testReceivedByImpl2() throws Exception
+    {
+               
assertReport("/controlsWeb/contextevent/implrecord2/Controller.jpf");
+    }
+
+    /**
+     * Tests receiving control lifecycle events from control bean instance.
+     */
+       @Freq("checkin")
+       @Status("inactive")
+    public void testListenFromBean() throws Exception
+    {
+               
assertReport("/controlsWeb/contextevent/implrecord2/Controller.jpf");
+    }
+
+
+}

Added: 
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/event/TestEvent.java
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/event/TestEvent.java
   Fri Aug 13 12:34:18 2004
@@ -0,0 +1,33 @@
+package org.apache.beehive.controls.test.jpf.event;
+
+import org.apache.beehive.test.tools.milton.junit.HtmlReportTestCase;
+import org.apache.beehive.mantis.annotations.tch.Freq;
+import org.apache.beehive.mantis.annotations.tch.Status;
+
+
+
+/**
+ * Tests pageflow receiving events raised by a control
+ */
+public class TestEvent extends HtmlReportTestCase
+{
+       public TestEvent(String s){super(s);}
+    /**
+     * Tests receiving control's events by EventHandler annotation
+     */
+       @Freq("checkin")
+    public void testByEventHandler() throws Exception
+    {
+               assertReport("/controlsWeb/event/eventhandler/Controller.jpf");
+    }
+
+    /**
+     * Tests receiving control's events by registered listeners.
+     * The pageflow instantiates the control declaratively
+     */
+       @Freq("checkin")
+    public void testByListener() throws Exception
+    {
+               assertReport("/controlsWeb/event/listener/Controller.jpf");
+    }
+}

Added: 
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/extension/TestSubControl.java
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/extension/TestSubControl.java
  Fri Aug 13 12:34:18 2004
@@ -0,0 +1,132 @@
+package org.apache.beehive.controls.test.jpf.extension;
+
+import org.apache.beehive.test.tools.milton.junit.HtmlReportTestCase;
+import org.apache.beehive.mantis.annotations.tch.Freq;
+import org.apache.beehive.mantis.annotations.tch.Status;
+
+
+/**
+ * Tests controls inheritance by invoking a sub control on a pageflow.
+ */
+public class TestSubControl extends HtmlReportTestCase
+{
+       public TestSubControl(String s){super(s);}
+    /**
+     * Tests invoking a method inherited from the super control
+     */
+       @Freq("checkin")
+    public void testInheritedMethod() throws Exception
+    {
+               assertReport("/controlsWeb/extension/testInheritedMethod.do");
+    }
+
+    /**
+     * Tests invoking a method declared on the sub control only
+     */
+       @Freq("checkin")
+    public void testExtendedMethod() throws Exception
+    {
+               assertReport("/controlsWeb/extension/testExtendedMethod.do");
+    }
+
+    /**
+     * Tests getting an inherited property by control context on sub control
+     * implementation class.
+     */
+
+       @Freq("detail")
+    public void testGetInheritedPropertyByContext() throws Exception
+    {
+               
assertReport("/controlsWeb/extension/testGetInheritedPropertyByContext.do");
+       }
+
+       /**
+     * Tests getting an inherited property by getter on sub control bean class.
+        */
+       @Freq("detail")
+    public void testGetInheritedPropertyByGetter() throws Exception
+    {
+               
assertReport("/controlsWeb/extension/testGetInheritedPropertyByGetter.do");
+    }
+
+       /**
+     * Tests setting an inherited property by setter on sub control bean class.
+        */
+       @Freq("detail")
+    public void testSetInheritedPropertyBySetter() throws Exception
+    {
+               
assertReport("/controlsWeb/extension/testSetInheritedPropertyBySetter.do");
+    }
+
+       /**
+     * The value of an inherited property can by reset on subcontrol interface.
+     * This test verifies the reconfigured property is assigned to a new value
+     * when retrieved from control context on the subcontrol implementation 
class.
+        */
+       @Freq("detail")
+    public void testGetReconfiguredPropertyByContext() throws Exception
+    {
+               
assertReport("/controlsWeb/extension/testGetReconfiguredPropertyByContext.do");
+    }
+
+       /**
+     * The value of an inherited property can by reset on subcontrol interface.
+     * This test verifies the reconfigured property is assigned to a new value
+     * when retrieved from getter method on sub control bean class.
+        */
+       @Freq("detail")
+    public void testGetReconfiguredPropertyByGetter() throws Exception
+    {
+               
assertReport("/controlsWeb/extension/testGetReconfiguredPropertyByGetter.do");
+    }
+
+       /**
+     * The value of an inherited property can by reset on subcontrol interface.
+     * This test tries to set the reconfigured property to a new value using
+     * the setter method on sub control bean class.
+        */
+       @Freq("detail")
+    public void testSetReconfiguredPropertyBySetter() throws Exception
+    {
+               
assertReport("/controlsWeb/extension/testSetReconfiguredPropertyBySetter.do");
+    }
+
+    /**
+     * Tests getting an extended property by control context on sub control
+     * implementation class.
+     */
+
+       @Freq("detail")
+    public void testGetExtendedPropertyByContext() throws Exception
+    {
+               
assertReport("/controlsWeb/extension/testGetExtendedPropertyByContext.do");
+       }
+
+       /**
+     * Tests getting an extended property by getter on sub control bean class.
+        */
+       @Freq("detail")
+    public void testGetExtendedPropertyByGetter() throws Exception
+    {
+               
assertReport("/controlsWeb/extension/testGetExtendedPropertyByGetter.do");
+    }
+
+       /**
+     * Tests setting an extended property by setter on sub control bean class.
+        */
+       @Freq("detail")
+    public void testSetExtendedPropertyBySetter() throws Exception
+    {
+               
assertReport("/controlsWeb/extension/testSetExtendedPropertyBySetter.do");
+    }
+
+       /**
+     * Tests invoking a method that is overwritten by subcontrol.
+        */
+       @Freq("detail")
+       @Status("inactive")
+    public void testOverwrittenMethod() throws Exception
+    {
+               
assertReport("/controlsWeb/extension/testSetExtendedPropertyBySetter.do");
+    }
+}

Added: 
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/instantiate/TestInstantiate.java
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/instantiate/TestInstantiate.java
       Fri Aug 13 12:34:18 2004
@@ -0,0 +1,61 @@
+package org.apache.beehive.controls.test.jpf.instantiate;
+
+import org.apache.beehive.test.tools.milton.junit.HtmlReportTestCase;
+import org.apache.beehive.mantis.annotations.tch.Freq;
+import org.apache.beehive.mantis.annotations.tch.Status;
+
+
+
+/**
+ * Tests controls instantiation on a web app deployed on a Tomcat server
+ */
+public class TestInstantiate extends HtmlReportTestCase
+{
+       public TestInstantiate(String s){super(s);}
+    /**
+     * Tests instantiating a custom control programmatically
+     */
+       @Freq("checkin")
+    public void testProgrammaticInstantiation() throws Exception
+    {
+               
assertReport("/controlsWeb/instantiate/programmatic/Controller.jpf");
+    }
+
+    /**
+     * Tests instantiating a custom control declaratively
+     */
+       @Freq("checkin")
+    public void testDeclarativeInstantiation() throws Exception
+    {
+               
assertReport("/controlsWeb/instantiate/declarative/Controller.jpf");
+    }
+
+    /**
+     * Tests declaratively instantiating a custom control with propertySet
+     */
+
+       @Freq("detail")
+    public void testDeclareWithProperty() throws Exception
+    {
+               
assertReport("/controlsWeb/instantiate/declarewithproperty/Controller.jpf");
+       }
+
+       /**
+        * Tests programmically instantiating a custom control with propertySet
+        */
+       @Freq("detail")
+       @Status("inactive")
+    public void testProgrammWithProperty() throws Exception
+    {
+               /*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);
+               */
+               
assertReport("/controlsWeb/instantiate/programwithproperty/Controller.jpf");
+    }
+}

Added: 
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/property/TestProperty.java
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/property/TestProperty.java
     Fri Aug 13 12:34:18 2004
@@ -0,0 +1,81 @@
+package org.apache.beehive.controls.test.jpf.property;
+
+import org.apache.beehive.test.tools.milton.junit.HtmlReportTestCase;
+import org.apache.beehive.mantis.annotations.tch.Freq;
+import org.apache.beehive.mantis.annotations.tch.Status;
+
+
+
+/**
+ * Tests runtime behavior of control property when controls runs on a 
pagesflow.
+ * Each test method invokes a pageflow that invokes controls.
+ */
+public class TestProperty extends HtmlReportTestCase
+{
+       public TestProperty(String s){super(s);}
+    /**
+     * Tests pageflow getting control property via control context.
+     * The control is instantiated declaratively on the pageflow
+     */
+       @Freq("checkin")
+    public void testContextAccessByDeclare() throws Exception
+    {
+               
assertReport("/controlsWeb/property/impl_access/Controller.jpf");
+    }
+
+    /**
+     * Tests pageflow getting control property via control context.
+     * The control is instantiated programmatically on the pageflow
+     */
+       @Freq("checkin")
+    public void testContextAccessByProgram() throws Exception
+    {
+               
assertReport("/controlsWeb/property/impl_access2/Controller.jpf");
+    }
+
+    /**
+     * Tests pageflow getting control property via getter on control bean.
+     * The control is instantiated declaratively on the pageflow
+     */
+       @Freq("checkin")
+       @Status("inactive")
+    public void testClientAccessByDeclare() throws Exception
+    {
+               
assertReport("/controlsWeb/property/client_access/Controller.jpf");
+    }
+
+
+    /**
+     * Tests pageflow getting control property via getter on control bean.
+     * The control is instantiated programmatically on the pageflow
+     */
+       @Freq("checkin")
+       @Status("inactive")
+    public void testClientAccessByProgram() throws Exception
+    {
+               
assertReport("/controlsWeb/property/client_access2/Controller.jpf");
+    }
+
+
+    /**
+     * Tests pageflow setting control property via setter on control bean.
+     * The control is instantiated declaratively on the pageflow
+     */
+       @Freq("checkin")
+       @Status("inactive")
+    public void testPropertySetterByDeclare() throws Exception
+    {
+               
assertReport("/controlsWeb/property/client_impl/Controller.jpf");
+    }
+
+    /**
+     * Tests pageflow setting control property via setter on control bean.
+     * The control is instantiated programmatically on the pageflow
+     */
+       @Freq("checkin")
+       @Status("inactive")
+    public void testPropertySetterByProgram() throws Exception
+    {
+               
assertReport("/controlsWeb/property/client_impl2/Controller.jpf");
+    }
+}

Reply via email to