mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
github: fix test
* fix NPE on tearDown() * do not call super.tearDown() on exception in beforeTest()
This commit is contained in:
@@ -176,17 +176,19 @@ public abstract class GithubTest extends GitPlatformTest {
|
||||
|
||||
myHttpAuthService = (GitHttpAuthTestService)ServiceManager.getService(GitHttpAuthService.class);
|
||||
|
||||
|
||||
try {
|
||||
beforeTest();
|
||||
}
|
||||
catch (Exception e) {
|
||||
try {
|
||||
tearDown();
|
||||
afterTest();
|
||||
}
|
||||
catch (Exception e2) {
|
||||
e2.printStackTrace();
|
||||
}
|
||||
finally {
|
||||
cleanup();
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@@ -197,11 +199,15 @@ public abstract class GithubTest extends GitPlatformTest {
|
||||
afterTest();
|
||||
}
|
||||
finally {
|
||||
myHttpAuthService.cleanup();
|
||||
cleanup();
|
||||
super.tearDown();
|
||||
}
|
||||
}
|
||||
|
||||
private void cleanup() {
|
||||
if (myHttpAuthService != null) myHttpAuthService.cleanup();
|
||||
}
|
||||
|
||||
protected void beforeTest() throws Exception {
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user