Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

junit · JUnit, the Java unit testing framework written by Kent Beck and Erich Gamma.

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 31224
  • Category: Java
  • Founded: Nov 6, 2000
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Messages

Advanced
Messages Help
Messages 22976 - 23005 of 24393   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#22976 From: Esko Luontola <esko.luontola@...>
Date: Fri Oct 1, 2010 11:55 am
Subject: Re: Missing JUnit jars in Maven central - intent to correct
egeluontola
Send Email Send Email
 
Cédric Beust ♔ wrote on 1.10.2010 6:21:
> Note that you will have to request ownership of org.junit.

JUnit is still using "junit" as its groupId. Would it be good at some
point to switch using "org.junit" groupId, to make it more in line with
the current naming standards?

Some coordination with Maven Surefire Plugin might be needed, because it
has "junit:junit" as the default for junitArtifactName in
http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html -
but there is a workaround (http://jira.codehaus.org/browse/SUREFIRE-519)
so it's not a showstopper.

--
Esko Luontola
www.orfjackal.net

#22977 From: David Saff <david@...>
Date: Fri Oct 1, 2010 2:54 pm
Subject: Re: Missing JUnit jars in Maven central - intent to correct
dsaff
Send Email Send Email
 
Max,

Would you be willing to take this on in the future, as well?  I'd be
delighted--I've been meaning to do this for over a year.

    David Saff

On Thu, Sep 30, 2010 at 7:54 PM, Max Bowsher <maxb@...> wrote:
> A number of JUnit jars are missing in Maven central.
>
> junit 4.8 4.8.2
>
> junit-dep 4.6 4.7 4.8 4.8.1 4.8.2
>
> All except 4.6 appear to be available on the github download area.
>
> If there's no-one already working on it, and the JUnit committers are
> happy with me doing so, I intend to synthesize the required artifact
> bundles and submit them through oss.sonatype.org.
>
> Max.
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>

#22978 From: Max Bowsher <maxb@...>
Date: Fri Oct 1, 2010 9:05 pm
Subject: Re: Missing JUnit jars in Maven central - intent to correct
maxbowsher
Send Email Send Email
 
On 01/10/10 15:54, David Saff wrote:
> Max,
>
> Would you be willing to take this on in the future, as well?  I'd be
> delighted--I've been meaning to do this for over a year.
>
>    David Saff

Yes, I'm happy to do that. OK, I'll go file a ticket with Sonatype
requesting creation of staging repositories for the "junit" groupId.

Max.



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

#22979 From: Mike Forsberg <bigmike.f@...>
Date: Sun Oct 3, 2010 11:56 am
Subject: Re: Missing JUnit jars in Maven central - intent to correct
bigmike_f
Send Email Send Email
 
I second the appreciation.

On Fri, Oct 1, 2010 at 4:05 PM, Max Bowsher <maxb@...> wrote:

>
>
> On 01/10/10 15:54, David Saff wrote:
> > Max,
> >
> > Would you be willing to take this on in the future, as well? I'd be
> > delighted--I've been meaning to do this for over a year.
> >
> > David Saff
>
> Yes, I'm happy to do that. OK, I'll go file a ticket with Sonatype
> requesting creation of staging repositories for the "junit" groupId.
>
>
> Max.
>
> [Non-text portions of this message have been removed]
>
>
>


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

#22980 From: Max Bowsher <maxb@...>
Date: Fri Oct 1, 2010 9:03 pm
Subject: Re: Missing JUnit jars in Maven central - intent to correct
maxbowsher
Send Email Send Email
 
On 01/10/10 12:55, Esko Luontola wrote:
> JUnit is still using "junit" as its groupId. Would it be good at some
> point to switch using "org.junit" groupId, to make it more in line with
> the current naming standards?

I would very strongly recommend against this.

If we do, Maven will treat the two as completely different artifacts,
and happily place a version of both on the classpath.

The situation is bad enough already with junit vs. junit-dep, let's not
make it even more convoluted. (If I were starting from scratch, I would
only ever upload the junit-dep jar to any Maven repository. Jars that
bundle other classes may be a powerful convenience in a world without a
dependency resolver, but IMO serve no purpose in Maven.)

Max.



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

#22981 From: "banksysan" <BanksySan@...>
Date: Mon Oct 4, 2010 5:19 pm
Subject: Bespoke logging
banksysan
Send Email Send Email
 
Hia,

I'd like to be able to write to the JUnit's output stream without calling an
assert.

Is there a method I can call that will do this?  I can't see anything.

My goal is to be able to write messages on tests that pass, as well as fail.

Thanks all.

David

#22982 From: David Saff <david@...>
Date: Mon Oct 4, 2010 5:45 pm
Subject: Re: Bespoke logging
dsaff
Send Email Send Email
 
David,

The JUnit core simply generates events interpreted by the RunListener.
  The right way to change the RunListener depends on how you're running
JUnit.

How are you running JUnit?  :-)

    David Saff

On Mon, Oct 4, 2010 at 1:19 PM, banksysan <BanksySan@...> wrote:
> Hia,
>
> I'd like to be able to write to the JUnit's output stream without calling an
assert.
>
> Is there a method I can call that will do this?  I can't see anything.
>
> My goal is to be able to write messages on tests that pass, as well as fail.
>
> Thanks all.
>
> David
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>

#22983 From: Sebastian Wittenkamp <sebwit@...>
Date: Mon Oct 4, 2010 7:55 pm
Subject: JUnit patterns?
sebwit...
Send Email Send Email
 
Hello all,I'm wondering if anyone has a go-to resource for unit testing
patterns? I have a copy of the "xUnit Test Patterns" book by Gerard Meszaros.
Just wondering if there's another great resource like it out there that folks
recommend.
Thank you,Sebastian

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

#22984 From: Gerard Meszaros <yahoo@...>
Date: Mon Oct 4, 2010 9:56 pm
Subject: Re: JUnit patterns?
gmkayaker
Send Email Send Email
 
JUnit Recipes by J.B. Rainsberger describes JUnit-specific solutions to
a number of unit-testing problems. Many of the solutions describe how to
use specific plug-ins. Some parts may be a bit dated as it was published
in 2004.

Gerard

--
Gerard Meszaros
Lean/Agile Coach/Mentor/Trainer
http://www.gerardmeszaros.com

Author of the Jolt Productivity Award winning book "xUnit Test Patterns -
Refactoring Test Code" and winner of the "Programming with the Stars"
competition at Agile 2009. Learn more at http://xunitpatterns.com/index.html



Sebastian Wittenkamp wrote:
>
> Hello all,I'm wondering if anyone has a go-to resource for unit
> testing patterns? I have a copy of the "xUnit Test Patterns" book by
> Gerard Meszaros. Just wondering if there's another great resource like
> it out there that folks recommend.
> Thank you,Sebastian
>
> [Non-text portions of this message have been removed]
>
>

--
Gerard Meszaros
Lean/Agile Coach/Mentor/Trainer
http://www.gerardmeszaros.com
1-403-827-2967

Author of the Jolt Productivity Award winning book "xUnit Test Patterns -
Refactoring Test Code" and winner of the "Programming with the Stars"
competition at Agile 2009. Learn more at http://xunitpatterns.com/index.html

#22985 From: Max Bowsher <maxb@...>
Date: Tue Oct 5, 2010 8:59 am
Subject: Re: Missing JUnit jars in Maven central - intent to correct
maxbowsher
Send Email Send Email
 
On 01/10/10 00:54, Max Bowsher wrote:
> A number of JUnit jars are missing in Maven central.
>
> junit 4.8 4.8.2
>
> junit-dep 4.6 4.7 4.8 4.8.1 4.8.2
>
> All except 4.6 appear to be available on the github download area.

I found 4.6 at sourceforge too.

> If there's no-one already working on it, and the JUnit committers are
> happy with me doing so, I intend to synthesize the required artifact
> bundles and submit them through oss.sonatype.org.

Done: bundles uploaded and released to Sonatype OSSRH, should propagate
to Central automatically in an hour or so.

Max.



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

#22986 From: "banksysan" <BanksySan@...>
Date: Tue Oct 5, 2010 9:25 am
Subject: Re: Bespoke logging
banksysan
Send Email Send Email
 
Hia David,

Thanks for replying.

I'm running it in Eclipse and viewing the results in the JUnit results window.

No "funny stuff" happening as far as I'm aware.

Yours

David

--- In junit@yahoogroups.com, David Saff <david@...> wrote:
>
> David,
>
> The JUnit core simply generates events interpreted by the RunListener.
>  The right way to change the RunListener depends on how you're running
> JUnit.
>
> How are you running JUnit?  :-)
>
>    David Saff
>
> On Mon, Oct 4, 2010 at 1:19 PM, banksysan <BanksySan@...> wrote:
> > Hia,
> >
> > I'd like to be able to write to the JUnit's output stream without calling an
assert.
> >
> > Is there a method I can call that will do this?  I can't see anything.
> >
> > My goal is to be able to write messages on tests that pass, as well as fail.
> >
> > Thanks all.
> >
> > David
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>

#22987 From: David Saff <david@...>
Date: Tue Oct 5, 2010 2:11 pm
Subject: Re: Re: Bespoke logging
dsaff
Send Email Send Email
 
David,

Eclipse doesn't attach any information to a test result unless the
result is a failure.  You can write information to standard out, and
that will be recorded in the console.

    David Saff

On Tue, Oct 5, 2010 at 5:25 AM, banksysan <BanksySan@...> wrote:
> Hia David,
>
> Thanks for replying.
>
> I'm running it in Eclipse and viewing the results in the JUnit results window.
>
> No "funny stuff" happening as far as I'm aware.
>
> Yours
>
> David
>
> --- In junit@yahoogroups.com, David Saff <david@...> wrote:
>>
>> David,
>>
>> The JUnit core simply generates events interpreted by the RunListener.
>>  The right way to change the RunListener depends on how you're running
>> JUnit.
>>
>> How are you running JUnit?  :-)
>>
>>    David Saff
>>
>> On Mon, Oct 4, 2010 at 1:19 PM, banksysan <BanksySan@...> wrote:
>> > Hia,
>> >
>> > I'd like to be able to write to the JUnit's output stream without calling
an assert.
>> >
>> > Is there a method I can call that will do this?  I can't see anything.
>> >
>> > My goal is to be able to write messages on tests that pass, as well as
fail.
>> >
>> > Thanks all.
>> >
>> > David
>> >
>> >
>> >
>> > ------------------------------------
>> >
>> > Yahoo! Groups Links
>> >
>> >
>> >
>> >
>>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>

