Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Problem With JUnit in Lesson 6(New Test Not Being Executed)
Problem With JUnit in Lesson 6 [message #648975] Mon, 17 January 2011 02:32 Go to next message
Michael Satterwhite is currently offline Michael SatterwhiteFriend
Messages: 5
Registered: January 2011
Junior Member
I'm as new as they come to Eclipse. I'm going through the (EXCELLENT!) tutorials, and am having a problem in Lesson 6. I've googled everything I can think of (which probably means I'm not thinking straight) and can find nothing.

In this lesson, we create another test procedure, testToString(). When I tell Eclipse to rerun the test, this new test does not get executed. In the tutorial, all that he does is to rerun the test, there is nothing that would add the new procedure to the tests that should be run. In the package explorer, the new test is clearly seen by Eclipse. It just isn't being run.

I do note that I have JUnit 4 installed, and the tutorial references JUnit 3. That may be irrelevant, but I mention it to be complete.

I'm sure this fix is simple - and probably obvious - but I don't see it.

Thanks in advance to anyone who can help.

---Michael
Re: Problem With JUnit in Lesson 6 *SOLVED* [message #648976 is a reply to message #648975] Mon, 17 January 2011 02:58 Go to previous messageGo to next message
Michael Satterwhite is currently offline Michael SatterwhiteFriend
Messages: 5
Registered: January 2011
Junior Member
OK, I found it - but I still don't see it in the documentation.

I noted that the procedures created by Eclipse had "@Test" immediately preceeding the declaration. This is not in the tutorial example. I added this line immediately prior to my new procedure, and it was recognized as a test.

---Michael
Re: Problem With JUnit in Lesson 6 *SOLVED* [message #648983 is a reply to message #648976] Mon, 17 January 2011 04:38 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 2011.01.16 19:58, Michael Satterwhite wrote:
> OK, I found it - but I still don't see it in the documentation.
>
> I noted that the procedures created by Eclipse had "@Test" immediately
> preceeding the declaration. This is not in the tutorial example. I added
> this line immediately prior to my new procedure, and it was recognized
> as a test.
>
> ---Michael

That annotation is new with JUnit 4; it wasn't in JUnit 3.
Re: Problem With JUnit in Lesson 6 *SOLVED* [message #649133 is a reply to message #648983] Mon, 17 January 2011 20:10 Go to previous messageGo to next message
Michael Satterwhite is currently offline Michael SatterwhiteFriend
Messages: 5
Registered: January 2011
Junior Member
Russell Bateman wrote on Sun, 16 January 2011 23:38
On 2011.01.16
> I noted that the procedures created by Eclipse had "@Test" immediately
> preceeding the declaration. This is not in the tutorial example. I added
> this line immediately prior to my new procedure, and it was recognized
> as a test.

That annotation is new with JUnit 4; it wasn't in JUnit 3.


I figured that, but do appreciate the confirmation. I find it interesting that now I can't create a JUnit 4 module, only JUnit 3. If I select JUnit 4, it eliminates the ability to select the superclass and sets the superclass to java.lang.Object.


Re: Problem With JUnit in Lesson 6 *SOLVED* [message #649151 is a reply to message #649133] Mon, 17 January 2011 22:21 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 2011.01.17 13:10, Michael Satterwhite wrote:
> Russell Bateman wrote on Sun, 16 January 2011 23:38
>> On 2011.01.16 > I noted that the procedures created by Eclipse had
>> "@Test" immediately
>> > preceding the declaration. This is not in the tutorial example. I
>> added
>> > this line immediately prior to my new procedure, and it was recognized
>> > as a test.
>>
>> That annotation is new with JUnit 4; it wasn't in JUnit 3.
>
>
> I figured that, but do appreciate the confirmation. I find it
> interesting that now I can't create a JUnit 4 module, only JUnit 3. If I
> select JUnit 4, it eliminates the ability to select the superclass and
> sets the superclass to java.lang.Object.

I think that's intentional although I haven't thought deeply enough
about it to decide why. I don't always use Eclipse wizards to their
fullest extent, preferring to write the code myself.
Re: Problem With JUnit in Lesson 6 *SOLVED* [message #649184 is a reply to message #649133] Tue, 18 January 2011 03:03 Go to previous messageGo to next message
Deepak Azad is currently offline Deepak AzadFriend
Messages: 543
Registered: July 2009
Senior Member
On 1/18/2011 1:40 AM, Michael Satterwhite wrote:
.. If I
> select JUnit 4, it eliminates the ability to select the superclass and
> sets the superclass to java.lang.Object.

This has been fixed in 3.7 M2 (see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=275574)
Re: Problem With JUnit in Lesson 6 *SOLVED* [message #649188 is a reply to message #649184] Tue, 18 January 2011 04:40 Go to previous message
Michael Satterwhite is currently offline Michael SatterwhiteFriend
Messages: 5
Registered: January 2011
Junior Member
Deepak Azad wrote on Mon, 17 January 2011 22:03
On 1/18/2011 1:40 AM, Michael Satterwhite wrote:
.. If I
> select JUnit 4, it eliminates the ability to select the superclass and
> sets the superclass to java.lang.Object.

This has been fixed in 3.7 M2 (see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=275574)


Thank you for this reply.

I'm incredibly impressed with Eclipse and the development team.

---Michael
Previous Topic:No more Sun Java in Ubuntu, which Java to use with Eclipse?
Next Topic:[Ubuntu 10.xx] How to install Struts on Eclipse Helios ?
Goto Forum:
  


Current Time: Wed Apr 24 23:53:57 GMT 2024

Powered by FUDForum. Page generated in 0.08566 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top