You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lécharny <el...@gmail.com> on 2015/05/29 16:53:40 UTC

[Studio] Tests ?

Hi Stefan,

I'd like to test some of the classes I'm writing in Studio, using junit
(they are not GUI classes). ATM, we don't define junit as a dependence
in any of the Studio projects. What would be the best way to do that ?

Thanks !

Re: [Studio] Tests ?

Posted by Stefan Seelmann <ma...@stefan-seelmann.de>.
On 05/29/2015 05:01 PM, phantomjinx wrote:
> On 29/05/15 15:53, Emmanuel Lécharny wrote:
>> Hi Stefan,
>>
>> I'd like to test some of the classes I'm writing in Studio, using junit
>> (they are not GUI classes). ATM, we don't define junit as a dependence
>> in any of the Studio projects. What would be the best way to do that ?
>>
>> Thanks !
> Hey Emmanuel,
> 
> Seeing as how you've helped me, I am sure I can return the favour.
> 
> My project is Teiid Designer [1], which provides a number of plugins and a perspective as part of
> JbossTools. We have a large number of unit tests [2] (using junit) that would provide a framework
> for what you are hoping to do. An example of the kind of pom you would need to write would be
> something like this [3].
> 
> The test plugins (or fragments if you prefer) will depend on junit, which would need to be made
> available from your target-platform.
> 
> Hope this helps. If not, apologies for the intrusion.

No need to apology, any kind of input from Eclipse RCP experts is highly
welcomed :)

I decided against separate test plugins/fragments during migration to
Tycho because we currently only have very few unit tests. Once we add
more tests it may make sense to move them to a test fragement. Until
then they reside within the bundle itself. But we have integration tests
(headless and UI).

Kind Regards,
Stefan


Re: [Studio] Tests ?

Posted by Stefan Seelmann <ma...@stefan-seelmann.de>.
On 05/29/2015 06:14 PM, Emmanuel Lécharny wrote:
> Le 29/05/15 17:01, phantomjinx a écrit :
>> On 29/05/15 15:53, Emmanuel Lécharny wrote:
>>> Hi Stefan,
>>>
>>> I'd like to test some of the classes I'm writing in Studio, using junit
>>> (they are not GUI classes). ATM, we don't define junit as a dependence
>>> in any of the Studio projects. What would be the best way to do that ?
>>>
>>> Thanks !
>> Hey Emmanuel,
>>
>> Seeing as how you've helped me, I am sure I can return the favour.
>>
>> My project is Teiid Designer [1], which provides a number of plugins and a perspective as part of
>> JbossTools. We have a large number of unit tests [2] (using junit) that would provide a framework
>> for what you are hoping to do. An example of the kind of pom you would need to write would be
>> something like this [3].
>>
>> The test plugins (or fragments if you prefer) will depend on junit, which would need to be made
>> available from your target-platform.
>>
>> Hope this helps. If not, apologies for the intrusion.
> 
> Thanks !
> 
> I'm dumb, we already have everything needed, and I wasn't even aware of
> it. I just have to run mvn test to get my tests executed.
> 
> The thing is that in eclipse, we don't see the test source file.

Right, junit test dependency and surefire is configured in
plugins/pom.xml and tests are executed by maven build. However in
Eclipse you have to add them manually to build path and add junit
dependency. The cause is that putting main and test code in one bundle
is not OSGi like.

See also https://issues.apache.org/jira/browse/DIRSTUDIO-1021 for more
details.

Kind Regards,
Stefan






Re: [Studio] Tests ?

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 29/05/15 17:01, phantomjinx a écrit :
> On 29/05/15 15:53, Emmanuel Lécharny wrote:
>> Hi Stefan,
>>
>> I'd like to test some of the classes I'm writing in Studio, using junit
>> (they are not GUI classes). ATM, we don't define junit as a dependence
>> in any of the Studio projects. What would be the best way to do that ?
>>
>> Thanks !
> Hey Emmanuel,
>
> Seeing as how you've helped me, I am sure I can return the favour.
>
> My project is Teiid Designer [1], which provides a number of plugins and a perspective as part of
> JbossTools. We have a large number of unit tests [2] (using junit) that would provide a framework
> for what you are hoping to do. An example of the kind of pom you would need to write would be
> something like this [3].
>
> The test plugins (or fragments if you prefer) will depend on junit, which would need to be made
> available from your target-platform.
>
> Hope this helps. If not, apologies for the intrusion.

Thanks !

I'm dumb, we already have everything needed, and I wasn't even aware of
it. I just have to run mvn test to get my tests executed.

The thing is that in eclipse, we don't see the test source file.

Anyway, thanks for the feedback !



Re: [Studio] Tests ?

Posted by phantomjinx <p....@phantomjinx.co.uk>.
On 29/05/15 15:53, Emmanuel Lécharny wrote:
> Hi Stefan,
>
> I'd like to test some of the classes I'm writing in Studio, using junit
> (they are not GUI classes). ATM, we don't define junit as a dependence
> in any of the Studio projects. What would be the best way to do that ?
>
> Thanks !
Hey Emmanuel,

Seeing as how you've helped me, I am sure I can return the favour.

My project is Teiid Designer [1], which provides a number of plugins and a perspective as part of
JbossTools. We have a large number of unit tests [2] (using junit) that would provide a framework
for what you are hoping to do. An example of the kind of pom you would need to write would be
something like this [3].

The test plugins (or fragments if you prefer) will depend on junit, which would need to be made
available from your target-platform.

Hope this helps. If not, apologies for the intrusion.

PGR

[1] https://github.com/Teiid-Designer/teiid-designer
[2] https://github.com/Teiid-Designer/teiid-designer/tree/master/tests
[3]
https://github.com/Teiid-Designer/teiid-designer/blob/master/tests/org.teiid.designer.ddl.importer.test/pom.xml

-- 

Paul Richardson

  * p.g.richardson@phantomjinx.co.uk
  * p.g.richardson@redhat.com
  * pgrichardson@linux.com

"I know exactly who reads the papers ...

  * The Daily Mirror is read by people who think they run the country.
  * The Guardian is read by people who think they ought to run the country.
  * The Times is read by people who do actually run the country.
  * The Daily Mail is read by the wives of the people who run the country.
  * The Financial Times is read by the people who own the country.
  * The Morning Star is read by the people who think the country ought to be run by another country.
  * The Daily Telegraph is read by the people who think it is."

Jim Hacker, Yes Minister