netbeans
netbeans copied to clipboard
remove usages of deprecated junit.framework.Assert.
project wide cleanup which intends to:
- get rid of many build log warnings
- reduce the mixing of two junit APIs
The annoying part is that junit 4 made the decision of simply throwing java.lang.AssertionError in Assert.* (and i forgot about that), while junit 3 and 5 throw a subtype, so that it is possible to distinguish between language level assert and test Assert. Further, NBTestCase extends TestCase which extends the deprecated Assert.
So i did the following:
- if it doesn't extend
NBTestCaseuseorg.junit.Assert - unless any of the tests catch
AssertionFailedError(there are not many instances, second commit), then we usejunit.framework.TestCase.*which is essentially whatNBTestCaseuses (but there won't be deprecation warnings), since catchingAssertionErrormight break tests in non obvious ways
This should hopefully clean things up without making it harder to migrate to junit 5 in future.