You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by js...@apache.org on 2004/07/30 01:55:12 UTC
svn commit: rev 30952 - in incubator/beehive/trunk/controls/test/src: controls/org/apache/beehive/controls/test/controls/contextevent controls/org/apache/beehive/controls/test/controls/event controls/org/apache/beehive/controls/test/controls/extension controls/org/apache/beehive/controls/test/controls/instantiate controls/org/apache/beehive/controls/test/controls/properties units/org/apache/beehive/controls/test/java/context units/org/apache/beehive/controls/test/java/contextevent units/org/apache/beehive/controls/test/java/event units/org/apache/beehive/controls/test/java/extension units/org/apache/beehive/controls/test/java/instantiate
Author: jsong
Date: Thu Jul 29 16:55:11 2004
New Revision: 30952
Modified:
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/contextevent/Recorder.java
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/contextevent/RecorderImpl.jcs
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/event/Hello.java
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/event/HelloImpl.jcs
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/extension/ExtensibleControl.java
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/extension/ExtensibleControlImpl.jcs
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/extension/SubControl.java
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/extension/SubControlImpl.jcs
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/instantiate/HelloControl.java
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/instantiate/HelloControlImpl.jcs
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/properties/SingleProperty.java
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/properties/SingleProperty2.java
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/properties/SingleProperty2Impl.jcs
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/properties/SinglePropertyImpl.jcs
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/context/ContextTest.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/contextevent/LifeCycleTest.java
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/DeclareTest.java
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/Event2Listener.java
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/ProgrammicTest.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
Log:
update test files for controls.
Modified: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/contextevent/Recorder.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/contextevent/Recorder.java (original)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/contextevent/Recorder.java Thu Jul 29 16:55:11 2004
@@ -3,9 +3,8 @@
import org.apache.beehive.controls.api.bean.ControlInterface;
/**
- * A simple control that record context event
+ * A simple control that records its lifecycle events in its impl
*/
-
@ControlInterface
public interface Recorder
{
Modified: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/contextevent/RecorderImpl.jcs
==============================================================================
--- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/contextevent/RecorderImpl.jcs (original)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/contextevent/RecorderImpl.jcs Thu Jul 29 16:55:11 2004
@@ -7,8 +7,8 @@
import org.apache.beehive.controls.api.events.EventHandler;
/**
- * A simple control that listens to and record context events
- * This impl listens to context event declaration
+ * A control impl that listens to and records its lifecycle events
+ * This impl listens to context event by declaring EventHandler
*/
@ControlImplementation
@@ -19,7 +19,8 @@
@Context ControlBeanContext context;
@Context ResourceContext resourceContext;
-
+
+ /*A EventHandler that listens to onCreate event*/
@EventHandler(field="context", eventSet=ControlBeanContext.LifeCycle.class, eventName="onCreate")
public void onCreate()
{
@@ -30,6 +31,7 @@
event_log=event_log+"onCreate";
}
+ /*A EventHandler that listens to onAcquire event*/
@EventHandler(field="resourceContext", eventSet=ResourceContext.ResourceEvents.class, eventName="onAcquire")
public void onAcquire()
{
@@ -39,6 +41,7 @@
event_log=event_log+"onAcquire";
}
+ /*A EventHandler that listens to onRelease event*/
@EventHandler(field="resourceContext", eventSet=ResourceContext.ResourceEvents.class, eventName="onRelease")
public void onRelease()
{
@@ -48,7 +51,8 @@
event_log=event_log+"onRelease";
}
-
+
+ /*Returns the event log*/
public String getRecord()
{
System.out.println("+++++++++++++++++++++++++++++++++++++++++");
Modified: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/event/Hello.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/event/Hello.java (original)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/event/Hello.java Thu Jul 29 16:55:11 2004
@@ -4,8 +4,7 @@
import org.apache.beehive.controls.api.events.EventSet;
/**
- * This is a basic control that tests event support code generation and runtime behavior
- * for ControlBeans.
+ * A ControlInterface that declares three events
*/
@ControlInterface
public interface Hello
Modified: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/event/HelloImpl.jcs
==============================================================================
--- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/event/HelloImpl.jcs (original)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/event/HelloImpl.jcs Thu Jul 29 16:55:11 2004
@@ -3,6 +3,9 @@
import org.apache.beehive.controls.api.bean.ControlImplementation;
import org.apache.beehive.controls.api.events.Client;
+/**
+ * A control implementation that raises events while executing its method
+ */
@ControlImplementation
public class HelloImpl implements Hello
{
Modified: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/extension/ExtensibleControl.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/extension/ExtensibleControl.java (original)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/extension/ExtensibleControl.java Thu Jul 29 16:55:11 2004
@@ -6,7 +6,7 @@
import org.apache.beehive.controls.api.properties.PropertySet;
/**
- * An control interface with one method declared
+ * A control interface with one method and one propertySet
*/
@ControlInterface
public interface ExtensibleControl
Modified: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/extension/ExtensibleControlImpl.jcs
==============================================================================
--- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/extension/ExtensibleControlImpl.jcs (original)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/extension/ExtensibleControlImpl.jcs Thu Jul 29 16:55:11 2004
@@ -5,8 +5,8 @@
import org.apache.beehive.controls.api.bean.Extensible;
/**
- * An impl of ExtensibleControl. By implementing Extensible, this impl allow
- * extending by other control impl
+ * A control impl.
+ * By implementing Extensible, this impl makes itself extensible
*/
@ControlImplementation
Modified: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/extension/SubControl.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/extension/SubControl.java (original)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/extension/SubControl.java Thu Jul 29 16:55:11 2004
@@ -6,11 +6,11 @@
import org.apache.beehive.controls.api.properties.PropertySet;
/**
- * A sub control extending the extensible control with one new method declared.
- * Reset on of the property value.
- * Will access another property in subcontrol impl
+ * A sub control extending ExtensibleControl.
+ * This control declares one new method and one new propertySet.
+ * It also resets the value of the propertySet inherited from ExtensibleControl.
*
- * This sub control also declare a new propertySet
+ * It will access another property inherited from ExtensibleControl in its impl.
*/
@ControlExtension
@ExtensibleControl.WhereAbout(Layer="On_SubControl_Interface_Layer")
Modified: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/extension/SubControlImpl.jcs
==============================================================================
--- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/extension/SubControlImpl.jcs (original)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/extension/SubControlImpl.jcs Thu Jul 29 16:55:11 2004
@@ -3,10 +3,10 @@
import org.apache.beehive.controls.api.context.Context;
import org.apache.beehive.controls.api.context.ControlBeanContext;
import org.apache.beehive.controls.api.bean.ControlImplementation;
-import org.apache.beehive.controls.api.bean.Extensible;
/**
- * The impl of a sub control with one new method declared
+ * A control impl of a SubControl and extending ExtensibleControlImpl.
+ * It access the propertySet inherited from ExtensibleControl.
*/
@ControlImplementation
public class SubControlImpl extends ExtensibleControlImpl implements SubControl
@@ -17,7 +17,7 @@
{
return "Hello from subcontrol";
}
-
+ /*Accessing the propertySet inherited from ExtensibleControl*/
public String accessInheritedProperty()
{
/**Bug: could not refer to WhereAbout directly*/
Modified: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/instantiate/HelloControl.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/instantiate/HelloControl.java (original)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/instantiate/HelloControl.java Thu Jul 29 16:55:11 2004
@@ -6,6 +6,10 @@
import org.apache.beehive.controls.api.bean.ControlInterface;
+/**
+ * A simple control with one method
+ */
+
@ControlInterface
public interface HelloControl
{
Modified: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/instantiate/HelloControlImpl.jcs
==============================================================================
--- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/instantiate/HelloControlImpl.jcs (original)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/instantiate/HelloControlImpl.jcs Thu Jul 29 16:55:11 2004
@@ -3,11 +3,8 @@
import org.apache.beehive.controls.api.bean.ControlImplementation;
/**
- * This test is one step further from a simple custome control
- * This test has a simple custome control invoking another
- * nested simple custome control
+ * A simple control impl
*/
-
@ControlImplementation
public class HelloControlImpl implements HelloControl
{
Modified: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/properties/SingleProperty.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/properties/SingleProperty.java (original)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/properties/SingleProperty.java Thu Jul 29 16:55:11 2004
@@ -1,14 +1,12 @@
package org.apache.beehive.controls.test.controls.properties;
-import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import org.apache.beehive.controls.api.bean.ControlInterface;
import org.apache.beehive.controls.api.properties.PropertySet;
/**
- * Hello control interface with one propertySet declared
- * HelloImpl access propertySet in sayHello method
+ * A control interface with one propertySet and one method declared
*/
@ControlInterface
public interface SingleProperty
Modified: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/properties/SingleProperty2.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/properties/SingleProperty2.java (original)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/properties/SingleProperty2.java Thu Jul 29 16:55:11 2004
@@ -2,14 +2,11 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Annotation;
import org.apache.beehive.controls.api.bean.ControlInterface;
import org.apache.beehive.controls.api.properties.PropertySet;
/**
- * Hello2 control interface with one propertySet declared
- * Hello2Impl does not access propertySet.
- * Client of HelloBean will access propertySet
+ * A control interface with one propertySet and one method declared
*/
@ControlInterface
public interface SingleProperty2
Modified: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/properties/SingleProperty2Impl.jcs
==============================================================================
--- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/properties/SingleProperty2Impl.jcs (original)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/properties/SingleProperty2Impl.jcs Thu Jul 29 16:55:11 2004
@@ -1,16 +1,14 @@
package org.apache.beehive.controls.test.controls.properties;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
import org.apache.beehive.controls.api.bean.ControlImplementation;
import org.apache.beehive.controls.api.context.Context;
import org.apache.beehive.controls.api.context.ControlBeanContext;
/**
- * Test objective: access propertySet from control client.
- * The client of this control shall access propertySet.
+ * A control impl
+ * Test client shall retrieve the property value via the getter/setter
+ * in the generated bean class
*/
-
@ControlImplementation
public class SingleProperty2Impl implements SingleProperty2
{
Modified: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/properties/SinglePropertyImpl.jcs
==============================================================================
--- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/properties/SinglePropertyImpl.jcs (original)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/properties/SinglePropertyImpl.jcs Thu Jul 29 16:55:11 2004
@@ -1,13 +1,11 @@
package org.apache.beehive.controls.test.controls.properties;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
import org.apache.beehive.controls.api.bean.ControlImplementation;
import org.apache.beehive.controls.api.context.Context;
import org.apache.beehive.controls.api.context.ControlBeanContext;
/**
- * Test objective: retrieve property from impl
+ * A control impl that access the property declared in its control interface
*/
@ControlImplementation
@@ -15,6 +13,7 @@
{
@Context ControlBeanContext context;
+ /*Accesses the propertySet value and returns the value*/
public String sayHello()
{
/**BUG: could not refer to Greeting directly*/
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/context/ContextTest.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/context/ContextTest.java (original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/context/ContextTest.java Thu Jul 29 16:55:11 2004
@@ -10,7 +10,9 @@
import org.apache.beehive.test.tools.milton.common.Report;
-
+/**
+ * A TestCase that tests controls context services
+ */
public class ContextTest extends TestCase
{
public ContextTest( String s ) { super( s ); }
@@ -28,7 +30,7 @@
}
/**
- * Test basic Context events for Controls
+ * Tests basic Context events for Controls
*/
public void testContextEventSingle() throws Exception
{
@@ -46,7 +48,7 @@
}
/**
- * Test basic Context events for Controls for multiple invocations in the same context
+ * Tests basic Context events for Controls for multiple invocations in the same context
*/
public void testContextEventMultiple() throws Exception
{
@@ -64,7 +66,7 @@
}
/**
- * Test basic Context events for Controls, for multiple controls used in the same context
+ * Tests basic Context events for Controls, for multiple controls used in the same context
*/
public void testContextEventParallel() throws Exception
{
@@ -80,5 +82,4 @@
fail("testContextEventParallel failed");
}
}
-
}
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 Thu Jul 29 16:55:11 2004
@@ -14,7 +14,7 @@
import org.apache.beehive.test.tools.milton.common.Report;
/**
- * Tests retrieving other services available to a control
+ * A TestCase that tests accessing available services via control context
*/
public class GetServiceTest extends TestCase
{
@@ -23,13 +23,14 @@
public void setUp() { }
/**
- * A control that exposes the function to access other services available
+ * A control that exposes a function to access available services
+ * via the control context service
*/
@Control
public ServiceGetterBean serviceGetter;
/**
- * Retrieves servlet service via context service
+ * Tests accessing servlet service via controls' context service
* In java environment, this should be "NULL"
*/
public void testServletContext() throws Exception
@@ -39,7 +40,7 @@
}
/**
- * Retrieves BeanContextServices via context service
+ * Tests accessing BeanContextServices via controls' context service.
* In java environment, this should be "0"
*/
public void testBeanContextServices() throws Exception
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/contextevent/LifeCycleTest.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/contextevent/LifeCycleTest.java (original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/contextevent/LifeCycleTest.java Thu Jul 29 16:55:11 2004
@@ -9,7 +9,7 @@
/**
- * Tests control's context event by listening to and recording controls'
+ * A TestCase that tests control's context event by listening to and recording controls'
* life cycle event
*/
@@ -24,7 +24,7 @@
public LifeCycleTest(String s) { super(s); }
/**
- * Retrieves the life cycle events recorded by RecordImpl
+ * Tests control impl listening to its lifecycle events.
*/
public void testRecordFromImpl() throws Exception
{
@@ -33,7 +33,7 @@
}
/**
- * Registers and records life cycle events in bean instance
+ * Tests listening to control's lifecycle events by registering a listener
*/
public void testRecordFromBeanInstance() throws Exception
{
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/DeclareTest.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/DeclareTest.java (original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/DeclareTest.java Thu Jul 29 16:55:11 2004
@@ -11,7 +11,7 @@
import org.apache.beehive.controls.api.events.EventHandler;
/**
- * This class receives events from a control by @EventHandler
+ * A TestCase that tests receiving events from a control by @EventHandler
*/
public class DeclareTest extends TestCase
{
@@ -19,7 +19,7 @@
public final static String LOG_FILE_METHOD2="test_method2.log";
/**
- * A control that sends events to this class
+ * A control that raises events
*/
@Control
public HelloBean myHelloBean;
@@ -27,7 +27,7 @@
public DeclareTest(String s) { super(s); }
- /** EventHandler for EventSet1 from myHelloBean*/
+ /** EventHandler that receives EventSet1 from myHelloBean*/
@EventHandler (field="myHelloBean", eventSet= HelloBean.EventSet1.class,
eventName="set1Method1")
public void myHelloBeanMessageHandler()
@@ -58,7 +58,7 @@
}
- /** EventHandler for EventSet2 from myHelloBean*/
+ /** EventHandler that receives EventSet2 from myHelloBean*/
@EventHandler (field="myHelloBean", eventSet= HelloBean.EventSet2.class,
eventName="set2Method2")
public void myHelloBeanMessageHandler(int i)
@@ -96,6 +96,8 @@
*/
public void testInvokeEvent() throws Exception
{
+
+ /*Clears the play ground*/
File f=null;
try{
f=new File(LOG_FILE_METHOD1);
@@ -124,6 +126,7 @@
System.out.println("****** event invoked ******");
System.out.println("*********************************");
+ /* Invokes the method on the control while will trigger the events*/
try{
myHelloBean.testEvents();
}
@@ -134,7 +137,7 @@
}
/**
- * Checks a log file to see if EventSet1 has been received
+ * Verifies the reception of EventSet1
*/
public void testMethod1Event() throws Exception
{
@@ -142,8 +145,7 @@
try{
log=new RandomAccessFile(LOG_FILE_METHOD1,"r");
String s=log.readLine();
- if (!s.equals("0"))
- fail("Log file:"+s);
+ Assert.assertEquals(s,"0");
}
catch(Exception e){
e.printStackTrace();
@@ -161,7 +163,7 @@
}
/**
- * Checks a log file to see if EventSet2 has been received
+ * Verifies the reception of EventSet2
*/
public void testMethod2Event() throws Exception
{
@@ -187,5 +189,4 @@
}
}
-
}
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/Event2Listener.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/Event2Listener.java (original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/Event2Listener.java Thu Jul 29 16:55:11 2004
@@ -1,15 +1,9 @@
package org.apache.beehive.controls.test.java.event;
-import java.io.File;
-import java.io.RandomAccessFile;
-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;
-
/**
- * Implements Hello.EventSet2
+ * A listener class for Hello.EventSet2 event
*/
public class Event2Listener implements Hello.EventSet2
{
@@ -20,24 +14,27 @@
public void method1(){
- //do something at here
+ //Event received, flip the counter
+ method1Result="0";
}
public int set2Method2(){
- //do something at here
+ //Event received, flip the counter
+ method2Result="0";
return 0;
}
public boolean set2OverloadedMethod(){
- //do something at here
+ //Event received, flip the counter
+ overloadMethod1="0";
return true;
}
public boolean set2OverloadedMethod(int anArg){
- //do something at here
+ //Event received, flip the counter
+ overloadMethod2="0";
return true;
}
public String getAllResult(){
return method1Result+method2Result+overloadMethod1+overloadMethod2;
-
}
}
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/ProgrammicTest.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/ProgrammicTest.java (original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/ProgrammicTest.java Thu Jul 29 16:55:11 2004
@@ -12,8 +12,8 @@
import org.apache.beehive.controls.api.events.EventHandler;
/**
- * This class receives events from a control with an inner class or
- * an instance of other class.
+ * A Testcase that tests receiving events from a control with an inner class or
+ * an instance of listener class.
*/
public class ProgrammicTest extends TestCase
{
@@ -29,7 +29,6 @@
public ProgrammicTest(String s) { super(s); }
-
/**
* 1. Deletes the file that might exist
* 2. Registers two event listeners to myHelloBean;
@@ -37,6 +36,7 @@
*/
public void testInvokeEvent1() throws Exception
{
+ /*Clears the play ground*/
File f=null;
try{
f=new File(LOG_FILE_METHOD1);
@@ -65,11 +65,11 @@
System.out.println("****** event invoked ******");
System.out.println("*********************************");
- /* Creates an instance of event listener designed for event2*/
+ /* Creates a listener for event2*/
Event2Listener event2listener=new Event2Listener();
try{
- /*Adds an inner class as event listener for event1*/
+ /*Register an inner class as listener for event1*/
myHelloBean.addEventSet1Listener(
new Hello.EventSet1()
{
@@ -80,10 +80,10 @@
});
- /* Registers the event listener designed for event2*/
+ /* Registers another listener for event2*/
myHelloBean.addEventSet2Listener(event2listener);
- /* Trigger the events on myHelloBean*/
+ /* Invokes methods on myHelloBean to trigger the events*/
myHelloBean.testEvents();
}
catch(Exception e){
@@ -93,7 +93,7 @@
}
/**
- * Checks a log file and verifies event1
+ * Verifies the reception of event1
*/
public void testMethod1Event() throws Exception
{
@@ -121,7 +121,7 @@
}
/**
- * Checks a log file and verifies event2
+ * Verifies the reception of event2
*/
public void testMethod2Event() throws Exception
{
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 Thu Jul 29 16:55:11 2004
@@ -9,7 +9,7 @@
import org.apache.beehive.controls.test.controls.extension.SubControlBean;
/**
- * Tests control inheritance by instantiating a subcontrol and invoking the methods.
+ * A TeseCase that tests control inheritance by instantiating a subcontrol and invoking the methods.
*/
public class SubControlTest extends TestCase
{
@@ -24,7 +24,7 @@
public SubControlBean subcontrol;
/**
- * Invokes a method inherited by the subcontrol
+ * Tests invoking a method inherited by the subcontrol
*/
public void testInheritedMethod() throws Exception
{
@@ -34,7 +34,7 @@
}
/**
- * Invokes a method inherited by the subcontrol.
+ * Tests invoking a method inherited by the subcontrol.
* The subcontrol is instantiated programmically
*/
public void testInheritedMethod2() throws Exception
@@ -47,7 +47,7 @@
}
/**
- * Invokes a method declared on the subcontrol
+ * Tests invoking a method declared on the subcontrol
*/
public void testExtendedMethod() throws Exception
{
@@ -57,7 +57,7 @@
}
/**
- * Invokes a method declared on the subcontrol
+ * Tests invoking a method declared on the subcontrol
* The subcontrol is instantiated programmically
*/
public void testExtendedMethod2() throws Exception
@@ -71,7 +71,7 @@
}
/**
- * Accesses the propertySet declared on ExtensibleControl from a subcontrol instance
+ * Tests accessing the propertySet declared on ExtensibleControl from a subcontrol instance.
* The subcontrol is instantiated declaratively
*/
public void testInheritedProperty() throws Exception
@@ -82,7 +82,7 @@
}
/**
- * Accesses the propertySet declared on ExtensibleControl from a subcontrol instance
+ * Tests accessing the propertySet declared on ExtensibleControl from a subcontrol instance
* The subcontrol is instantiated programmatically
*/
public void testInheritedProperty2() throws Exception
@@ -98,7 +98,7 @@
/** BUG: getter/setter in generated bean class is busted! comment out all tests using getter/setter*/
/**
- * Accesses the property declared on ExtensibleControl but reset on SubControl IF
+ * Tests accessing the property declared on ExtensibleControl but reset on SubControl IF
* The subcontrol is instantiated declaratively
*
public void testResetProperty() throws Exception
@@ -109,7 +109,7 @@
}
/**
- * Accesses the property declared on ExtensibleControl but reset on SubControl IF
+ * Tests accessing the property declared on ExtensibleControl but reset on SubControl IF
* The subcontrol is instantiated programmatically
*
public void testResetProperty2() throws Exception
@@ -123,7 +123,7 @@
}
/**
- * Accesses the property declared SubControl interface
+ * Tests accessing the property declared SubControl interface
* The subcontrol is instantiated declaratively
*
public void testNewProperty() throws Exception
@@ -134,7 +134,7 @@
}
/**
- * Accesses the property declared on SubControl interface
+ * Tests accessing the property declared on SubControl interface
* The subcontrol is instantiated programmatically
*
public void testNewProperty2() throws Exception
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 Thu Jul 29 16:55:11 2004
@@ -11,7 +11,7 @@
import org.apache.beehive.controls.test.controls.properties.SingleProperty;
/**
- * Tests instantiating controls in different ways
+ * A TestCase that tests instantiating controls in different ways
*/
public class TestInstantiate extends TestCase
{
@@ -34,7 +34,7 @@
public TestInstantiate(String s) { super(s); }
/**
- * Test instantiating a custom control programmatically
+ * Tests instantiating a custom control programmatically
*/
public void testProgrammaticInstantiation() throws Exception
{
@@ -47,7 +47,7 @@
}
/**
- * Test instantiating a custom control declaratively
+ * Tests instantiating a custom control declaratively
*/
public void testDeclarativeInstantiation() throws Exception
{
@@ -55,13 +55,18 @@
Assert.assertEquals(myHelloBean.hello("Bob"),"Bob");
}
+ /**
+ * Tests declaratively instantiating a custom control with propertySet
+ */
public void testDeclareWithProperty() throws Exception
{
Assert.assertNotNull(myPropertyBean);
Assert.assertEquals(myPropertyBean.sayHello(),"Good evening!");
}
- /** Instantiates a control and reset the property value*/
+ /**
+ * Tests programmically instantiating a custom control with propertySet
+ */
public void testProgrammWithProperty() throws Exception
{
/*BUG:CR190302