You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Thorsten Rössner <ro...@dig.de> on 2009/06/25 13:57:14 UTC

GWT Tests with Sling

Hello everybody,

I'm in the development team of a new CMS which is based on Sling.
I want to use GWT for the GUI of the backend. For this purpose I adapted 
the servlet in the contrib package of the Sling project to work with GWT 
1.6.4. This works fine. I use the gwt-maven-plugin for creating the 
bundles. In addition I got the hosted mode and debugging working, using 
the Sling installation for server side code. Summing up, I can use GWT 
for the backend GUI.

Now I want to test my GWT classes. GWT provides the test class 
GWTTestCase, that are executed with the help of the gwt-maven-plugin. 
The tests are running. The problem is, that I cant test my GWT classes 
because they use services for getting data from the server per RPC. Does 
anybody now, how to get the tests run in the Sling environment (the OSGi 
environment)? I need the OSGi services and the repository for the tests.

Does anybody have an alternative method for testing GWT with Sling?

Thanks for your help.
Best regards
Thorsten

Re: GWT Tests with Sling

Posted by Juan José Vázquez Delgado <ju...@gmail.com>.
> Futhermore, I'm not a CSS expert, I also need help in this area.

We´ll try it!.

>> > I have not yet
>> > make some unit tests.
>>
>> The better aproach seems to use pure JUnit tests versus GWTTest ones.
>> This approach can be reached applying patterns such as MVP
>> (Model-View-Presenter) and Dependecy Injection. You might want have a
>> look at this interesting thread [1].
>
>
> ok thanks for the link

FYI, furthermore GWT is using WebDriver [1] for functional testing.
WebDriver is built on Selenium framework [2].

[1] http://code.google.com/p/webdriver/
[2] http://seleniumhq.org/

Juanjo.

Re: GWT Tests with Sling

Posted by Christophe Lombart <ch...@gmail.com>.
2009/6/30 Juan José Vázquez Delgado <ju...@gmail.com>

> Hi,
>
> > I'm also working on a GWT-Sling integration. I'm still making some tests
> for
> > the Sling Explorer (with a minimal amount of dependencies) and I will
> > publish this week  what I'm doing. Now, it  is completly based on the ASF
> > 2.0 licence.
>
> Great news. I´ll have a look on it and if you want I can collaborate with
> you.


Nice ! it takes time to build a nice Sling Explorer :-(

Futhermore, I'm not a CSS expert, I also need help in this area.


>
>
> > Thanks to the "noserver" GWT option & the Sling Fs service, it  is
> possible
> > to run the gwt application in the hosted mode and have an access to the
> > Sling resources (services, scripts, static resources, ..).
>
> Yeap, this is a great configuration. It´s is amazing don´t have to
> re-initialize anything every time a change is done.


It is a kind of magic, specially wihtout js code ... Thanks to Sling & GWT
:-)

>
>
> > I have not yet
> > make some unit tests.
>
> The better aproach seems to use pure JUnit tests versus GWTTest ones.
> This approach can be reached applying patterns such as MVP
> (Model-View-Presenter) and Dependecy Injection. You might want have a
> look at this interesting thread [1].


ok thanks for the link


>
>
> > I'm also using the maven gwt plugin.
>
> Me too.
>
> BR,
>
> Juanjo.
>
> [1]
> http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/8b0ae5eaf84d8bc2/f4e546662ace840f#f4e546662ace840f
>

Re: GWT Tests with Sling

Posted by Juan José Vázquez Delgado <ju...@gmail.com>.
Hi,

> I'm also working on a GWT-Sling integration. I'm still making some tests for
> the Sling Explorer (with a minimal amount of dependencies) and I will
> publish this week  what I'm doing. Now, it  is completly based on the ASF
> 2.0 licence.

Great news. I´ll have a look on it and if you want I can collaborate with you.

> Thanks to the "noserver" GWT option & the Sling Fs service, it  is possible
> to run the gwt application in the hosted mode and have an access to the
> Sling resources (services, scripts, static resources, ..).

Yeap, this is a great configuration. It´s is amazing don´t have to
re-initialize anything every time a change is done.

> I have not yet
> make some unit tests.

The better aproach seems to use pure JUnit tests versus GWTTest ones.
This approach can be reached applying patterns such as MVP
(Model-View-Presenter) and Dependecy Injection. You might want have a
look at this interesting thread [1].

> I'm also using the maven gwt plugin.

Me too.

BR,

Juanjo.

[1] http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/8b0ae5eaf84d8bc2/f4e546662ace840f#f4e546662ace840f

Re: GWT Tests with Sling

Posted by Christophe Lombart <ch...@gmail.com>.
I'm also working on a GWT-Sling integration. I'm still making some tests for
the Sling Explorer (with a minimal amount of dependencies) and I will
publish this week  what I'm doing. Now, it  is completly based on the ASF
2.0 licence.
Thanks to the "noserver" GWT option & the Sling Fs service, it  is possible
to run the gwt application in the hosted mode and have an access to the
Sling resources (services, scripts, static resources, ..). I have not yet
make some unit tests.

