Search the web
Sign In
New User? Sign Up
junit · JUnit, the Java unit testing framework written by Kent Beck and Erich Gamma.
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Hijacking JUnit infrastructure   Topic List   < Prev Topic  |  Next Topic >
Summarize Messages Sort by Date  
#21795 From: Arnaud Bailly <arnaud.oqube@...>
Date: Fri Jul 3, 2009 3:16 pm
Subject: Hijacking JUnit infrastructure
arnaud.baillly
Offline Offline
Send Email Send Email
 
Hello,
JUnit is a defacto standard in Java circle, which means it has a rich
ecosystem. I would like to "hijack" this ecosystem for other
languages/environments than Java. I actually did something for running
Javascript tests with htmlunit and would now like to to do the same
thing for C/C++ tests: use JUnit to drive and report test executions
that encapsulates native tests.

I am no sure this is a good idea, but it kind of worked for my JS
tests. For the C tests, I am confronted with an issue probably due to
my misunderstanding of JUnit architecture: It seems that Runner
instances need Class objects to work on, being passed them by the
framework. But of course, in my particular case I do not have specific
Class objects to work with as tests are written in native C/C++ code.

Could somebody point me to the right direction, or give me some good
reasons to forget about this ?

Thanks

Arnaud



#21797 From: "Charlie Poole" <charlie@...>
Date: Sat Jul 4, 2009 3:20 am
Subject: RE: Hijacking JUnit infrastructure
cpoole98370
Offline Offline
Send Email Send Email
 
Why not use an existing C/C++ framework? Gtest is my
current favorite.

Charlie

> -----Original Message-----
> From: junit@yahoogroups.com [mailto:junit@yahoogroups.com] On
> Behalf Of Arnaud Bailly
> Sent: Friday, July 03, 2009 8:16 AM
> To: junit
> Subject: [junit] Hijacking JUnit infrastructure
>
> Hello,
> JUnit is a defacto standard in Java circle, which means it
> has a rich ecosystem. I would like to "hijack" this ecosystem
> for other languages/environments than Java. I actually did
> something for running Javascript tests with htmlunit and
> would now like to to do the same thing for C/C++ tests: use
> JUnit to drive and report test executions that encapsulates
> native tests.
>
> I am no sure this is a good idea, but it kind of worked for
> my JS tests. For the C tests, I am confronted with an issue
> probably due to my misunderstanding of JUnit architecture: It
> seems that Runner instances need Class objects to work on,
> being passed them by the framework. But of course, in my
> particular case I do not have specific Class objects to work
> with as tests are written in native C/C++ code.
>
> Could somebody point me to the right direction, or give me
> some good reasons to forget about this ?
>
> Thanks
>
> Arnaud
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>





#21800 From: Arnaud Bailly <arnaud.oqube@...>
Date: Mon Jul 6, 2009 10:06 am
Subject: Re: Hijacking JUnit infrastructure
arnaud.baillly
Offline Offline
Send Email Send Email
 
Thanks for your answer,
We use a framework for writing and executing tests (eg. at present
CUnit and CPPUnit). But we are in a mixed language environment and
would like to be able to integrate smoothly my native tests w/ java
build system (eg. maven, CI).

Regards,
Arnaud



#21805 From: Nat Pryce <nat.pryce@...>
Date: Tue Jul 7, 2009 5:57 am
Subject: Re: Hijacking JUnit infrastructure
nat_pryce
Offline Offline
Send Email Send Email
 
2009/7/6 Arnaud Bailly <arnaud.oqube@...>:
> Thanks for your answer,
> We use a framework for writing and executing tests (eg. at present
> CUnit and CPPUnit). But we are in a mixed language environment and
> would like to be able to integrate smoothly my native tests w/ java
> build system (eg. maven, CI).

You could look at the Test Anything Protocol, which is used to gather
results from tests written in different languages. There is a Java
implementation.

http://testanything.org

--Nat

--
http://www.natpryce.com



