diff options
7 files changed, 38 insertions, 38 deletions
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/action/JFaceActionTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/action/JFaceActionTest.java index 72389d84167..a703e052d00 100644 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/action/JFaceActionTest.java +++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/action/JFaceActionTest.java @@ -35,9 +35,7 @@ public abstract class JFaceActionTest extends TestCase { super(name); } - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ + @Override protected void setUp() throws Exception { display = Display.getCurrent(); if (display == null) { @@ -48,10 +46,8 @@ public abstract class JFaceActionTest extends TestCase { shell.setLayout(new FillLayout()); shell.open(); } - - /* (non-Javadoc) - * @see junit.framework.TestCase#tearDown() - */ + + @Override protected void tearDown() throws Exception { shell.dispose(); } diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/DialogSettingsTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/DialogSettingsTest.java index da0a04d0425..0cf90cfd441 100644 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/DialogSettingsTest.java +++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/DialogSettingsTest.java @@ -35,8 +35,8 @@ public class DialogSettingsTest extends TestCase { "\rvalue\rwith\rreturn\r", }; public void testDialogSettings() throws IOException { - for (int i = 0; i < TEST_STRINGS.length; i++) { - final String name = TEST_STRINGS[i]; + for (String testString : TEST_STRINGS) { + final String name = testString; testPutAndGetWithTitle(new DialogSettingsChecker() { public void prepareAndCheckBeforeSerialization( IDialogSettings dialogSettingsToSerialize) { @@ -52,8 +52,8 @@ public class DialogSettingsTest extends TestCase { } public void testAddNewSection() throws IOException { - for (int i = 0; i < TEST_STRINGS.length; i++) { - final String name = TEST_STRINGS[i]; + for (String testString : TEST_STRINGS) { + final String name = testString; testPutAndGet(new DialogSettingsChecker() { public void prepareAndCheckBeforeSerialization( @@ -205,8 +205,8 @@ public class DialogSettingsTest extends TestCase { } public void testKeys() throws IOException { - for (int i = 0; i < TEST_STRINGS.length; i++) { - final String key = TEST_STRINGS[i]; + for (String testString : TEST_STRINGS) { + final String key = testString; testPutAndGet(new DialogSettingsChecker() { public void prepareAndCheckBeforeSerialization( IDialogSettings dialogSettingsToSerialize) { @@ -226,8 +226,8 @@ public class DialogSettingsTest extends TestCase { } public void testGet() throws IOException { - for (int i = 0; i < TEST_STRINGS.length; i++) { - final String value = TEST_STRINGS[i]; + for (String testString : TEST_STRINGS) { + final String value = testString; testPutAndGet(new DialogSettingsChecker() { public void prepareAndCheckBeforeSerialization( @@ -247,10 +247,10 @@ public class DialogSettingsTest extends TestCase { } public void testGetArray() throws IOException { - for (int i = 0; i < TEST_STRINGS.length; i++) { - final String value1 = TEST_STRINGS[i]; - for (int j = 0; j < TEST_STRINGS.length; j++) { - final String value2 = TEST_STRINGS[j]; + for (String testString : TEST_STRINGS) { + final String value1 = testString; + for (String otherTestString : TEST_STRINGS) { + final String value2 = otherTestString; final String[] value = new String[] { value1, value2 }; testPutAndGet(new DialogSettingsChecker() { @@ -336,8 +336,8 @@ public class DialogSettingsTest extends TestCase { Double.MAX_VALUE, Double.MIN_VALUE, Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY }; - for (int i = 0; i < values.length; i++) { - final double value = values[i]; + for (double testValue : values) { + final double value = testValue; testPutAndGet(new DialogSettingsChecker() { public void prepareAndCheckBeforeSerialization( IDialogSettings dialogSettingsToSerialize) { @@ -370,8 +370,8 @@ public class DialogSettingsTest extends TestCase { Float.MAX_VALUE, Float.MIN_VALUE, Float.NaN, Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY }; - for (int i = 0; i < values.length; i++) { - final float value = values[i]; + for (float testValue : values) { + final float value = testValue; testPutAndGet(new DialogSettingsChecker() { public void prepareAndCheckBeforeSerialization( IDialogSettings dialogSettingsToSerialize) { @@ -403,8 +403,8 @@ public class DialogSettingsTest extends TestCase { int[] values = new int[] { 36254, 0, 1, -36254, Integer.MAX_VALUE, Integer.MIN_VALUE }; - for (int i = 0; i < values.length; i++) { - final int value = values[i]; + for (int testValue : values) { + final int value = testValue; testPutAndGet(new DialogSettingsChecker() { public void prepareAndCheckBeforeSerialization( @@ -427,8 +427,8 @@ public class DialogSettingsTest extends TestCase { long[] values = new long[] { 36254L, 0L, 1L, -36254L, Long.MAX_VALUE, Long.MIN_VALUE }; - for (int i = 0; i < values.length; i++) { - final long value = values[i]; + for (long testValue : values) { + final long value = testValue; testPutAndGet(new DialogSettingsChecker() { public void prepareAndCheckBeforeSerialization( diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/DialogTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/DialogTest.java index 63d59d4ef02..e1fc20905bf 100644 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/DialogTest.java +++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/DialogTest.java @@ -27,6 +27,7 @@ public class DialogTest extends TestCase { */ private Dialog dialog; + @Override protected void tearDown() throws Exception { if (dialog != null) { // close the dialog diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/InputDialogTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/InputDialogTest.java index 0b4e42583b2..c2253127c21 100644 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/InputDialogTest.java +++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/InputDialogTest.java @@ -17,7 +17,8 @@ import org.eclipse.jface.dialogs.InputDialog; public class InputDialogTest extends TestCase { private InputDialog dialog; - + + @Override protected void tearDown() throws Exception { if (dialog != null) { dialog.close(); diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/ProgressMonitorDialogTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/ProgressMonitorDialogTest.java index 6d4016d917a..acca00905c1 100644 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/ProgressMonitorDialogTest.java +++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/ProgressMonitorDialogTest.java @@ -20,6 +20,7 @@ import org.eclipse.swt.widgets.Display; public class ProgressMonitorDialogTest extends TestCase { + @Override protected void setUp() throws Exception { super.setUp(); diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/SafeRunnableErrorTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/SafeRunnableErrorTest.java index 8a17139c93d..74d01b36092 100644 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/SafeRunnableErrorTest.java +++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/SafeRunnableErrorTest.java @@ -64,10 +64,11 @@ public class SafeRunnableErrorTest extends TestCase { }; // Make sure these don't block - SafeRunnable.run(runnable); - SafeRunnable.run(runnable); - SafeRunnable.run(runnable); - assertEquals(3, count); + int expectedRuns = 3; + for (int run = 0; run < expectedRuns; run++) { + SafeRunnable.run(runnable); + } + assertEquals(expectedRuns, count); } } diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/StatusDialogTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/StatusDialogTest.java index f7d52611b37..ac42840f156 100755 --- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/StatusDialogTest.java +++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/dialogs/StatusDialogTest.java @@ -47,15 +47,15 @@ public class StatusDialogTest extends TestCase { private CLabel findStatusLabel(Composite parent) { CLabel result = null; Control[] children = parent.getChildren(); - for (int i = 0; i < children.length; i++) { - if (children[i] instanceof CLabel) { - result = (CLabel) children[i]; + for (Control child : children) { + if (child instanceof CLabel) { + result = (CLabel) child; } } if (result == null) { - for (int i = 0; i < children.length; i++) { - if (children[i] instanceof Composite) { - result = findStatusLabel((Composite) children[i]); + for (Control child : children) { + if (child instanceof Composite) { + result = findStatusLabel((Composite) child); } } } |