Skip to main content



      Home
Home » Newcomers » Newcomers » Problem With JUnit in Lesson 6(New Test Not Being Executed)
Problem With JUnit in Lesson 6 [message #648975] Sun, 16 January 2011 21:32 Go to next message
Eclipse UserFriend
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] Sun, 16 January 2011 21:58 Go to previous messageGo to next message
Eclipse UserFriend
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] Sun, 16 January 2011 23:38 Go to previous messageGo to next message
Eclipse UserFriend
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 15:10 Go to previous messageGo to next message
Eclipse UserFriend
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 17:21 Go to previous messageGo to next message
Eclipse UserFriend
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] Mon, 17 January 2011 22:03 Go to previous messageGo to next message
Eclipse UserFriend
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] Mon, 17 January 2011 23:40 Go to previous message
Eclipse UserFriend
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: Sat Nov 08 20:21:14 EST 2025

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

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

Back to the top