-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Programically Loading TestNG Suite from JAR File Fails to Delete Temporary Copy of Suite File #2825
Programically Loading TestNG Suite from JAR File Fails to Delete Temporary Copy of Suite File #2825
Comments
@speedythesnail - I noticed that you have mentioned your JDK as JDK17. TestNG is still not officially certified with JDK17. So can you see if you are able to recreate this issue with JDK11 as well (Just to ensure that we are ruling out JDK flavors as the reason for the behaviour) I say this because we do have unit tests for this implementation and haven't seen any exception from it so far. |
@speedythesnail - Did something go wrong at your end? You seem to have merged your PR into the |
I also compiled and ran my application with OpenJDK 11 and encountered the same issue :(. I'm fairly sure it is probably Windows-specific, but I don't have my Linux box readily available to test out to see if this is a platform-specific issue. |
Oh that is interesting, I just opened a PR to merge my master branch back into TestNG's. I created a separate branch in my fork to work out of, I am surprised that it impacted this issue, though I certainly had no intentions of closing this. |
JarFileUtils.delete(File f) throw actual exception (instead of FileNotFound) when file cannot be deleted #2825
TestNG Version
Expected behavior
When programmatically running TestNG, TestNG should load a suite yaml / xml file from a JAR.
Actual behavior
TestNG JarFileUtils copies the file from the jar to a temporary path, after it loads the suite file it attempts to delete the file.
If JarFileUtils fails to delete the file, it throws a FileNotFoundException, no matter what the cause is. This is not the case on my machine, the file definitely exists where it was reported to have not existed.
Is the issue reproducible on runner?
Test case sample
Spring Configuration to set up TestNG
Main TestNG run:
Resultant Exception:
The file does exist though:
I am currently opening a PR for this issue, this issue is submitted so I have a Github # to add to the CHANGES.txt file.
The text was updated successfully, but these errors were encountered: