[FLINK-12102][tests] Fix FlinkILoopTest on Java 9 #8151
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
Fixes an issue in the FlinkILoopTest where the test failed on Java 9.
From my understanding, powermock loads classes in a separate classloader during mocking. However powermock does not account for Java 9 modules (see powermock/powermock#864), due to which the loading will fail if the class is not available by default on java 9, as is the case for
javaxclasses.Apparently the
PowerMockIgnoreannotation stops powermock from separately loading the class, and thus the test can pass.Verifying this change
I ran the test successfully on java 9 on a dev branch: https://travis-ci.org/zentol/flink/jobs/518712231