AjaxRequestTarget weirdness

2014-05-15 Thread Pierre Goupil
Hello folks,

I'm currently trying to roll my own on Wicket-Atmosphere: I've forked the
github repo and I'm trying to make the project unit testable.

I must admit that I'm not far from reaching my objectives, but there is a
thing that puzzles me.

Please, let me explain: I would like to have an AJAX-style response when JS
and / or components are added to the event bus, since it uses
AjaxRequestTarget. That would allow me to assert whatever I like using the
WicketTester API.

Here is a sample code:

--
if (this.application.createRequestCycle(request,
response).processRequestAndDetach())
{
System.out.println(response.toString());
this.broadcaster.broadcast(response.toString(), _resource);
}
--

Here, the System.out displays something correct like that:

--
?xml version=1.0 encoding=UTF-8?
ajax-response
 component id=id1 
 ![CDATA[div id=id1my label/div]]
 /component
 evaluate
  ![CDATA[(function(){ myJs; })();]]
  /evaluate
/ajax-response
--

BUT, when I then do this in my unit-test:
tester.getLastResponse().getDocument();

I only get:
--
?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response
--

A clue, anyone, please?

If needed, I can publish the link to my github project. But I prefer asking
here first because it needs some cleaning and maybe the problem I'm facing
is just dumb.

Best regards,

Pierre



-- 
La vie est source de joie, la mort est source de paix, seule la transition
est difficile.


AjaxRequestTarget weirdness

2014-05-14 Thread Pierre Goupil
Hello folks,

Sorry if this is double-posting, but I have the feeling that my previous
message didn't find its way.

I'm currently trying to roll my own on Wicket-Atmosphere: I've forked the
github repo and I'm trying to make the project unit testable.

I must admit that I'm not far from reaching my objectives, but there is a
thing that puzzles me.

Please, let me explain: I would like to have an AJAX-style response when JS
and / or components are added to the event bus, since it uses
AjaxRequestTarget. That would allow me to assert whatever I like using the
WicketTester API.

Here is a sample code:

--
if (this.application.createRequestCycle(request,
response).processRequestAndDetach())
{
System.out.println(response.toString());
this.broadcaster.broadcast(response.toString(), _resource);
}
--

Here, the System.out displays something correct like that:

--
?xml version=1.0 encoding=UTF-8?
ajax-response
 component id=id1 
 ![CDATA[div id=id1my label/div]]
 /component
 evaluate
  ![CDATA[(function(){ myJs; })();]]
  /evaluate
/ajax-response
--

BUT, when I then do this in my unit-test:
tester.getLastResponse().getDocument();

I only get:
--
?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response
--

A clue, anyone, please?

If needed, I can publish the link to my github project. But I prefer asking
here first because it needs some cleaning and maybe the problem I'm facing
is just dumb.

Best regards,

Pierre

-- 
La vie est source de joie, la mort est source de paix, seule la transition
est difficile.


AjaxRequestTarget weirdness

2014-05-12 Thread Pierre Goupil
Hello folks,

Sorry if this is double-posting, but I have the feeling that my previous
message didn't find its way.

I'm currently trying to roll my own on Wicket-Atmosphere: I've forked the
github repo and I'm trying to make the project unit testable.

I must admit that I'm not far from reaching my objectives, but there is a
thing that puzzles me.

Please, let me explain: I would like to have an AJAX-style response when JS
and / or components are added to the event bus, since it uses
AjaxRequestTarget. That would allow me to assert whatever I like using the
WicketTester API.

Here is a sample code from EventBus.java in Wicket-Atmosphere:

--
if (this.application.createRequestCycle(request,
response).processRequestAndDetach())
{
System.out.println(response.toString());
this.broadcaster.broadcast(response.toString(), _resource);
}
--

Here, the System.out displays something correct like that:

--
?xml version=1.0 encoding=UTF-8?
ajax-response
 component id=id1 
 ![CDATA[div id=id1my label/div]]
 /component
 evaluate
  ![CDATA[(function(){ myJs; })();]]
  /evaluate
/ajax-response
--

But, when I then do this in my unit-test:
tester.getLastResponse().getDocument();

I only get:
--
?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response
--

A clue, anyone, please?

If needed, I can publish the link to my github project. But I prefer asking
here first because it needs some cleaning and maybe the problem I'm facing
is just dumb.

Best regards,

Pierre


-- 
La vie est source de joie, la mort est source de paix, seule la transition
est difficile.