• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JUnit, Cannot find symbol?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

This is the first time that I have had to use JUnit testing therefore the practice is a little strange for me. That said, I've managed to set up a test (Using Netbeans) to test the two classes in my java code. However, they both return three failures, all with the same error message of 'Cannot find symbol'. The code itself does compile and run perfectly. Can anyone please tell me what has gone wrong!

I'm not sure which part of code that you are after, whether its the JUnit generated code or whether its the actual code, so for the sake of this thread, I'll leave the code out for now until someone can inform me of what code is needed.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Calvin,
Does it say which symbol it cannot find? That's usually the message for a compiler error so it's strange you say it compiles.

You'll need to post some code to get a useful answer here though. I recommend making it the smallest example that reproduces the error. (one failure instead of three)
 
Calvin Williamson
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After some considerable searching, and slight alterations, I now have slightly different kind of errors.
Here is the error:


And this is the code that it is on about,


I hope this helps more than my previous message

 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, the line



tells the test to fail with the specified error message, which it does. So everything seems to be working fine.

What are you expecting to be different?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic