File tree Expand file tree Collapse file tree 4 files changed +15
-30
lines changed
org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/workbench
org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests Expand file tree Collapse file tree 4 files changed +15
-30
lines changed Original file line number Diff line number Diff line change 7171import org .junit .Rule ;
7272import org .junit .Test ;
7373import org .junit .rules .TestName ;
74+ import org .junit .rules .TestWatcher ;
7475import org .osgi .service .log .LogLevel ;
7576import org .osgi .service .log .LogListener ;
7677import org .osgi .service .log .LogReaderService ;
@@ -2972,6 +2973,9 @@ public void testBug371100() {
29722973 assertFalse (logged );
29732974 }
29742975
2976+ @ Rule
2977+ public TestWatcher screenshotRule = Screenshots .onFailure ();
2978+
29752979 @ Test
29762980 public void testBug372226 () {
29772981 assumeFalse ("Test fails on Mac: Bug 537639" , Platform .OS_MACOSX .equals (Platform .getOS ()));
@@ -2991,8 +2995,6 @@ public void testBug372226() {
29912995 Control control = (Control ) part .getWidget ();
29922996 assertEquals (subShell , control .getParent ());
29932997
2994- Screenshots .takeScreenshot (getClass (), testName .getMethodName ());
2995-
29962998 appContext .get (EPartService .class ).activate (part );
29972999 assertEquals (subShell , control .getParent ());
29983000 }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2828import org .junit .Assume ;
2929import org .junit .Rule ;
3030import org .junit .Test ;
31+ import org .junit .rules .TestWatcher ;
32+
33+ import org .eclipse .test .Screenshots ;
3134
3235import org .eclipse .swt .SWT ;
3336import org .eclipse .swt .custom .StyledText ;
7376 */
7477public class TextViewerTest {
7578
76- @ Rule public ScreenshotOnFailureRule screenshotRule = new ScreenshotOnFailureRule ();
79+ @ Rule
80+ public TestWatcher screenshotRule = Screenshots .onFailure ();
81+
7782 private Shell fShell ;
7883
7984 @ After
Original file line number Diff line number Diff line change 2525import org .junit .Before ;
2626import org .junit .Rule ;
2727import org .junit .Test ;
28+ import org .junit .rules .TestWatcher ;
29+
30+ import org .eclipse .test .Screenshots ;
2831
2932import org .eclipse .swt .SWT ;
3033import org .eclipse .swt .custom .StyleRange ;
5760import org .eclipse .jface .text .source .AnnotationModel ;
5861import org .eclipse .jface .text .source .AnnotationPainter ;
5962import org .eclipse .jface .text .source .SourceViewer ;
60- import org .eclipse .jface .text .tests .ScreenshotOnFailureRule ;
6163import org .eclipse .jface .text .tests .TextViewerTest ;
6264import org .eclipse .jface .text .tests .util .DisplayHelper ;
6365
@@ -66,7 +68,8 @@ public class CodeMiningTest {
6668 private SourceViewer fViewer ;
6769 private Shell fShell ;
6870
69- @ Rule public ScreenshotOnFailureRule rule = new ScreenshotOnFailureRule ();
71+ @ Rule
72+ public TestWatcher screenshotRule = Screenshots .onFailure ();
7073
7174 @ Before
7275 public void setUp () {
You can’t perform that action at this time.
0 commit comments