You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beehive.apache.org by "Kyle Marvin (JIRA)" <be...@incubator.apache.org> on 2005/05/05 17:26:06 UTC
[jira] Resolved: (BEEHIVE-604) control context events:could not be received on jws
[ http://issues.apache.org/jira/browse/BEEHIVE-604?page=all ]
Kyle Marvin resolved BEEHIVE-604:
---------------------------------
Resolution: Invalid
James, I think there is a problem with the test case (testResourceContextEvent) itself. The following code retrieves the nested control BeanContext and registers a listener for the control:
ControlBeanContext beanContext = myControl.getControlBeanContext();
try{
ResourceContext resourceContext=(ResourceContext)beanContext.getService(
Class.forName("org.apache.beehive.controls.api.context.ResourceContext"),null);
resourceContext.addResourceEventsListener( new ResourceContext.ResourceEvents()
{
public void onAcquire(){
System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
System.out.println("onAcquire invoked on DriveBeanRecorder");
System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
onAcquireReceived=true;
};
public void onRelease(){onReleaseReceived=true;};
});
report.setStatus(Report.PASS);
but I don't see any activity on the control after registering the listener, so its not clear to me what you except to trigger the onAcquire event between the time the listener is registered and the subsequent call to getResult().
The rub is that it isn't as simple as just calling onto the control after registering the listener (to trigger resource acquisition). The control will already have acquired resources within the current execution context as a result of the original call to myControl.getBeanContext(), so a subsequent call isn't going to cause resource acquisition to happen again.
Flip this back to me if you think I've missed something key in the test scenario....
> control context events:could not be received on jws
> ---------------------------------------------------
>
> Key: BEEHIVE-604
> URL: http://issues.apache.org/jira/browse/BEEHIVE-604
> Project: Beehive
> Type: Bug
> Components: Controls
> Versions: V1
> Reporter: James Song
> Assignee: Kyle Marvin
> Fix For: V1
>
> Can not listen to onAcquire by adding listener.
> Test files:
> trunk\controls\test\webapps\controlsWeb\WEB-INF\src\jws\ContextEvent.jws
> Repro:
> 1. svn update to r168235;
> 2. build and deploy controlsWeb;
> 3. run junit from controls\test ant run -Dtest-suite=mantis-cases\org-apache-beehive-controls-test-jws-contextevent.xml -Dtest.freq=detailed
> Watch for server output.
> What is expected:
> System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
> System.out.println("onAcquire invoked on DriveBeanRecorder");
> System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira