summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2008-08-19 07:53:03 (EDT)
committerCarsten Drossel2008-08-19 07:53:03 (EDT)
commit3aa2517a446c329af53c5d0c098eb3291237f45c (patch)
treee9b3a4aebe5055c3b109eab54a7d5ae13fe2cc66
parenta9d035371c6a750c39aa458dc4583d000bc9d814 (diff)
downloadorg.eclipse.riena-3aa2517a446c329af53c5d0c098eb3291237f45c.zip
org.eclipse.riena-3aa2517a446c329af53c5d0c098eb3291237f45c.tar.gz
org.eclipse.riena-3aa2517a446c329af53c5d0c098eb3291237f45c.tar.bz2
handled compiler & check-style warnings
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/ExtensionInjectorTest.java18
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/IInitializerDesc.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/IModifierDesc.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/IScopeDesc.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/service/Target.java6
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTRidgetTest.java36
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ComboRidgetTest.java62
-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/TreeRidgetLabelProviderTest.java9
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/preferences/PreferencesTest.java3
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/security/common/Callback2CredentialConverterTest.java4
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/tests/RienaTestCase.java30
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/tests/TestUtils.java4
13 files changed, 97 insertions, 85 deletions
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 15ea798..928a01d 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
@@ -199,7 +199,7 @@ public class ExtensionInjectorTest extends RienaTestCase {
assertEquals(2.7182818284590452d, target.getData().getDoubleNumber());
assertEquals(3.14159f, target.getData().getFloatNumber());
assertEquals(123, target.getData().getIntegerNumber());
- assertEquals(1234567890l, target.getData().getLongNumber());
+ assertEquals(1234567890L, target.getData().getLongNumber());
assertEquals(1, target.getData().getShortNumber());
assertEquals('#', target.getData().getDelimCharacter());
@@ -425,14 +425,15 @@ public class ExtensionInjectorTest extends RienaTestCase {
getContext());
assertEquals(3, target.getExtData().length);
for (IExtData data : target.getExtData()) {
- if (data.getTest()[0].getText().equals("test1"))
+ if (data.getTest()[0].getText().equals("test1")) {
assertEquals("java.lang.String", data.getTest()[0].createObjectType().getClass().getName());
- else if (data.getTest()[0].getText().equals("test2"))
+ } else if (data.getTest()[0].getText().equals("test2")) {
assertEquals("java.util.HashMap", data.getTest()[0].createObjectType().getClass().getName());
- else if (data.getTest()[0].getText().equals("test3"))
+ } else if (data.getTest()[0].getText().equals("test3")) {
assertEquals("java.util.ArrayList", data.getTest()[0].createObjectType().getClass().getName());
- else
+ } else {
fail("Argh!");
+ }
}
removeExtension("core.test.extpoint.id1");
removeExtension("core.test.extpoint.id2");
@@ -452,12 +453,13 @@ public class ExtensionInjectorTest extends RienaTestCase {
for (IExtData extData : target.getExtData()) {
assertEquals(2, extData.getTest().length);
for (IData data : extData.getTest()) {
- if (data.getText().equals("test-a1"))
+ if (data.getText().equals("test-a1")) {
assertEquals("java.lang.String", data.createObjectType().getClass().getName());
- else if (data.getText().equals("test-a2"))
+ } else if (data.getText().equals("test-a2")) {
assertEquals("java.lang.StringBuffer", data.createObjectType().getClass().getName());
- else
+ } else {
fail("Argh!");
+ }
}
}
removeExtension("core.test.extpoint.id-a");
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/IInitializerDesc.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/IInitializerDesc.java
index fb62c2b..66588c0 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/IInitializerDesc.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/IInitializerDesc.java
@@ -11,8 +11,6 @@
package org.eclipse.riena.core.extension;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.riena.core.extension.MapContributor;
-import org.eclipse.riena.core.extension.MapName;
import org.osgi.framework.Bundle;
/**
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/IModifierDesc.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/IModifierDesc.java
index 03c79c4..8b5d91a 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/IModifierDesc.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/IModifierDesc.java
@@ -11,8 +11,6 @@
package org.eclipse.riena.core.extension;
import org.eclipse.core.runtime.preferences.PreferenceModifyListener;
-import org.eclipse.riena.core.extension.MapContributor;
-import org.eclipse.riena.core.extension.MapName;
import org.osgi.framework.Bundle;
/**
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/IScopeDesc.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/IScopeDesc.java
index b72cbc6..49cf712 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/IScopeDesc.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/IScopeDesc.java
@@ -11,8 +11,6 @@
package org.eclipse.riena.core.extension;
import org.eclipse.core.runtime.preferences.IScope;
-import org.eclipse.riena.core.extension.MapContributor;
-import org.eclipse.riena.core.extension.MapName;
import org.osgi.framework.Bundle;
/**
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/service/Target.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/service/Target.java
index a84faba..983f5b7 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/service/Target.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/service/Target.java
@@ -84,8 +84,9 @@ public class Target {
public int count(String method, Class<?> clazz) {
List<Class<?>> deps4method = deps.get(key(method, clazz));
- if (deps4method != null)
+ if (deps4method != null) {
return deps4method.size();
+ }
return 0;
}
@@ -104,8 +105,9 @@ public class Target {
private void remove(String method, Class<?> depClass) {
List<Class<?>> deps4method = deps.get(key(method, depClass));
- if (deps4method != null)
+ if (deps4method != null) {
deps4method.remove(depClass);
+ }
}
private String key(String methodKey, Class<?> type) {
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 fa83c27..4adc68a 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
@@ -146,51 +146,51 @@ public abstract class AbstractSWTRidgetTest extends TestCase {
assertEquals("foo", ridget.getToolTipText());
- Control control = getUIControl();
- control.setToolTipText(null);
- ridget.setUIControl(control);
+ Control aControl = getUIControl();
+ aControl.setToolTipText(null);
+ ridget.setUIControl(aControl);
assertEquals("foo", ridget.getToolTipText());
assertEquals("foo", ((Control) ridget.getUIControl()).getToolTipText());
}
public void testGetFocusable() {
- IRidget ridget = getRidget();
+ IRidget aRidget = getRidget();
- assertTrue(ridget.isFocusable());
+ assertTrue(aRidget.isFocusable());
- ridget.setFocusable(false);
+ aRidget.setFocusable(false);
- assertFalse(ridget.isFocusable());
+ assertFalse(aRidget.isFocusable());
- ridget.setFocusable(true);
+ aRidget.setFocusable(true);
- assertTrue(ridget.isFocusable());
+ assertTrue(aRidget.isFocusable());
}
public void testSetFocusable() {
- IRidget ridget = getRidget();
- Control control = getUIControl();
- otherControl.moveAbove(control);
+ IRidget aRidget = getRidget();
+ Control aControl = getUIControl();
+ otherControl.moveAbove(aControl);
- control.setFocus();
- if (control.isFocusControl()) { // skip if control cannot receive focus
+ aControl.setFocus();
+ if (aControl.isFocusControl()) { // skip if control cannot receive focus
- ridget.setFocusable(false);
+ aRidget.setFocusable(false);
otherControl.setFocus();
assertTrue(otherControl.isFocusControl());
UITestHelper.sendString(otherControl.getDisplay(), "\t");
- assertFalse(control.isFocusControl());
+ assertFalse(aControl.isFocusControl());
- ridget.setFocusable(true);
+ aRidget.setFocusable(true);
otherControl.setFocus();
UITestHelper.sendString(otherControl.getDisplay(), "\t");
- assertTrue(control.isFocusControl());
+ assertTrue(aControl.isFocusControl());
}
}
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 74dfe86..6abfba0 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
@@ -104,8 +104,8 @@ public class ComboRidgetTest extends AbstractSWTRidgetTest {
public void testGetEmptySelectionItem() {
Combo control = getUIControl();
ComboRidget ridget = getRidget();
- StringManager manager = new StringManager("A", "B", "C", "D", "E");
- ridget.bindToModel(manager, "items", String.class, null, manager, "selectedItem");
+ StringManager aManager = new StringManager("A", "B", "C", "D", "E");
+ ridget.bindToModel(aManager, "items", String.class, null, aManager, "selectedItem");
ridget.updateFromModel();
assertNull(ridget.getEmptySelectionItem());
@@ -210,12 +210,12 @@ public class ComboRidgetTest extends AbstractSWTRidgetTest {
}
public void testBindToModelWithStrings() {
- final StringManager manager = new StringManager("A", "B", "C", "D", "E");
- Iterator<String> it = manager.getItems().iterator();
- final String selection1 = it.next();
- final String selection2 = it.next();
- final String selection3 = it.next();
- manager.setSelectedItem(selection1);
+ final StringManager aManager = new StringManager("A", "B", "C", "D", "E");
+ Iterator<String> it = aManager.getItems().iterator();
+ final String aSelection1 = it.next();
+ final String aSelection2 = it.next();
+ final String aSelection3 = it.next();
+ aManager.setSelectedItem(aSelection1);
Runnable runnable = new Runnable() {
public void run() {
@@ -224,34 +224,34 @@ public class ComboRidgetTest extends AbstractSWTRidgetTest {
assertEquals(-1, control.getSelectionIndex());
assertEquals(0, control.getItemCount());
- ridget.bindToModel(manager, "items", String.class, null, manager, "selectedItem");
+ ridget.bindToModel(aManager, "items", String.class, null, aManager, "selectedItem");
assertEquals(-1, control.getSelectionIndex());
assertEquals(0, control.getItemCount());
ridget.updateFromModel();
- assertEquals(manager.getItems().size(), control.getItemCount());
- assertEquals(selection1, getSelectedString(control));
+ assertEquals(aManager.getItems().size(), control.getItemCount());
+ assertEquals(aSelection1, getSelectedString(control));
for (int i = 0; i < control.getItemCount(); i++) {
- if (!manager.getItems().contains(control.getItem(i))) {
+ if (!aManager.getItems().contains(control.getItem(i))) {
fail();
}
}
- manager.setSelectedItem(selection2);
+ aManager.setSelectedItem(aSelection2);
- assertEquals(selection1, getSelectedString(control));
+ assertEquals(aSelection1, getSelectedString(control));
ridget.updateFromModel();
- assertEquals(selection2, getSelectedString(control));
+ assertEquals(aSelection2, getSelectedString(control));
control.select(2);
- assertEquals(selection3, getSelectedString(control));
- assertEquals(selection3, control.getText());
- assertEquals(selection3, manager.getSelectedItem());
+ assertEquals(aSelection3, getSelectedString(control));
+ assertEquals(aSelection3, control.getText());
+ assertEquals(aSelection3, aManager.getSelectedItem());
}
};
getUIControl().getDisplay().syncExec(runnable);
@@ -327,16 +327,16 @@ public class ComboRidgetTest extends AbstractSWTRidgetTest {
public void testGetObservableListWithStrings() {
Runnable runnable = new Runnable() {
public void run() {
- StringManager manager = new StringManager("A", "B", "C", "D", "E");
+ StringManager aManager = new StringManager("A", "B", "C", "D", "E");
ComboRidget ridget = getRidget();
- ridget.bindToModel(manager, "items", String.class, null, manager, "selectedItem");
+ ridget.bindToModel(aManager, "items", String.class, null, aManager, "selectedItem");
assertEquals(0, ridget.getObservableList().size());
ridget.updateFromModel();
- assertEquals(manager.getItems().size(), ridget.getObservableList().size());
+ assertEquals(aManager.getItems().size(), ridget.getObservableList().size());
for (String item : new String[] { "A", "B", "C", "D", "E" }) {
assertTrue(ridget.getObservableList().contains(item));
}
@@ -348,10 +348,10 @@ public class ComboRidgetTest extends AbstractSWTRidgetTest {
public void testGetSelectionIndex() {
Runnable runnable = new Runnable() {
public void run() {
- StringManager manager = new StringManager("A", "B", "C", "D", "E");
+ StringManager aManager = new StringManager("A", "B", "C", "D", "E");
ComboRidget ridget = getRidget();
- ridget.bindToModel(manager, "items", String.class, null, manager, "selectedItem");
+ ridget.bindToModel(aManager, "items", String.class, null, aManager, "selectedItem");
ridget.updateFromModel();
assertEquals(-1, getRidget().getSelectionIndex());
@@ -370,8 +370,8 @@ public class ComboRidgetTest extends AbstractSWTRidgetTest {
Runnable runnable = new Runnable() {
public void run() {
ComboRidget ridget = getRidget();
- StringManager manager = new StringManager("A", "B", "C", "D", "E");
- ridget.bindToModel(manager, "items", String.class, null, manager, "selectedItem");
+ StringManager aManager = new StringManager("A", "B", "C", "D", "E");
+ ridget.bindToModel(aManager, "items", String.class, null, aManager, "selectedItem");
ridget.updateFromModel();
assertEquals(null, getRidget().getSelection());
@@ -392,8 +392,8 @@ public class ComboRidgetTest extends AbstractSWTRidgetTest {
Runnable runnable = new Runnable() {
public void run() {
ComboRidget ridget = getRidget();
- StringManager manager = new StringManager("A", "B", "C", "D", "E");
- ridget.bindToModel(manager, "items", String.class, null, manager, "selectedItem");
+ StringManager aManager = new StringManager("A", "B", "C", "D", "E");
+ ridget.bindToModel(aManager, "items", String.class, null, aManager, "selectedItem");
ridget.updateFromModel();
IObservableValue selectionObservable = getRidget().getSelectionObservable();
@@ -415,8 +415,8 @@ public class ComboRidgetTest extends AbstractSWTRidgetTest {
public void testSetSelectionInt() {
ComboRidget ridget = getRidget();
Combo control = ridget.getUIControl();
- StringManager manager = new StringManager("A", "B", "C", "D", "E");
- ridget.bindToModel(manager, "items", String.class, null, manager, "selectedItem");
+ StringManager aManager = new StringManager("A", "B", "C", "D", "E");
+ ridget.bindToModel(aManager, "items", String.class, null, aManager, "selectedItem");
ridget.updateFromModel();
assertEquals(null, ridget.getSelection());
@@ -458,8 +458,8 @@ public class ComboRidgetTest extends AbstractSWTRidgetTest {
public void testSetSelectionString() {
ComboRidget ridget = getRidget();
Combo control = ridget.getUIControl();
- StringManager manager = new StringManager("A", "B", "C", "D", "E");
- ridget.bindToModel(manager, "items", String.class, null, manager, "selectedItem");
+ StringManager aManager = new StringManager("A", "B", "C", "D", "E");
+ ridget.bindToModel(aManager, "items", String.class, null, aManager, "selectedItem");
ridget.updateFromModel();
assertEquals(null, ridget.getSelection());
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 4ecdd6f..faf4f35 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
@@ -74,8 +74,8 @@ public class ToggleButtonRidgetTest extends TestCase {
Button buttonPush = new Button(shell, SWT.PUSH);
assertNotSame(ToggleButtonRidget.class, mapper.getRidgetClass(buttonPush));
- Button button = new Button(shell, SWT.NONE);
- assertNotSame(ToggleButtonRidget.class, mapper.getRidgetClass(button));
+ Button aButton = new Button(shell, SWT.NONE);
+ assertNotSame(ToggleButtonRidget.class, mapper.getRidgetClass(aButton));
}
public void testSetUIControl() throws Exception {
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeRidgetLabelProviderTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeRidgetLabelProviderTest.java
index 6047ae9..1996251 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeRidgetLabelProviderTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeRidgetLabelProviderTest.java
@@ -15,9 +15,6 @@ import java.util.Collection;
import junit.framework.TestCase;
-import org.eclipse.riena.core.util.ReflectionUtils;
-import org.eclipse.riena.ui.ridgets.util.beans.WordNode;
-
import org.eclipse.core.databinding.beans.BeansObservables;
import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.core.databinding.observable.map.IObservableMap;
@@ -27,6 +24,8 @@ import org.eclipse.jface.databinding.swt.SWTObservables;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.riena.core.util.ReflectionUtils;
+import org.eclipse.riena.ui.ridgets.util.beans.WordNode;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
@@ -56,8 +55,8 @@ public class TreeRidgetLabelProviderTest extends TestCase {
String[] columnProperties = { "word", "upperCase" };
IObservableMap[] attrMap = BeansObservables.observeMaps(elements, WordNode.class, columnProperties);
- Shell shell = new Shell(display);
- viewer = new TreeViewer(createTree(shell));
+ Shell aShell = new Shell(display);
+ viewer = new TreeViewer(createTree(aShell));
labelProvider = new TreeRidgetLabelProvider(viewer, attrMap);
viewer.setContentProvider(new FTTreeContentProvider());
viewer.setLabelProvider(labelProvider);
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/preferences/PreferencesTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/preferences/PreferencesTest.java
index 2d258ee..fe0c4ae 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/preferences/PreferencesTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/preferences/PreferencesTest.java
@@ -34,8 +34,9 @@ public class PreferencesTest extends TestCase {
*/
private void diggIn(Preferences prefs, int i) throws BackingStoreException {
String indent = "";
- for (int j = 0; j < i; j++)
+ for (int j = 0; j < i; j++) {
indent = indent + " ";
+ }
System.out.println(indent + prefs.name() + "(" + prefs.absolutePath() + "," + prefs.getClass() + ")");
String[] keys = prefs.keys();
for (String key : keys) {
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/security/common/Callback2CredentialConverterTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/security/common/Callback2CredentialConverterTest.java
index dfb57f6..cff4d85 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/security/common/Callback2CredentialConverterTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/security/common/Callback2CredentialConverterTest.java
@@ -92,7 +92,7 @@ public class Callback2CredentialConverterTest extends TestCase {
PasswordCredential pc = (PasswordCredential) credentials[0];
TextInputCredential tic = (TextInputCredential) credentials[1];
assertTrue(pc.getPrompt().equals("password"));
- assertTrue(pc.isEchoOn() == false);
+ assertFalse(pc.isEchoOn());
assertTrue(tic.getPrompt().equals("textinp"));
assertTrue(tic.getDefaultText().equals("default-text"));
assertTrue(tic.getText() == null);
@@ -104,7 +104,7 @@ public class Callback2CredentialConverterTest extends TestCase {
PasswordCallback pcb = (PasswordCallback) callbacksReturned[0];
TextInputCallback ticb = (TextInputCallback) callbacksReturned[1];
assertTrue(pcb.getPrompt().equals("password"));
- assertTrue(pcb.isEchoOn() == false);
+ assertFalse(pcb.isEchoOn());
assertTrue(ticb.getPrompt().equals("textinp"));
assertTrue(ticb.getDefaultText().equals("default-text"));
assertTrue(ticb.getText() == null);
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 aea03f9..a4e2ea9 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
@@ -75,8 +75,9 @@ public abstract class RienaTestCase extends TestCase {
*/
@Override
protected void tearDown() throws Exception {
- for (ServiceReference reference : services.values())
+ for (ServiceReference reference : services.values()) {
context.ungetService(reference);
+ }
services.clear();
@@ -114,11 +115,13 @@ public abstract class RienaTestCase extends TestCase {
* Print the current testīs name.
*/
protected void printTestName() {
- if (!print)
+ if (!print) {
return;
+ }
System.out.println(getName());
- for (int i = 0; i < getName().length(); i++)
+ for (int i = 0; i < getName().length(); i++) {
System.out.print('-');
+ }
System.out.println();
}
@@ -128,8 +131,9 @@ public abstract class RienaTestCase extends TestCase {
* @param string
*/
protected void print(String string) {
- if (!print)
+ if (!print) {
return;
+ }
System.out.print(string);
}
@@ -139,8 +143,9 @@ public abstract class RienaTestCase extends TestCase {
* @param string
*/
protected void println(String string) {
- if (!print)
+ if (!print) {
return;
+ }
System.out.println(string);
}
@@ -193,11 +198,13 @@ public abstract class RienaTestCase extends TestCase {
@SuppressWarnings("unchecked")
protected <T> T getService(Class<T> serviceClass) {
ServiceReference reference = context.getServiceReference(serviceClass.getName());
- if (reference == null)
+ if (reference == null) {
return null;
+ }
Object service = context.getService(reference);
- if (service == null)
+ if (service == null) {
return null;
+ }
services.put(service, reference);
return (T) service;
}
@@ -209,8 +216,9 @@ public abstract class RienaTestCase extends TestCase {
*/
protected void ungetService(Object service) {
ServiceReference reference = services.get(service);
- if (reference == null)
+ if (reference == null) {
return;
+ }
context.ungetService(reference);
}
@@ -311,10 +319,12 @@ public abstract class RienaTestCase extends TestCase {
Pattern exclude = Pattern.compile(excludePattern);
Bundle[] bundles = context.getBundles();
- for (Bundle bundle : bundles)
+ for (Bundle bundle : bundles) {
if (inlcude.matcher(bundle.getSymbolicName()).matches()
- && !(exclude.matcher(bundle.getSymbolicName()).matches()))
+ && !(exclude.matcher(bundle.getSymbolicName()).matches())) {
closure.execute(bundle);
+ }
+ }
}
protected interface IClosure {
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/tests/TestUtils.java b/org.eclipse.riena.tests/src/org/eclipse/riena/tests/TestUtils.java
index e6db5c3..2b4f3b1 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/tests/TestUtils.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/tests/TestUtils.java
@@ -17,6 +17,10 @@ import java.util.Locale;
*/
public class TestUtils {
+ private TestUtils() {
+ // utility class
+ }
+
public static boolean isArabLocaleAvailable() {
Locale arabLocale = new Locale("ar", "AE");
for (Locale availableLocale : Locale.getAvailableLocales()) {