-
Notifications
You must be signed in to change notification settings - Fork 67
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
Migrate resolver tests in o.e.osgi.tests to JUnit 4 #455
Conversation
2ca9ef2
to
73026df
Compare
private void fail(String message, Throwable exception) { | ||
AssertionFailedError error = new AssertionFailedError(message); | ||
error.initCause(exception); | ||
throw error; | ||
} |
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.
fyi: this is a reduced version of the method that was inherited from CoreTest
before. I kept it instead of replacing all the fail
calls as the exceptions in those cases are part of the functionality-under-test, so they should make the test fail rather than error on occurrence (see #453 (comment)).
73026df
to
37a2fdb
Compare
Test Results 25 files ±0 25 suites ±0 10m 55s ⏱️ -6s Results for commit 7ee4201. ± Comparison against base commit fa054eb. This pull request skips 1 test.
♻️ This comment has been updated with latest results. |
a78cd14
to
48325aa
Compare
48325aa
to
5599ccd
Compare
public void testCreateLocation04() { | ||
Location configLocation = configLocationTracker.getService(); | ||
File testLocationFile = OSGiTestsActivator.getContext().getDataFile("testLocations/testCreateLocation04"); | ||
Location testLocation = configLocation.createLocation(null, null, true); | ||
try { | ||
testLocation.set(testLocationFile.toURL(), true); | ||
testLocation.release(); | ||
fail("Should not be able to lock read-only location"); | ||
Assert.fail("Should not be able to lock read-only location"); |
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.
Could not be replaced with an assertThrows
as this test actually fails silently, see #460
Skipped test is because the conditional return was replaced with a JUnit 4 |
5599ccd
to
fa4671a
Compare
This migrates all tests in org.eclipse.osgi.tests.resolver and org.eclipse.osgi.tests.services.resolver to JUnit 4 * Add JUnit 4 annotations @test, @before, @after * Remove inheritance of JUnit 3 TestCase and CoreTest * Replace try-catch for actual errors with making the test method throw the exception
fa4671a
to
7ee4201
Compare
Thank you Alex for taking over and of course to Heiko. |
This migrates all tests in
org.eclipse.osgi.tests.resolver
andorg.eclipse.osgi.tests.services.resolver
to JUnit 4@Test
,@Before
,@After
TestCase
andCoreTest