summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2009-01-13 08:55:32 (EST)
committerCarsten Drossel2009-01-13 08:55:32 (EST)
commit600aabfbe5c70fb8ab8859fcf4fcaa86a267610f (patch)
tree4d86974adcadc7379e025132869f46bd6e6245e8
parent64e1d6bd765432233d6065382350dbf60c2775aa (diff)
downloadorg.eclipse.riena-600aabfbe5c70fb8ab8859fcf4fcaa86a267610f.zip
org.eclipse.riena-600aabfbe5c70fb8ab8859fcf4fcaa86a267610f.tar.gz
org.eclipse.riena-600aabfbe5c70fb8ab8859fcf4fcaa86a267610f.tar.bz2
fixed warnings
-rw-r--r--org.eclipse.riena.tests/AuthorizationServiceITest.launch6
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/communication/core/attachment/AttachmentClientITest.java6
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/communication/core/attachment/ByteArrayDataSourceTest.java21
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/ExtensionInjectorTest.java48
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/HeterogeneousInjectingTest.java6
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/marker/AbstractMarkerTest.java9
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/util/ArraysUtilTest.java11
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/util/IterTest.java1
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/util/MillisTest.java7
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/util/PropertiesUtilsTest.java11
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/util/ReflectionUtilsTest.java7
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/util/VariableManagerUtilTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/navigation/ui/filter/AbstractUIFilterRuleNavigationMarkerTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTRidgetTest.java5
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractTableRidgetTest.java24
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ActionRidgetTest.java6
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ChoiceCompositeTest.java7
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ComboRidgetTest.java8
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/DateTextRidgetTest.java10
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/DecimalTextRidgetTest.java6
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/LabelRidgetTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ListRidgetTest.java18
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MarkableRidgetTest.java11
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuItemRidgetTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuRidgetTest.java10
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MultipleChoiceRidgetTest.java24
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/NumericStringTest.java7
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/NumericTextRidgetTest.java16
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/SegmentedStringTest.java7
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/SharedResourcesTest.java11
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/SingleChoiceRidgetTest.java20
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TableRidgetTest.java20
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidgetTest2.java7
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ToggleButtonRidgetTest.java4
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeRidgetTest.java17
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeRidgetTest2.java20
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeTableRidgetTest.java33
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/NavigationNodeTest.java23
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/controllers/AllTests.java5
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/controllers/NavigationNodeControllerTest.java6
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/binding/DefaultSwtControlRidgetMapperTest.java8
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/component/SubApplicationSwitcherWidgetTest.java9
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/lnf/renderer/SubModuleTreeItemMarkerRendererTest.java11
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/viewprovider/AllTests.java5
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/viewprovider/SwtViewIdTest.java11
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/AbstractViewBindingDelegateTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/AllTests.java5
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/objecttransaction/simple/ObjectTransactionVariousSimpleTest.java7
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/security/authentication/LoginModuleTest.java4
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authentication/AuthenticationClientITest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authorization/AuthorizationServiceITest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/tests/RienaTestCase.java25
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/ValueBindingSupportTest.java7
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/databinding/AllTests.java5
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/marker/AllTests.java5
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/tree2/AllTests.java5
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/tree2/TreeNodeTest.java8
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/MinLengthTest.java7
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidCharactersTest.java9
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidDateTest.java7
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidDecimalTest.java15
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidEmailAddressTest.java7
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidIntegerTest.java13
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidatorCollectionTest.java53
64 files changed, 359 insertions, 339 deletions
diff --git a/org.eclipse.riena.tests/AuthorizationServiceITest.launch b/org.eclipse.riena.tests/AuthorizationServiceITest.launch
index 16fcd20..2c7d994 100644
--- a/org.eclipse.riena.tests/AuthorizationServiceITest.launch
+++ b/org.eclipse.riena.tests/AuthorizationServiceITest.launch
@@ -11,7 +11,8 @@
<booleanAttribute key="clearws" value="true"/>
<booleanAttribute key="clearwslog" value="false"/>
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
-<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="default" value="false"/>
+<stringAttribute key="deselected_workspace_plugins" value="de.compeople.scp.office,de.compeople.scp.offline.common,org.eclipse.riena.sample.app.client.mail,de.compeople.scp.onlinestatus,de.compeople.scp.ui.widgets.swing,org.eclipse.riena.communication.publisher,de.compeople.scp.client,de.compeople.scp.ui.swing,de.compeople.scp.offline.xstream.gzip,de.compeople.scp.offline.xstream.gzipcrypt,org.eclipse.riena.communication.discovery,org.eclipse.riena.communication.publisher.xfire,org.eclipse.riena.sample.app.client.rcpmail,org.eclipse.riena.sample.app.client,de.compeople.scp.example.common,org.eclipse.swt.snippets,org.eclipse.riena.communication.publisher.hessian,org.eclipse.riena.communication.factory.xfire,de.compeople.scp.ui.core,org.eclipse.riena.demo.common,org.eclipse.riena.sample.app.server,de.compeople.scp.server,de.compeople.scp.ui.swing.lnf.default,org.eclipse.riena.demo.server,org.eclipse.riena.example.client,org.eclipse.riena.demo.client,de.compeople.scp.offline.xstream.xml,de.compeople.scp.navigation.ui.swing,org.eclipse.riena.communication.sample.pingpong.common,de.compeople.scp.ui.ridgets.swing,de.compeople.scp.example.client.bank,de.compeople.scp.example.client.person,com.jgoodies,org.objectweb.asm,de.compeople.scp.navigation,com.thoughworks.xstream,de.compeople.scp.offline.xstream,de.compeople.scp.example.client,de.compeople.scp.tests,de.compeople.scp.offline.jserialization,org.eclipse.riena.communication.sample.pingpong.client.config,org.eclipse.riena.communication.sample.pingpong.client,org.eclipse.riena.server,org.eclipse.riena.communication.sample.pingpong.server,org.eclipse.riena.sample.snippets,org.codehaus.xfire,de.compeople.scp.sample.app.client,org.eclipse.riena.security.client.startup,de.compeople.scp.example.client.person.common"/>
<booleanAttribute key="includeOptional" value="true"/>
<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
@@ -30,7 +31,8 @@
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.riena.tests"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="org.eclipse.equinox.security.sample.authProduct"/>
+<stringAttribute key="product" value="org.eclipse.equinox.p2.director.app.product"/>
+<stringAttribute key="selected_target_plugins" value="org.eclipse.osgi.services,org.eclipse.ui.ide,org.eclipse.core.filesystem,org.eclipse.core.databinding,org.eclipse.jface.text,org.apache.commons.collections,org.eclipse.core.runtime.compatibility.registry,org.eclipse.update.configurator,org.eclipse.core.resources.win32.x86,org.eclipse.update.core,org.eclipse.ui.views,org.eclipse.text,org.eclipse.core.net.win32.x86,org.eclipse.core.commands,org.eclipse.ant.core,org.eclipse.swt.win32.win32.x86,org.eclipse.equinox.app,org.eclipse.ui.forms,org.eclipse.equinox.common,org.eclipse.jface,org.eclipse.core.expressions,org.eclipse.core.databinding.beans,com.ibm.icu,org.eclipse.jface.databinding,org.eclipse.core.runtime.compatibility.auth,org.eclipse.equinox.security.win32.x86,org.eclipse.core.runtime,org.eclipse.ui.win32,org.eclipse.core.contenttype,org.eclipse.core.filesystem.win32.x86,org.eclipse.core.net,org.apache.commons.logging,org.eclipse.core.resources,org.eclipse.osgi,org.eclipse.core.resources.compatibility,org.eclipse.ui,org.eclipse.update.ui,org.eclipse.ui.workbench,org.eclipse.swt,org.eclipse.equinox.registry,org.eclipse.help,org.eclipse.update.core.win32,org.eclipse.core.jobs,org.eclipse.equinox.preferences"/>
<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
<booleanAttribute key="tracing" value="false"/>
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/communication/core/attachment/AttachmentClientITest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/communication/core/attachment/AttachmentClientITest.java
index 5189749..f17452d 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/communication/core/attachment/AttachmentClientITest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/communication/core/attachment/AttachmentClientITest.java
@@ -167,7 +167,7 @@ public final class AttachmentClientITest extends RienaTestCase {
attachment.readAsStream();
fail();
} catch (RemoteFailure e) {
- // ok();
+ ok();
}
}
@@ -181,7 +181,7 @@ public final class AttachmentClientITest extends RienaTestCase {
trace(output);
fail();
} catch (RuntimeException e) {
- // ok();
+ ok();
}
}
@@ -230,7 +230,7 @@ public final class AttachmentClientITest extends RienaTestCase {
trace(attachment);
fail();
} catch (IOException e) {
- // ok();
+ ok();
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/communication/core/attachment/ByteArrayDataSourceTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/communication/core/attachment/ByteArrayDataSourceTest.java
index a046c5c..4f2d23a 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/communication/core/attachment/ByteArrayDataSourceTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/communication/core/attachment/ByteArrayDataSourceTest.java
@@ -14,7 +14,7 @@ import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
-import org.easymock.MockControl;
+import org.easymock.EasyMock;
import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.NonUITestCase;
@@ -26,7 +26,6 @@ import org.eclipse.riena.tests.collect.NonUITestCase;
public class ByteArrayDataSourceTest extends RienaTestCase {
private IDataSource dataSourceMock;
- private MockControl dataSourceControl;
private final static String NAME = "Test";
/**
@@ -37,16 +36,12 @@ public class ByteArrayDataSourceTest extends RienaTestCase {
}
private void setUpDataSourceMock(int length) throws Exception {
- dataSourceControl = MockControl.createControl(IDataSource.class);
- dataSourceMock = (IDataSource) dataSourceControl.getMock();
+ dataSourceMock = EasyMock.createMock(IDataSource.class);
- dataSourceMock.getName();
- dataSourceControl.setReturnValue(NAME);
+ EasyMock.expect(dataSourceMock.getName()).andReturn(NAME);
+ EasyMock.expect(dataSourceMock.getInputStream()).andReturn(getInputStream(length));
- dataSourceMock.getInputStream();
- dataSourceControl.setReturnValue(getInputStream(length));
-
- dataSourceControl.replay();
+ EasyMock.replay(dataSourceMock);
}
private InputStream getInputStream(int length) {
@@ -61,8 +56,8 @@ public class ByteArrayDataSourceTest extends RienaTestCase {
* @see junit.framework.TestCase#tearDown()
*/
protected void tearDown() throws Exception {
- if (dataSourceControl != null) {
- dataSourceControl.verify();
+ if (dataSourceMock != null) {
+ EasyMock.verify(dataSourceMock);
}
super.tearDown();
}
@@ -115,7 +110,7 @@ public class ByteArrayDataSourceTest extends RienaTestCase {
dataSource.getOutputStream();
fail("Should throw an IOException!");
} catch (IOException ioe) {
- // ok();
+ ok("IOException expected.");
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/ExtensionInjectorTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/ExtensionInjectorTest.java
index f892882..be962f3 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/ExtensionInjectorTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/ExtensionInjectorTest.java
@@ -38,9 +38,9 @@ public class ExtensionInjectorTest extends RienaTestCase {
printTestName();
try {
Inject.extension(null);
- fail("That should not happen!");
- } catch (RuntimeException e) {
- // ok
+ fail("Exception expected");
+ } catch (RuntimeException expected) {
+ ok("Exception expected");
}
}
@@ -48,21 +48,21 @@ public class ExtensionInjectorTest extends RienaTestCase {
printTestName();
try {
Inject.extension("id").useType(null);
- fail("That should not happen!");
- } catch (RuntimeException e) {
- // ok
+ fail("Exception expected");
+ } catch (RuntimeException expected) {
+ ok("Exception expected");
}
try {
Inject.extension("id").useType(IData.class).useType(IData.class);
- fail("That should not happen!");
- } catch (RuntimeException e) {
- // ok
+ fail("Exception expected");
+ } catch (RuntimeException expected) {
+ ok("Exception expected");
}
try {
Inject.extension("id").useType(String.class);
- fail("That should not happen!");
- } catch (RuntimeException e) {
- // ok
+ fail("Exception expected");
+ } catch (RuntimeException expected) {
+ ok("Exception expected");
}
}
@@ -70,21 +70,21 @@ public class ExtensionInjectorTest extends RienaTestCase {
printTestName();
try {
Inject.extension("id").expectingMinMax(2, 1);
- fail("That should not happen!");
- } catch (RuntimeException e) {
- // ok
+ fail("Exception expected");
+ } catch (RuntimeException expected) {
+ ok("Exception expected");
}
try {
Inject.extension("id").expectingMinMax(-1, 0);
- fail("That should not happen!");
- } catch (RuntimeException e) {
- // ok
+ fail("Exception expected");
+ } catch (RuntimeException expected) {
+ ok("Exception expected");
}
try {
Inject.extension("id").expectingMinMax(0, 0);
- fail("That should not happen!");
- } catch (RuntimeException e) {
- // ok
+ fail("Exception expected");
+ } catch (RuntimeException expected) {
+ ok("Exception expected");
}
}
@@ -92,9 +92,9 @@ public class ExtensionInjectorTest extends RienaTestCase {
printTestName();
try {
Inject.extension("id").into(null);
- fail("That should not happen!");
- } catch (RuntimeException e) {
- // ok
+ fail("Exception expected");
+ } catch (RuntimeException expected) {
+ ok("Exception expected");
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/HeterogeneousInjectingTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/HeterogeneousInjectingTest.java
index 80c24be..914b31b 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/HeterogeneousInjectingTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/HeterogeneousInjectingTest.java
@@ -26,10 +26,8 @@ public class HeterogeneousInjectingTest extends RienaTestCase {
private IPreferencesDesc[] prefs;
private static final String PREFERENCES = "org.eclipse.core.runtime.preferences";
- {
- // If you want printing remove the comments below:
- // setPrint(true);
- }
+ // If you want printing enable the comment below:
+ // setPrint(true);
public void update(IPreferencesDesc[] prefs) {
this.prefs = prefs;
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/marker/AbstractMarkerTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/marker/AbstractMarkerTest.java
index f408aed..8a9ac85 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/marker/AbstractMarkerTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/marker/AbstractMarkerTest.java
@@ -10,15 +10,14 @@
*******************************************************************************/
package org.eclipse.riena.core.marker;
-import junit.framework.TestCase;
-
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.NonUITestCase;
/**
* Tests of the class {@link AbstractMarker}.
*/
@NonUITestCase
-public class AbstractMarkerTest extends TestCase {
+public class AbstractMarkerTest extends RienaTestCase {
/**
* Test of the constructor {@code AbstractMarker()}.
@@ -77,9 +76,9 @@ public class AbstractMarkerTest extends TestCase {
marker.reset();
try {
marker.setAttribute(null, 12);
- fail("Exception expectd");
+ fail("Exception expected");
} catch (Exception e) {
- // OK
+ ok("Exception expected");
}
assertFalse(marker.isChangeFired());
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/ArraysUtilTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/ArraysUtilTest.java
index f1c4dbb..f0ea03d 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/ArraysUtilTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/ArraysUtilTest.java
@@ -12,15 +12,14 @@ package org.eclipse.riena.core.util;
import java.util.Arrays;
-import junit.framework.TestCase;
-
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.NonUITestCase;
/**
* Test the {@code ArraysUtil} class.
*/
@NonUITestCase
-public class ArraysUtilTest extends TestCase {
+public class ArraysUtilTest extends RienaTestCase {
public void testCopy() {
String[] source = new String[] { "1", "2", "3", "4" };
@@ -37,7 +36,7 @@ public class ArraysUtilTest extends TestCase {
ArraysUtil.copyRange(null, 0, 2);
fail();
} catch (IllegalArgumentException e) {
- // ok
+ ok();
}
}
@@ -47,7 +46,7 @@ public class ArraysUtilTest extends TestCase {
ArraysUtil.copyRange(source, 0, 5);
fail();
} catch (IllegalArgumentException e) {
- // ok
+ ok();
}
}
@@ -56,7 +55,7 @@ public class ArraysUtilTest extends TestCase {
ArraysUtil.copyRange(null, 2, 0);
fail();
} catch (IllegalArgumentException e) {
- // ok
+ ok();
}
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/IterTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/IterTest.java
index 6b50187..b27436b 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/IterTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/IterTest.java
@@ -161,6 +161,7 @@ public class IterTest extends RienaTestCase {
*
* @return
*/
+ @SuppressWarnings("unchecked")
public Iterator getIterator() {
return new Iterator() {
private int i = 0;
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/MillisTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/MillisTest.java
index 8726a40..d24f43c 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/MillisTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/MillisTest.java
@@ -10,15 +10,14 @@
*******************************************************************************/
package org.eclipse.riena.core.util;
-import junit.framework.TestCase;
-
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.NonUITestCase;
/**
* Test the {@code Milli} class.
*/
@NonUITestCase
-public class MillisTest extends TestCase {
+public class MillisTest extends RienaTestCase {
public void testSeconds() {
assertEquals(1000, Millis.seconds(1));
@@ -41,7 +40,7 @@ public class MillisTest extends TestCase {
Millis.valueOf(null);
fail();
} catch (IllegalArgumentException e) {
- // ok
+ ok();
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/PropertiesUtilsTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/PropertiesUtilsTest.java
index b8721a1..b63c76b 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/PropertiesUtilsTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/PropertiesUtilsTest.java
@@ -13,15 +13,14 @@ package org.eclipse.riena.core.util;
import java.util.Hashtable;
import java.util.Map;
-import junit.framework.TestCase;
-
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.NonUITestCase;
/**
* Test stuff from {@code PropertiesUtils}.
*/
@NonUITestCase
-public class PropertiesUtilsTest extends TestCase {
+public class PropertiesUtilsTest extends RienaTestCase {
/**
*
@@ -78,7 +77,7 @@ public class PropertiesUtilsTest extends TestCase {
PropertiesUtils.asMap("a=1;b=2", "a", "c");
fail();
} catch (IllegalArgumentException e) {
- //ok
+ ok();
}
}
@@ -93,7 +92,7 @@ public class PropertiesUtilsTest extends TestCase {
PropertiesUtils.asMap(" a: 1 ; b = 2 ");
fail();
} catch (IllegalArgumentException e) {
- // ok
+ ok();
}
}
@@ -180,7 +179,7 @@ public class PropertiesUtilsTest extends TestCase {
PropertiesUtils.asArray("1,2\\n,3,\\\\,4");
fail();
} catch (IllegalArgumentException e) {
- // ok
+ ok();
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/ReflectionUtilsTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/ReflectionUtilsTest.java
index 9741351..9b67082 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/ReflectionUtilsTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/ReflectionUtilsTest.java
@@ -18,15 +18,14 @@ import java.net.URLClassLoader;
import java.util.HashMap;
import java.util.Map;
-import junit.framework.TestCase;
-
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.NonUITestCase;
/**
* Test the ReflectionUtils class.
*/
@NonUITestCase
-public class ReflectionUtilsTest extends TestCase {
+public class ReflectionUtilsTest extends RienaTestCase {
/**
* Test creating an instance #1
@@ -92,7 +91,7 @@ public class ReflectionUtilsTest extends TestCase {
ReflectionUtils.invokeHidden(object, "setUrl", MalformedURLException.class, "filez://murks.at");
fail("MalformedURLException expected");
} catch (MalformedURLException expected) {
- // ok, expected
+ ok("MalformedURLException expected");
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/VariableManagerUtilTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/VariableManagerUtilTest.java
index ca30a5b..545ba6f 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/VariableManagerUtilTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/VariableManagerUtilTest.java
@@ -126,7 +126,7 @@ public class VariableManagerUtilTest extends RienaTestCase {
VariableManagerUtil.substitute("${a}");
fail();
} catch (CoreException e) {
- // ok
+ ok();
}
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/navigation/ui/filter/AbstractUIFilterRuleNavigationMarkerTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/navigation/ui/filter/AbstractUIFilterRuleNavigationMarkerTest.java
index f62c0f2..9bc9f8b 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/navigation/ui/filter/AbstractUIFilterRuleNavigationMarkerTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/navigation/ui/filter/AbstractUIFilterRuleNavigationMarkerTest.java
@@ -36,7 +36,7 @@ public class AbstractUIFilterRuleNavigationMarkerTest extends TestCase {
INavigationNode<?> node = new SubModuleNode();
node.setNodeId(new NavigationNodeId("id"));
IUIFilterRule attribute = new MyUIFilterRuleNavigationMarker("*/" + node.getNodeId().getTypeId(), null);
- assertFalse(attribute.matches(null));
+ assertFalse(attribute.matches((Object[]) null));
assertFalse(attribute.matches(new Object()));
SubModuleNode sm = new SubModuleNode();
sm.setNodeId(new NavigationNodeId("id2"));
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTRidgetTest.java
index 7ebeeb3..ef1872b 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTRidgetTest.java
@@ -16,13 +16,12 @@ import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
-import junit.framework.TestCase;
-
import org.easymock.EasyMock;
import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.jface.databinding.swt.SWTObservables;
import org.eclipse.riena.core.marker.IMarker;
import org.eclipse.riena.core.util.ReflectionUtils;
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.UITestHelper;
import org.eclipse.riena.tests.collect.UITestCase;
import org.eclipse.riena.ui.core.marker.DisabledMarker;
@@ -46,7 +45,7 @@ import org.eclipse.swt.widgets.Widget;
* Tests for the class {@link AbstractSwtRidget}.
*/
@UITestCase
-public abstract class AbstractSWTRidgetTest extends TestCase {
+public abstract class AbstractSWTRidgetTest extends RienaTestCase {
private Shell shell;
private Widget widget;
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractTableRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractTableRidgetTest.java
index f6483be..b005e8b 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractTableRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractTableRidgetTest.java
@@ -182,7 +182,7 @@ public abstract class AbstractTableRidgetTest extends AbstractSWTRidgetTest {
ridget.setSelection(99);
fail();
} catch (RuntimeException e) {
- // expected
+ ok();
}
assertEquals(1, getUIControlSelectedRowCount());
@@ -195,7 +195,7 @@ public abstract class AbstractTableRidgetTest extends AbstractSWTRidgetTest {
ridget.setSelection(-1);
fail();
} catch (RuntimeException e) {
- // expected
+ ok();
}
assertEquals(1, getUIControlSelectedRowCount());
@@ -240,7 +240,7 @@ public abstract class AbstractTableRidgetTest extends AbstractSWTRidgetTest {
ridget.setSelection(new int[] { 1, -1, 2 });
fail();
} catch (RuntimeException e) {
- // expected
+ ok();
}
}
@@ -289,7 +289,7 @@ public abstract class AbstractTableRidgetTest extends AbstractSWTRidgetTest {
ridget.setSelection((List<?>) null);
fail();
} catch (RuntimeException e) {
- // expected
+ ok();
}
}
@@ -330,28 +330,28 @@ public abstract class AbstractTableRidgetTest extends AbstractSWTRidgetTest {
ridget.setSelection(0);
fail();
} catch (BindingException bex) {
- // expected
+ ok();
}
try {
ridget.setSelection(new int[] { 0 });
fail();
} catch (BindingException bex) {
- // expected
+ ok();
}
try {
ridget.setSelection((Object) null);
fail();
} catch (BindingException bex) {
- // expected
+ ok();
}
try {
ridget.setSelection(Collections.EMPTY_LIST);
fail();
} catch (BindingException bex) {
- // expected
+ ok();
}
}
@@ -725,7 +725,7 @@ public abstract class AbstractTableRidgetTest extends AbstractSWTRidgetTest {
ridget.getOption(-1);
fail();
} catch (RuntimeException e) {
- // expected
+ ok();
}
try {
@@ -733,7 +733,7 @@ public abstract class AbstractTableRidgetTest extends AbstractSWTRidgetTest {
ridget.getOption(tooBig);
fail();
} catch (RuntimeException e) {
- // expected
+ ok();
}
assertSame(person1, ridget.getOption(0));
@@ -765,7 +765,7 @@ public abstract class AbstractTableRidgetTest extends AbstractSWTRidgetTest {
ridget.setSelectionType(null);
fail();
} catch (RuntimeException npe) {
- // expected
+ ok();
}
}
@@ -776,7 +776,7 @@ public abstract class AbstractTableRidgetTest extends AbstractSWTRidgetTest {
ridget.setSelectionType(ISelectableRidget.SelectionType.NONE);
fail();
} catch (RuntimeException iae) {
- // expected
+ ok();
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ActionRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ActionRidgetTest.java
index 4ee0e4d..641a700 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ActionRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ActionRidgetTest.java
@@ -74,7 +74,7 @@ public class ActionRidgetTest extends AbstractSWTRidgetTest {
ridget.setUIControl(getShell());
fail();
} catch (BindingException bex) {
- // expected
+ ok();
}
}
@@ -83,7 +83,7 @@ public class ActionRidgetTest extends AbstractSWTRidgetTest {
getRidget().addListener(null);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
@@ -137,7 +137,7 @@ public class ActionRidgetTest extends AbstractSWTRidgetTest {
ridget.setText(null);
fail();
} catch (IllegalArgumentException iae) {
- // expected
+ ok();
}
ridget.setText(LABEL);
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ChoiceCompositeTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ChoiceCompositeTest.java
index f906ed4..d9ba523 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ChoiceCompositeTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ChoiceCompositeTest.java
@@ -10,8 +10,7 @@
*******************************************************************************/
package org.eclipse.riena.internal.ui.ridgets.swt;
-import junit.framework.TestCase;
-
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.UITestCase;
import org.eclipse.riena.ui.swt.ChoiceComposite;
import org.eclipse.swt.SWT;
@@ -26,7 +25,7 @@ import org.eclipse.swt.widgets.Shell;
* Tests for the class {@link ChoiceComposite}.
*/
@UITestCase
-public class ChoiceCompositeTest extends TestCase {
+public class ChoiceCompositeTest extends RienaTestCase {
private Shell shell;
@@ -56,7 +55,7 @@ public class ChoiceCompositeTest extends TestCase {
new ChoiceComposite(null, SWT.NONE, false);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
ChoiceComposite control1 = new ChoiceComposite(shell, SWT.NONE, false);
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ComboRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ComboRidgetTest.java
index 0a4c7dd..46db08f 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ComboRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ComboRidgetTest.java
@@ -90,14 +90,14 @@ public class ComboRidgetTest extends AbstractSWTRidgetTest {
ridget.setUIControl(getShell());
fail();
} catch (BindingException bex) {
- // expected
+ ok();
}
try {
ridget.setUIControl(new Combo(getShell(), SWT.NONE));
fail();
} catch (BindingException bex) {
- // expected
+ ok();
}
}
@@ -424,7 +424,7 @@ public class ComboRidgetTest extends AbstractSWTRidgetTest {
ridget.setSelection(999);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
@@ -477,7 +477,7 @@ public class ComboRidgetTest extends AbstractSWTRidgetTest {
ridget.setSelection(new Object());
fail();
} catch (BindingException bex) {
- // expected
+ ok();
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/DateTextRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/DateTextRidgetTest.java
index f6b6539..f46dba4 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/DateTextRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/DateTextRidgetTest.java
@@ -154,35 +154,35 @@ public class DateTextRidgetTest extends AbstractSWTRidgetTest {
ridget.setText(null);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.setText("abc");
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.setText("12102008");
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.setText("12/10/2008");
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.setText("12.ab");
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/DecimalTextRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/DecimalTextRidgetTest.java
index f58c4f3..19e30e9 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/DecimalTextRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/DecimalTextRidgetTest.java
@@ -373,14 +373,14 @@ public class DecimalTextRidgetTest extends AbstractSWTRidgetTest {
ridget.setMaxLength(0);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.setMaxLength(-1);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
expectPropertyChangeEvent(IDecimalTextRidget.PROPERTY_MAXLENGTH, Integer.valueOf(10), Integer.valueOf(5));
@@ -437,7 +437,7 @@ public class DecimalTextRidgetTest extends AbstractSWTRidgetTest {
ridget.setPrecision(-1);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
expectPropertyChangeEvent(IDecimalTextRidget.PROPERTY_PRECISION, Integer.valueOf(2), Integer.valueOf(5));
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/LabelRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/LabelRidgetTest.java
index 1c0a0e4..f18c2b6 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/LabelRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/LabelRidgetTest.java
@@ -132,7 +132,7 @@ public class LabelRidgetTest extends AbstractSWTRidgetTest {
ridget.setText(null);
fail();
} catch (IllegalArgumentException iae) {
- // expected
+ ok();
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ListRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ListRidgetTest.java
index b31ad2d..f6567d5 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ListRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ListRidgetTest.java
@@ -153,7 +153,7 @@ public class ListRidgetTest extends AbstractTableRidgetTest {
ridget.addDoubleClickListener(null);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
FTActionListener listener1 = new FTActionListener();
@@ -189,14 +189,14 @@ public class ListRidgetTest extends AbstractTableRidgetTest {
ridget.setComparator(-1, comparator);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.setComparator(1, comparator);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
int lastItemIndex = control.getItemCount() - 1;
@@ -223,14 +223,14 @@ public class ListRidgetTest extends AbstractTableRidgetTest {
ridget.setSortedColumn(1);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.setSortedColumn(-2);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
assertEquals(-1, ridget.getSortedColumn());
@@ -264,14 +264,14 @@ public class ListRidgetTest extends AbstractTableRidgetTest {
assertFalse(ridget.isColumnSortable(-1));
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
assertFalse(ridget.isColumnSortable(1));
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
assertFalse(ridget.isColumnSortable(0));
@@ -292,7 +292,7 @@ public class ListRidgetTest extends AbstractTableRidgetTest {
ridget.setColumnSortable(0, true);
fail();
} catch (UnsupportedOperationException uoe) {
- // expected
+ ok();
}
}
@@ -392,7 +392,7 @@ public class ListRidgetTest extends AbstractTableRidgetTest {
ridget.setMoveableColumns(true);
fail();
} catch (UnsupportedOperationException ex) {
- // expected
+ ok();
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MarkableRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MarkableRidgetTest.java
index 0ba4c01..7c0b02c 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MarkableRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MarkableRidgetTest.java
@@ -132,6 +132,7 @@ public class MarkableRidgetTest extends AbstractSWTRidgetTest {
assertFalse(ridget.isOutputOnly());
}
+ @SuppressWarnings("unchecked")
public void testAddMarker() throws Exception {
IMarkableRidget ridget = getRidget();
IMarker marker1 = new ErrorMarker();
@@ -198,7 +199,7 @@ public class MarkableRidgetTest extends AbstractSWTRidgetTest {
verifyPropertyChangeEvents();
- Collection newValue = new HashSet<IMarker>(ridget.getMarkers());
+ Collection<?> newValue = new HashSet<IMarker>(ridget.getMarkers());
newValue.remove(marker1);
expectPropertyChangeEvents(new ExpectedMarkerPropertyChangeEvent(ridget.getMarkers(), newValue, false));
@@ -206,7 +207,7 @@ public class MarkableRidgetTest extends AbstractSWTRidgetTest {
verifyPropertyChangeEvents();
newValue = ridget.getMarkers();
- Collection markers = ridget.getMarkers();
+ Collection<?> markers = ridget.getMarkers();
assertEquals(1, markers.size());
assertEquals(true, markers.contains(marker2));
@@ -231,7 +232,7 @@ public class MarkableRidgetTest extends AbstractSWTRidgetTest {
ridget.removeAllMarkers();
verifyPropertyChangeEvents();
- Collection markers = ridget.getMarkers();
+ Collection<?> markers = ridget.getMarkers();
assertEquals(0, markers.size());
expectNoPropertyChangeEvent();
@@ -248,11 +249,11 @@ public class MarkableRidgetTest extends AbstractSWTRidgetTest {
IMarkableRidget ridget = getRidget();
IMarker marker = new ErrorMarker();
- Collection markers = ridget.getMarkers();
+ Collection<?> markers = ridget.getMarkers();
assertNotNull(markers);
ridget.addMarker(marker);
- Collection markers2 = ridget.getMarkers();
+ Collection<?> markers2 = ridget.getMarkers();
assertEquals(0, markers.size());
assertEquals(1, markers2.size());
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuItemRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuItemRidgetTest.java
index 7d15a01..9d42a93 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuItemRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuItemRidgetTest.java
@@ -84,7 +84,7 @@ public class MenuItemRidgetTest extends AbstractSWTRidgetTest {
ridget.setText(null);
fail();
} catch (IllegalArgumentException iae) {
- // expected
+ ok();
}
ridget.setText(LABEL);
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuRidgetTest.java
index 957f199..e146715 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuRidgetTest.java
@@ -10,10 +10,9 @@
*******************************************************************************/
package org.eclipse.riena.internal.ui.ridgets.swt;
-import junit.framework.TestCase;
-
import org.eclipse.core.databinding.BindingException;
import org.eclipse.riena.core.util.ReflectionUtils;
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.UITestCase;
import org.eclipse.riena.ui.swt.utils.SWTBindingPropertyLocator;
import org.eclipse.riena.ui.swt.utils.SwtUtilities;
@@ -26,7 +25,7 @@ import org.eclipse.swt.widgets.Shell;
* Tests of the class {@link MenuRidget}.
*/
@UITestCase
-public class MenuRidgetTest extends TestCase {
+public class MenuRidgetTest extends RienaTestCase {
private Shell shell;
@@ -50,7 +49,7 @@ public class MenuRidgetTest extends TestCase {
ridget.checkUIControl(null);
fail("BindingException was expected");
} catch (BindingException e) {
- // expected
+ ok("BindingException was expected");
}
Menu menu = new Menu(shell);
@@ -59,13 +58,12 @@ public class MenuRidgetTest extends TestCase {
ridget.checkUIControl(menuItem);
fail("BindingException was expected");
} catch (BindingException e) {
- // expected
+ ok("BindingException was expected");
}
menuItem = new MenuItem(menu, SWT.CASCADE);
try {
ridget.checkUIControl(menuItem);
} catch (BindingException e) {
- // expected
fail("No BindingException was expected");
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MultipleChoiceRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MultipleChoiceRidgetTest.java
index d0d7380..952d2cd 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MultipleChoiceRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MultipleChoiceRidgetTest.java
@@ -194,7 +194,7 @@ public final class MultipleChoiceRidgetTest extends MarkableRidgetTest {
ridget.setSelection(Arrays.asList(unknownObject));
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
@@ -433,13 +433,13 @@ public final class MultipleChoiceRidgetTest extends MarkableRidgetTest {
.observeList(Realm.getDefault(), optionProvider, "selectedOptions"));
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.bindToModel(BeansObservables.observeList(Realm.getDefault(), optionProvider, "options"), null);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
@@ -453,25 +453,25 @@ public final class MultipleChoiceRidgetTest extends MarkableRidgetTest {
ridget.bindToModel(null, "options", optionProvider, "selectedOptions");
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.bindToModel(optionProvider, null, optionProvider, "selectedOptions");
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.bindToModel(optionProvider, "options", null, "selectedOptions");
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.bindToModel(optionProvider, "options", optionProvider, null);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
@@ -485,11 +485,11 @@ public final class MultipleChoiceRidgetTest extends MarkableRidgetTest {
ridget.bindToModel(null, optionProvider.getOptionLabels(), optionProvider, "selectedOptions");
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.bindToModel(optionProvider.getOptions(), (List<String>) null, optionProvider, "selectedOptions");
- // ok
+ ok();
} catch (RuntimeException rex) {
fail();
}
@@ -497,19 +497,19 @@ public final class MultipleChoiceRidgetTest extends MarkableRidgetTest {
ridget.bindToModel(optionProvider.getOptions(), new ArrayList<String>(), optionProvider, "selectedOptions");
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.bindToModel(optionProvider.getOptions(), optionProvider.getOptionLabels(), null, "selectedOptions");
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.bindToModel(optionProvider.getOptions(), optionProvider.getOptionLabels(), optionProvider, null);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/NumericStringTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/NumericStringTest.java
index ab17f8a..5672478 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/NumericStringTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/NumericStringTest.java
@@ -10,8 +10,7 @@
*******************************************************************************/
package org.eclipse.riena.internal.ui.ridgets.swt;
-import junit.framework.TestCase;
-
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.TestUtils;
import org.eclipse.riena.tests.collect.NonUITestCase;
@@ -19,7 +18,7 @@ import org.eclipse.riena.tests.collect.NonUITestCase;
* Tests for the {@link NumericString} class.
*/
@NonUITestCase
-public class NumericStringTest extends TestCase {
+public class NumericStringTest extends RienaTestCase {
public void testCreateNumericString() {
NumericString ns;
@@ -34,7 +33,7 @@ public class NumericStringTest extends TestCase {
new NumericString(null, false);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/NumericTextRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/NumericTextRidgetTest.java
index 7c50114..d099af4 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/NumericTextRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/NumericTextRidgetTest.java
@@ -111,21 +111,21 @@ public class NumericTextRidgetTest extends TextRidgetTest {
ridget.setText(localize("98.765,12"));
fail();
} catch (NumberFormatException nfe) {
- // expected
+ ok();
}
try {
ridget.setText("abcd");
fail();
} catch (NumberFormatException nfe) {
- // expected
+ ok();
}
try {
ridget.setText("a,bcd");
fail();
} catch (NumberFormatException nfe) {
- // expected
+ ok();
}
}
@@ -153,14 +153,14 @@ public class NumericTextRidgetTest extends TextRidgetTest {
ridget.setText(localize("98.765,12"));
fail();
} catch (NumberFormatException nfe) {
- // expected
+ ok();
}
try {
ridget.setText("abcd");
fail();
} catch (NumberFormatException nfe) {
- // expected
+ ok();
}
}
@@ -173,7 +173,7 @@ public class NumericTextRidgetTest extends TextRidgetTest {
ridget.setText(null);
fail();
} catch (RuntimeException rex) {
- // ok
+ ok();
}
}
@@ -254,14 +254,14 @@ public class NumericTextRidgetTest extends TextRidgetTest {
ridget.setUIControl(control);
fail();
} catch (RuntimeException exc) {
- // expected;
+ ok();
}
try {
ridget.setUIControl(new Button(getShell(), SWT.PUSH));
fail();
} catch (RuntimeException exc) {
- // expected;
+ ok();
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/SegmentedStringTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/SegmentedStringTest.java
index 802df8c..dbabd06 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/SegmentedStringTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/SegmentedStringTest.java
@@ -10,8 +10,7 @@
*******************************************************************************/
package org.eclipse.riena.internal.ui.ridgets.swt;
-import junit.framework.TestCase;
-
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.NonUITestCase;
import org.eclipse.riena.ui.ridgets.IDateTextRidget;
@@ -19,7 +18,7 @@ import org.eclipse.riena.ui.ridgets.IDateTextRidget;
* Tests for the {@link SegmentedString} class.
*/
@NonUITestCase
-public class SegmentedStringTest extends TestCase {
+public class SegmentedStringTest extends RienaTestCase {
public void testCreateSegmentedString() {
SegmentedString ss;
@@ -44,7 +43,7 @@ public class SegmentedStringTest extends TestCase {
new SegmentedString("ddabcMM");
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/SharedResourcesTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/SharedResourcesTest.java
index 00a479a..2154ff8 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/SharedResourcesTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/SharedResourcesTest.java
@@ -10,8 +10,7 @@
*******************************************************************************/
package org.eclipse.riena.internal.ui.ridgets.swt;
-import junit.framework.TestCase;
-
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.NonUITestCase;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;
@@ -22,7 +21,7 @@ import org.eclipse.swt.widgets.Display;
* @see Activator#getSharedColor(Display, String)
*/
@NonUITestCase
-public class SharedResourcesTest extends TestCase {
+public class SharedResourcesTest extends RienaTestCase {
public void testSharedColors() {
Display display = Display.getDefault();
@@ -43,21 +42,21 @@ public class SharedResourcesTest extends TestCase {
Activator.getSharedColor(null, SharedColors.COLOR_FLASH_ERROR);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
Activator.getSharedColor(display, "does_not_exist");
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
Activator.getSharedColor(display, null);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/SingleChoiceRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/SingleChoiceRidgetTest.java
index 9c95504..c9f5ea0 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/SingleChoiceRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/SingleChoiceRidgetTest.java
@@ -336,13 +336,13 @@ public final class SingleChoiceRidgetTest extends MarkableRidgetTest {
ridget.bindToModel(null, BeansObservables.observeValue(optionProvider, "selectedOption"));
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.bindToModel(BeansObservables.observeList(Realm.getDefault(), optionProvider, "options"), null);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
@@ -356,25 +356,25 @@ public final class SingleChoiceRidgetTest extends MarkableRidgetTest {
ridget.bindToModel(null, "options", optionProvider, "selectedOption");
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.bindToModel(optionProvider, null, optionProvider, "selectedOption");
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.bindToModel(optionProvider, "options", null, "selectedOption");
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.bindToModel(optionProvider, "options", optionProvider, null);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
@@ -388,7 +388,7 @@ public final class SingleChoiceRidgetTest extends MarkableRidgetTest {
ridget.bindToModel(null, optionProvider.getOptionLabels(), optionProvider, "selectedOption");
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.bindToModel(optionProvider.getOptions(), (List<String>) null, optionProvider, "selectedOption");
@@ -399,19 +399,19 @@ public final class SingleChoiceRidgetTest extends MarkableRidgetTest {
ridget.bindToModel(optionProvider.getOptions(), new ArrayList<String>(), optionProvider, "selectedOption");
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.bindToModel(optionProvider.getOptions(), optionProvider.getOptionLabels(), null, "selectedOption");
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.bindToModel(optionProvider.getOptions(), optionProvider.getOptionLabels(), optionProvider, null);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TableRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TableRidgetTest.java
index f2a10a2..13afff3 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TableRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TableRidgetTest.java
@@ -101,7 +101,7 @@ public class TableRidgetTest extends AbstractTableRidgetTest {
new String[] { "First Name" });
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
@@ -117,7 +117,7 @@ public class TableRidgetTest extends AbstractTableRidgetTest {
new String[] { "First Name", "Last Name", "First - Last" });
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
// table has 1 default column, expected 3
@@ -125,7 +125,7 @@ public class TableRidgetTest extends AbstractTableRidgetTest {
ridget.setUIControl(new Table(getShell(), SWT.NONE));
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
@@ -147,7 +147,7 @@ public class TableRidgetTest extends AbstractTableRidgetTest {
getRidget().bindToModel(manager, "persons", Person.class, properties1, headers1);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
@@ -287,7 +287,7 @@ public class TableRidgetTest extends AbstractTableRidgetTest {
ridget.addDoubleClickListener(null);
fail();
} catch (RuntimeException npe) {
- // expected
+ ok();
}
FTActionListener listener1 = new FTActionListener();
@@ -323,14 +323,14 @@ public class TableRidgetTest extends AbstractTableRidgetTest {
ridget.setComparator(-1, comparator);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.setComparator(2, comparator);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
ridget.setSortedAscending(true);
@@ -375,7 +375,7 @@ public class TableRidgetTest extends AbstractTableRidgetTest {
ridget.setSortedColumn(2);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
assertEquals(-1, ridget.getSortedColumn());
@@ -414,14 +414,14 @@ public class TableRidgetTest extends AbstractTableRidgetTest {
assertFalse(ridget.isColumnSortable(-1));
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
assertFalse(ridget.isColumnSortable(2));
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
for (int i = 0; i < 2; i++) {
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidgetTest2.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidgetTest2.java
index accf956..ad46943 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidgetTest2.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidgetTest2.java
@@ -15,6 +15,8 @@ import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
+import org.eclipse.core.databinding.validation.IValidator;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.riena.core.marker.IMarker;
import org.eclipse.riena.tests.UITestHelper;
import org.eclipse.riena.ui.core.marker.ErrorMarker;
@@ -36,9 +38,6 @@ import org.eclipse.riena.ui.ridgets.validation.ValidEmailAddress;
import org.eclipse.riena.ui.ridgets.validation.ValidIntermediateDate;
import org.eclipse.riena.ui.ridgets.validation.ValidationFailure;
import org.eclipse.riena.ui.ridgets.validation.ValidationRuleStatus;
-
-import org.eclipse.core.databinding.validation.IValidator;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -1144,7 +1143,7 @@ public class TextRidgetTest2 extends AbstractSWTRidgetTest {
ridget.setText(null);
fail();
} catch (RuntimeException rex) {
- // ok
+ ok();
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ToggleButtonRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ToggleButtonRidgetTest.java
index c6fc2ea..de7602b 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ToggleButtonRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ToggleButtonRidgetTest.java
@@ -190,7 +190,7 @@ public class ToggleButtonRidgetTest extends AbstractSWTRidgetTest {
ridget.addListener(null);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
@@ -207,7 +207,7 @@ public class ToggleButtonRidgetTest extends AbstractSWTRidgetTest {
ridget.setText(null);
fail();
} catch (IllegalArgumentException iae) {
- // expected
+ ok();
}
ridget.setText(LABEL);
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeRidgetTest.java
index 208b000..8aed7b3 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeRidgetTest.java
@@ -104,7 +104,7 @@ public class TreeRidgetTest extends AbstractSWTRidgetTest {
ITreeNode.PROPERTY_VALUE);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
@@ -112,28 +112,28 @@ public class TreeRidgetTest extends AbstractSWTRidgetTest {
ITreeNode.PROPERTY_VALUE);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.bindToModel(roots, ITreeNode.class, null, ITreeNode.PROPERTY_PARENT, ITreeNode.PROPERTY_VALUE);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.bindToModel(roots, ITreeNode.class, ITreeNode.PROPERTY_CHILDREN, null, ITreeNode.PROPERTY_VALUE);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.bindToModel(roots, ITreeNode.class, ITreeNode.PROPERTY_CHILDREN, ITreeNode.PROPERTY_PARENT, null);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
@@ -350,7 +350,7 @@ public class TreeRidgetTest extends AbstractSWTRidgetTest {
ridget.addDoubleClickListener(null);
fail();
} catch (RuntimeException npe) {
- // expected
+ ok();
}
FTActionListener listener1 = new FTActionListener();
@@ -406,7 +406,7 @@ public class TreeRidgetTest extends AbstractSWTRidgetTest {
* This method will fully expand the tree to ensure all tree items are
* created.
*/
- private final TreeItem getUIControlItem(int index) {
+ private TreeItem getUIControlItem(int index) {
getRidget().expandAll();
Tree control = getWidget();
switch (index) {
@@ -418,8 +418,9 @@ public class TreeRidgetTest extends AbstractSWTRidgetTest {
return control.getItem(0).getItem(0).getItem(0);
case 3:
return control.getItem(0).getItem(1);
+ default:
+ throw new IndexOutOfBoundsException("index= " + index);
}
- throw new IndexOutOfBoundsException("index= " + index);
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeRidgetTest2.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeRidgetTest2.java
index 1131dba..c35eca7 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeRidgetTest2.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeRidgetTest2.java
@@ -195,7 +195,7 @@ public class TreeRidgetTest2 extends AbstractSWTRidgetTest {
ridget.setSelection((List<?>) null);
fail();
} catch (RuntimeException e) {
- // expected
+ ok();
}
}
@@ -234,14 +234,14 @@ public class TreeRidgetTest2 extends AbstractSWTRidgetTest {
ridget.setSelection((Object) null);
fail();
} catch (BindingException bex) {
- // expected
+ ok();
}
try {
ridget.setSelection(Collections.EMPTY_LIST);
fail();
} catch (BindingException bex) {
- // expected
+ ok();
}
}
@@ -600,7 +600,7 @@ public class TreeRidgetTest2 extends AbstractSWTRidgetTest {
ridget.setSelectionType(null);
fail();
} catch (RuntimeException npe) {
- // expected
+ ok();
}
}
@@ -611,7 +611,7 @@ public class TreeRidgetTest2 extends AbstractSWTRidgetTest {
ridget.setSelectionType(ISelectableRidget.SelectionType.NONE);
fail();
} catch (RuntimeException iae) {
- // expected
+ ok();
}
}
@@ -723,7 +723,7 @@ public class TreeRidgetTest2 extends AbstractSWTRidgetTest {
ridget.setSelectionType(ITreeRidget.SelectionType.NONE);
fail("IllegalArgumentException expected");
} catch (IllegalArgumentException expected) {
- // ok, expected
+ ok("IllegalArgumentException expected");
}
assertEquals(ITreeRidget.SelectionType.MULTI, ridget.getSelectionType());
@@ -1183,7 +1183,7 @@ public class TreeRidgetTest2 extends AbstractSWTRidgetTest {
* This method will fully expand the tree to ensure all tree items are
* created.
*/
- private final TreeItem getUIControlItem(int index) {
+ private TreeItem getUIControlItem(int index) {
getRidget().expandAll();
Tree control = getWidget();
switch (index) {
@@ -1195,8 +1195,9 @@ public class TreeRidgetTest2 extends AbstractSWTRidgetTest {
return control.getItem(0).getItem(0).getItem(0);
case 3:
return control.getItem(0).getItem(1);
+ default:
+ throw new IndexOutOfBoundsException("index= " + index);
}
- throw new IndexOutOfBoundsException("index= " + index);
}
/**
@@ -1211,8 +1212,9 @@ public class TreeRidgetTest2 extends AbstractSWTRidgetTest {
return rootChild1;
case 2:
return rootChild1Child1;
+ default:
+ throw new IndexOutOfBoundsException("index= " + index);
}
- throw new IndexOutOfBoundsException("index= " + index);
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeTableRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeTableRidgetTest.java
index 69dc92f..526cdcf 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeTableRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeTableRidgetTest.java
@@ -36,11 +36,11 @@ import org.eclipse.swt.widgets.TreeItem;
*/
public class TreeTableRidgetTest extends AbstractSWTRidgetTest {
- PersonNode[] roots;
- PersonNode node1;
- PersonNode node2;
- PersonNode node3;
- PersonNode node4;
+ private PersonNode[] roots;
+ private PersonNode node1;
+ private PersonNode node2;
+ private PersonNode node3;
+ private PersonNode node4;
@Override
protected void setUp() throws Exception {
@@ -112,7 +112,7 @@ public class TreeTableRidgetTest extends AbstractSWTRidgetTest {
new String[] { "First Name" });
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
@@ -128,7 +128,7 @@ public class TreeTableRidgetTest extends AbstractSWTRidgetTest {
new String[] { "First Name", "Last Name", "First - Last" });
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
// tree has 1 default column, expected 3
@@ -136,7 +136,7 @@ public class TreeTableRidgetTest extends AbstractSWTRidgetTest {
getRidget().setUIControl(new Tree(getShell(), SWT.NONE));
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
@@ -158,7 +158,7 @@ public class TreeTableRidgetTest extends AbstractSWTRidgetTest {
getRidget().bindToModel(roots, PersonNode.class, "children", "parent", properties1, headers1);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
}
@@ -235,14 +235,14 @@ public class TreeTableRidgetTest extends AbstractSWTRidgetTest {
ridget.setComparator(-1, comparator);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
ridget.setComparator(2, comparator);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
ridget.setSortedAscending(true);
@@ -277,7 +277,7 @@ public class TreeTableRidgetTest extends AbstractSWTRidgetTest {
ridget.setSortedColumn(2);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
assertEquals(-1, ridget.getSortedColumn());
@@ -316,14 +316,14 @@ public class TreeTableRidgetTest extends AbstractSWTRidgetTest {
assertFalse(ridget.isColumnSortable(-1));
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
try {
assertFalse(ridget.isColumnSortable(2));
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
for (int i = 0; i < 2; i++) {
@@ -661,7 +661,7 @@ public class TreeTableRidgetTest extends AbstractSWTRidgetTest {
* This method will fully expand the tree to ensure all tree items are
* created.
*/
- private final TreeItem getUIControlItem(int index) {
+ private TreeItem getUIControlItem(int index) {
getRidget().expandAll();
Tree control = getWidget();
switch (index) {
@@ -673,8 +673,9 @@ public class TreeTableRidgetTest extends AbstractSWTRidgetTest {
return control.getItem(0).getItem(0).getItem(0);
case 3:
return control.getItem(0).getItem(1);
+ default:
+ throw new IndexOutOfBoundsException("index= " + index);
}
- throw new IndexOutOfBoundsException("index= " + index);
}
// helping classes
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/NavigationNodeTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/NavigationNodeTest.java
index 9b75e74..4a2baf4 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/NavigationNodeTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/NavigationNodeTest.java
@@ -13,14 +13,13 @@ package org.eclipse.riena.navigation.model;
import java.util.Collection;
import java.util.List;
-import junit.framework.TestCase;
-
import org.eclipse.core.runtime.AssertionFailedException;
import org.eclipse.riena.core.marker.IMarker;
import org.eclipse.riena.core.util.ReflectionUtils;
import org.eclipse.riena.navigation.INavigationNode;
import org.eclipse.riena.navigation.ISimpleNavigationNodeListener;
import org.eclipse.riena.navigation.NavigationNodeId;
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.NonUITestCase;
import org.eclipse.riena.ui.core.marker.DisabledMarker;
import org.eclipse.riena.ui.core.marker.ErrorMarker;
@@ -32,7 +31,7 @@ import org.eclipse.riena.ui.filter.IUIFilter;
* Tests of the class {@code NavigationNode}.
*/
@NonUITestCase
-public class NavigationNodeTest extends TestCase {
+public class NavigationNodeTest extends RienaTestCase {
/**
* Tests the constructor of the
@@ -385,7 +384,7 @@ public class NavigationNodeTest extends TestCase {
node.addChild(null);
fail("NavigationModelFailure expected"); //$NON-NLS-1$
} catch (NavigationModelFailure failure) {
- // expected
+ ok("NavigationModelFailure expected");
}
assertTrue(node.getChildren().isEmpty());
assertFalse(node.isChildAddedCalled());
@@ -406,7 +405,7 @@ public class NavigationNodeTest extends TestCase {
node.addChild(node2);
fail("NavigationModelFailure expected"); //$NON-NLS-1$
} catch (NavigationModelFailure failure) {
- // expected
+ ok("NavigationModelFailure expected");
}
assertTrue(node.getChildren().size() == 1);
assertSame(node2, node.getChildren().get(0));
@@ -423,7 +422,7 @@ public class NavigationNodeTest extends TestCase {
node.addChild(node3);
fail("NavigationModelFailure expected"); //$NON-NLS-1$
} catch (NavigationModelFailure failure) {
- // expected
+ ok("NavigationModelFailure expected");
}
assertTrue(node.getChildren().size() == 1);
assertSame(node2, node.getChildren().get(0));
@@ -435,7 +434,7 @@ public class NavigationNodeTest extends TestCase {
node.addChild(node);
fail("NavigationModelFailure expected"); //$NON-NLS-1$
} catch (NavigationModelFailure failure) {
- // expected
+ ok("NavigationModelFailure expected");
}
// add wrong kind of node
@@ -443,7 +442,7 @@ public class NavigationNodeTest extends TestCase {
getParentNode(ApplicationNode.class).addChild(node);
fail("NavigationModelFailure expected"); //$NON-NLS-1$
} catch (NavigationModelFailure failure) {
- // expected
+ ok("NavigationModelFailure expected");
}
// add correct kind of node
@@ -482,7 +481,7 @@ public class NavigationNodeTest extends TestCase {
node.removeChild(null);
fail("NavigationModelFailure expected"); //$NON-NLS-1$
} catch (NavigationModelFailure failure) {
- // expected
+ ok("NavigationModelFailure expected");
}
assertTrue(node.getChildren().size() == 2);
assertSame(node, node2.getParent());
@@ -512,7 +511,7 @@ public class NavigationNodeTest extends TestCase {
node.removeChild(node2);
fail("NavigationModelFailure expected"); //$NON-NLS-1$
} catch (NavigationModelFailure failure) {
- // expected
+ ok("NavigationModelFailure expected");
}
assertTrue(node.getChildren().size() == 1);
assertSame(node, node2.getParent());
@@ -542,7 +541,7 @@ public class NavigationNodeTest extends TestCase {
node.removeChild(node2);
fail("NavigationModelFailure expected"); //$NON-NLS-1$
} catch (NavigationModelFailure failure) {
- // expected
+ ok("NavigationModelFailure expected");
}
assertTrue(node.getChildren().isEmpty());
assertNull(node2.getParent());
@@ -570,7 +569,7 @@ public class NavigationNodeTest extends TestCase {
node.checkChildClass(null);
fail("Exception expected");
} catch (AssertionFailedException e) {
- // expected
+ ok("Exception expected");
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/controllers/AllTests.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/controllers/AllTests.java
index 851d14a..355bc76 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/controllers/AllTests.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/controllers/AllTests.java
@@ -19,7 +19,10 @@ import org.eclipse.riena.tests.collect.NonGatherableTestCase;
*
*/
@NonGatherableTestCase("This is not a ´TestCase´!")
-public class AllTests {
+public final class AllTests {
+
+ private AllTests() {
+ }
public static Test suite() {
TestSuite suite = new TestSuite("Test for org.eclipse.riena.navigation.ui.controllers");
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/controllers/NavigationNodeControllerTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/controllers/NavigationNodeControllerTest.java
index 848b865..9417702 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/controllers/NavigationNodeControllerTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/controllers/NavigationNodeControllerTest.java
@@ -119,14 +119,14 @@ public class NavigationNodeControllerTest extends TestCase {
LabelRidget ridget2 = new LabelRidget();
controller.addRidget("0815", ridget2);
- Collection<IMarker> markers = ReflectionUtils.invokeHidden(controller, "getRidgetMarkers", null);
+ Collection<IMarker> markers = ReflectionUtils.invokeHidden(controller, "getRidgetMarkers", (Object[]) null);
assertNotNull(markers);
ErrorMarker errorMarker = new ErrorMarker();
ridget.addMarker(errorMarker);
OutputMarker outputMarker = new OutputMarker();
ridget2.addMarker(outputMarker);
- markers = ReflectionUtils.invokeHidden(controller, "getRidgetMarkers", null);
+ markers = ReflectionUtils.invokeHidden(controller, "getRidgetMarkers", (Object[]) null);
assertNotNull(markers);
assertEquals(2, markers.size());
assertTrue(markers.contains(errorMarker));
@@ -138,7 +138,7 @@ public class NavigationNodeControllerTest extends TestCase {
controller.addRidget("comp", compositeRidget);
MandatoryMarker mandatoryMarker = new MandatoryMarker();
ridget3.addMarker(mandatoryMarker);
- markers = ReflectionUtils.invokeHidden(controller, "getRidgetMarkers", null);
+ markers = ReflectionUtils.invokeHidden(controller, "getRidgetMarkers", (Object[]) null);
assertNotNull(markers);
assertEquals(3, markers.size());
assertTrue(markers.contains(mandatoryMarker));
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/binding/DefaultSwtControlRidgetMapperTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/binding/DefaultSwtControlRidgetMapperTest.java
index 05348ba..89762b4 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/binding/DefaultSwtControlRidgetMapperTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/binding/DefaultSwtControlRidgetMapperTest.java
@@ -12,12 +12,11 @@ package org.eclipse.riena.navigation.ui.swt.binding;
import java.beans.PropertyChangeListener;
-import junit.framework.TestCase;
-
import org.eclipse.core.databinding.BindingException;
import org.eclipse.riena.internal.ui.ridgets.swt.ActionRidget;
import org.eclipse.riena.internal.ui.ridgets.swt.LabelRidget;
import org.eclipse.riena.internal.ui.ridgets.swt.ToggleButtonRidget;
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.UITestCase;
import org.eclipse.riena.ui.ridgets.IRidget;
import org.eclipse.riena.ui.ridgets.listener.IFocusListener;
@@ -34,7 +33,7 @@ import org.eclipse.swt.widgets.Shell;
* Tests of the class <code>DefaultSwtControlRidgetMapper</code>
*/
@UITestCase
-public class DefaultSwtControlRidgetMapperTest extends TestCase {
+public class DefaultSwtControlRidgetMapperTest extends RienaTestCase {
private DefaultSwtControlRidgetMapper mapper;
private Shell shell;
@@ -129,7 +128,7 @@ public class DefaultSwtControlRidgetMapperTest extends TestCase {
ridgetClass = mapper.getRidgetClass(widget);
fail();
} catch (BindingException bex) {
- // expected: no matching widget
+ ok();
}
} finally {
widget.dispose();
@@ -152,6 +151,7 @@ public class DefaultSwtControlRidgetMapperTest extends TestCase {
ridget = mapper.getRidgetClass(MockComposite.class);
fail("BindingException expected");
} catch (BindingException e) {
+ ok("BindingException expected");
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/component/SubApplicationSwitcherWidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/component/SubApplicationSwitcherWidgetTest.java
index fb9de90..a555897 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/component/SubApplicationSwitcherWidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/component/SubApplicationSwitcherWidgetTest.java
@@ -60,7 +60,8 @@ public class SubApplicationSwitcherWidgetTest extends TestCase {
IApplicationNode node = new ApplicationNode();
SubApplicationNode subNode1 = new SubApplicationNode("sub1");
subNode1.setIcon("icon1");
- List<SubApplicationNodeListener> listeners = ReflectionUtils.invokeHidden(subNode1, "getListeners", null);
+ List<SubApplicationNodeListener> listeners = ReflectionUtils.invokeHidden(subNode1, "getListeners",
+ (Object[]) null);
assertNotNull(listeners);
assertTrue(listeners.isEmpty());
node.addChild(subNode1);
@@ -69,7 +70,7 @@ public class SubApplicationSwitcherWidgetTest extends TestCase {
node.addChild(subNode2);
switcher = new SubApplicationSwitcherWidget(shell, SWT.NONE, node);
- List<SubApplicationItem> items = ReflectionUtils.invokeHidden(switcher, "getItems", null);
+ List<SubApplicationItem> items = ReflectionUtils.invokeHidden(switcher, "getItems", (Object[]) null);
assertNotNull(items);
assertEquals(2, items.size());
assertEquals("sub1", items.get(0).getLabel());
@@ -77,7 +78,7 @@ public class SubApplicationSwitcherWidgetTest extends TestCase {
assertEquals("icon1", items.get(0).getIcon());
assertEquals("icon2", items.get(1).getIcon());
- listeners = ReflectionUtils.invokeHidden(subNode1, "getListeners", null);
+ listeners = ReflectionUtils.invokeHidden(subNode1, "getListeners", (Object[]) null);
assertNotNull(listeners);
assertFalse(listeners.isEmpty());
assertEquals(1, listeners.size());
@@ -125,7 +126,7 @@ public class SubApplicationSwitcherWidgetTest extends TestCase {
SubApplicationNode node = new SubApplicationNode();
SubApplicationItem item = new SubApplicationItem(switcher, node);
- List<SubApplicationItem> items = ReflectionUtils.invokeHidden(switcher, "getItems", null);
+ List<SubApplicationItem> items = ReflectionUtils.invokeHidden(switcher, "getItems", (Object[]) null);
Point point = new Point(0, 0);
SubApplicationItem retItem = ReflectionUtils.invokeHidden(switcher, "getItem", new Object[] { point });
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/lnf/renderer/SubModuleTreeItemMarkerRendererTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/lnf/renderer/SubModuleTreeItemMarkerRendererTest.java
index 8f1868c..d813e06 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/lnf/renderer/SubModuleTreeItemMarkerRendererTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/lnf/renderer/SubModuleTreeItemMarkerRendererTest.java
@@ -14,12 +14,11 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
-import junit.framework.TestCase;
-
import org.eclipse.core.runtime.AssertionFailedException;
import org.eclipse.riena.core.util.ReflectionUtils;
import org.eclipse.riena.navigation.model.NavigationProcessor;
import org.eclipse.riena.navigation.model.SubModuleNode;
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.UITestCase;
import org.eclipse.riena.ui.core.marker.ErrorMarker;
import org.eclipse.riena.ui.core.marker.IIconizableMarker;
@@ -40,7 +39,7 @@ import org.eclipse.swt.widgets.TreeItem;
* Tests of the class {@link SubModuleTreeItemMarkerRenderer}.
*/
@UITestCase
-public class SubModuleTreeItemMarkerRendererTest extends TestCase {
+public class SubModuleTreeItemMarkerRendererTest extends RienaTestCase {
private Shell shell;
private GC gc;
@@ -83,21 +82,21 @@ public class SubModuleTreeItemMarkerRendererTest extends TestCase {
renderer.paint(gc, null);
fail("AssertionFailedException expected");
} catch (AssertionFailedException e) {
- // ok, expected
+ ok("AssertionFailedException expected");
}
try {
renderer.paint(gc, shell);
fail("AssertionFailedException expected");
} catch (AssertionFailedException e) {
- // ok, expected
+ ok("AssertionFailedException expected");
}
try {
renderer.paint(null, item);
fail("AssertionFailedException expected");
} catch (AssertionFailedException e) {
- // ok, expected
+ ok("AssertionFailedException expected");
}
renderer.resetPaintMarkersCalled();
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/viewprovider/AllTests.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/viewprovider/AllTests.java
index b97a6d5..f85c56c 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/viewprovider/AllTests.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/viewprovider/AllTests.java
@@ -19,7 +19,10 @@ import org.eclipse.riena.tests.collect.NonGatherableTestCase;
*
*/
@NonGatherableTestCase("This is not a ´TestCase´!")
-public class AllTests {
+public final class AllTests {
+
+ private AllTests() {
+ }
public static Test suite() {
TestSuite suite = new TestSuite("Test for org.eclipse.riena.navigation.ui.swt.viewprovider");
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/viewprovider/SwtViewIdTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/viewprovider/SwtViewIdTest.java
index 4f7922d..760aee4 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/viewprovider/SwtViewIdTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/viewprovider/SwtViewIdTest.java
@@ -10,16 +10,15 @@
*******************************************************************************/
package org.eclipse.riena.navigation.ui.swt.viewprovider;
-import junit.framework.TestCase;
-
import org.eclipse.riena.navigation.ui.swt.presentation.SwtViewId;
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.NonUITestCase;
/**
* Test of the class <code>SwtViewId</code>.
*/
@NonUITestCase
-public class SwtViewIdTest extends TestCase {
+public class SwtViewIdTest extends RienaTestCase {
/**
* Tests the constructor <code>SwtViewId(String,String)</code>
@@ -45,21 +44,21 @@ public class SwtViewIdTest extends TestCase {
new SwtViewId(null);
fail("Exception expected");
} catch (RuntimeException e) {
- // expected
+ ok("Exception expected");
}
try {
new SwtViewId("ab");
fail("Exception expected");
} catch (RuntimeException e) {
- // expected
+ ok("Exception expected");
}
try {
new SwtViewId(null);
fail("Exception expected");
} catch (RuntimeException e) {
- // expected
+ ok("Exception expected");
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/AbstractViewBindingDelegateTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/AbstractViewBindingDelegateTest.java
index 5f7c456..6233c2f 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/AbstractViewBindingDelegateTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/AbstractViewBindingDelegateTest.java
@@ -65,7 +65,7 @@ public class AbstractViewBindingDelegateTest extends TestCase {
* @param propertyStrategy
* @param mapper
*/
- public MyViewBindingDelegate(IBindingPropertyLocator propertyStrategy, IControlRidgetMapper mapper) {
+ public MyViewBindingDelegate(IBindingPropertyLocator propertyStrategy, IControlRidgetMapper<Object> mapper) {
super(propertyStrategy, mapper);
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/AllTests.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/AllTests.java
index 0f3fbf3..36f01d6 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/AllTests.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/AllTests.java
@@ -19,7 +19,10 @@ import org.eclipse.riena.tests.collect.NonGatherableTestCase;
*
*/
@NonGatherableTestCase("This is not a ´TestCase´!")
-public class AllTests {
+public final class AllTests {
+
+ private AllTests() {
+ }
public static Test suite() {
TestSuite suite = new TestSuite("Test for org.eclipse.riena.navigation.ui.swt.views");
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/objecttransaction/simple/ObjectTransactionVariousSimpleTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/objecttransaction/simple/ObjectTransactionVariousSimpleTest.java
index 22046e5..a2b5333 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/objecttransaction/simple/ObjectTransactionVariousSimpleTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/objecttransaction/simple/ObjectTransactionVariousSimpleTest.java
@@ -498,8 +498,7 @@ public class ObjectTransactionVariousSimpleTest extends RienaTestCase {
extract.addCleanTransactedObject(kunde);
fail();
} catch (AssertionFailedException e) {
- // ok(); expected exception TODO check if we should add that to
- // RienaTestCase
+ ok();
}
}
@@ -628,7 +627,7 @@ public class ObjectTransactionVariousSimpleTest extends RienaTestCase {
objectTransaction2.importOnlyModifedObjectsFromExtract(extract);
fail();
} catch (InvalidTransactionFailure e) {
- // ok(); expected behaviour TODO
+ ok();
}
}
@@ -663,7 +662,7 @@ public class ObjectTransactionVariousSimpleTest extends RienaTestCase {
objectTransaction2.importOnlyModifedObjectsFromExtract(extract);
fail();
} catch (InvalidTransactionFailure e) {
- // ok(); expected behaviour TODO
+ ok();
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/security/authentication/LoginModuleTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/security/authentication/LoginModuleTest.java
index e1bcab2..759db67 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/security/authentication/LoginModuleTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/security/authentication/LoginModuleTest.java
@@ -66,9 +66,9 @@ public class LoginModuleTest extends RienaTestCase {
secureContext.login();
- assertTrue("login MUST fail since the password is wrong", true);
+ fail("login MUST fail since the password is wrong");
} catch (LoginException e) {
- // expecting an exception
+ ok("expecting an exception");
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authentication/AuthenticationClientITest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authentication/AuthenticationClientITest.java
index 8da5b0f..00580c7 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authentication/AuthenticationClientITest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authentication/AuthenticationClientITest.java
@@ -117,7 +117,7 @@ public class AuthenticationClientITest extends RienaTestCase {
authenticationService.login("Test", creds);
fail("exception expected");
} catch (AuthenticationFailure e) {
- // ok();
+ ok("exception expected");
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authorization/AuthorizationServiceITest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authorization/AuthorizationServiceITest.java
index f66ac43..7a3410d 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authorization/AuthorizationServiceITest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authorization/AuthorizationServiceITest.java
@@ -123,7 +123,7 @@ public class AuthorizationServiceITest extends RienaTestCase {
// assertTrue(foundCustomers.length > 0);
// assertTrue(foundCustomers[0].getLastName().equals("Solo"));
} catch (AccessControlException ex) {
- // expected exception
+ ok("expected exception");
}
as.logout();
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/tests/RienaTestCase.java b/org.eclipse.riena.tests/src/org/eclipse/riena/tests/RienaTestCase.java
index c8eb39c..b8ba93e 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/tests/RienaTestCase.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/tests/RienaTestCase.java
@@ -63,6 +63,31 @@ public abstract class RienaTestCase extends TestCase {
this.context = Activator.getDefault().getContext();
}
+ /**
+ * A counterpart to Assert.fail() that may be invoked to indicate that
+ * everything is fine and that the test should continue. May be used e.g. in
+ * an otherwise empty catch block that handles an expected exception. In
+ * this use case its advantages over a comment are that it allows a more
+ * uniform way of documentation than the numerous variations of "// ignore"
+ * and that it avoids a Checkstyle warning about the empty block.
+ */
+ protected void ok() {
+ // nothing to do, everything is OK...
+ }
+
+ /**
+ * A counterpart to Assert.fail(String) that may be invoked to indicate that
+ * everything is fine and that the test should continue.
+ *
+ * @see #ok()
+ *
+ * @param message
+ * A message explaining why nothing is wrong.
+ */
+ protected void ok(String message) {
+ ok();
+ }
+
/*
* @see junit.framework.TestCase#setUp()
*/
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/ValueBindingSupportTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/ValueBindingSupportTest.java
index f40ade1..6d56268 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/ValueBindingSupportTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/ValueBindingSupportTest.java
@@ -14,8 +14,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
-import junit.framework.TestCase;
-
import org.eclipse.core.databinding.beans.BeansObservables;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.databinding.observable.value.WritableValue;
@@ -23,6 +21,7 @@ import org.eclipse.core.databinding.validation.IValidator;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.riena.core.marker.IMarkable;
import org.eclipse.riena.core.marker.Markable;
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.NonUITestCase;
import org.eclipse.riena.ui.core.marker.ErrorMarker;
import org.eclipse.riena.ui.core.marker.ErrorMessageMarker;
@@ -37,7 +36,7 @@ import org.eclipse.riena.ui.ridgets.validation.ValidationRuleStatus;
* Tests for the ValueBindingSupport.
*/
@NonUITestCase
-public class ValueBindingSupportTest extends TestCase {
+public class ValueBindingSupportTest extends RienaTestCase {
private DefaultRealm realm;
private ValueBindingSupport valueBindingSupport;
@@ -253,7 +252,7 @@ public class ValueBindingSupportTest extends TestCase {
valueBindingSupport.addValidationRule(null, ValidationTime.ON_UPDATE_TO_MODEL);
fail();
} catch (RuntimeException rex) {
- // expected
+ ok();
}
boolean result = valueBindingSupport.removeValidationRule(null);
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/databinding/AllTests.java b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/databinding/AllTests.java
index 67081c8..db34ec6 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/databinding/AllTests.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/databinding/AllTests.java
@@ -19,7 +19,10 @@ import org.eclipse.riena.tests.collect.NonGatherableTestCase;
* All tests of the package org.eclipse.riena.ui.ridgets.databinding.
*/
@NonGatherableTestCase("This is not a ´TestCase´!")
-public class AllTests {
+public final class AllTests {
+
+ private AllTests() {
+ }
public static Test suite() {
TestSuite suite = new TestSuite("Test for org.eclipse.riena.ui.ridgets.databinding");
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/marker/AllTests.java b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/marker/AllTests.java
index 7b91dfc..4675ba2 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/marker/AllTests.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/marker/AllTests.java
@@ -19,7 +19,10 @@ import org.eclipse.riena.tests.collect.NonGatherableTestCase;
* All tests of the package org.eclipse.riena.ui.ridgets.marker.
*/
@NonGatherableTestCase("This is not a ´TestCase´!")
-public class AllTests {
+public final class AllTests {
+
+ private AllTests() {
+ }
public static Test suite() {
TestSuite suite = new TestSuite("Test for org.eclipse.riena.ui.ridgets.marker");
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/tree2/AllTests.java b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/tree2/AllTests.java
index 6b53806..a1116e2 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/tree2/AllTests.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/tree2/AllTests.java
@@ -19,7 +19,10 @@ import org.eclipse.riena.tests.collect.NonGatherableTestCase;
* All tests of the package org.eclipse.riena.ui.ridgets.tree2.
*/
@NonGatherableTestCase("This is not a ´TestCase´!")
-public class AllTests {
+public final class AllTests {
+
+ private AllTests() {
+ }
public static Test suite() {
TestSuite suite = new TestSuite("Test for org.eclipse.riena.ui.ridgets.tree2");
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/tree2/TreeNodeTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/tree2/TreeNodeTest.java
index a32963b..204e3a8 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/tree2/TreeNodeTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/tree2/TreeNodeTest.java
@@ -152,12 +152,12 @@ public class TreeNodeTest extends TestCase {
return PropertyChangeEventEquals.eqPropertyChangeEvent(propertyChangeEvent);
}
- private final void expectNoPropertyChangeEvent() {
+ private void expectNoPropertyChangeEvent() {
EasyMock.reset(propertyChangeListenerMock);
EasyMock.replay(propertyChangeListenerMock);
}
- private final void expectPropertyChangeEvents(PropertyChangeEvent... propertyChangeEvents) {
+ private void expectPropertyChangeEvents(PropertyChangeEvent... propertyChangeEvents) {
EasyMock.reset(propertyChangeListenerMock);
for (PropertyChangeEvent propertyChangeEvent : propertyChangeEvents) {
propertyChangeListenerMock.propertyChange(createArgumentMatcher(propertyChangeEvent));
@@ -165,11 +165,11 @@ public class TreeNodeTest extends TestCase {
EasyMock.replay(propertyChangeListenerMock);
}
- private final void expectPropertyChangeEvent(Object bean, String propertyName, Object oldValue, Object newValue) {
+ private void expectPropertyChangeEvent(Object bean, String propertyName, Object oldValue, Object newValue) {
expectPropertyChangeEvents(new PropertyChangeEvent(bean, propertyName, oldValue, newValue));
}
- private final void verifyPropertyChangeEvents() {
+ private void verifyPropertyChangeEvents() {
EasyMock.verify(propertyChangeListenerMock);
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/MinLengthTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/MinLengthTest.java
index 53adc75..c912f58 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/MinLengthTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/MinLengthTest.java
@@ -10,8 +10,7 @@
*******************************************************************************/
package org.eclipse.riena.ui.ridgets.validation.tests;
-import junit.framework.TestCase;
-
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.NonUITestCase;
import org.eclipse.riena.ui.ridgets.validation.MinLength;
import org.eclipse.riena.ui.ridgets.validation.ValidationFailure;
@@ -20,7 +19,7 @@ import org.eclipse.riena.ui.ridgets.validation.ValidationFailure;
* Tests for the MinLength rule.
*/
@NonUITestCase
-public class MinLengthTest extends TestCase {
+public class MinLengthTest extends RienaTestCase {
/**
* @throws Exception
@@ -33,7 +32,7 @@ public class MinLengthTest extends TestCase {
rule.validate(new Object());
fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("ValidationFailure expected");
}
assertTrue(rule.validate("0123456789ab").isOK());
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidCharactersTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidCharactersTest.java
index d710052..b4f8287 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidCharactersTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidCharactersTest.java
@@ -10,8 +10,7 @@
*******************************************************************************/
package org.eclipse.riena.ui.ridgets.validation.tests;
-import junit.framework.TestCase;
-
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.NonUITestCase;
import org.eclipse.riena.ui.ridgets.validation.ValidCharacters;
import org.eclipse.riena.ui.ridgets.validation.ValidationFailure;
@@ -20,7 +19,7 @@ import org.eclipse.riena.ui.ridgets.validation.ValidationFailure;
* Tests for the ValidCharacters rule.
*/
@NonUITestCase
-public class ValidCharactersTest extends TestCase {
+public class ValidCharactersTest extends RienaTestCase {
/**
* @throws Exception
@@ -44,7 +43,7 @@ public class ValidCharactersTest extends TestCase {
rule.validate(new Object());
fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("expected a thrown ValidationFailure");
}
final ValidCharacters nullRule = new ValidCharacters(null);
@@ -62,7 +61,7 @@ public class ValidCharactersTest extends TestCase {
nullRule.validate(new Object());
fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("expected a thrown ValidationFailure");
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidDateTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidDateTest.java
index 52e1b91..91f9b5e 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidDateTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidDateTest.java
@@ -10,8 +10,7 @@
*******************************************************************************/
package org.eclipse.riena.ui.ridgets.validation.tests;
-import junit.framework.TestCase;
-
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.NonUITestCase;
import org.eclipse.riena.ui.ridgets.validation.ValidDate;
import org.eclipse.riena.ui.ridgets.validation.ValidationFailure;
@@ -20,7 +19,7 @@ import org.eclipse.riena.ui.ridgets.validation.ValidationFailure;
* Tests for the ValidDate rule.
*/
@NonUITestCase
-public class ValidDateTest extends TestCase {
+public class ValidDateTest extends RienaTestCase {
/**
* Checks for validity of an input string against the date format DDMMYYYY
@@ -104,7 +103,7 @@ public class ValidDateTest extends TestCase {
rule.validate(new Object());
fail("expected thrown ValidationFailure.");
} catch (final ValidationFailure e) {
- // passed
+ ok("expected thrown ValidationFailure.");
} catch (final RuntimeException e) {
fail("expected ValidationFailure instead of " + e.getClass().getName());
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidDecimalTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidDecimalTest.java
index 31d8f4b..438a26e 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidDecimalTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidDecimalTest.java
@@ -15,9 +15,8 @@ import java.text.NumberFormat;
import java.text.ParseException;
import java.util.Locale;
-import junit.framework.TestCase;
-
import org.eclipse.riena.core.util.ReflectionUtils;
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.NonUITestCase;
import org.eclipse.riena.ui.ridgets.validation.ValidDecimal;
import org.eclipse.riena.ui.ridgets.validation.ValidationFailure;
@@ -26,7 +25,7 @@ import org.eclipse.riena.ui.ridgets.validation.ValidationFailure;
* Tests for the ValidCharacters rule.
*/
@NonUITestCase
-public class ValidDecimalTest extends TestCase {
+public class ValidDecimalTest extends RienaTestCase {
/**
* @throws Exception
@@ -103,7 +102,7 @@ public class ValidDecimalTest extends TestCase {
rule.validate(new Object());
fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("expected a thrown ValidationFailure");
}
}
@@ -168,7 +167,7 @@ public class ValidDecimalTest extends TestCase {
rule.validate(new Object());
fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("expected a thrown ValidationFailure");
}
}
@@ -236,7 +235,7 @@ public class ValidDecimalTest extends TestCase {
rule.validate(new Object());
fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("expected a thrown ValidationFailure");
}
}
@@ -305,7 +304,7 @@ public class ValidDecimalTest extends TestCase {
rule.validate(new Object());
fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("expected a thrown ValidationFailure");
}
}
@@ -350,7 +349,7 @@ public class ValidDecimalTest extends TestCase {
rule.validate(new Object());
fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("expected a thrown ValidationFailure");
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidEmailAddressTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidEmailAddressTest.java
index ee19c4d..c50fa39 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidEmailAddressTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidEmailAddressTest.java
@@ -10,9 +10,8 @@
*******************************************************************************/
package org.eclipse.riena.ui.ridgets.validation.tests;
-import junit.framework.TestCase;
-
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.NonUITestCase;
import org.eclipse.riena.ui.ridgets.validation.IValidationRuleStatus;
import org.eclipse.riena.ui.ridgets.validation.ValidEmailAddress;
@@ -24,7 +23,7 @@ import org.eclipse.riena.ui.ridgets.validation.ValidationFailure;
* @author Wanja Gayk
*/
@NonUITestCase
-public class ValidEmailAddressTest extends TestCase {
+public class ValidEmailAddressTest extends RienaTestCase {
/**
* @throws Exception
@@ -91,7 +90,7 @@ public class ValidEmailAddressTest extends TestCase {
new ValidEmailAddress().validate(new Object());
fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure e) {
- // passed
+ ok("expected a thrown ValidationFailure");
} catch (final RuntimeException e) {
fail("expected a " + ValidationFailure.class.getName());
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidIntegerTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidIntegerTest.java
index e304031..3431c74 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidIntegerTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidIntegerTest.java
@@ -15,8 +15,7 @@ import java.text.NumberFormat;
import java.text.ParseException;
import java.util.Locale;
-import junit.framework.TestCase;
-
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.NonUITestCase;
import org.eclipse.riena.ui.ridgets.validation.ValidInteger;
import org.eclipse.riena.ui.ridgets.validation.ValidationFailure;
@@ -25,7 +24,7 @@ import org.eclipse.riena.ui.ridgets.validation.ValidationFailure;
* Tests for the ValidCharacters rule.
*/
@NonUITestCase
-public class ValidIntegerTest extends TestCase {
+public class ValidIntegerTest extends RienaTestCase {
/**
* @throws Exception
@@ -38,7 +37,7 @@ public class ValidIntegerTest extends TestCase {
rule.validate(new Object());
fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("expected a thrown ValidationFailure");
}
assertTrue(rule.validate(null).isOK());
@@ -88,7 +87,7 @@ public class ValidIntegerTest extends TestCase {
rule.validate(new Object());
fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("expected a thrown ValidationFailure");
}
assertTrue(rule.validate(null).isOK());
@@ -138,7 +137,7 @@ public class ValidIntegerTest extends TestCase {
rule.validate(new Object());
fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("expected a thrown ValidationFailure");
}
assertTrue(rule.validate(null).isOK());
@@ -188,7 +187,7 @@ public class ValidIntegerTest extends TestCase {
rule.validate(new Object());
fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("expected a thrown ValidationFailure");
}
assertTrue(rule.validate(null).isOK());
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidatorCollectionTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidatorCollectionTest.java
index 8bbda8e..fff1b2b 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidatorCollectionTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidatorCollectionTest.java
@@ -10,10 +10,9 @@
*******************************************************************************/
package org.eclipse.riena.ui.ridgets.validation.tests;
-import junit.framework.TestCase;
-
import org.eclipse.core.databinding.validation.IValidator;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.riena.tests.RienaTestCase;
import org.eclipse.riena.tests.collect.NonUITestCase;
import org.eclipse.riena.ui.ridgets.validation.ValidationFailure;
import org.eclipse.riena.ui.ridgets.validation.ValidationRuleStatus;
@@ -23,7 +22,7 @@ import org.eclipse.riena.ui.ridgets.validation.ValidatorCollection;
* Tests for the MinLength rule.
*/
@NonUITestCase
-public class ValidatorCollectionTest extends TestCase {
+public class ValidatorCollectionTest extends RienaTestCase {
private static final IValidator ALWAYS_SUCCEED_1 = new IValidator() {
public IStatus validate(final Object value) {
@@ -128,21 +127,21 @@ public class ValidatorCollectionTest extends TestCase {
rule.add(ALWAYS_THROW_EXCEPTION);
try {
rule.validate(new Object());
- fail("expected a thrown " + ValidationFailure.class.getName());
+ fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("expected a thrown ValidationFailure");
} catch (RuntimeException e) {
- fail("expected a thrown " + ValidationFailure.class.getName());
+ fail("expected a thrown ValidationFailure instead");
}
// two exception throwing rules
rule.add(ALWAYS_THROW_EXCEPTION);
try {
rule.validate(new Object());
- fail("expected a thrown " + ValidationFailure.class.getName());
+ fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("expected a thrown ValidationFailure");
} catch (RuntimeException e) {
- fail("expected a thrown " + ValidationFailure.class.getName());
+ fail("expected a thrown ValidationFailure instead");
}
rule = new ValidatorCollection();
@@ -150,11 +149,11 @@ public class ValidatorCollectionTest extends TestCase {
rule.add(ALWAYS_THROW_EXCEPTION);
try {
rule.validate(new Object());
- fail("expected a thrown " + ValidationFailure.class.getName());
+ fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("expected a thrown ValidationFailure");
} catch (RuntimeException e) {
- fail("expected a thrown " + ValidationFailure.class.getName());
+ fail("expected a thrown ValidationFailure instead");
}
rule = new ValidatorCollection();
@@ -162,11 +161,11 @@ public class ValidatorCollectionTest extends TestCase {
rule.add(ALWAYS_SUCCEED_1);
try {
rule.validate(new Object());
- fail("expected a thrown " + ValidationFailure.class.getName());
+ fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("expected a thrown ValidationFailure");
} catch (RuntimeException e) {
- fail("expected a thrown " + ValidationFailure.class.getName());
+ fail("expected a thrown ValidationFailure instead");
}
rule = new ValidatorCollection();
@@ -174,11 +173,11 @@ public class ValidatorCollectionTest extends TestCase {
rule.add(ALWAYS_THROW_EXCEPTION);
try {
rule.validate(new Object());
- fail("expected a thrown " + ValidationFailure.class.getName());
+ fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("expected a thrown ValidationFailure");
} catch (RuntimeException e) {
- fail("expected a thrown " + ValidationFailure.class.getName());
+ fail("expected a thrown ValidationFailure instead");
}
rule = new ValidatorCollection();
@@ -187,11 +186,11 @@ public class ValidatorCollectionTest extends TestCase {
rule.add(ALWAYS_FAIL_1);
try {
rule.validate(new Object());
- fail("expected a thrown " + ValidationFailure.class.getName());
+ fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("expected a thrown ValidationFailure");
} catch (RuntimeException e) {
- fail("expected a thrown " + ValidationFailure.class.getName());
+ fail("expected a thrown ValidationFailure instead");
}
rule = new ValidatorCollection();
@@ -200,11 +199,11 @@ public class ValidatorCollectionTest extends TestCase {
rule.add(ALWAYS_SUCCEED_1);
try {
rule.validate(new Object());
- fail("expected a thrown " + ValidationFailure.class.getName());
+ fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("expected a thrown ValidationFailure");
} catch (RuntimeException e) {
- fail("expected a thrown " + ValidationFailure.class.getName());
+ fail("expected a thrown ValidationFailure instead");
}
rule = new ValidatorCollection();
@@ -213,11 +212,11 @@ public class ValidatorCollectionTest extends TestCase {
rule.add(ALWAYS_THROW_EXCEPTION);
try {
rule.validate(new Object());
- fail("expected a thrown " + ValidationFailure.class.getName());
+ fail("expected a thrown ValidationFailure");
} catch (final ValidationFailure f) {
- // test passed
+ ok("expected a thrown ValidationFailure");
} catch (RuntimeException e) {
- fail("expected a thrown " + ValidationFailure.class.getName());
+ fail("expected a thrown ValidationFailure instead");
}
}