Author: jsong
Date: Mon Oct 18 13:07:13 2004
New Revision: 55030
Modified:
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/context/DriveServiceGetter.java
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/context/GetServiceTest.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/instantiate/TestInstantiate.java
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientAccessTest.java
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientImplTest.java
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ImplAccessTest.java
Log:
Covert all java junit tests to using drivers.
Checkin.tests pass on WinXP.
Modified:
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/context/DriveServiceGetter.java
==============================================================================
---
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/context/DriveServiceGetter.java
(original)
+++
incubator/beehive/trunk/controls/test/src/drivers/org/apache/beehive/controls/test/driver/context/DriveServiceGetter.java
Mon Oct 18 13:07:13 2004
@@ -87,10 +87,10 @@
Report report=new Report();
report.setStatus(Report.PASS);
String tmp="";
- try{
+ //try{
boolean b1=checkBeanContextService();
boolean b2=checkControlBeanContext();
- boolean b3=checkResourceContext();
+ //boolean b3=checkResourceContext();
if(!b1){
report.setStatus(Report.FAIL);
@@ -102,17 +102,20 @@
tmp=report.getMessage();
report.setMessage(tmp+"ControlBeanContext
unavaliable");
}
-
+ /*
if(!b3){
report.setStatus(Report.FAIL);
tmp=report.getMessage();
report.setMessage(tmp+"ResourceContext
unavaliable");
}
+ */
+ /*
}
catch(ClassNotFoundException e){
report.setStatus(Report.FAIL);
report.setExceptionStack(e);
}
+ */
return report;
}
Modified:
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/context/GetServiceTest.java
==============================================================================
---
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/context/GetServiceTest.java
(original)
+++
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/context/GetServiceTest.java
Mon Oct 18 13:07:13 2004
@@ -1,7 +1,6 @@
package org.apache.beehive.controls.test.java.context;
-import junit.framework.Assert;
import junit.framework.TestCase;
import javax.servlet.ServletContext;
import java.beans.Beans;
@@ -9,8 +8,11 @@
import org.apache.beehive.controls.api.bean.ControlBean;
import org.apache.beehive.controls.api.context.ControlBeanContext;
import org.apache.beehive.controls.test.controls.context.ServiceGetterBean;
+import org.apache.beehive.controls.test.driver.context.DriveServiceGetter;
import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.milton.common.Report;
+
/**
@@ -31,31 +33,22 @@
public ServiceGetterBean serviceGetter;
/**
- * Tests accessing servlet service via controls' context service
- * In java environment, this should be "NULL"
- * The control is instantiated by declaration
- */
- @Freq("checkin")
- @Status("inactive")
- public void testGetServletContextByDeclaration() throws Exception
- {
- Assert.assertNotNull(serviceGetter);
- Object service=serviceGetter.getService(ServletContext.class,
null);
- Assert.assertNull(service);
- }
-
- /**
* Tests accessing ControlBeanContext via controls' context service.
* In java environment, this should be an instanceof ControlBeanContext
* The control is instantiated by declaration
*/
@Freq("checkin")
@Status("inactive")
- public void testGetControlBeanContextByDeclaration() throws Exception
+ public void testGetServiceFromContextByDeclaration() throws Exception
{
- Assert.assertNotNull(serviceGetter);
- Object
service=serviceGetter.getService(ControlBeanContext.class, null);
- Assert.assertTrue(service instanceof ControlBeanContext);
+ Report report=new Report();
+ DriveServiceGetter driver=new DriveServiceGetter();
+ driver.setControl(serviceGetter);
+ driver.setTestEnv(true,false,false);
+ report=driver.doTest();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
/**
@@ -63,29 +56,19 @@
* In java environment, this should be "NULL"
* The control is instantiated programmatically
*/
- @Freq("checkin")
- public void testGetServletContextByProgram() throws Exception
- {
- ServiceGetterBean
getterbean=(ServiceGetterBean)java.beans.Beans.instantiate(
- Thread.currentThread().getContextClassLoader() ,
-
"org.apache.beehive.controls.test.controls.context.ServiceGetterBean");
- Object service=getterbean.getService(ServletContext.class,
null);
- Assert.assertNull(service);
- }
-
- /**
- * Tests accessing ControlBeanContext via controls' context service.
- * In java environment, this should be "0"
- * The control is instantiated programmatically
- */
@Freq("detailed")
- public void testGetControlBeanContextByProgram() throws Exception
+ public void testGetServiceFromContextByProgram() throws Exception
{
+ Report report=new Report();
ServiceGetterBean
getterbean=(ServiceGetterBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
"org.apache.beehive.controls.test.controls.context.ServiceGetterBean");
- Object service=getterbean.getService(ControlBeanContext.class,
null);
- Assert.assertTrue(service instanceof ControlBeanContext);
+ DriveServiceGetter driver=new DriveServiceGetter();
+ driver.setControl(getterbean);
+ driver.setTestEnv(true,false,false);
+ 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/event/ListenerTest.java
==============================================================================
---
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
Mon Oct 18 13:07:13 2004
@@ -1,14 +1,16 @@
package org.apache.beehive.controls.test.java.event;
-import junit.framework.Assert;
import junit.framework.TestCase;
import java.beans.Beans;
import org.apache.beehive.controls.api.bean.Control;
import org.apache.beehive.controls.api.bean.ControlBean;
import org.apache.beehive.controls.test.controls.event.Hello;
import org.apache.beehive.controls.test.controls.event.HelloBean;
+import org.apache.beehive.controls.test.driver.event.DriveListener;
import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.milton.common.Report;
+
/**
* A Testcase that tests receiving events from a control with an inner class or
@@ -38,40 +40,30 @@
public void testListenerReceiveEventsProgram() throws Exception
{
- try{
-
- HelloBean
hellobean=(HelloBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
-
"org.apache.beehive.controls.test.controls.event.HelloBean");
- /*Register an inner class as listener for event1*/
- hellobean.addEventSet1Listener(
- new Hello.EventSet1()
- {
- public void method1()
- {
- innerClassReceiveEvent_program=true;
- }
-
- });
-
- /* Creates a listener for event2 and register it*/
- Event2Listener event2listener=new Event2Listener();
- hellobean.addEventSet2Listener(event2listener);
-
- /* Invokes methods on myHelloBean to trigger the
events*/
- hellobean.triggerEvents();
+ Report report=new Report();
+ HelloBean hellobean=(HelloBean)java.beans.Beans.instantiate(
+ Thread.currentThread().getContextClassLoader() ,
+
"org.apache.beehive.controls.test.controls.event.HelloBean");
+
+ DriveListener driver=new DriveListener();
+ driver.setControl(hellobean);
+ report=driver.doTest();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
- /*Wait for the events*/
+ try{
Thread.currentThread().sleep(1000);
-
- /*Verified result*/
-
Assert.assertEquals(true,innerClassReceiveEvent_program);
-
Assert.assertEquals("0",event2listener.getMethod2Result());
+ report=driver.verifyResult();
+ result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
catch(Exception e){
- e.printStackTrace();
- fail(e.toString());
+ fail("Exception caught:"+e.toString());
}
+
}
/**
@@ -83,37 +75,23 @@
@Status("inactive")
public void testListenerReceiveEventsDeclare() throws Exception
{
- Assert.assertNotNull(myHellobean);
- try{
- /*Register an inner class as listener for event1*/
- myHellobean.addEventSet1Listener(
- new Hello.EventSet1()
- {
- public void method1()
- {
- innerClassReceiveEvent_declare=true;
- }
- });
-
- /* Creates a listener for event2 and register it*/
- Event2Listener event2listener=new Event2Listener();
- myHellobean.addEventSet2Listener(event2listener);
-
- /* Invokes methods on myHelloBean to trigger the
events*/
- myHellobean.triggerEvents();
+ Report report=new Report();
+ DriveListener driver=new DriveListener();
+ driver.setControl(myHellobean);
+ report=driver.doTest();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
- /*Wait for the events*/
+ try{
Thread.currentThread().sleep(1000);
-
- /*Verified result*/
-
-
Assert.assertEquals(true,innerClassReceiveEvent_declare);
-
Assert.assertEquals("0",event2listener.getMethod2Result());
-
+ report=driver.verifyResult();
+ result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
catch(Exception e){
- e.printStackTrace();
- fail(e.toString());
+ fail("Exception caught:"+e.toString());
}
}
Modified:
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/extension/SubControlTest.java
==============================================================================
---
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/extension/SubControlTest.java
(original)
+++
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/extension/SubControlTest.java
Mon Oct 18 13:07:13 2004
@@ -1,14 +1,14 @@
package org.apache.beehive.controls.test.java.extension;
-import junit.framework.Assert;
import junit.framework.TestCase;
import java.beans.Beans;
import org.apache.beehive.controls.api.bean.Control;
import org.apache.beehive.controls.api.bean.ControlBean;
import org.apache.beehive.controls.test.controls.extension.SubControlBean;
+import org.apache.beehive.controls.test.driver.extension.DriveSubControl;
import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
-
+import org.apache.beehive.test.tools.milton.common.Report;
/**
@@ -35,10 +35,13 @@
@Status("inactive")
public void testInheritedMethod() throws Exception
{
- Assert.assertNotNull(subcontrol);
- String s=subcontrol.hello();
- Assert.assertEquals("Hello from super control",s);
-
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(subcontrol);
+ report=driver.doInvokeInheritedMethod();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
/**
@@ -50,9 +53,13 @@
{
SubControlBean
sub=(SubControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
-
- Assert.assertNotNull(sub);
- Assert.assertEquals("Hello from super control",sub.hello());
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(sub);
+ report=driver.doInvokeInheritedMethod();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
/**
@@ -62,9 +69,13 @@
@Status("inactive")
public void testExtendedMethod() throws Exception
{
- Assert.assertNotNull(subcontrol);
- String s=subcontrol.hello2();
- Assert.assertEquals("Hello from subcontrol",s);
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(subcontrol);
+ report=driver.doInvokeExtendedMethod();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
@@ -78,8 +89,13 @@
SubControlBean
sub=(SubControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
- Assert.assertNotNull(sub);
- Assert.assertEquals("Hello from subcontrol",sub.hello2());
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(sub);
+ report=driver.doInvokeExtendedMethod();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
@@ -92,9 +108,13 @@
@Status("inactive")
public void testGettingInheritedPropertyByContext() throws Exception
{
- Assert.assertNotNull(subcontrol);
- String s=subcontrol.accessInheritedProperty();
- Assert.assertEquals("In_ExtensibleControl_Interface",s);
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(subcontrol);
+ report=driver.doGetInheritedPropertyByContext();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
@@ -109,8 +129,13 @@
SubControlBean
sub=(SubControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
- Assert.assertNotNull(sub);
-
Assert.assertEquals("In_ExtensibleControl_Interface",sub.accessInheritedProperty());
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(sub);
+ report=driver.doGetInheritedPropertyByContext();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
@@ -125,12 +150,13 @@
@Status("inactive")
public void testGettingInheritedPropertyByGetter() throws Exception
{
- /*
- Assert.assertNotNull(subcontrol);
- String s=subcontrol.getWhereaboutPosition();
- Assert.assertEquals("In_ExtensibleControl_Interface",s);
- */
-
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(subcontrol);
+ report=driver.doGetInheritedPropertyByGetter();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
/**
@@ -142,14 +168,17 @@
@Status("inactive")
public void testGettingInheritedPropertyByGetter2() throws Exception
{
- /*
SubControlBean sub=(SubControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
- Assert.assertNotNull(sub);
-
Assert.assertEquals("In_ExtensibleControl_Interface",sub.getWhereaboutPosition());
- */
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(sub);
+ report=driver.doGetInheritedPropertyByGetter();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
/**
@@ -161,11 +190,13 @@
@Status("inactive")
public void testSettingInheritedPropertyBySetter() throws Exception
{
- /*
- Assert.assertNotNull(subcontrol);
- String s=subcontrol.setWhereaboutPosition("new position");
- Assert.assertEquals("In_ExtensibleControl_Interface",s);
- */
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(subcontrol);
+ report=driver.doSetInheritedPropertyBySetter();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
/**
@@ -177,14 +208,18 @@
@Status("inactive")
public void testSettingInheritedPropertyBySetter2() throws Exception
{
- /*
+
SubControlBean sub=(SubControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
- Assert.assertNotNull(sub);
-
Assert.assertEquals("In_ExtensibleControl_Interface",sub.getWhereaboutPosition());
- */
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(sub);
+ report=driver.doSetInheritedPropertyBySetter();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
@@ -198,9 +233,18 @@
@Status("inactive")
public void testGetReconfiguredPropertyByContext() throws Exception
{
+ /*
Assert.assertNotNull(subcontrol);
String s=subcontrol.getLayerByContext();
Assert.assertEquals("On_SubControl_Interface_Layer",s);
+ */
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(subcontrol);
+ report=driver.doGetReconfiguredPropertyByContext();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
@@ -216,8 +260,13 @@
SubControlBean
sub=(SubControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
- Assert.assertNotNull(sub);
-
Assert.assertEquals("On_SubControl_Interface_Layer",sub.getLayerByContext());
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(sub);
+ report=driver.doGetReconfiguredPropertyByContext();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
@@ -230,10 +279,13 @@
@Status("inactive")
public void testGetReconfiguredPropertyByGetter() throws Exception
{
- /*
- String s=subcontrol.getWhereAboutLayer();
- Assert.assertEquals(s,"On_SubControl_Interface_Layer");
- */
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(subcontrol);
+ report=driver.doGetReconfiguredPropertyByGetter();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
/**
@@ -245,13 +297,17 @@
@Status("inactive")
public void testGetReconfiguredPropertyByGetter2() throws Exception
{
- /*
SubControlBean sub=(SubControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
- Assert.assertNotNull(sub);
-
Assert.assertEquals(sub.getWhereAboutLayer(),"On_SubControl_Interface_Layer");
- */
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(sub);
+ report=driver.doGetReconfiguredPropertyByGetter();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
+
}
/**
@@ -262,10 +318,14 @@
@Status("inactive")
public void testSetReconfiguredPropertyBySetter() throws Exception
{
- /*
- String s=subcontrol.getWhereAboutLayer();
- Assert.assertEquals(s,"On_SubControl_Interface_Layer");
- */
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(subcontrol);
+ report=driver.doSetReconfiguredPropertyBySetter();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
+
}
/**
@@ -276,14 +336,18 @@
@Status("inactive")
public void testSetReconfiguredPropertyBySetter2() throws Exception
{
- /*
SubControlBean sub=(SubControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
- Assert.assertNotNull(sub);
-
Assert.assertEquals(sub.getWhereAboutLayer(),"On_SubControl_Interface_Layer");
- */
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(sub);
+ report=driver.doSetReconfiguredPropertyBySetter();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
+
}
@@ -303,14 +367,19 @@
* The value is retrieved by control context.
* The subcontrol is instantiated declaratively.
*/
- @Freq("checkin")
+ @Freq("detailed")
+ @Status("inactive")
public void testGetExtendedPropertyByContext() throws Exception
{
- SubControlBean
sub=(SubControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
-
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
- Assert.assertNotNull(sub);
- Assert.assertEquals("New Property Declared by Sub
Control",sub.getExtendedPropertyByContext());
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(subcontrol);
+ report=driver.doGetExtendedPropertyByContext();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
+
}
/**
@@ -318,12 +387,22 @@
* The property is retrieved by control context.
* The subcontrol is instantiated programmatically.
*/
- @Freq("detailed")
- @Status("inactive")
+ @Freq("checkin")
public void testGetExtendedPropertyByContext2() throws Exception
{
- //one new method needs to be added on SubControl
- //getNewPropertyByContext()
+
+ SubControlBean sub=(SubControlBean)java.beans.Beans.instantiate(
+ Thread.currentThread().getContextClassLoader() ,
+
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
+
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(sub);
+ report=driver.doGetExtendedPropertyByContext();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
+
}
/**
@@ -335,10 +414,13 @@
@Status("inactive")
public void testGetExtendedPropertyByGetter() throws Exception
{
- /*
- String s=subcontrol.getNewPropertyMessage();
- Assert.assertEquals(s,"New Property Declared by Sub Control");
- */
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(subcontrol);
+ report=driver.doGetExtendedPropertyByGetter();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
/**
@@ -350,14 +432,16 @@
@Status("inactive")
public void testGetExtendedPropertyByGetter2() throws Exception
{
- /*
SubControlBean sub=(SubControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
-
- Assert.assertNotNull(sub);
- Assert.assertEquals(sub.getNewPropertyMessage(),"New Property
Declared by Sub Control");
- */
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(sub);
+ report=driver.doGetExtendedPropertyByGetter();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
/**
@@ -369,10 +453,13 @@
@Status("inactive")
public void testSetExtendedPropertyBySetter() throws Exception
{
- /*
- String s=subcontrol.getNewPropertyMessage();
- Assert.assertEquals(s,"New Property Declared by Sub Control");
- */
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(subcontrol);
+ report=driver.doSetExtendedPropertyBySetter();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
/**
@@ -384,14 +471,17 @@
@Status("inactive")
public void testSetExtendedPropertyBySetter2() throws Exception
{
- /*
SubControlBean sub=(SubControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
"org.apache.beehive.controls.test.controls.extension.SubControlBean");
- Assert.assertNotNull(sub);
- Assert.assertEquals(sub.getNewPropertyMessage(),"New Property
Declared by Sub Control");
- */
+ Report report =new Report();
+ DriveSubControl driver=new DriveSubControl();
+ driver.setControl(sub);
+ report=driver.doSetExtendedPropertyBySetter();
+ 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/instantiate/TestInstantiate.java
==============================================================================
---
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/instantiate/TestInstantiate.java
(original)
+++
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/instantiate/TestInstantiate.java
Mon Oct 18 13:07:13 2004
@@ -1,16 +1,17 @@
package org.apache.beehive.controls.test.java.instantiate;
-import junit.framework.Assert;
import junit.framework.TestCase;
import java.beans.Beans;
import org.apache.beehive.controls.api.bean.Control;
import org.apache.beehive.controls.api.bean.ControlBean;
import org.apache.beehive.controls.test.controls.instantiate.HelloControlBean;
-import org.apache.beehive.controls.test.controls.property.SinglePropertyBean;
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.mantis.annotations.tch.Freq;
import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
-
+import org.apache.beehive.test.tools.milton.common.Report;
/**
@@ -43,13 +44,16 @@
@Freq("checkin")
public void testProgrammaticInstantiation() throws Exception
{
-
+ Report report=new Report();
HelloControlBean
hc=(HelloControlBean)java.beans.Beans.instantiate(
Thread.currentThread().getContextClassLoader() ,
"org.apache.beehive.controls.test.controls.instantiate.HelloControlBean");
-
- Assert.assertNotNull(hc);
- Assert.assertEquals("Bob",hc.hello("Bob"));
+ DriveHelloControl driver=new DriveHelloControl();
+ driver.setControl(hc);
+ report=driver.doTest();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
}
/**
@@ -59,8 +63,14 @@
@Status("inactive")
public void testDeclarativeInstantiation() throws Exception
{
- Assert.assertNotNull(myHelloBean);
- Assert.assertEquals("Bob",myHelloBean.hello("Bob"));
+ Report report=new Report();
+ DriveHelloControl driver=new DriveHelloControl();
+ driver.setControl(myHelloBean);
+ report=driver.doTest();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
+
}
/**
@@ -71,8 +81,14 @@
@Status("inactive")
public void testDeclareWithProperty() throws Exception
{
- Assert.assertNotNull(myPropertyBean);
- Assert.assertEquals("Good evening!",myPropertyBean.sayHello());
+ Report report=new Report();
+ DriveSingleProperty driver=new DriveSingleProperty();
+ driver.setControl(myPropertyBean);
+ report=driver.doTest();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
+
}
/**
@@ -84,6 +100,8 @@
{
/*BUG:CR190302
+ Report report=new Report();
+
PropertyMap greetAttr = new
(PropertyMap(SingleProperty.Greeting.class);
greetAttr.setProperty("GreetWord","Good afternoon!");
SinglePropertyBean spbean =
(SinglePropertyBean)Controls.instantiate(
@@ -91,9 +109,13 @@
"org.apache.beehive.controls.test.controls.properties.SinglePropertyBean",
greetAttr);
+ DriveSingleProperty driver=new DriveSingleProperty();
+ driver.setControl(spbean);
+ report=driver.doTest();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
- Assert.assertNotNull(spbean);
- Assert.assertEquals("Good afternoon!",spbean.sayHello());
*/
}
}
Modified:
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientAccessTest.java
==============================================================================
---
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientAccessTest.java
(original)
+++
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientAccessTest.java
Mon Oct 18 13:07:13 2004
@@ -1,16 +1,15 @@
package org.apache.beehive.controls.test.java.property;
+import junit.framework.Assert;
+import junit.framework.TestCase;
import java.beans.Beans;
import org.apache.beehive.controls.api.bean.Control;
import org.apache.beehive.controls.api.bean.ControlBean;
import org.apache.beehive.controls.test.controls.property.SingleProperty2Bean;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-import org.apache.beehive.test.tools.milton.common.Report;
-
+import org.apache.beehive.controls.test.driver.property.DriveClientAccess;
import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.milton.common.Report;
/**
* Test accessing control's propertySet by control bean's getter/setter
@@ -36,8 +35,14 @@
public void testGetterByDeclare() throws Exception
{
/*
- String s=myControl.getGreetingGreetWord();
- Assert.assertEquals(s,"Hello");
+ Report report=new Report();
+ DriveClientAccess driver=new DriveClientAccess();
+ driver.setControl(myControl);
+ report=driver.doTest();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
+
*/
}
@@ -48,12 +53,16 @@
public void testGetterByProgram() throws Exception
{
/*
- Report report =new Report();
+ Report report=new Report();
SingleProperty2Bean
sbean=(SingleProperty2Bean)Beans.instantiate(Thread.currentThread().getContextClassLoader(),
"org.apache.beehive.controls.test.controls.property.SingleProperty2Bean");
+ DriveClientAccess driver=new DriveClientAccess();
+ driver.setControl(sbean);
+ report=driver.doTest();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
- String s=sbean.getGreetingGreetWord();
- Assert.assertEquals(s,"Hello");
*/
}
Modified:
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientImplTest.java
==============================================================================
---
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientImplTest.java
(original)
+++
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientImplTest.java
Mon Oct 18 13:07:13 2004
@@ -1,16 +1,14 @@
package org.apache.beehive.controls.test.java.property;
-import junit.framework.Assert;
import junit.framework.TestCase;
import java.beans.Beans;
import org.apache.beehive.controls.api.bean.Control;
import org.apache.beehive.controls.api.bean.ControlBean;
import org.apache.beehive.controls.test.controls.property.SinglePropertyBean;
-
-import org.apache.beehive.test.tools.milton.common.Report;
+import org.apache.beehive.controls.test.driver.property.DriveClientImpl;
import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
-
+import org.apache.beehive.test.tools.milton.common.Report;
/**
@@ -40,9 +38,13 @@
public void testResetPropertyByDeclare() throws Exception
{
/*
- myBean.setGreetingGreetWord("Good morning!");
- String s=myControl.sayHello();
- Assert.assertEquals("Good morning!",s);
+ Report report=new Report();
+ DriveClientImpl driver=new DriveClientImpl();
+ driver.setControl(myControl);
+ report=driver.doTest();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
*/
}
@@ -54,12 +56,15 @@
public void testResetPropertyByProgram() throws Exception
{
/*
- Report report =new Report();
- SinglePropertyBean
sbean=(SinglePropertyBean)Beans.instantiate(Thread.currentThread().getContextClassLoader(),
-
"org.apache.beehive.controls.test.controls.property.SingleProperty");
- hbean.setGreetingGreetWord("Good morning!");
- String s=sbean.sayHello();
- Assert.assertEquals("Good morning!",s);
+ Report report=new Report();
+ SingleProperty2Bean
sbean=(SingleProperty2Bean)Beans.instantiate(Thread.currentThread().getContextClassLoader(),
+
"org.apache.beehive.controls.test.controls.property.SingleProperty2Bean");
+ DriveClientImpl driver=new DriveClientImpl();
+ driver.setControl(sbean);
+ 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
==============================================================================
---
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
Mon Oct 18 13:07:13 2004
@@ -1,16 +1,14 @@
package org.apache.beehive.controls.test.java.property;
+import junit.framework.TestCase;
import java.beans.Beans;
import org.apache.beehive.controls.api.bean.Control;
import org.apache.beehive.controls.api.bean.ControlBean;
import org.apache.beehive.controls.test.controls.property.SinglePropertyBean;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-import org.apache.beehive.test.tools.milton.common.Report;
+import org.apache.beehive.controls.test.driver.property.DriveImplAccess;
import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
-
+import org.apache.beehive.test.tools.milton.common.Report;
/**
@@ -38,13 +36,15 @@
@Status("inactive")
public void testContextAccessByDeclare() throws Exception
{
- /*
- Report report =new Report();
- Assert.assertEquals(report.getStatus(), Report.PASS);
- */
- Assert.assertNotNull(myControl);
- String s=myControl.sayHello();
- Assert.assertEquals("Hello",s);
+
+ Report report=new Report();
+ DriveImplAccess driver=new DriveImplAccess();
+ driver.setControl(myControl);
+ report=driver.doTest();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
+
}
/**
@@ -55,11 +55,17 @@
@Freq("checkin")
public void testContextAccessByProgram() throws Exception
{
- //Report report =new Report();
+ Report report=new Report();
SinglePropertyBean
sbean=(SinglePropertyBean)Beans.instantiate(Thread.currentThread().getContextClassLoader(),
"org.apache.beehive.controls.test.controls.property.SinglePropertyBean");
- String s=sbean.sayHello();
- Assert.assertEquals("Hello",s);
+ DriveImplAccess driver=new DriveImplAccess();
+ driver.setControl(sbean);
+ report=driver.doTest();
+ String result=report.getStatus();
+ if (!result.equals(Report.PASS))
+ fail(report.getMessage());
+
+
}
}