Skip to content

Commit 35c3434

Browse files
committed
server: Separate @before and @after methods in Bookmarks unit tests
Until now, before running each individual unit tests, a new experiment would've been created and all its previous (if any) bookmarks were deleted. Now, using @before, a new experiment will be created upon running each individual test, and then, using @after, all the data related to the bookmarks will be deleted. Signed-off-by: Kaveh Shahedi <kaveh.shahedi@ericsson.com>
1 parent 0044363 commit 35c3434

File tree

1 file changed

+9
-3
lines changed
  • trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests/src/org/eclipse/tracecompass/incubator/trace/server/jersey/rest/core/tests/services

1 file changed

+9
-3
lines changed

trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests/src/org/eclipse/tracecompass/incubator/trace/server/jersey/rest/core/tests/services/BookmarkManagerServiceTest.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs.BookmarkModelStub;
2727
import org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs.ExperimentModelStub;
2828
import org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.utils.RestServerTest;
29+
import org.junit.After;
2930
import org.junit.Before;
3031
import org.junit.Test;
3132

@@ -46,8 +47,7 @@ public class BookmarkManagerServiceTest extends RestServerTest {
4647
private static final String END = "end";
4748

4849
/**
49-
* Setup method to run before each test. Creates a clean experiment and removes all
50-
* existing bookmarks.
50+
* Setup method to run before each test
5151
*/
5252
@Before
5353
public void setUp() {
@@ -56,8 +56,14 @@ public void setUp() {
5656
CONTEXT_SWITCHES_UST_NOT_INITIALIZED_STUB);
5757
assertNotNull("Experiment should not be null", experiment);
5858
assertNotNull("Experiment UUID should not be null", experiment.getUUID());
59+
}
5960

60-
// Get all existing bookmarks and delete them
61+
/**
62+
* Tear down method to run after each test
63+
*/
64+
@After
65+
public void tearDown() {
66+
// Remove all bookmarks
6167
WebTarget application = getApplicationEndpoint();
6268
WebTarget bookmarkTarget = application.path(EXPERIMENTS)
6369
.path(experiment.getUUID().toString())

0 commit comments

Comments
 (0)