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 2005/05/26 22:31:22 UTC
svn commit: r178673 - in /incubator/beehive/trunk/controls/test:
src/units/org/apache/beehive/controls/test/java/composition/
src/units/org/apache/beehive/controls/test/java/event/
src/units/org/apache/beehive/controls/test/java/extension/
src/units/org/apache/beehive/controls/test/java/property/
src/units/org/apache/beehive/controls/test/jpf/contextevent/
src/units/org/apache/beehive/controls/test/jpf/extension/
src/units/org/apache/beehive/controls/test/jws/binding/
webapps/controlsWeb/WEB-INF/src/jws/
Author: jsong
Date: Thu May 26 13:31:19 2005
New Revision: 178673
URL: http://svn.apache.org/viewcvs?rev=178673&view=rev
Log:
Activate more detailed controls tests. beehive drts passed.
Added:
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Binding.jws
Modified:
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/ProgrammaticTest.java
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/ListenerTest.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/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/jpf/contextevent/TestLifecycleEvent.java
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/jws/binding/TestBinding.java
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/ProgrammaticTest.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/ProgrammaticTest.java?rev=178673&r1=178672&r2=178673&view=diff
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/ProgrammaticTest.java (original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/ProgrammaticTest.java Thu May 26 13:31:19 2005
@@ -87,47 +87,45 @@
/**
* Tests outer control getting inner control property by getter
- *
-
- commented out temporarily before getter/setter is fixed
-
+ */
+ @Freq("detailed")
public void testGetProppertyByGetter() throws Exception
{
Assert.assertNotNull(outerControl);
InnerControlBean innercontrol=outerControl.instantiateNestedControlProgrammatically();
Assert.assertNotNull(innercontrol);
- Assert.assertEquals("Bob",innercontrol.getIdentityname());
- Assert.assertNull(innercontrol.getIdentityjob());
+ Assert.assertEquals("Bob",innercontrol.getName());
+ Assert.assertNull(innercontrol.getJob());
}
/**
* Tests outer control setting inner control property by setter
- *
+ */
+ @Freq("detailed")
public void testSetProppertyBySetter() throws Exception
{
Assert.assertNotNull(outerControl);
InnerControlBean innercontrol=outerControl.instantiateNestedControlProgrammatically();
Assert.assertNotNull(innercontrol);
- innerControl.setIdentityname("new name");
- innerControl.setIdentityjob("new job");
+ innercontrol.setName("new name");
+ innercontrol.setJob("new job");
Assert.assertEquals("new name",innercontrol.getNameFromContext());
Assert.assertEquals("new job",innercontrol.getJobFromContext());
}
- */
+
/**
* Tests reconfigured property.
* Outer control reconfigures the inner control's property when instantiating it
* Deactivated by CR190302
*/
@Freq("detailed")
- @Status("inactive")
public void testReconfiguredProperty() throws Exception
{
Assert.assertNotNull(outerControl);
InnerControlBean innercontrol=outerControl.instantiateNestedControlWithProperty();
Assert.assertNotNull(innercontrol);
- Assert.assertEquals("Bob",innercontrol.getNameFromContext());
- Assert.assertEquals("farmer",innercontrol.getJobFromContext());
+ Assert.assertEquals("ken",innercontrol.getNameFromContext());
+ Assert.assertEquals("engineer",innercontrol.getJobFromContext());
}
/**
@@ -136,7 +134,6 @@
* This is deactivated, as declarative instantiating control in java is not supported
*/
@Freq("detailed")
- @Status("inactive")
public void testEventHandler() throws Exception
{
Assert.assertNotNull(outerControl);
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/ListenerTest.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/ListenerTest.java?rev=178673&r1=178672&r2=178673&view=diff
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/ListenerTest.java (original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/ListenerTest.java Thu May 26 13:31:19 2005
@@ -29,6 +29,7 @@
import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
import org.apache.beehive.test.tools.milton.common.Report;
+import org.apache.beehive.controls.test.controls.util.TestBeanContext;
/**
* A Testcase that tests receiving events from a control with an inner class or
@@ -38,6 +39,28 @@
public class ListenerTest extends TestCase
{
+ //Start of unique client programming to instantiate controls declaratively in java container
+ private TestBeanContext _testContext;
+
+ public ListenerTest(String s)throws Exception {
+
+ super(s);
+ _testContext = new TestBeanContext();
+ org.apache.beehive.controls.api.bean.Controls.initializeClient( null, this, _testContext );
+
+ }
+
+ public void setUp() throws Exception
+ {
+ _testContext.beginContext();
+ }
+
+ public void tearDown() throws Exception
+ {
+ _testContext.endContext();
+ }
+ //End of unique client programming to instantiate controls declaratively in java container
+
private boolean innerClassReceiveEvent_declare=false;
private boolean innerClassReceiveEvent_program=false;
@@ -47,9 +70,6 @@
@Control
public HelloBean myHellobean;
- @Freq("checkin")
- public ListenerTest(String s) { super(s); }
-
/**
* 1. Instantiates a control bean programmatically;
* 2. Registers two event listeners to the bean instance;
@@ -89,14 +109,12 @@
* 3. Invokes the method on the bean instance that triggers the event1 and event2
*/
@Freq("checkin")
- @Status("inactive")
public void testListenerReceiveEventsDeclare() throws Exception
{
testListenerReceiveEvents(myHellobean, false);
}
@Freq("checkin")
- @Status("inactive")
public void testListenerReceiveEventsDeclareUsingHandle() throws Exception
{
testListenerReceiveEvents(myHellobean, true);
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/extension/SubControlTest.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/extension/SubControlTest.java?rev=178673&r1=178672&r2=178673&view=diff
==============================================================================
--- 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 Thu May 26 13:31:19 2005
@@ -28,6 +28,7 @@
import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
import org.apache.beehive.test.tools.milton.common.Report;
+import org.apache.beehive.controls.test.controls.util.TestBeanContext;
/**
* A TeseCase that tests control inheritance by instantiating a subcontrol and invoking the methods
@@ -37,8 +38,27 @@
public class SubControlTest extends TestCase
{
- public SubControlTest(String name) throws Exception
- {super(name);}
+ //Start of unique client programming to instantiate controls declaratively in java container
+ private TestBeanContext _testContext;
+
+ public SubControlTest(String s)throws Exception {
+
+ super(s);
+ _testContext = new TestBeanContext();
+ org.apache.beehive.controls.api.bean.Controls.initializeClient( null, this, _testContext );
+
+ }
+
+ public void setUp() throws Exception
+ {
+ _testContext.beginContext();
+ }
+
+ public void tearDown() throws Exception
+ {
+ _testContext.endContext();
+ }
+ //End of unique client programming to instantiate controls declaratively in java container
/**
* A control extending ExtensibleControl in the same package
@@ -49,8 +69,7 @@
/**
* Tests invoking a method inherited by the subcontrol
*/
- @Freq("checkin")
- @Status("inactive")
+ @Freq("detailed")
public void testInheritedMethod() throws Exception
{
Report report =new Report();
@@ -84,7 +103,6 @@
* Tests invoking a method declared on the subcontrol
*/
@Freq("detailed")
- @Status("inactive")
public void testExtendedMethod() throws Exception
{
Report report =new Report();
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientAccessTest.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientAccessTest.java?rev=178673&r1=178672&r2=178673&view=diff
==============================================================================
--- 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 Thu May 26 13:31:19 2005
@@ -29,13 +29,35 @@
import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
import org.apache.beehive.test.tools.milton.common.Report;
+import org.apache.beehive.controls.test.controls.util.TestBeanContext;
+
/**
* Test accessing control's propertySet by control bean's getter/setter
*/
public class ClientAccessTest extends TestCase
{
- public ClientAccessTest( String s ) { super( s ); }
+ //Start of unique client programming to instantiate controls declaratively in java container
+ private TestBeanContext _testContext;
+
+ public ClientAccessTest(String s)throws Exception {
+
+ super(s);
+ _testContext = new TestBeanContext();
+ org.apache.beehive.controls.api.bean.Controls.initializeClient( null, this, _testContext );
+
+ }
+
+ public void setUp() throws Exception
+ {
+ _testContext.beginContext();
+ }
+
+ public void tearDown() throws Exception
+ {
+ _testContext.endContext();
+ }
+ //End of unique client programming to instantiate controls declaratively in java container
/**
* A control that declares some propertySet in its control interface
@@ -48,10 +70,8 @@
* The ccontrol bean is instantiated declaratively
*/
@Freq("detailed")
- @Status("inactive")
public void testGetterByDeclare() throws Exception
{
- /*
Report report=new Report();
DriveGetters driver=new DriveGetters();
driver.setControl(myControl);
@@ -60,7 +80,6 @@
if (!result.equals(Report.PASS))
fail(report.getMessage());
- */
}
/**
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientImplTest.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientImplTest.java?rev=178673&r1=178672&r2=178673&view=diff
==============================================================================
--- 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 Thu May 26 13:31:19 2005
@@ -29,6 +29,7 @@
import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
import org.apache.beehive.test.tools.milton.common.Report;
+import org.apache.beehive.controls.test.controls.util.TestBeanContext;
/**
* A TestCase that tests accessing control's propertySet by both impl and client
@@ -36,7 +37,27 @@
public class ClientImplTest extends TestCase
{
- public ClientImplTest( String s ) { super( s ); }
+ //Start of unique client programming to instantiate controls declaratively in java container
+ private TestBeanContext _testContext;
+
+ public ClientImplTest(String s)throws Exception {
+
+ super(s);
+ _testContext = new TestBeanContext();
+ org.apache.beehive.controls.api.bean.Controls.initializeClient( null, this, _testContext );
+
+ }
+
+ public void setUp() throws Exception
+ {
+ _testContext.beginContext();
+ }
+
+ public void tearDown() throws Exception
+ {
+ _testContext.endContext();
+ }
+ //End of unique client programming to instantiate controls declaratively in java container
/**
* A control that declares some propertySets in its control interface
@@ -50,18 +71,15 @@
* This method instantiates HelloBean by declaration
*/
@Freq("detailed")
- @Status("inactive")
public void testResetPropertyByDeclare() throws Exception
{
- /*
Report report=new Report();
- DriveSetter driver=new DriveSetter();
+ DriveSetters driver=new DriveSetters();
driver.setControl(myControl);
report=driver.doTest();
String result=report.getStatus();
if (!result.equals(Report.PASS))
fail(report.getMessage());
- */
}
/**
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ImplAccessTest.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ImplAccessTest.java?rev=178673&r1=178672&r2=178673&view=diff
==============================================================================
--- 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 Thu May 26 13:31:19 2005
@@ -28,6 +28,7 @@
import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
import org.apache.beehive.test.tools.milton.common.Report;
+import org.apache.beehive.controls.test.controls.util.TestBeanContext;
/**
* A TestCase that tests accessing property values via control context in control impl
@@ -35,7 +36,27 @@
*/
public class ImplAccessTest extends TestCase
{
- public ImplAccessTest( String s ) { super( s ); }
+ //Start of unique client programming to instantiate controls declaratively in java container
+ private TestBeanContext _testContext;
+
+ public ImplAccessTest(String s)throws Exception {
+
+ super(s);
+ _testContext = new TestBeanContext();
+ org.apache.beehive.controls.api.bean.Controls.initializeClient( null, this, _testContext );
+
+ }
+
+ public void setUp() throws Exception
+ {
+ _testContext.beginContext();
+ }
+
+ public void tearDown() throws Exception
+ {
+ _testContext.endContext();
+ }
+ //End of unique client programming to instantiate controls declaratively in java container
/**
* A control that declares some propertySets in its control interface.
@@ -51,7 +72,6 @@
* The control bean is instantiated by declaration.
*/
@Freq("detailed")
- @Status("inactive")
public void testContextAccessByDeclare() throws Exception
{
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/contextevent/TestLifecycleEvent.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/contextevent/TestLifecycleEvent.java?rev=178673&r1=178672&r2=178673&view=diff
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/contextevent/TestLifecycleEvent.java (original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/contextevent/TestLifecycleEvent.java Thu May 26 13:31:19 2005
@@ -56,7 +56,6 @@
* Tests receiving control lifecycle events from control bean instance.
*/
@Freq("checkin")
- @Status("inactive")
public void testListenFromBean() throws Exception
{
assertReport("/controlsWeb/contextevent/beanrecord/Controller.jpf");
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/extension/TestSubControl.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/extension/TestSubControl.java?rev=178673&r1=178672&r2=178673&view=diff
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/extension/TestSubControl.java (original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/extension/TestSubControl.java Thu May 26 13:31:19 2005
@@ -168,10 +168,8 @@
/**
* Tests getting an extended property by getter on sub control bean class.
* The sub control is instantiated declaratively.
- * deactivated for CR190164
*/
@Freq("detailed")
- @Status("inactive")
public void testGetExtendedPropertyByGetter() throws Exception
{
assertReport("/controlsWeb/extension/testGetExtendedPropertyByGetter.do");
@@ -180,10 +178,8 @@
/**
* Tests getting an extended property by getter on sub control bean class.
* The sub control is instantiated programmatically.
- * deactivated for CR190164
*/
@Freq("detailed")
- @Status("inactive")
public void testGetExtendedPropertyByGetterP() throws Exception
{
assertReport("/controlsWeb/extension/testGetExtendedPropertyByGetterP.do");
@@ -192,10 +188,8 @@
/**
* Tests setting an extended property by setter on sub control bean class.
* The sub control is instantiated declaratively.
- * deactivated for CR190164
*/
@Freq("detailed")
- @Status("inactive")
public void testSetExtendedPropertyBySetter() throws Exception
{
assertReport("/controlsWeb/extension/testSetExtendedPropertyBySetter.do");
@@ -204,10 +198,8 @@
/**
* Tests setting an extended property by setter on sub control bean class.
* The sub control is instantiated programmatically.
- * deactivated for CR190164
*/
@Freq("detailed")
- @Status("inactive")
public void testSetExtendedPropertyBySetterP() throws Exception
{
assertReport("/controlsWeb/extension/testSetExtendedPropertyBySetterP.do");
@@ -241,11 +233,9 @@
* 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.
- * deactivated for CR190164.
* The sub control is instantiated declaratively.
*/
@Freq("detailed")
- @Status("inactive")
public void testGetReconfiguredPropertyByGetter() throws Exception
{
assertReport("/controlsWeb/extension/testGetReconfiguredPropertyByGetter.do");
@@ -255,11 +245,9 @@
* 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.
- * deactivated for CR190164.
* The sub control is instantiated programmatically.
*/
@Freq("detailed")
- @Status("inactive")
public void testGetReconfiguredPropertyByGetterP() throws Exception
{
assertReport("/controlsWeb/extension/testGetReconfiguredPropertyByGetterP.do");
@@ -269,11 +257,9 @@
* 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.
- * deactivated for CR190164.
* The sub control is instantiated decalratively
*/
@Freq("detailed")
- @Status("inactive")
public void testSetReconfiguredPropertyBySetter() throws Exception
{
assertReport("/controlsWeb/extension/testSetReconfiguredPropertyBySetter.do");
@@ -283,11 +269,9 @@
* 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.
- * deactivated for CR190164.
* The sub control is instantiated programmatically
*/
@Freq("detailed")
- @Status("inactive")
public void testSetReconfiguredPropertyBySetterP() throws Exception
{
assertReport("/controlsWeb/extension/testSetReconfiguredPropertyBySetterP.do");
@@ -296,7 +280,6 @@
* Tests invoking a method that is overwritten by subcontrol.
*/
@Freq("detailed")
- @Status("inactive")
public void testOverwrittenMethod() throws Exception
{
assertReport("/controlsWeb/extension/testSetExtendedPropertyBySetter.do");
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jws/binding/TestBinding.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jws/binding/TestBinding.java?rev=178673&r1=178672&r2=178673&view=diff
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jws/binding/TestBinding.java (original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jws/binding/TestBinding.java Thu May 26 13:31:19 2005
@@ -24,7 +24,6 @@
@Freq("detailed")
-@Status("inactive")
/**
* Tests controls binding on a web app deployed on a Tomcat server
*/
Added: incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Binding.jws
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Binding.jws?rev=178673&view=auto
==============================================================================
--- incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Binding.jws (added)
+++ incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/jws/Binding.jws Thu May 26 13:31:19 2005
@@ -0,0 +1,63 @@
+package jws;
+
+/*
+ * Copyright 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.
+ *
+ * $Header:$
+ */
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.api.bean.Controls;
+import org.apache.beehive.controls.api.bean.ControlBean;
+import org.apache.beehive.controls.api.properties.BaseProperties;
+import org.apache.beehive.controls.test.controls.binding.*;
+import org.apache.beehive.controls.test.driver.binding.DriveSubControl;
+import org.apache.beehive.test.tools.milton.common.Report;
+
+
+@WebService
+public class Binding
+{
+ @Control
+ public SubControl myControl1;
+
+ @Control
+ @BaseProperties( controlImplementation="org.apache.beehive.controls.test.controls.binding.SubControlImpl" )
+ public SubControl myControl2;
+
+
+ @WebMethod
+ public Report testBasePropertyOnSubControl()
+ {
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl1(myControl1);
+ report=driver.doTestBasePropertyOnSubControl();
+ return report;
+ }
+
+ @WebMethod
+ public Report testOverwriteByDeclare()
+ {
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl2(myControl2);
+ report=driver.doTestOverwriteByDeclare();
+ return report;
+ }
+
+}