#21801 From: David Saff <david@...>
Date: Mon Jul 6, 2009 2:12 pm
Subject: Re: Hijacking JUnit infrastructure
dsaff
Offline Offline
Send Email Send Email
 
On Fri, Jul 3, 2009 at 11:16 AM, Arnaud Bailly<arnaud.oqube@...> wrote:
> Hello,
> JUnit is a defacto standard in Java circle, which means it has a rich
> ecosystem. I would like to "hijack" this ecosystem for other
> languages/environments than Java. I actually did something for running
> Javascript tests with htmlunit and would now like to to do the same
> thing for C/C++ tests: use JUnit to drive and report test executions
> that encapsulates native tests.
>
> I am no sure this is a good idea, but it kind of worked for my JS
> tests. For the C tests, I am confronted with an issue probably due to
> my misunderstanding of JUnit architecture: It seems that Runner
> instances need Class objects to work on, being passed them by the
> framework. But of course, in my particular case I do not have specific
> Class objects to work with as tests are written in native C/C++ code.
>
> Could somebody point me to the right direction, or give me some good
> reasons to forget about this ?

Arnaud,

There are definitely ways to do what you want. Runner doesn't require
a Java class, it just happens that almost all of the provided
subclasses do have a Java class.

How are you planning to run the overall test suite? Depending on that
answer, it may work best to have a "stand-in" Java class that serves
as the root of your C++ suite.

David Saff

>
> Thanks
>
> Arnaud
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>



#21804 From: Arnaud Bailly <arnaud.oqube@...>
Date: Mon Jul 6, 2009 3:37 pm
Subject: Re: Hijacking JUnit infrastructure
arnaud.baillly
Offline Offline
Send Email Send Email
 
hello david,
thanks for your encouraging mail. Right now, I just used the Result
and RunListener classes and interfaces to manage feedback from my
tests, but the basic idea is that I would run JUnit with some custom
runner that would discover "test classes" that would report results.

In a previous JS framework I wrote, the wrapper classes were defined
statically (ie. each known html test was associated to a defined
JUnit4 test class) and run with a custom Runner deriving from
JUnit4BlockRunner (and making use of parameterized btw).

I could have a java class "proxy" that would report results on a given
runner. Is that what you are thinking of ?

Arnaud



#21846 From: Gilles Scokart <gscokart@...>
Date: Fri Jul 31, 2009 8:09 pm
Subject: Re: Hijacking JUnit infrastructure
gscokart
Offline Offline
Send Email Send Email
 
I have something similar for antunit (unit test written as ant script).  I
wanted to integrate antunit test with the IDE (mostly to run the ant tasks
in a java debugger).

I have written a Runner (AntUnitSuiteRunner) that you can use to run a
'proxy' that can be detected by your IDE.
Then, there is a simple protocal between my runner and the 'proxy' class.

It looks like this :

@RunWith(AntUnitSuiteRunner.class)
public class EatYourOwnDogFoodTest {

public static TestSuite suite() {
File script = new File("src/etc/testcases/antunit/java-io.xml");
return new AntUnitSuite(script, EatYourOwnDogFoodTest.class);
}

}


Gilles Scokart


2009/7/6 Arnaud Bailly <arnaud.oqube@...>

>
>
> hello david,
> thanks for your encouraging mail. Right now, I just used the Result
> and RunListener classes and interfaces to manage feedback from my
> tests, but the basic idea is that I would run JUnit with some custom
> runner that would discover "test classes" that would report results.
>
> In a previous JS framework I wrote, the wrapper classes were defined
> statically (ie. each known html test was associated to a defined
> JUnit4 test class) and run with a custom Runner deriving from
> JUnit4BlockRunner (and making use of parameterized btw).
>
> I could have a java class "proxy" that would report results on a given
> runner. Is that what you are thinking of ?
>
> Arnaud
>
>


[Non-text portions of this message have been removed]




 
Advanced
Add to My Yahoo!      XML What's This?

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help