Jeanne Boyarsky wrote:Glenn,
It is a matter of style. I don't have any problems with a test having multiple assertions that cover the same scenario. Some people believe a test should only have one assertion.
I do have two observations:
1) It appears you are testing the value passed into the constructor is the value returned by getName(). If so, you could create a String variable so you aren't duplicating that String and to make the intent clearer.
2) Does the getName() method have logic in it? If it just returns the value (vs doing conversion/validation), most of your tests are overkill.
Stephan van Hulst wrote:You can eliminate testName and returnedName. Just pass the name directly into the constructor, and pass the result of getName() directly to assertEquals(). Also, move each case to their own test method. One test should test one case. Rename your test methods to explain what they do: testNewRecipe(), testNewRecipeWithEmptyName(), testNewRecipeWithLongName(), testNewRecipeWithSpecialName().
Paul Clapham wrote:"Configuration" covers a lot of territory. Maybe there is supposed to be some other folder somewhere where your code expects to find files. Maybe you have to run the application as an administrator and you aren't. The list could go on indefinitely.
Don't take those guesses seriously, they are based on no evidence. You've got Eclipse running on the target machine? Good. Then run your application and see where exceptions are thrown, for a start. If that doesn't happen then you'll have to start debugging. But without any evidence of a problem you aren't going to be able to solve that problem.
Paul Clapham wrote:That means you haven't configured Eclipse to know where the source code is for the JRE it's using. Just click that debig button which gets you out of that method and back to whatever called it.
It doesn't have anything to do with why your code doesn't run on a different machine -- that would be because the other machine isn't configured the same way as the one you did your testing on.
Knute Snortum wrote:You probably should include .settings, .project, and .classpath in your .gitignore file as these files are very system specific and proprietary to Eclipse. It also exposes the internal structure of your system to the public.
Knute Snortum wrote:It looks to me that your project is very dependent on local jars and resources. How did you build your runnable jar? Have you considered using Maven or some other build program?
Stephan van Hulst wrote:Why don't you just use a WatchService to get notified when your spreadsheet changes