#22988 From: David Saff <david@...>
Date: Tue Oct 5, 2010 2:12 pm
Subject: Re: Missing JUnit jars in Maven central - intent to correct
dsaff
Send Email Send Email
 
Max,

Many thanks.  The 27 voters on

http://github.com/KentBeck/junit/issues#issue/66

thank you as well.  Would you mind posting a link there when the
propagation to Central is complete?  Thanks,

    David Saff

On Tue, Oct 5, 2010 at 4:59 AM, Max Bowsher <maxb@...> wrote:
> On 01/10/10 00:54, Max Bowsher wrote:
>> A number of JUnit jars are missing in Maven central.
>>
>> junit 4.8 4.8.2
>>
>> junit-dep 4.6 4.7 4.8 4.8.1 4.8.2
>>
>> All except 4.6 appear to be available on the github download area.
>
> I found 4.6 at sourceforge too.
>
>> If there's no-one already working on it, and the JUnit committers are
>> happy with me doing so, I intend to synthesize the required artifact
>> bundles and submit them through oss.sonatype.org.
>
> Done: bundles uploaded and released to Sonatype OSSRH, should propagate
> to Central automatically in an hour or so.
>
> Max.
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>

#22989 From: Max Bowsher <maxb@...>
Date: Tue Oct 5, 2010 2:22 pm
Subject: Re: Missing JUnit jars in Maven central - intent to correct
maxbowsher
Send Email Send Email
 
On 05/10/10 15:12, David Saff wrote:
> Max,
>
> Many thanks.  The 27 voters on
>
> http://github.com/KentBeck/junit/issues#issue/66
>
> thank you as well.  Would you mind posting a link there when the
> propagation to Central is complete?  Thanks,
>
>    David Saff


Done.



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

#22990 From: "banksysan" <BanksySan@...>
Date: Wed Oct 6, 2010 1:03 pm
Subject: Re: Bespoke logging
banksysan
Send Email Send Email
 
I considered writing to the System.out, but it's crude and harder to read and
harder to match up the output with the test results.

The only solution I can think of is to duplicate the output to a file so I can
get my debug information for both cases.

Doing this kind of defeats the purpose of Eclipse's nice JUnit window though.

--- In junit@yahoogroups.com, David Saff <david@...> wrote:
>
> David,
>
> Eclipse doesn't attach any information to a test result unless the
> result is a failure.  You can write information to standard out, and
> that will be recorded in the console.
>
>    David Saff
>
> On Tue, Oct 5, 2010 at 5:25 AM, banksysan <BanksySan@...> wrote:
> > Hia David,
> >
> > Thanks for replying.
> >
> > I'm running it in Eclipse and viewing the results in the JUnit results
window.
> >
> > No "funny stuff" happening as far as I'm aware.
> >
> > Yours
> >
> > David
> >
> > --- In junit@yahoogroups.com, David Saff <david@> wrote:
> >>
> >> David,
> >>
> >> The JUnit core simply generates events interpreted by the RunListener.
> >>  The right way to change the RunListener depends on how you're running
> >> JUnit.
> >>
> >> How are you running JUnit?  :-)
> >>
> >>    David Saff
> >>
> >> On Mon, Oct 4, 2010 at 1:19 PM, banksysan <BanksySan@> wrote:
> >> > Hia,
> >> >
> >> > I'd like to be able to write to the JUnit's output stream without calling
an assert.
> >> >
> >> > Is there a method I can call that will do this?  I can't see anything.
> >> >
> >> > My goal is to be able to write messages on tests that pass, as well as
fail.
> >> >
> >> > Thanks all.
> >> >
> >> > David
> >> >
> >> >
> >> >
> >> > ------------------------------------
> >> >
> >> > Yahoo! Groups Links
> >> >
> >> >
> >> >
> >> >
> >>
> >
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>

#22991 From: David Saff <david@...>
Date: Wed Oct 6, 2010 1:44 pm
Subject: Re: Re: Bespoke logging
dsaff
Send Email Send Email
 
David,

Unfortunately, what you want would need changes in both JUnit and
Eclipse.  Could you share a little more about what you're trying to
solve, so maybe we can brainstorm how to get what you need out of what
you have?  Thanks,

    David

On Wed, Oct 6, 2010 at 9:03 AM, banksysan <BanksySan@...> wrote:
> I considered writing to the System.out, but it's crude and harder to read and
harder to match up the output with the test results.
>
> The only solution I can think of is to duplicate the output to a file so I can
get my debug information for both cases.
>
> Doing this kind of defeats the purpose of Eclipse's nice JUnit window though.
>
> --- In junit@yahoogroups.com, David Saff <david@...> wrote:
>>
>> David,
>>
>> Eclipse doesn't attach any information to a test result unless the
>> result is a failure.  You can write information to standard out, and
>> that will be recorded in the console.
>>
>>    David Saff
>>
>> On Tue, Oct 5, 2010 at 5:25 AM, banksysan <BanksySan@...> wrote:
>> > Hia David,
>> >
>> > Thanks for replying.
>> >
>> > I'm running it in Eclipse and viewing the results in the JUnit results
window.
>> >
>> > No "funny stuff" happening as far as I'm aware.
>> >
>> > Yours
>> >
>> > David
>> >
>> > --- In junit@yahoogroups.com, David Saff <david@> wrote:
>> >>
>> >> David,
>> >>
>> >> The JUnit core simply generates events interpreted by the RunListener.
>> >>  The right way to change the RunListener depends on how you're running
>> >> JUnit.
>> >>
>> >> How are you running JUnit?  :-)
>> >>
>> >>    David Saff
>> >>
>> >> On Mon, Oct 4, 2010 at 1:19 PM, banksysan <BanksySan@> wrote:
>> >> > Hia,
>> >> >
>> >> > I'd like to be able to write to the JUnit's output stream without
calling an assert.
>> >> >
>> >> > Is there a method I can call that will do this?  I can't see anything.
>> >> >
>> >> > My goal is to be able to write messages on tests that pass, as well as
fail.
>> >> >
>> >> > Thanks all.
>> >> >
>> >> > David
>> >> >
>> >> >
>> >> >
>> >> > ------------------------------------
>> >> >
>> >> > Yahoo! Groups Links
>> >> >
>> >> >
>> >> >
>> >> >
>> >>
>> >
>> >
>> >
>> >
>> > ------------------------------------
>> >
>> > Yahoo! Groups Links
>> >
>> >
>> >
>> >
>>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>

#22992 From: "banksysan" <BanksySan@...>
Date: Wed Oct 6, 2010 2:39 pm
Subject: Re: Bespoke logging
banksysan
Send Email Send Email
 
Hia Dave,

I'm a .NET dev who moved to Java 3 weeks ago.  I'm used to working with NUnit
and am missing some of the functionality it had.  I'm thinking of test names,
test descriptions and parametrised tests.

Parametrised tests are a trivial matter in NUnit, in the NUnit GUI you can see
each test case in the parametrised test and the input values for each case.

JUnit doesn't have this, so I thought I'd compensate a little by writing the
parameters to the JUnit window.  It's surprising how often you want to see
details of your passing tests so you can compare them with the failing ones.  In
order to be useful, and to get my colleagues to agree with me and hop on-board,
it needs to be easy to read and require as little code massaging as possible.

Thanks

David

--- In junit@yahoogroups.com, David Saff <david@...> wrote:
>
> David,
>
> Unfortunately, what you want would need changes in both JUnit and
> Eclipse.  Could you share a little more about what you're trying to
> solve, so maybe we can brainstorm how to get what you need out of what
> you have?  Thanks,
>
>    David
>
> On Wed, Oct 6, 2010 at 9:03 AM, banksysan <BanksySan@...> wrote:
> > I considered writing to the System.out, but it's crude and harder to read
and harder to match up the output with the test results.
> >
> > The only solution I can think of is to duplicate the output to a file so I
can get my debug information for both cases.
> >
> > Doing this kind of defeats the purpose of Eclipse's nice JUnit window
though.
> >
> > --- In junit@yahoogroups.com, David Saff <david@> wrote:
> >>
> >> David,
> >>
> >> Eclipse doesn't attach any information to a test result unless the
> >> result is a failure.  You can write information to standard out, and
> >> that will be recorded in the console.
> >>
> >>    David Saff
> >>
> >> On Tue, Oct 5, 2010 at 5:25 AM, banksysan <BanksySan@> wrote:
> >> > Hia David,
> >> >
> >> > Thanks for replying.
> >> >
> >> > I'm running it in Eclipse and viewing the results in the JUnit results
window.
> >> >
> >> > No "funny stuff" happening as far as I'm aware.
> >> >
> >> > Yours
> >> >
> >> > David
> >> >
> >> > --- In junit@yahoogroups.com, David Saff <david@> wrote:
> >> >>
> >> >> David,
> >> >>
> >> >> The JUnit core simply generates events interpreted by the RunListener.
> >> >>  The right way to change the RunListener depends on how you're running
> >> >> JUnit.
> >> >>
> >> >> How are you running JUnit?  :-)
> >> >>
> >> >>    David Saff
> >> >>
> >> >> On Mon, Oct 4, 2010 at 1:19 PM, banksysan <BanksySan@> wrote:
> >> >> > Hia,
> >> >> >
> >> >> > I'd like to be able to write to the JUnit's output stream without
calling an assert.
> >> >> >
> >> >> > Is there a method I can call that will do this?  I can't see anything.
> >> >> >
> >> >> > My goal is to be able to write messages on tests that pass, as well as
fail.
> >> >> >
> >> >> > Thanks all.
> >> >> >
> >> >> > David
> >> >> >
> >> >> >
> >> >> >
> >> >> > ------------------------------------
> >> >> >
> >> >> > Yahoo! Groups Links
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >>
> >> >
> >> >
> >> >
> >> >
> >> > ------------------------------------
> >> >
> >> > Yahoo! Groups Links
> >> >
> >> >
> >> >
> >> >
> >>
> >
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>

#22993 From: "rejohnsoca" <regan.v.johnson@...>
Date: Thu Oct 7, 2010 2:53 am
Subject: what should I do first? upgrade to Java 6, or write unit tests?
rejohnsoca
Send Email Send Email
 
I've recently become responsible for a piece of software, that runs under java
1.4.2.  it has NO unit tests.
I want to move it to Java 6, but the CTO of my company is thinking that we
should write a unit test suite first, so that we can make sure the upgrade
doesn't break anything.

That's a nice idea, and I'm fully behind writing some unit tests.  I'm not sure
that the plan is very practical, as I'd really like to start with a recent
version of JUnit -like 4.8, and I can't use it with java 1.4.2

We do have a reasonable suite of integration tests (which are NOT unit tests),
to ensure that the upgrade goes well.

I was considering, rather than writing unit tests for java 1.4.2, and JUnit 3.8
and then potentially rewriting all of them to run under JUnit 4.8 after the
upgrade, it would be better to upgrade the JVM first, rely on integration tests,
and then write unit tests from scratch for JUnit 4.8.

What do other people do if they are in a similar situation?

#22994 From: David Saff <david@...>
Date: Thu Oct 7, 2010 3:03 am
Subject: Re: Re: Bespoke logging
dsaff
Send Email Send Email
 
David,

What you want in terms of showing the parameters is a very popular
feature request, and I wouldn't be surprised to see us incorporate a
patch, or write our own, for that sometime in the next couple of
months.  That doesn't necessarily tell you what to do while you're
waiting, sorry.

    David

On Wed, Oct 6, 2010 at 10:39 AM, banksysan <BanksySan@...> wrote:
>
> Hia Dave,
>
> I'm a .NET dev who moved to Java 3 weeks ago.  I'm used to working with NUnit
and am missing some of the functionality it had.  I'm thinking of test names,
test descriptions and parametrised tests.
>
> Parametrised tests are a trivial matter in NUnit, in the NUnit GUI you can see
each test case in the parametrised test and the input values for each case.
>
> JUnit doesn't have this, so I thought I'd compensate a little by writing the
parameters to the JUnit window.  It's surprising how often you want to see
details of your passing tests so you can compare them with the failing ones.  In
order to be useful, and to get my colleagues to agree with me and hop on-board,
it needs to be easy to read and require as little code massaging as possible.
>
> Thanks
>
> David
>
> --- In junit@yahoogroups.com, David Saff <david@...> wrote:
>>
>> David,
>>
>> Unfortunately, what you want would need changes in both JUnit and
>> Eclipse.  Could you share a little more about what you're trying to
>> solve, so maybe we can brainstorm how to get what you need out of what
>> you have?  Thanks,
>>
>>    David
>>
>> On Wed, Oct 6, 2010 at 9:03 AM, banksysan <BanksySan@...> wrote:
>> > I considered writing to the System.out, but it's crude and harder to read
and harder to match up the output with the test results.
>> >
>> > The only solution I can think of is to duplicate the output to a file so I
can get my debug information for both cases.
>> >
>> > Doing this kind of defeats the purpose of Eclipse's nice JUnit window
though.
>> >
>> > --- In junit@yahoogroups.com, David Saff <david@> wrote:
>> >>
>> >> David,
>> >>
>> >> Eclipse doesn't attach any information to a test result unless the
>> >> result is a failure.  You can write information to standard out, and
>> >> that will be recorded in the console.
>> >>
>> >>    David Saff
>> >>
>> >> On Tue, Oct 5, 2010 at 5:25 AM, banksysan <BanksySan@> wrote:
>> >> > Hia David,
>> >> >
>> >> > Thanks for replying.
>> >> >
>> >> > I'm running it in Eclipse and viewing the results in the JUnit results
window.
>> >> >
>> >> > No "funny stuff" happening as far as I'm aware.
>> >> >
>> >> > Yours
>> >> >
>> >> > David
>> >> >
>> >> > --- In junit@yahoogroups.com, David Saff <david@> wrote:
>> >> >>
>> >> >> David,
>> >> >>
>> >> >> The JUnit core simply generates events interpreted by the RunListener.
>> >> >>  The right way to change the RunListener depends on how you're running
>> >> >> JUnit.
>> >> >>
>> >> >> How are you running JUnit?  :-)
>> >> >>
>> >> >>    David Saff
>> >> >>
>> >> >> On Mon, Oct 4, 2010 at 1:19 PM, banksysan <BanksySan@> wrote:
>> >> >> > Hia,
>> >> >> >
>> >> >> > I'd like to be able to write to the JUnit's output stream without
calling an assert.
>> >> >> >
>> >> >> > Is there a method I can call that will do this?  I can't see
anything.
>> >> >> >
>> >> >> > My goal is to be able to write messages on tests that pass, as well
as fail.
>> >> >> >
>> >> >> > Thanks all.
>> >> >> >
>> >> >> > David
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > ------------------------------------
>> >> >> >
>> >> >> > Yahoo! Groups Links
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > ------------------------------------
>> >> >
>> >> > Yahoo! Groups Links
>> >> >
>> >> >
>> >> >
>> >> >
>> >>
>> >
>> >
>> >
>> >
>> > ------------------------------------
>> >
>> > Yahoo! Groups Links
>> >
>> >
>> >
>> >
>>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>

#22995 From: David Saff <david@...>
Date: Thu Oct 7, 2010 3:06 am
Subject: Re: what should I do first? upgrade to Java 6, or write unit tests?
dsaff
Send Email Send Email
 
rejohnsoca,

A lot of this depends on how risky you and your CTO agree the JVM
upgrade is.  If you just change the JVM version, and let generics
warnings stand, are you concerned there would be behavior changes?
I'd be a little surprised, but I can't say that I've watched a large
Java project go through that transition, so I don't know.

    David Saff

On Wed, Oct 6, 2010 at 10:53 PM, rejohnsoca <regan.v.johnson@...> wrote:
> I've recently become responsible for a piece of software, that runs under java
1.4.2.  it has NO unit tests.
> I want to move it to Java 6, but the CTO of my company is thinking that we
should write a unit test suite first, so that we can make sure the upgrade
doesn't break anything.
>
> That's a nice idea, and I'm fully behind writing some unit tests.  I'm not
sure that the plan is very practical, as I'd really like to start with a recent
version of JUnit -like 4.8, and I can't use it with java 1.4.2
>
> We do have a reasonable suite of integration tests (which are NOT unit tests),
to ensure that the upgrade goes well.
>
> I was considering, rather than writing unit tests for java 1.4.2, and JUnit
3.8 and then potentially rewriting all of them to run under JUnit 4.8 after the
upgrade, it would be better to upgrade the JVM first, rely on integration tests,
and then write unit tests from scratch for JUnit 4.8.
>
> What do other people do if they are in a similar situation?
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>

#22996 From: Regan Johnson <regan.v.johnson@...>
Date: Thu Oct 7, 2010 2:49 pm
Subject: Re: what should I do first? upgrade to Java 6, or write unit tests?
rejohnsoca
Send Email Send Email
 
I personally don't think that moving to java 6 is risky, and I don't think
my CTO does either, I think I'm just trying to validate my approach of not
writing the tests until after I am in my new (java 6 and JUnit 4.8) home,
and that's what other people would do.



On Wed, Oct 6, 2010 at 11:06 PM, David Saff <david@...> wrote:

>
>
> rejohnsoca,
>
> A lot of this depends on how risky you and your CTO agree the JVM
> upgrade is. If you just change the JVM version, and let generics
> warnings stand, are you concerned there would be behavior changes?
> I'd be a little surprised, but I can't say that I've watched a large
> Java project go through that transition, so I don't know.
>
> David Saff
>
>
> On Wed, Oct 6, 2010 at 10:53 PM, rejohnsoca
<regan.v.johnson@...<regan.v.johnson%40gmail.com>>
> wrote:
> > I've recently become responsible for a piece of software, that runs under
> java 1.4.2.  it has NO unit tests.
> > I want to move it to Java 6, but the CTO of my company is thinking that
> we should write a unit test suite first, so that we can make sure the
> upgrade doesn't break anything.
> >
> > That's a nice idea, and I'm fully behind writing some unit tests.  I'm
> not sure that the plan is very practical, as I'd really like to start with a
> recent version of JUnit -like 4.8, and I can't use it with java 1.4.2
> >
> > We do have a reasonable suite of integration tests (which are NOT unit
> tests), to ensure that the upgrade goes well.
> >
> > I was considering, rather than writing unit tests for java 1.4.2, and
> JUnit 3.8 and then potentially rewriting all of them to run under JUnit 4.8
> after the upgrade, it would be better to upgrade the JVM first, rely on
> integration tests, and then write unit tests from scratch for JUnit 4.8.
> >
> > What do other people do if they are in a similar situation?
> >
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>
>
>



--
"There are no passengers on Spaceship Earth - we are all crew."
    Marshall McLuhan


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

#22997 From: Charlie Poole <charlie@...>
Date: Thu Oct 7, 2010 6:28 pm
Subject: Re: what should I do first? upgrade to Java 6, or write unit tests?
cpoole98370
Send Email Send Email
 
If you had _no_ tests, I'd suggest you wrap the whole thing with
system/acceptance tests first, rather than trying to add unit tests.
If you already have a good suite of high-level tests, I would go
with them.

Obviously, you want to do all this in a non-production environment
first. I'd also put some good exploratory testers on it for a day or two
before going live.

Charlie

On Thu, Oct 7, 2010 at 7:49 AM, Regan Johnson <regan.v.johnson@...> wrote:
> I personally don't think that moving to java 6 is risky, and I don't think
> my CTO does either, I think I'm just trying to validate my approach of not
> writing the tests until after I am in my new (java 6 and JUnit 4.8) home,
> and that's what other people would do.
>
>
>
> On Wed, Oct 6, 2010 at 11:06 PM, David Saff <david@...> wrote:
>
>>
>>
>> rejohnsoca,
>>
>> A lot of this depends on how risky you and your CTO agree the JVM
>> upgrade is. If you just change the JVM version, and let generics
>> warnings stand, are you concerned there would be behavior changes?
>> I'd be a little surprised, but I can't say that I've watched a large
>> Java project go through that transition, so I don't know.
>>
>> David Saff
>>
>>
>> On Wed, Oct 6, 2010 at 10:53 PM, rejohnsoca
<regan.v.johnson@...<regan.v.johnson%40gmail.com>>
>> wrote:
>> > I've recently become responsible for a piece of software, that runs under
>> java 1.4.2.  it has NO unit tests.
>> > I want to move it to Java 6, but the CTO of my company is thinking that
>> we should write a unit test suite first, so that we can make sure the
>> upgrade doesn't break anything.
>> >
>> > That's a nice idea, and I'm fully behind writing some unit tests.  I'm
>> not sure that the plan is very practical, as I'd really like to start with a
>> recent version of JUnit -like 4.8, and I can't use it with java 1.4.2
>> >
>> > We do have a reasonable suite of integration tests (which are NOT unit
>> tests), to ensure that the upgrade goes well.
>> >
>> > I was considering, rather than writing unit tests for java 1.4.2, and
>> JUnit 3.8 and then potentially rewriting all of them to run under JUnit 4.8
>> after the upgrade, it would be better to upgrade the JVM first, rely on
>> integration tests, and then write unit tests from scratch for JUnit 4.8.
>> >
>> > What do other people do if they are in a similar situation?
>> >
>> >
>> >
>> >
>> > ------------------------------------
>> >
>> > Yahoo! Groups Links
>> >
>> >
>> >
>> >
>>
>>
>>
>
>
>
> --
> "There are no passengers on Spaceship Earth - we are all crew."
>   Marshall McLuhan
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>

#22998 From: "chuckmosher" <chuckmosher@...>
Date: Thu Oct 7, 2010 8:33 pm
Subject: JUnit4 and Threads
chuckmosher
Send Email Send Email
 
Hi,

I'm a moderately experienced JUnit user, but a new member of this Yahoo group. I
use Eclipse (Helios), JUnit4, and EclEmma for testing and code coverage. I've
been looking for a way to incorporate more robust unit testing into a parallel
computing framework that uses both MPIJava and Threads. Google searches and a
search of this group didn't turn up an obvious answer. Google turned up a
reference from JavaWorld back in 2000, which has let me get started with JUnit3.

Is there a good reference with basic examples that I have missed for JUnit4 ?

Thanks,
Chuck Mosher

#22999 From: "beauchesne.david" <beauchesne.david@...>
Date: Fri Oct 8, 2010 3:32 pm
Subject: Wrong number of arguments
beauchesne.d...
Send Email Send Email
 
Hi. My test parameterized class keeps throwing up this exception, and I can't
figure out how to fix it. Could someone point out where my problem lies?

java.lang.IllegalAgumentException: wrong number of arguments
at java.lang.reflect.Constructor.newInstance(Unknown Source)

Here's the parameter method:

@Parameters
     public static Collection<Object[]> licenseBaselines() {
         ArrayList<Object[]> tests = new ArrayList<Object[]>();
         try {
             BufferedReader in = new BufferedReader(new FileReader(testFile));
             String line;
             while((line = in.readLine()) != null)
                 tests.add(line.split("::"));
             in.close();
         } catch(Exception e) {
             System.out.println("Exception: " + e.toString());
         }
         return tests;
}

My constructor:

public LicenseScrubberTest(Object[] stuff) {...}

#23000 From: David Saff <david@...>
Date: Fri Oct 8, 2010 4:39 pm
Subject: Re: Wrong number of arguments
dsaff
Send Email Send Email
 
David,

There's so much I'd love to change about the current parameterized
runner.  The way it's designed, a @Parameters method returns a
Collection<Object[]>, but the individual elements of the Object array
are unpacked to fill the parameters of the constructor.  So, there's
two ways to fix what's going on:

1) If the number of elements read on each line of your testFile is
going to be constant, you could explicitly name them in the
constructor:

public LicenseScrubberTest(String field1, String field2, String field3) {...}

2) If it isn't, then you'll need to wrap the array in an array:

tests.add(new Object[] { line.split("::") });

In either case, you deserved a better error message.  Can you log a
bug for that?

    David Saff

On Fri, Oct 8, 2010 at 11:32 AM, beauchesne.david
<beauchesne.david@...> wrote:
> Hi. My test parameterized class keeps throwing up this exception, and I can't
figure out how to fix it. Could someone point out where my problem lies?
>
> java.lang.IllegalAgumentException: wrong number of arguments
> at java.lang.reflect.Constructor.newInstance(Unknown Source)
>
> Here's the parameter method:
>
> @Parameters
>    public static Collection<Object[]> licenseBaselines() {
>        ArrayList<Object[]> tests = new ArrayList<Object[]>();
>        try {
>            BufferedReader in = new BufferedReader(new FileReader(testFile));
>            String line;
>            while((line = in.readLine()) != null)
>                tests.add(line.split("::"));
>            in.close();
>        } catch(Exception e) {
>            System.out.println("Exception: " + e.toString());
>        }
>        return tests;
> }
>
> My constructor:
>
> public LicenseScrubberTest(Object[] stuff) {...}
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>

#23001 From: "Dinesh :\)" <spdinu@...>
Date: Fri Oct 8, 2010 7:58 pm
Subject: Junit result files
spdinu
Send Email Send Email
 
Hi Junit users,

I am trying to integrate junit to our own proprietary test framework.

Would like to know if Junit result files(xml files) are written/copied into any
folders in a windows machine, where I run my eclipse.

This would definetly help my task.

Thanks a lot in advacne.

Regards,
Dinesh

#23002 From: David Saff <david@...>
Date: Fri Oct 8, 2010 8:19 pm
Subject: Re: Junit result files
dsaff
Send Email Send Email
 
Dinesh,

There are no output files automatically written.  However, I believe
there is a UI option to write out a test result set.

    David Saff

On Fri, Oct 8, 2010 at 3:58 PM, Dinesh :) <spdinu@...> wrote:
> Hi Junit users,
>
> I am trying to integrate junit to our own proprietary test framework.
>
> Would like to know if Junit result files(xml files) are written/copied into
any folders in a windows machine, where I run my eclipse.
>
> This would definetly help my task.
>
> Thanks a lot in advacne.
>
> Regards,
> Dinesh
>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>

#23003 From: "Dinesh :\)" <spdinu@...>
Date: Fri Oct 8, 2010 8:39 pm
Subject: Re: Junit result files
spdinu
Send Email Send Email
 
Thanks David,
 
Thanks for your quick response.I have one more query.
 
Is there any Junit event I can wait for to know if my test is comleted and my
result files are ready.
 
I need this info as I initiate the Junit test from my framework and I am
waiting for the Junit test completion(and for results)
 
Regards,
Dinesh.

--- On Sat, 10/9/10, David Saff <david@...> wrote:


From: David Saff <david@...>
Subject: Re: [junit] Junit result files
To: junit@yahoogroups.com
Date: Saturday, October 9, 2010, 1:49 AM


 



Dinesh,

There are no output files automatically written. However, I believe
there is a UI option to write out a test result set.

David Saff

On Fri, Oct 8, 2010 at 3:58 PM, Dinesh :) <spdinu@...> wrote:
> Hi Junit users,
>
> I am trying to integrate junit to our own proprietary test framework.
>
> Would like to know if Junit result files(xml files) are written/copied into
any folders in a windows machine, where I run my eclipse.
>
> This would definetly help my task.
>
> Thanks a lot in advacne.
>
> Regards,
> Dinesh
>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>










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

#23004 From: "tiaraki" <tiaraki@...>
Date: Mon Oct 11, 2010 1:10 am
Subject: Running test with guaranteed method order -> cookbook/FAQ?
tiaraki
Send Email Send Email
 
Hello

Although junit is designed to run the test methods in arbitrary order,
e.g. for sorting often failing ones first or just to be safe that there are not
dependencies, every now and then someone has a valid case where it could indeed
be useful.

One solution is offered in the API docs of Request.sortWith()¹ but the
example seems only to work for standalone calls not for running the tests with
@test annotations from an IDE or automated tool. For these cases it would be
nice if you could write an example like the one below in the FAQ or the cookbook
as it took me a while to figure out how to do it.

bye
tiaraki


import java.util.Collections;
import java.util.Comparator;
import java.util.List;

import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.InitializationError;

public class SortByMethodNameRunner extends BlockJUnit4ClassRunner {

     private static class NameCmp implements Comparator<FrameworkMethod> {
         @Override
         public int compare(FrameworkMethod o1, FrameworkMethod o2) {
             return o1.getName().compareTo(o2.getName());
         }
     }

     public SortByMethodNameRunner(Class<?> clazz) throws InitializationError {
         super(clazz);
     }

     @Override
     protected List<FrameworkMethod> computeTestMethods() {
         List<FrameworkMethod> list = super.computeTestMethods();
         Collections.sort(list, new NameCmp());
         return list;
     }
}

¹:
http://junit.sourceforge.net/javadoc/org/junit/runner/Request.html#sortWith%28ja\
va.util.Comparator%29

#23005 From: "chuckmosher" <chuckmosher@...>
Date: Fri Oct 8, 2010 12:36 pm
Subject: Re: JUnit4 and Threads
chuckmosher
Send Email Send Email
 
Here are the two references I pursued:

http://www.cs.rice.edu/~mgricken/research/concutest/concjunit/

This looked interesting, but I wasn't quite ready to take on trying to get this
integrated with my Eclipse environment.

http://www.javaworld.com/jw-12-2000/jw-1221-junit.html?page=6

The last section on this page, "Test Thread Safety", gave me something that was
easy to get working with Eclipse. I would work on getting this working with
JUnit4, but suspect that others have figured all this out already.

Any pointers appreciated !

-Chuck Mosher

Messages 22976 - 23005 of 24393   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

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