-
Notifications
You must be signed in to change notification settings - Fork 104
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
Bugs/460 test bug297635 #465
Bugs/460 test bug297635 #465
Conversation
Test Results 30 files + 2 30 suites +2 49m 3s ⏱️ + 4m 57s Results for commit 0347088. ± Comparison against base commit d444af5. This pull request removes 2 and adds 1 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
...eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestBug297635.java
Outdated
Show resolved
Hide resolved
...eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestBug297635.java
Show resolved
Hide resolved
@fedejeanne please remove merge commit (see https://www.vogella.com/tutorials/Git/article.html#pullrebase for a general setup). My comments could be handled in another PR. This one looks fine to me, any other opions @jukzi ? |
@vogella This is still draft. Please separate actual fixes from refactoring and give an explanation about the fix for easier review. |
...eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestBug297635.java
Outdated
Show resolved
Hide resolved
...eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestBug297635.java
Outdated
Show resolved
Hide resolved
...eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestBug297635.java
Outdated
Show resolved
Hide resolved
53dbf77
to
4813db4
Compare
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.
This test class is a WorkspaceSessionTest
. Thus the intention was that between the original test methods test1
and test2
, the platform was shut down and restarted.
So from my point of view either
- the two test methods should remain to still have a restart of the platform, or
- the test should not be a
WorkspaceSessionTest
anymore.
I do not see any reasons for restarting the platform in the original bug report (https://bugs.eclipse.org/bugs/show_bug.cgi?id=297635), so probably this stays a proper regression test for that bug when making a simple ResourceTest
out of it.
4813db4
to
c08de7a
Compare
Good point, I changed it to a |
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.
Changes look good to me. Just two minor comments for possible improvements, which are (from my side) not mandatory to be processed before merging.
...eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/session/TestBug297635.java
Outdated
Show resolved
Hide resolved
@@ -45,26 +53,12 @@ public BundleContext getContext() { | |||
return Platform.getBundle(PI_RESOURCES_TESTS).getBundleContext(); | |||
} | |||
|
|||
public void test1() { | |||
public void testBug() throws Exception { |
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.
The method becomes much easier to read and comprehend due to this separation of functionality into dedicated methods.
Maybe you could even remove the comments and, if necessary, improve the method names. That could further improve comprehensibility, also w.r.t. the method actually being composed of two chunks that made up the original test methods (install / reinstall).
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.
You mean:
- Rename
testBug
totestSavedStatesAreDiscardedAfterSnapshot
(or do you have another name in mind?) - Remove comment (
/* ... */
) inreinstallBundle
If not, could you please give me some example(s)?
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.
Sorry for being imprecise: I just meant to remove the comments within the testBug
method, i.e., the comments just repeating what the method called in the line after the comment is doing, like
// install a bundle
installBundle();
The method of the test method can remain as it is.
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.
I get it now, thanks.
I created/renamed some private methods and removed unnecessary comments in testBug
in 0347088
c08de7a
to
5fd81b6
Compare
Merge both test methods in the class into 1 and let the class extend directly from ResourceTest. Extract private methods to improve readability. Rethrow exceptions (they let the test fail anyway).
5fd81b6
to
0347088
Compare
This fixes #460
Merge both test methods in the class
TestBug297635
into 1 in order to avoid a possible workspace crash between their executions. Such a crash let (before my PR) the second test fail.