-
-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix NPE when Spoon launch with a wrong path for input resource #1057
Conversation
…ith an or instead of an and. Now the test is failing, proof that the assertion is checked :)
… a local variable in the same block or by a field (or a variable in another block). First detection implemented but patch not satisfying.
Solve in using version of inria/master
@Test | ||
public void testLauncherWithWrongPathAsInput() { | ||
expectedEx.expect(SpoonException.class); | ||
expectedEx.expectMessage("java.io.FileNotFoundException: The following file does not exist: /Users/urli/Github/spoon/src/wrong/direction/File.java"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should a test case really depend on the message of an exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. Indeed I was a bit fast in my cut & paste. The intent was only to paste the FileNotFound. I fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Furthermore, I'm pretty sure that most of us do not clone Spoon into: /Users/urli/Github/spoon
:)
@Test | ||
public void testLauncherWithWrongPathAsInput() { | ||
expectedEx.expect(SpoonException.class); | ||
expectedEx.expectMessage("java.io.FileNotFoundException"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to use a try catch and make the assert in catch
Fix #1042 and now encapsulate a FileNotFoundException inside a SpoonException in case of a wrong path given to Spoon.