I'm also using the maven gwt plugin.

Christophe


2009/6/25 Juan José Vázquez Delgado <ju...@gmail.com>

> > Well, that of course then amounts to a problem - luckily GWT itself is
> > ASL2 licensed. And as long as the dependencies have acceptable licenses
> > (MIT and BSD come to mind) there is not an issue, either. Where it
> > starts getting problematic is the LGPL and GPL licenses.
>
> I think a GWT content editor is possible without LGPL and GPL
> licenses. Currently, I´m working in a GWT GUI involving just only GWT
> libraries (ASL2), GWT incubator (ASL2) and google-gin (ASL2). BTW,
> google-gin [1] is a dependency injection framework very interesting in
> order to design a good testing approach with GWT.
>
> Regards,
>
> Juanjo.
>
> [1] http://code.google.com/p/google-gin/
>

Re: GWT Tests with Sling

Posted by Juan José Vázquez Delgado <ju...@gmail.com>.
> Well, that of course then amounts to a problem - luckily GWT itself is
> ASL2 licensed. And as long as the dependencies have acceptable licenses
> (MIT and BSD come to mind) there is not an issue, either. Where it
> starts getting problematic is the LGPL and GPL licenses.

I think a GWT content editor is possible without LGPL and GPL
licenses. Currently, I´m working in a GWT GUI involving just only GWT
libraries (ASL2), GWT incubator (ASL2) and google-gin (ASL2). BTW,
google-gin [1] is a dependency injection framework very interesting in
order to design a good testing approach with GWT.

Regards,

Juanjo.

[1] http://code.google.com/p/google-gin/

Re: GWT Tests with Sling

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Torgeir Veimo schrieb:
> 2009/6/26 Felix Meschberger <fm...@gmail.com>:
>> Hi,
>>
>> Torgeir Veimo schrieb:
>>> 2009/6/26 Felix Meschberger <fm...@gmail.com>:
>>>> Hi,
>>>>
>>>> Torgeir Veimo schrieb:
>>>>>>> I'm in the development team of a new CMS which is based on Sling.
>>>>> It seems there are several that are doing this, basing their admin
>>>>> console on GWT. There might be an opportunity to put together an open
>>>>> source project here around this, since there would otherwise be a lot
>>>>> of duplicate effort, and I don't think there's much competitive
>>>>> advantage in having a proprietary admin console for an open source
>>>>> cms.
>>>> What do you mean by "admin console" ? If you have something like the
>>>> Felix Web Console [1] in mind, there is already such a beast, which is
>>>> being actively developed.
>>>>
>>>> Otherwise, I would be eager to hear your requirements and to discuss,
>>>> whether we could use the Web Console for your requirements or whether
>>>> another console is required.
>>> No I was of course thinking about content editors. The "admin console"
>>> is an umbrella term we use internally here to mean those things.
>> Thanks for the clarification.
>>
>> In this case, I would assume, that the Sling project is probably a good
>> candidate to be such an open-source project.
> 
> Even GWT based content editors? It would drag in a number of
> dependencies, not all of them apache licensed.

Well, that of course then amounts to a problem - luckily GWT itself is
ASL2 licensed. And as long as the dependencies have acceptable licenses
(MIT and BSD come to mind) there is not an issue, either. Where it
starts getting problematic is the LGPL and GPL licenses.

Regards
Felix

Re: GWT Tests with Sling

Posted by Torgeir Veimo <to...@pobox.com>.
2009/6/26 Felix Meschberger <fm...@gmail.com>:
> Hi,
>
> Torgeir Veimo schrieb:
>> 2009/6/26 Felix Meschberger <fm...@gmail.com>:
>>> Hi,
>>>
>>> Torgeir Veimo schrieb:
>>>>>> I'm in the development team of a new CMS which is based on Sling.
>>>> It seems there are several that are doing this, basing their admin
>>>> console on GWT. There might be an opportunity to put together an open
>>>> source project here around this, since there would otherwise be a lot
>>>> of duplicate effort, and I don't think there's much competitive
>>>> advantage in having a proprietary admin console for an open source
>>>> cms.
>>> What do you mean by "admin console" ? If you have something like the
>>> Felix Web Console [1] in mind, there is already such a beast, which is
>>> being actively developed.
>>>
>>> Otherwise, I would be eager to hear your requirements and to discuss,
>>> whether we could use the Web Console for your requirements or whether
>>> another console is required.
>>
>> No I was of course thinking about content editors. The "admin console"
>> is an umbrella term we use internally here to mean those things.
>
> Thanks for the clarification.
>
> In this case, I would assume, that the Sling project is probably a good
> candidate to be such an open-source project.

Even GWT based content editors? It would drag in a number of
dependencies, not all of them apache licensed.

-- 
-Tor

Re: GWT Tests with Sling

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Torgeir Veimo schrieb:
> 2009/6/26 Felix Meschberger <fm...@gmail.com>:
>> Hi,
>>
>> Torgeir Veimo schrieb:
>>>>> I'm in the development team of a new CMS which is based on Sling.
>>> It seems there are several that are doing this, basing their admin
>>> console on GWT. There might be an opportunity to put together an open
>>> source project here around this, since there would otherwise be a lot
>>> of duplicate effort, and I don't think there's much competitive
>>> advantage in having a proprietary admin console for an open source
>>> cms.
>> What do you mean by "admin console" ? If you have something like the
>> Felix Web Console [1] in mind, there is already such a beast, which is
>> being actively developed.
>>
>> Otherwise, I would be eager to hear your requirements and to discuss,
>> whether we could use the Web Console for your requirements or whether
>> another console is required.
> 
> No I was of course thinking about content editors. The "admin console"
> is an umbrella term we use internally here to mean those things.

Thanks for the clarification.

In this case, I would assume, that the Sling project is probably a good
candidate to be such an open-source project.

Regards
Felix

Re: GWT Tests with Sling

Posted by Juan José Vázquez Delgado <ju...@gmail.com>.
> No I was of course thinking about content editors. The "admin console"
> is an umbrella term we use internally here to mean those things.

Yes, I´m sure Thorsten is thinking about a content editor instead an
OSGi environment admin console.

Regards,

Juanjo.

Re: GWT Tests with Sling

Posted by Torgeir Veimo <to...@pobox.com>.
2009/6/26 Felix Meschberger <fm...@gmail.com>:
> Hi,
>
> Torgeir Veimo schrieb:
>>>> I'm in the development team of a new CMS which is based on Sling.
>>
>> It seems there are several that are doing this, basing their admin
>> console on GWT. There might be an opportunity to put together an open
>> source project here around this, since there would otherwise be a lot
>> of duplicate effort, and I don't think there's much competitive
>> advantage in having a proprietary admin console for an open source
>> cms.
>
> What do you mean by "admin console" ? If you have something like the
> Felix Web Console [1] in mind, there is already such a beast, which is
> being actively developed.
>
> Otherwise, I would be eager to hear your requirements and to discuss,
> whether we could use the Web Console for your requirements or whether
> another console is required.

No I was of course thinking about content editors. The "admin console"
is an umbrella term we use internally here to mean those things.

-- 
-Tor

Re: GWT Tests with Sling

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Torgeir Veimo schrieb:
>>> I'm in the development team of a new CMS which is based on Sling.
> 
> It seems there are several that are doing this, basing their admin
> console on GWT. There might be an opportunity to put together an open
> source project here around this, since there would otherwise be a lot
> of duplicate effort, and I don't think there's much competitive
> advantage in having a proprietary admin console for an open source
> cms.

What do you mean by "admin console" ? If you have something like the
Felix Web Console [1] in mind, there is already such a beast, which is
being actively developed.

Otherwise, I would be eager to hear your requirements and to discuss,
whether we could use the Web Console for your requirements or whether
another console is required.


Regards
Felix

[1] http://felix.apache.org/site/apache-felix-web-console.html

Re: GWT Tests with Sling

Posted by Torgeir Veimo <to...@pobox.com>.
>> I'm in the development team of a new CMS which is based on Sling.

It seems there are several that are doing this, basing their admin
console on GWT. There might be an opportunity to put together an open
source project here around this, since there would otherwise be a lot
of duplicate effort, and I don't think there's much competitive
advantage in having a proprietary admin console for an open source
cms.

-- 
-Tor

Re: GWT Tests with Sling

Posted by Juan José Vázquez Delgado <ju...@gmail.com>.
Hi,

> I'm in the development team of a new CMS which is based on Sling.

Good choice!, Sling is the most suitable tool to this purpose :).

> Now I want to test my GWT classes. GWT provides the test class GWTTestCase,
> that are executed with the help of the gwt-maven-plugin. The tests are
> running. The problem is, that I cant test my GWT classes because they use
> services for getting data from the server per RPC. Does anybody now, how to
> get the tests run in the Sling environment (the OSGi environment)? I need
> the OSGi services and the repository for the tests.
>
> Does anybody have an alternative method for testing GWT with Sling?

IMHO, you´re talking about in-container testing. You need a Sling
instance running while the tests are executed. According to this, you
might want to have a look at the Sling integration test module [1].
This module uses the cargo plugin [2] in order to get in-container
testing.

Hope this helps.

BR,

Juanjo.

[1] http://svn.apache.org/repos/asf/sling/trunk/launchpad/testing
[2] http://cargo.codehaus.org/Maven2+plugin