jchen8460 opened a new pull request, #942: URL: https://github.com/apache/cxf/pull/942
**Issue** [Jira Issue](https://issues.apache.org/jira/browse/CXF-8697?jql=project%20%3D%20CXF%20AND%20resolution%20%3D%20Unresolved%20AND%20text%20~%20%22CachedOutputStream%22%20ORDER%20BY%20priority%20DESC%2C%20updated%20DESC) The tests `org.apache.cxf.io.CacheAndWriteOutputStreamTest.testDeleteTmpFile` and `org.apache.cxf.io.CachedOutputStreamTest.testDeleteTmpFile` fail when run by themselves with the command `mvn test` because the temporary file is null. The reason is because the method `createFileOutPutStream` is never called in the method `enforceLimits` in `CachedOutputStream` since the threshold instance variable is not greater than the totalLength variable. The threshold variable depends on the static variable defaultThreshold. The defaultThreshold also depends on the system property. Therefore, these tests pass when the whole test suite is run because a different test, such as `testUseSysProps`, changes the static variable along with the system property. **Solution** In order to allow these two tests to pass on their own, the system property must first be set to 4. Next, the static variables need to be updated with a call to `reloadDefaultProperties`. Since the previous version of these tests do not change system properties and static variables, the test should then reset the system property to the original state once finished executing. Please let me know if you would like me to reset the state differently. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
