Results 1 to 15 of 15

Thread: JUnit errors

  1. #1
    Hazza is offline Member
    Join Date
    Oct 2012
    Posts
    64
    Rep Power
    0

    Default JUnit errors

    I have been trying to run some tests with JUnit in Eclipse, but instead of failures I just get errors, even though there are no errors in the test methods, or the methods of the class I am trying to test?

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: JUnit errors

    Yes!
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    Hazza is offline Member
    Join Date
    Oct 2012
    Posts
    64
    Rep Power
    0

    Default Re: JUnit errors

    Yeah that really helps...

  4. #4
    Hazza is offline Member
    Join Date
    Oct 2012
    Posts
    64
    Rep Power
    0

    Default Re: JUnit errors

    Answering "yes" to the question doesn't even make sense!

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,044
    Rep Power
    20

    Default Re: JUnit errors

    Neither does your question with the amount of information supplied.
    You haven't said what errors you are getting, what your tests look like, what the code they're testing looks like.

    "Yes" is about as meaningful an answer as can be expected.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  6. #6
    Hazza is offline Member
    Join Date
    Oct 2012
    Posts
    64
    Rep Power
    0

    Default Re: JUnit errors

    That's the problem Eclipse won't tell me. If there's an error in the code it will always say when you highlight the big red X but this just tells me theres an error?

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,044
    Rep Power
    20

    Default Re: JUnit errors

    So it's not compiling?
    Is that what you're saying?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  8. #8
    Hazza is offline Member
    Join Date
    Oct 2012
    Posts
    64
    Rep Power
    0

    Default Re: JUnit errors

    I noticed underneath is says java.lang.ArrayIndexOutOfBoudsException: -1

    But we haven't covered exceptions yet, so we wouldn't have to catch exceptions in this exercise?

  9. #9
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: JUnit errors

    then you've got a programming error. An arry index of -1 is not possible. Either your test case is injecting invalid values into the code you're testing, or the actual code has flaws.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,044
    Rep Power
    20

    Default Re: JUnit errors

    So back to my first post:
    "You haven't said what errors you are getting, what your tests look like, what the code they're testing looks like."

    You're expecting us to fly blind here.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  11. #11
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: JUnit errors

    Quote Originally Posted by Tolls View Post
    You're expecting us to fly blind here.
    Is your crystal ball in service again?
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  12. #12
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,044
    Rep Power
    20

    Default Re: JUnit errors

    It's in with the mechanic to get repaired.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  13. #13
    Hazza is offline Member
    Join Date
    Oct 2012
    Posts
    64
    Rep Power
    0

    Default Re: JUnit errors

    Tolls I pm'd you have you seen it yet?

  14. #14
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,044
    Rep Power
    20

    Default Re: JUnit errors

    I don't do PMs.
    This is an open forum.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  15. #15
    Hazza is offline Member
    Join Date
    Oct 2012
    Posts
    64
    Rep Power
    0

    Default Re: JUnit errors

    Yeah but I cant post code from a uni assignment onto a public forum because if they find out they throw you off the course!

Similar Threads

  1. JUnit help please
    By FIREDANCEXS in forum New To Java
    Replies: 3
    Last Post: 04-25-2012, 03:44 AM
  2. junit 4 QTP
    By limcy in forum Advanced Java
    Replies: 0
    Last Post: 09-26-2011, 07:20 AM
  3. Replies: 4
    Last Post: 01-04-2011, 12:36 AM
  4. Replies: 3
    Last Post: 03-08-2009, 01:51 AM
  5. Junit
    By Azndaddy in forum New To Java
    Replies: 6
    Last Post: 06-15-2008, 06:47 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •