summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2011-11-10 16:06:30 +0200
committerHenri Sara <hesara@vaadin.com>2011-11-10 16:06:30 +0200
commit63fc9d04820822e60f7ac5946344d32711a55e2c (patch)
tree18b26542948acfb19ddf252e59a064ab4c31aef8 /tests
parent72d6c3cfb822badcf0463a99fd9a6c761bd22525 (diff)
downloadvaadin-framework-63fc9d04820822e60f7ac5946344d32711a55e2c.tar.gz
vaadin-framework-63fc9d04820822e60f7ac5946344d32711a55e2c.zip
Eliminate many generics related warnings in tests.
Most of the warnings eliminated are related to generics for Property, Field or field factories. Not all such warnings are eliminated in this changeset.
Diffstat (limited to 'tests')
-rw-r--r--tests/server-side/com/vaadin/data/util/BeanItemTest.java7
-rw-r--r--tests/server-side/com/vaadin/data/util/NestedMethodPropertyTest.java89
-rw-r--r--tests/server-side/com/vaadin/data/util/PropertyDescriptorTest.java5
-rw-r--r--tests/server-side/com/vaadin/data/util/filter/AndOrFilterTest.java4
-rw-r--r--tests/server-side/com/vaadin/data/util/filter/CompareFilterTest.java2
-rw-r--r--tests/server-side/com/vaadin/data/util/filter/IsNullFilterTest.java4
-rw-r--r--tests/server-side/com/vaadin/data/util/filter/NotFilterTest.java4
-rw-r--r--tests/server-side/com/vaadin/data/util/filter/SimpleStringFilterTest.java5
-rw-r--r--tests/server-side/com/vaadin/tests/server/TestSerialization.java2
-rw-r--r--tests/server-side/com/vaadin/tests/server/component/textfield/TextFieldWithPropertyFormatter.java14
-rw-r--r--tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/Buttons2.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldTest.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/RequiredInvalidDateField.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/form/FormTest.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/form/FormWithEnterShortCut.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/EditableModeChange.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java10
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/PropertyValueChange.java11
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableCacheBuildEfficiency.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.java95
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableMultiSelectSimple.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableUnregisterComponent.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableWithManyColumns.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/Tables.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTest.java1
-rw-r--r--tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java5
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/CaptionsInLayouts.java10
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java10
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/TestAbsoluteLayout.java5
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java18
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java2
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java2
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1245.java3
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer.java2
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java2
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1804.java2
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1819.java2
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1878.java2
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2204.java2
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2998.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket677.java12
-rw-r--r--tests/testbench/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java2
46 files changed, 189 insertions, 195 deletions
diff --git a/tests/server-side/com/vaadin/data/util/BeanItemTest.java b/tests/server-side/com/vaadin/data/util/BeanItemTest.java
index 044a410803..51e11260f5 100644
--- a/tests/server-side/com/vaadin/data/util/BeanItemTest.java
+++ b/tests/server-side/com/vaadin/data/util/BeanItemTest.java
@@ -12,11 +12,6 @@ import java.util.Map;
import junit.framework.Assert;
import junit.framework.TestCase;
-import com.vaadin.data.util.BeanItem;
-import com.vaadin.data.util.MethodProperty;
-import com.vaadin.data.util.MethodPropertyDescriptor;
-import com.vaadin.data.util.VaadinPropertyDescriptor;
-
/**
* Test BeanItem specific features.
*
@@ -322,7 +317,7 @@ public class BeanItemTest extends TestCase {
MyClass.class.getDeclaredMethod("getName"),
MyClass.class.getDeclaredMethod("setName", String.class));
- BeanItem<MyClass> item = new BeanItem(new MyClass("bean1"));
+ BeanItem<MyClass> item = new BeanItem<MyClass>(new MyClass("bean1"));
Assert.assertEquals(6, item.getItemPropertyIds().size());
Assert.assertEquals(null, item.getItemProperty("myname"));
diff --git a/tests/server-side/com/vaadin/data/util/NestedMethodPropertyTest.java b/tests/server-side/com/vaadin/data/util/NestedMethodPropertyTest.java
index b110ea1c6b..640ede8743 100644
--- a/tests/server-side/com/vaadin/data/util/NestedMethodPropertyTest.java
+++ b/tests/server-side/com/vaadin/data/util/NestedMethodPropertyTest.java
@@ -10,8 +10,6 @@ import java.io.Serializable;
import junit.framework.Assert;
import junit.framework.TestCase;
-import com.vaadin.data.util.NestedMethodProperty;
-
public class NestedMethodPropertyTest extends TestCase {
public static class Address implements Serializable {
@@ -126,34 +124,34 @@ public class NestedMethodPropertyTest extends TestCase {
}
public void testSingleLevelNestedSimpleProperty() {
- NestedMethodProperty nameProperty = new NestedMethodProperty(vaadin,
- "name");
+ NestedMethodProperty<String> nameProperty = new NestedMethodProperty<String>(
+ vaadin, "name");
Assert.assertEquals(String.class, nameProperty.getType());
Assert.assertEquals("Vaadin", nameProperty.getValue());
}
public void testSingleLevelNestedObjectProperty() {
- NestedMethodProperty managerProperty = new NestedMethodProperty(vaadin,
- "manager");
+ NestedMethodProperty<Person> managerProperty = new NestedMethodProperty<Person>(
+ vaadin, "manager");
Assert.assertEquals(Person.class, managerProperty.getType());
Assert.assertEquals(joonas, managerProperty.getValue());
}
public void testMultiLevelNestedProperty() {
- NestedMethodProperty managerNameProperty = new NestedMethodProperty(
+ NestedMethodProperty<String> managerNameProperty = new NestedMethodProperty<String>(
vaadin, "manager.name");
- NestedMethodProperty addressProperty = new NestedMethodProperty(vaadin,
- "manager.address");
- NestedMethodProperty streetProperty = new NestedMethodProperty(vaadin,
- "manager.address.street");
- NestedMethodProperty postalCodePrimitiveProperty = new NestedMethodProperty(
+ NestedMethodProperty<Address> addressProperty = new NestedMethodProperty<Address>(
+ vaadin, "manager.address");
+ NestedMethodProperty<String> streetProperty = new NestedMethodProperty<String>(
+ vaadin, "manager.address.street");
+ NestedMethodProperty<Integer> postalCodePrimitiveProperty = new NestedMethodProperty<Integer>(
vaadin, "manager.address.postalCodePrimitive");
- NestedMethodProperty postalCodeObjectProperty = new NestedMethodProperty(
+ NestedMethodProperty<Integer> postalCodeObjectProperty = new NestedMethodProperty<Integer>(
vaadin, "manager.address.postalCodeObject");
- NestedMethodProperty booleanProperty = new NestedMethodProperty(vaadin,
- "manager.address.boolean");
+ NestedMethodProperty<Boolean> booleanProperty = new NestedMethodProperty<Boolean>(
+ vaadin, "manager.address.boolean");
Assert.assertEquals(String.class, managerNameProperty.getType());
Assert.assertEquals("Joonas", managerNameProperty.getValue());
@@ -166,25 +164,27 @@ public class NestedMethodPropertyTest extends TestCase {
Assert.assertEquals(Integer.class,
postalCodePrimitiveProperty.getType());
- Assert.assertEquals(20540, postalCodePrimitiveProperty.getValue());
+ Assert.assertEquals(Integer.valueOf(20540),
+ postalCodePrimitiveProperty.getValue());
Assert.assertEquals(Integer.class, postalCodeObjectProperty.getType());
- Assert.assertEquals(20540, postalCodeObjectProperty.getValue());
+ Assert.assertEquals(Integer.valueOf(20540),
+ postalCodeObjectProperty.getValue());
Assert.assertEquals(Boolean.class, booleanProperty.getType());
- Assert.assertEquals(true, booleanProperty.getValue());
+ Assert.assertEquals(Boolean.TRUE, booleanProperty.getValue());
}
public void testEmptyPropertyName() {
try {
- new NestedMethodProperty(vaadin, "");
+ new NestedMethodProperty<Object>(vaadin, "");
fail();
} catch (IllegalArgumentException e) {
// should get exception
}
try {
- new NestedMethodProperty(vaadin, " ");
+ new NestedMethodProperty<Object>(vaadin, " ");
fail();
} catch (IllegalArgumentException e) {
// should get exception
@@ -193,25 +193,25 @@ public class NestedMethodPropertyTest extends TestCase {
public void testInvalidPropertyName() {
try {
- new NestedMethodProperty(vaadin, ".");
+ new NestedMethodProperty<Object>(vaadin, ".");
fail();
} catch (IllegalArgumentException e) {
// should get exception
}
try {
- new NestedMethodProperty(vaadin, ".manager");
+ new NestedMethodProperty<Object>(vaadin, ".manager");
fail();
} catch (IllegalArgumentException e) {
// should get exception
}
try {
- new NestedMethodProperty(vaadin, "manager.");
+ new NestedMethodProperty<Object>(vaadin, "manager.");
fail();
} catch (IllegalArgumentException e) {
// should get exception
}
try {
- new NestedMethodProperty(vaadin, "manager..name");
+ new NestedMethodProperty<Object>(vaadin, "manager..name");
fail();
} catch (IllegalArgumentException e) {
// should get exception
@@ -220,21 +220,21 @@ public class NestedMethodPropertyTest extends TestCase {
public void testInvalidNestedPropertyName() {
try {
- new NestedMethodProperty(vaadin, "member");
+ new NestedMethodProperty<Object>(vaadin, "member");
fail();
} catch (IllegalArgumentException e) {
// should get exception
}
try {
- new NestedMethodProperty(vaadin, "manager.pet");
+ new NestedMethodProperty<Object>(vaadin, "manager.pet");
fail();
} catch (IllegalArgumentException e) {
// should get exception
}
try {
- new NestedMethodProperty(vaadin, "manager.address.city");
+ new NestedMethodProperty<Object>(vaadin, "manager.address.city");
fail();
} catch (IllegalArgumentException e) {
// should get exception
@@ -242,10 +242,10 @@ public class NestedMethodPropertyTest extends TestCase {
}
public void testNullNestedProperty() {
- NestedMethodProperty managerNameProperty = new NestedMethodProperty(
+ NestedMethodProperty<String> managerNameProperty = new NestedMethodProperty<String>(
vaadin, "manager.name");
- NestedMethodProperty streetProperty = new NestedMethodProperty(vaadin,
- "manager.address.street");
+ NestedMethodProperty<String> streetProperty = new NestedMethodProperty<String>(
+ vaadin, "manager.address.street");
joonas.setAddress(null);
try {
@@ -274,15 +274,15 @@ public class NestedMethodPropertyTest extends TestCase {
}
public void testMultiLevelNestedPropertySetValue() {
- NestedMethodProperty managerNameProperty = new NestedMethodProperty(
+ NestedMethodProperty<String> managerNameProperty = new NestedMethodProperty<String>(
vaadin, "manager.name");
- NestedMethodProperty addressProperty = new NestedMethodProperty(vaadin,
- "manager.address");
- NestedMethodProperty streetProperty = new NestedMethodProperty(vaadin,
- "manager.address.street");
- NestedMethodProperty postalCodePrimitiveProperty = new NestedMethodProperty(
+ NestedMethodProperty<Address> addressProperty = new NestedMethodProperty<Address>(
+ vaadin, "manager.address");
+ NestedMethodProperty<String> streetProperty = new NestedMethodProperty<String>(
+ vaadin, "manager.address.street");
+ NestedMethodProperty<Integer> postalCodePrimitiveProperty = new NestedMethodProperty<Integer>(
vaadin, "manager.address.postalCodePrimitive");
- NestedMethodProperty postalCodeObjectProperty = new NestedMethodProperty(
+ NestedMethodProperty<Integer> postalCodeObjectProperty = new NestedMethodProperty<Integer>(
vaadin, "manager.address.postalCodeObject");
managerNameProperty.setValue("Joonas L");
@@ -303,21 +303,22 @@ public class NestedMethodPropertyTest extends TestCase {
}
public void testSerialization() throws IOException, ClassNotFoundException {
- NestedMethodProperty streetProperty = new NestedMethodProperty(vaadin,
- "manager.address.street");
+ NestedMethodProperty<String> streetProperty = new NestedMethodProperty<String>(
+ vaadin, "manager.address.street");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
new ObjectOutputStream(baos).writeObject(streetProperty);
- NestedMethodProperty property2 = (NestedMethodProperty) new ObjectInputStream(
+ @SuppressWarnings("unchecked")
+ NestedMethodProperty<String> property2 = (NestedMethodProperty<String>) new ObjectInputStream(
new ByteArrayInputStream(baos.toByteArray())).readObject();
Assert.assertEquals("Ruukinkatu 2-4", property2.getValue());
}
public void testIsReadOnly() {
- NestedMethodProperty streetProperty = new NestedMethodProperty(vaadin,
- "manager.address.street");
- NestedMethodProperty booleanProperty = new NestedMethodProperty(vaadin,
- "manager.address.boolean");
+ NestedMethodProperty<String> streetProperty = new NestedMethodProperty<String>(
+ vaadin, "manager.address.street");
+ NestedMethodProperty<Boolean> booleanProperty = new NestedMethodProperty<Boolean>(
+ vaadin, "manager.address.boolean");
Assert.assertFalse(streetProperty.isReadOnly());
Assert.assertTrue(booleanProperty.isReadOnly());
diff --git a/tests/server-side/com/vaadin/data/util/PropertyDescriptorTest.java b/tests/server-side/com/vaadin/data/util/PropertyDescriptorTest.java
index c3621fa99b..d722a9e23b 100644
--- a/tests/server-side/com/vaadin/data/util/PropertyDescriptorTest.java
+++ b/tests/server-side/com/vaadin/data/util/PropertyDescriptorTest.java
@@ -11,9 +11,6 @@ import junit.framework.Assert;
import junit.framework.TestCase;
import com.vaadin.data.Property;
-import com.vaadin.data.util.MethodPropertyDescriptor;
-import com.vaadin.data.util.NestedPropertyDescriptor;
-import com.vaadin.data.util.VaadinPropertyDescriptor;
import com.vaadin.data.util.NestedMethodPropertyTest.Person;
public class PropertyDescriptorTest extends TestCase {
@@ -33,6 +30,7 @@ public class PropertyDescriptorTest extends TestCase {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
new ObjectOutputStream(baos).writeObject(descriptor);
+ @SuppressWarnings("unchecked")
VaadinPropertyDescriptor<Person> descriptor2 = (VaadinPropertyDescriptor<Person>) new ObjectInputStream(
new ByteArrayInputStream(baos.toByteArray())).readObject();
@@ -47,6 +45,7 @@ public class PropertyDescriptorTest extends TestCase {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
new ObjectOutputStream(baos).writeObject(pd);
+ @SuppressWarnings("unchecked")
VaadinPropertyDescriptor<Person> pd2 = (VaadinPropertyDescriptor<Person>) new ObjectInputStream(
new ByteArrayInputStream(baos.toByteArray())).readObject();
diff --git a/tests/server-side/com/vaadin/data/util/filter/AndOrFilterTest.java b/tests/server-side/com/vaadin/data/util/filter/AndOrFilterTest.java
index bdd852bd41..fdd5b8a645 100644
--- a/tests/server-side/com/vaadin/data/util/filter/AndOrFilterTest.java
+++ b/tests/server-side/com/vaadin/data/util/filter/AndOrFilterTest.java
@@ -5,10 +5,8 @@ import junit.framework.Assert;
import com.vaadin.data.Container.Filter;
import com.vaadin.data.Item;
import com.vaadin.data.util.BeanItem;
-import com.vaadin.data.util.filter.And;
-import com.vaadin.data.util.filter.Or;
-public class AndOrFilterTest extends AbstractFilterTest {
+public class AndOrFilterTest extends AbstractFilterTest<AbstractJunctionFilter> {
protected Item item1 = new BeanItem<Integer>(1);
protected Item item2 = new BeanItem<Integer>(2);
diff --git a/tests/server-side/com/vaadin/data/util/filter/CompareFilterTest.java b/tests/server-side/com/vaadin/data/util/filter/CompareFilterTest.java
index 4cd683bfde..99e8429a51 100644
--- a/tests/server-side/com/vaadin/data/util/filter/CompareFilterTest.java
+++ b/tests/server-side/com/vaadin/data/util/filter/CompareFilterTest.java
@@ -14,7 +14,7 @@ import com.vaadin.data.util.filter.Compare.GreaterOrEqual;
import com.vaadin.data.util.filter.Compare.Less;
import com.vaadin.data.util.filter.Compare.LessOrEqual;
-public class CompareFilterTest extends AbstractFilterTest {
+public class CompareFilterTest extends AbstractFilterTest<Compare> {
protected Item itemNull;
protected Item itemEmpty;
diff --git a/tests/server-side/com/vaadin/data/util/filter/IsNullFilterTest.java b/tests/server-side/com/vaadin/data/util/filter/IsNullFilterTest.java
index 24d5152cf7..6f90273de1 100644
--- a/tests/server-side/com/vaadin/data/util/filter/IsNullFilterTest.java
+++ b/tests/server-side/com/vaadin/data/util/filter/IsNullFilterTest.java
@@ -6,10 +6,8 @@ import com.vaadin.data.Container.Filter;
import com.vaadin.data.Item;
import com.vaadin.data.util.ObjectProperty;
import com.vaadin.data.util.PropertysetItem;
-import com.vaadin.data.util.filter.And;
-import com.vaadin.data.util.filter.IsNull;
-public class IsNullFilterTest extends AbstractFilterTest {
+public class IsNullFilterTest extends AbstractFilterTest<IsNull> {
public void testIsNull() {
Item item1 = new PropertysetItem();
diff --git a/tests/server-side/com/vaadin/data/util/filter/NotFilterTest.java b/tests/server-side/com/vaadin/data/util/filter/NotFilterTest.java
index be6417ccdf..c3b666e6f7 100644
--- a/tests/server-side/com/vaadin/data/util/filter/NotFilterTest.java
+++ b/tests/server-side/com/vaadin/data/util/filter/NotFilterTest.java
@@ -5,10 +5,8 @@ import junit.framework.Assert;
import com.vaadin.data.Container.Filter;
import com.vaadin.data.Item;
import com.vaadin.data.util.BeanItem;
-import com.vaadin.data.util.filter.And;
-import com.vaadin.data.util.filter.Not;
-public class NotFilterTest extends AbstractFilterTest {
+public class NotFilterTest extends AbstractFilterTest<Not> {
protected Item item1 = new BeanItem<Integer>(1);
protected Item item2 = new BeanItem<Integer>(2);
diff --git a/tests/server-side/com/vaadin/data/util/filter/SimpleStringFilterTest.java b/tests/server-side/com/vaadin/data/util/filter/SimpleStringFilterTest.java
index c36a764a54..bc63d57752 100644
--- a/tests/server-side/com/vaadin/data/util/filter/SimpleStringFilterTest.java
+++ b/tests/server-side/com/vaadin/data/util/filter/SimpleStringFilterTest.java
@@ -2,9 +2,8 @@ package com.vaadin.data.util.filter;
import junit.framework.Assert;
-import com.vaadin.data.util.filter.SimpleStringFilter;
-
-public class SimpleStringFilterTest extends AbstractFilterTest {
+public class SimpleStringFilterTest extends
+ AbstractFilterTest<SimpleStringFilter> {
protected static TestItem<String, String> createTestItem() {
return new TestItem<String, String>("abcde", "TeSt");
diff --git a/tests/server-side/com/vaadin/tests/server/TestSerialization.java b/tests/server-side/com/vaadin/tests/server/TestSerialization.java
index e3b6a47855..bed109d99a 100644
--- a/tests/server-side/com/vaadin/tests/server/TestSerialization.java
+++ b/tests/server-side/com/vaadin/tests/server/TestSerialization.java
@@ -92,7 +92,7 @@ public class TestSerialization extends TestCase {
private static String toString(Object o) {
if (o instanceof Property) {
- return String.valueOf(((Property) o).getValue());
+ return String.valueOf(((Property<?>) o).getValue());
} else {
return String.valueOf(o);
}
diff --git a/tests/server-side/com/vaadin/tests/server/component/textfield/TextFieldWithPropertyFormatter.java b/tests/server-side/com/vaadin/tests/server/component/textfield/TextFieldWithPropertyFormatter.java
index 5a494b8ccd..d7b38cecfc 100644
--- a/tests/server-side/com/vaadin/tests/server/component/textfield/TextFieldWithPropertyFormatter.java
+++ b/tests/server-side/com/vaadin/tests/server/component/textfield/TextFieldWithPropertyFormatter.java
@@ -2,6 +2,8 @@ package com.vaadin.tests.server.component.textfield;
import java.util.Collections;
+import junit.framework.TestCase;
+
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
@@ -11,8 +13,6 @@ import com.vaadin.terminal.Paintable;
import com.vaadin.terminal.Paintable.RepaintRequestEvent;
import com.vaadin.ui.TextField;
-import junit.framework.TestCase;
-
public class TextFieldWithPropertyFormatter extends TestCase {
private static final String INPUT_VALUE = "foo";
@@ -20,7 +20,7 @@ public class TextFieldWithPropertyFormatter extends TestCase {
private static final String FORMATTED_VALUE = "FOOBAR";
private static final String ORIGINAL_VALUE = "Original";
private TextField field;
- private PropertyFormatter formatter;
+ private PropertyFormatter<String> formatter;
private ObjectProperty<String> property;
private ValueChangeListener listener;
private int listenerCalled;
@@ -32,16 +32,16 @@ public class TextFieldWithPropertyFormatter extends TestCase {
field = new TextField();
- formatter = new PropertyFormatter() {
+ formatter = new PropertyFormatter<String>() {
@Override
- public Object parse(String formattedValue) throws Exception {
+ public String parse(String formattedValue) throws Exception {
assertEquals(INPUT_VALUE, formattedValue);
return PARSED_VALUE;
}
@Override
- public String format(Object value) {
+ public String format(String value) {
return FORMATTED_VALUE;
}
};
@@ -59,7 +59,7 @@ public class TextFieldWithPropertyFormatter extends TestCase {
assertEquals(FORMATTED_VALUE, event.getProperty().getValue());
}
};
-
+
field.addListener(listener);
field.addListener(new Paintable.RepaintRequestListener() {
public void repaintRequested(RepaintRequestEvent event) {
diff --git a/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java b/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java
index 1b04198da0..57a32aafc4 100644
--- a/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java
+++ b/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java
@@ -126,7 +126,7 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent>
public void execute(T c, Boolean enabled, Object data) {
if (c instanceof Field) {
- ((Field) c).setRequired(enabled);
+ ((Field<?>) c).setRequired(enabled);
} else {
throw new IllegalArgumentException(c.getClass().getName()
+ " is not a field and cannot be set to required");
@@ -136,7 +136,7 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent>
protected Command<T, String> requiredErrorMessageCommand = new Command<T, String>() {
public void execute(T c, String value, Object data) {
- ((Field) c).setRequiredError(value);
+ ((Field<?>) c).setRequiredError(value);
}
};
diff --git a/tests/testbench/com/vaadin/tests/components/button/Buttons2.java b/tests/testbench/com/vaadin/tests/components/button/Buttons2.java
index c18e736082..bcd3ed84be 100644
--- a/tests/testbench/com/vaadin/tests/components/button/Buttons2.java
+++ b/tests/testbench/com/vaadin/tests/components/button/Buttons2.java
@@ -38,6 +38,7 @@ public class Buttons2<T extends Button> extends AbstractFieldTest<T> implements
}
};
+ @SuppressWarnings("unchecked")
@Override
protected Class<T> getTestClass() {
return (Class<T>) Button.class;
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java
index 18bc719850..826b714346 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java
@@ -59,9 +59,9 @@ public class DateFieldInSubWindow extends AbstractTestCase {
public static final String COMMON_FIELD_WIDTH = "12em";
@Override
- public Field createField(Item item, Object propertyId,
+ public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
- Field f = super.createField(item, propertyId, uiContext);
+ Field<?> f = super.createField(item, propertyId, uiContext);
if ("myDate".equals(propertyId)) {
((DateField) f).setResolution(DateField.RESOLUTION_MIN);
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTest.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTest.java
index cf433257bb..8ef9b5908c 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTest.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTest.java
@@ -12,6 +12,7 @@ import com.vaadin.ui.DateField;
public class DateFieldTest<T extends DateField> extends AbstractFieldTest<T> {
+ @SuppressWarnings("unchecked")
@Override
protected Class<T> getTestClass() {
return (Class<T>) DateField.class;
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/RequiredInvalidDateField.java b/tests/testbench/com/vaadin/tests/components/datefield/RequiredInvalidDateField.java
index 7176dae48b..c997895628 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/RequiredInvalidDateField.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/RequiredInvalidDateField.java
@@ -47,7 +47,7 @@ public class RequiredInvalidDateField extends TestBase {
};
// not required
- Property dateProperty1 = new ObjectProperty<Date>(date);
+ Property<Date> dateProperty1 = new ObjectProperty<Date>(date);
DateField dateField1 = new DateField("Not required", dateProperty1);
dateField1.setLocale(new Locale("fi", "FI"));
dateField1.setResolution(DateField.RESOLUTION_DAY);
@@ -57,7 +57,7 @@ public class RequiredInvalidDateField extends TestBase {
addComponent(dateField1);
// required
- Property dateProperty2 = new ObjectProperty<Date>(date);
+ Property<Date> dateProperty2 = new ObjectProperty<Date>(date);
DateField dateField2 = new DateField("Required", dateProperty2);
dateField2.setLocale(new Locale("fi", "FI"));
dateField2.setResolution(DateField.RESOLUTION_DAY);
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.java b/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.java
index 1f9735b543..aa9791684d 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.java
@@ -15,7 +15,7 @@ import com.vaadin.ui.Label;
import com.vaadin.ui.PopupDateField;
public class ValueThroughProperty extends TestBase {
- private final Property dateProperty = new ObjectProperty<Date>(null,
+ private final Property<Date> dateProperty = new ObjectProperty<Date>(null,
Date.class);
@Override
diff --git a/tests/testbench/com/vaadin/tests/components/form/FormTest.java b/tests/testbench/com/vaadin/tests/components/form/FormTest.java
index 8735da285d..451a1b7fa3 100644
--- a/tests/testbench/com/vaadin/tests/components/form/FormTest.java
+++ b/tests/testbench/com/vaadin/tests/components/form/FormTest.java
@@ -148,10 +148,10 @@ public class FormTest extends AbstractFieldTest<Form> {
options.put("Default", DefaultFieldFactory.get());
options.put("Custom FieldFactory", new FormFieldFactory() {
- public Field createField(Item item, Object propertyId,
+ public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
Class<?> type = item.getItemProperty(propertyId).getType();
- Field c = null;
+ Field<?> c = null;
if (Number.class.isAssignableFrom(type)) {
TextField tf = new TextField();
tf.setCaption(DefaultFieldFactory
diff --git a/tests/testbench/com/vaadin/tests/components/form/FormWithEnterShortCut.java b/tests/testbench/com/vaadin/tests/components/form/FormWithEnterShortCut.java
index 624d0746e9..7f750c9e24 100644
--- a/tests/testbench/com/vaadin/tests/components/form/FormWithEnterShortCut.java
+++ b/tests/testbench/com/vaadin/tests/components/form/FormWithEnterShortCut.java
@@ -5,7 +5,6 @@ import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Log;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Field;
import com.vaadin.ui.Form;
import com.vaadin.ui.TextField;
@@ -16,7 +15,7 @@ public class FormWithEnterShortCut extends TestBase {
protected void setup() {
final Form form = new Form();
- final Field tf = new TextField("Search");
+ final TextField tf = new TextField("Search");
form.addField("searchfield", tf);
Button button = new Button("Go");
diff --git a/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java b/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java
index 2e26d3e2c4..7f25e07cea 100644
--- a/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java
+++ b/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java
@@ -23,7 +23,7 @@ public class RichTextAreaWithKeyboardShortcuts extends TestBase {
msg += " From : " + sender.getClass().getSimpleName() + " '"
+ ((Component) sender).getCaption() + "'";
- AbstractField f = (AbstractField) target;
+ AbstractField<String> f = (AbstractField<String>) target;
msg += " Target:" + target.getClass().getSimpleName() + " '"
+ f.getCaption() + "'";
diff --git a/tests/testbench/com/vaadin/tests/components/table/EditableModeChange.java b/tests/testbench/com/vaadin/tests/components/table/EditableModeChange.java
index f2163f6df3..f4ec44b5c4 100644
--- a/tests/testbench/com/vaadin/tests/components/table/EditableModeChange.java
+++ b/tests/testbench/com/vaadin/tests/components/table/EditableModeChange.java
@@ -74,7 +74,7 @@ public class EditableModeChange extends TestBase {
private class ItemFieldFactory extends DefaultFieldFactory {
@Override
- public Field createField(Container container, Object itemId,
+ public Field<?> createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
if (selectionEvent != null) {
if ((selectionEvent.getItemId().equals(itemId))
diff --git a/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java b/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java
index 6561ff0076..1c4f757104 100644
--- a/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java
+++ b/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java
@@ -57,10 +57,10 @@ public class EditableTableLeak extends TestBase {
}
private static class CachingFieldFactory extends DefaultFieldFactory {
- private final HashMap<Object, HashMap<Object, Field>> cache = new HashMap<Object, HashMap<Object, Field>>();
+ private final HashMap<Object, HashMap<Object, Field<?>>> cache = new HashMap<Object, HashMap<Object, Field<?>>>();
@Override
- public Field createField(Container container, Object itemId,
+ public Field<?> createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
if (cache.containsKey(itemId)) {
if (cache.get(itemId) != null
@@ -68,10 +68,10 @@ public class EditableTableLeak extends TestBase {
return cache.get(itemId).get(propertyId);
}
}
- Field f = super.createField(container, itemId, propertyId,
+ Field<?> f = super.createField(container, itemId, propertyId,
uiContext);
if (!cache.containsKey(itemId)) {
- cache.put(itemId, new HashMap<Object, Field>());
+ cache.put(itemId, new HashMap<Object, Field<?>>());
}
cache.get(itemId).put(propertyId, f);
return f;
@@ -86,7 +86,7 @@ public class EditableTableLeak extends TestBase {
useFieldFactory.addListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- if ((Boolean) useFieldFactory.getValue()) {
+ if (useFieldFactory.getValue()) {
table.setTableFieldFactory(new CachingFieldFactory());
} else {
table.setTableFieldFactory(DefaultFieldFactory.get());
diff --git a/tests/testbench/com/vaadin/tests/components/table/PropertyValueChange.java b/tests/testbench/com/vaadin/tests/components/table/PropertyValueChange.java
index 5975137976..1ded66848f 100644
--- a/tests/testbench/com/vaadin/tests/components/table/PropertyValueChange.java
+++ b/tests/testbench/com/vaadin/tests/components/table/PropertyValueChange.java
@@ -39,16 +39,17 @@ public class PropertyValueChange extends TestBase {
// Also use column generator in test, to ensure it is possible to build
// columns that update automatically.
ColumnGenerator multiplier = new ColumnGenerator() {
- private int getMultipliedValue(Property p) {
- int i = ((Integer) p.getValue()).intValue();
+ private int getMultipliedValue(Property<Integer> p) {
+ int i = p.getValue().intValue();
return i * 3;
}
public Component generateCell(Table source, Object itemId,
Object columnId) {
final Label l = new Label();
- final Property integer = source.getContainerProperty(itemId,
- "integer");
+ @SuppressWarnings("unchecked")
+ final Property<Integer> integer = source.getContainerProperty(
+ itemId, "integer");
l.setValue(getMultipliedValue(integer));
// we must hook value change listener to ensure updates in all use
@@ -134,7 +135,7 @@ class MyFieldFactory extends DefaultFieldFactory {
}
@Override
- public Field createField(Container container, Object itemId,
+ public Field<?> createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
if (propertyId.equals("text")) {
// replace text fields with comboboxes
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableCacheBuildEfficiency.java b/tests/testbench/com/vaadin/tests/components/table/TableCacheBuildEfficiency.java
index 220d5e8192..3c6445349a 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableCacheBuildEfficiency.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableCacheBuildEfficiency.java
@@ -28,7 +28,7 @@ public class TableCacheBuildEfficiency extends TestBase {
final Table table = new Table() {
@Override
- public Property getContainerProperty(Object itemId,
+ public Property<?> getContainerProperty(Object itemId,
Object propertyId) {
log("Fetched container property \"" + propertyId
+ "\" for item \"" + itemId + "\"");
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.java b/tests/testbench/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.java
index 2f53b91107..1f15b224dc 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.java
@@ -4,69 +4,70 @@ import com.vaadin.data.Container;
import com.vaadin.data.Item;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Button;
+import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator;
import com.vaadin.ui.Component;
-import com.vaadin.ui.Label;
import com.vaadin.ui.Table;
-import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator;
import com.vaadin.ui.TextField;
public class TableItemDescriptionGeneratorTest extends TestBase {
- private final String COLUMN1_PROPERTY_ID = "Text - Cell description";
- private final String COLUMN2_PROPERTY_ID = "Text - Row description";
- private final String COLUMN3_PROPERTY_ID = "Widget";
-
- @Override
- protected void setup() {
- final Table table = new Table();
- table.setDebugId("table");
- table.setContainerDataSource(createContainer());
- addComponent(table);
-
- table.setItemDescriptionGenerator(new ItemDescriptionGenerator() {
- public String generateDescription(Component source, Object itemId,
- Object propertyId) {
- if(propertyId == null){
- return "Row description "+ itemId;
- } else if(propertyId == COLUMN1_PROPERTY_ID) {
- return "Cell description " + itemId +","+propertyId;
- }
- return null;
- }
- });
-
- table.addGeneratedColumn(COLUMN3_PROPERTY_ID, new Table.ColumnGenerator() {
-
- public Component generateCell(Table source, Object itemId, Object columnId) {
- TextField lbl = new TextField();
- lbl.setDescription("Textfields own description");
- return lbl;
- }
- });
- }
+ private final String COLUMN1_PROPERTY_ID = "Text - Cell description";
+ private final String COLUMN2_PROPERTY_ID = "Text - Row description";
+ private final String COLUMN3_PROPERTY_ID = "Widget";
+
+ @Override
+ protected void setup() {
+ final Table table = new Table();
+ table.setDebugId("table");
+ table.setContainerDataSource(createContainer());
+ addComponent(table);
+
+ table.setItemDescriptionGenerator(new ItemDescriptionGenerator() {
+ public String generateDescription(Component source, Object itemId,
+ Object propertyId) {
+ if (propertyId == null) {
+ return "Row description " + itemId;
+ } else if (propertyId == COLUMN1_PROPERTY_ID) {
+ return "Cell description " + itemId + "," + propertyId;
+ }
+ return null;
+ }
+ });
+
+ table.addGeneratedColumn(COLUMN3_PROPERTY_ID,
+ new Table.ColumnGenerator() {
- @Override
- protected String getDescription() {
- return "Cells and rows should have tooltips";
- }
+ public Component generateCell(Table source, Object itemId,
+ Object columnId) {
+ TextField lbl = new TextField();
+ lbl.setDescription("Textfields own description");
+ return lbl;
+ }
+ });
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Cells and rows should have tooltips";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 5414;
+ }
- @Override
- protected Integer getTicketNumber() {
- return 5414;
- }
-
- private Container createContainer() {
+ private Container createContainer() {
IndexedContainer container = new IndexedContainer();
container.addContainerProperty(COLUMN1_PROPERTY_ID, String.class, "");
container.addContainerProperty(COLUMN2_PROPERTY_ID, String.class, "");
- // container.addContainerProperty(COLUMN3_PROPERTY_ID, String.class, "");
+ // container.addContainerProperty(COLUMN3_PROPERTY_ID, String.class,
+ // "");
for (int i = 0; i < 5; i++) {
Item item = container.addItem("item " + i);
item.getItemProperty(COLUMN1_PROPERTY_ID).setValue("first" + i);
item.getItemProperty(COLUMN2_PROPERTY_ID).setValue("middle" + i);
- // item.getItemProperty(COLUMN3_PROPERTY_ID).setValue("last" + i);
+ // item.getItemProperty(COLUMN3_PROPERTY_ID).setValue("last" + i);
}
return container;
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableMultiSelectSimple.java b/tests/testbench/com/vaadin/tests/components/table/TableMultiSelectSimple.java
index 76415844be..5033d4e91d 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableMultiSelectSimple.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableMultiSelectSimple.java
@@ -29,8 +29,8 @@ public class TableMultiSelectSimple extends TestBase {
t.addListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- TreeSet sorted = new TreeSet((Set) event.getProperty()
- .getValue());
+ TreeSet<?> sorted = new TreeSet<Object>((Set<?>) event
+ .getProperty().getValue());
log.log("Selected value: " + sorted);
}
});
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableUnregisterComponent.java b/tests/testbench/com/vaadin/tests/components/table/TableUnregisterComponent.java
index 91f5aec1ca..6fd4a9db52 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableUnregisterComponent.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableUnregisterComponent.java
@@ -49,10 +49,10 @@ public class TableUnregisterComponent extends TestBase {
table.setColumnCollapsingAllowed(true);
table.setTableFieldFactory(new DefaultFieldFactory() {
@Override
- public Field createField(Container container, Object itemId,
+ public Field<?> createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
if (COL_B.equals(propertyId)) {
- Field field = new TextField() {
+ Field<String> field = new TextField() {
@Override
public void setPropertyDataSource(Property newDataSource) {
super.setPropertyDataSource(newDataSource);
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableWithManyColumns.java b/tests/testbench/com/vaadin/tests/components/table/TableWithManyColumns.java
index 543c1ebae2..28ef0da95b 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableWithManyColumns.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableWithManyColumns.java
@@ -20,7 +20,7 @@ public class TableWithManyColumns extends TestBase {
for (int row = 0; row < ROWS; row++) {
Item i = t.addItem(String.valueOf(row));
for (int col = 0; col < COLS; col++) {
- Property p = i.getItemProperty("COLUMN_" + col);
+ Property<?> p = i.getItemProperty("COLUMN_" + col);
p.setValue("item " + row + "/" + col);
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/Tables.java b/tests/testbench/com/vaadin/tests/components/table/Tables.java
index 3a34fb47b2..7da5a590a1 100644
--- a/tests/testbench/com/vaadin/tests/components/table/Tables.java
+++ b/tests/testbench/com/vaadin/tests/components/table/Tables.java
@@ -34,9 +34,10 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
private static final String CATEGORY_FOOTER = "Footer";
private static final String CATEGORY_COLUMNS = "Columns";
+ @SuppressWarnings("unchecked")
@Override
protected Class<T> getTestClass() {
- return (Class) Table.class;
+ return (Class<T>) Table.class;
}
/* COMMANDS */
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTest.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTest.java
index bbbe92f069..db17d3b77b 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTest.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTest.java
@@ -80,6 +80,7 @@ public class TabSheetTest<T extends TabSheet> extends
}
};
+ @SuppressWarnings("unchecked")
@Override
protected Class<T> getTestClass() {
return (Class<T>) TabSheet.class;
diff --git a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java
index 86aee2d5ab..7fac9e442e 100644
--- a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java
+++ b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java
@@ -17,7 +17,6 @@ import com.vaadin.data.util.sqlcontainer.connection.SimpleJDBCConnectionPool;
import com.vaadin.data.util.sqlcontainer.query.TableQuery;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Form;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Table;
@@ -65,7 +64,7 @@ public class CheckboxUpdateProblem extends Application implements
public void valueChange(ValueChangeEvent event) {
- Property property = event.getProperty();
+ Property<?> property = event.getProperty();
if (property == testList) {
Item item = testList.getItem(testList.getValue());
@@ -85,7 +84,7 @@ public class CheckboxUpdateProblem extends Application implements
setWriteThrough(false);
setInvalidCommitted(false);
- save = new Button("Save", (ClickListener) this);
+ save = new Button("Save", this);
getFooter().addComponent(save);
getFooter().setVisible(false);
}
diff --git a/tests/testbench/com/vaadin/tests/layouts/CaptionsInLayouts.java b/tests/testbench/com/vaadin/tests/layouts/CaptionsInLayouts.java
index ec825a3404..b447101e96 100644
--- a/tests/testbench/com/vaadin/tests/layouts/CaptionsInLayouts.java
+++ b/tests/testbench/com/vaadin/tests/layouts/CaptionsInLayouts.java
@@ -37,7 +37,7 @@ public class CaptionsInLayouts extends TestBase {
private HorizontalLayout horizontalLayout;
private GridLayout gridLayout;
private FormLayout formLayout;
- private List<AbstractField> components = new ArrayList<AbstractField>();
+ private List<AbstractField<?>> components = new ArrayList<AbstractField<?>>();
private CssLayout cssLayout;
private HorizontalLayout layoutParent = new HorizontalLayout();
@@ -69,7 +69,7 @@ public class CaptionsInLayouts extends TestBase {
}
protected void prependCaptions(String prepend) {
- for (AbstractField c : components) {
+ for (AbstractField<?> c : components) {
c.setCaption(prepend + c.getCaption());
}
@@ -102,14 +102,14 @@ public class CaptionsInLayouts extends TestBase {
}
protected void setRequired(boolean value) {
- for (AbstractField c : components) {
+ for (AbstractField<?> c : components) {
c.setRequired(value);
}
}
protected void setIcon(boolean value) {
- for (AbstractField c : components) {
+ for (AbstractField<?> c : components) {
if (!value) {
c.setIcon(null);
} else {
@@ -133,7 +133,7 @@ public class CaptionsInLayouts extends TestBase {
}
protected void setError(boolean value) {
- for (AbstractField c : components) {
+ for (AbstractField<?> c : components) {
if (value) {
c.setComponentError(new UserError("error"));
} else {
diff --git a/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java b/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java
index 08df953e66..af41e2ee6b 100644
--- a/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java
+++ b/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java
@@ -27,31 +27,31 @@ public class GridLayoutCaptions extends TestBase {
private CssLayout wrapper2 = new CssLayout();
private FormFieldFactory fff = new FormFieldFactory() {
- public Field createField(Item item, Object propertyId,
+ public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
if (propertyId.equals(DataPOJO.Fields.name.name())) {
- Field f = DefaultFieldFactory.get().createField(item,
+ Field<?> f = DefaultFieldFactory.get().createField(item,
propertyId, uiContext);
f.setCaption("This is a long caption for the name field");
return f;
} else if (propertyId.equals(DataPOJO.Fields.hp.name())) {
- Field f = DefaultFieldFactory.get().createField(item,
+ Field<?> f = DefaultFieldFactory.get().createField(item,
propertyId, uiContext);
f.setCaption("This is a long caption for the HP field, but it has a VL as a wrapper");
return f;
} else if (propertyId.equals(DataPOJO.Fields.place.name())) {
- Field f = DefaultFieldFactory.get().createField(item,
+ Field<?> f = DefaultFieldFactory.get().createField(item,
propertyId, uiContext);
f.setCaption("This is a long caption for the Place field, but it has a CSSLo as a wrapper");
return f;
} else if (propertyId.equals(DataPOJO.Fields.price.name())) {
- Field f = DefaultFieldFactory.get().createField(item,
+ Field<?> f = DefaultFieldFactory.get().createField(item,
propertyId, uiContext);
f.setCaption("With size undefined the caption behaves like this...");
f.setSizeFull();
diff --git a/tests/testbench/com/vaadin/tests/layouts/TestAbsoluteLayout.java b/tests/testbench/com/vaadin/tests/layouts/TestAbsoluteLayout.java
index baf8218922..4f7269284d 100644
--- a/tests/testbench/com/vaadin/tests/layouts/TestAbsoluteLayout.java
+++ b/tests/testbench/com/vaadin/tests/layouts/TestAbsoluteLayout.java
@@ -33,7 +33,7 @@ public class TestAbsoluteLayout extends TestBase {
private static class MFieldFactory extends DefaultFieldFactory {
@Override
- public Field createField(Item item, Object propertyId,
+ public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
if (propertyId.equals("CSSString")) {
TextArea f = new TextArea();
@@ -155,7 +155,8 @@ public class TestAbsoluteLayout extends TestBase {
+ getDebugId();
if (next instanceof Property) {
- caption += " value:" + ((Property) next).getValue();
+ caption += " value:"
+ + ((Property<?>) next).getValue();
}
item.getItemProperty("caption").setValue(caption);
diff --git a/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java b/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java
index 6b56d93a30..0181c0a0a6 100644
--- a/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java
+++ b/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java
@@ -510,17 +510,17 @@ public class GridLayoutTests extends AbstractLayoutTests {
glo.replaceComponent(row2, row2 = new NativeSelect());
glo.replaceComponent(row3, row3 = getTestTabsheet());
- ((AbstractField) col1).setRequired(true);
- ((AbstractField) col1).setValidationVisible(true);
- ((AbstractField) col1).setRequiredError("required error");
+ ((AbstractField<?>) col1).setRequired(true);
+ ((AbstractField<?>) col1).setValidationVisible(true);
+ ((AbstractField<?>) col1).setRequiredError("required error");
- ((AbstractField) row1).setRequired(true);
- ((AbstractField) row1).setValidationVisible(true);
- ((AbstractField) row1).setRequiredError("required error");
+ ((AbstractField<?>) row1).setRequired(true);
+ ((AbstractField<?>) row1).setValidationVisible(true);
+ ((AbstractField<?>) row1).setRequiredError("required error");
- ((AbstractField) row2).setRequired(true);
- ((AbstractField) row2).setValidationVisible(true);
- ((AbstractField) row2).setRequiredError("required error");
+ ((AbstractField<?>) row2).setRequired(true);
+ ((AbstractField<?>) row2).setValidationVisible(true);
+ ((AbstractField<?>) row2).setRequiredError("required error");
row2.setComponentError(new UserError("component error, user error"));
row3.setComponentError(new UserError("component error, user error"));
diff --git a/tests/testbench/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java b/tests/testbench/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java
index ff6e76e480..3f7d9b9f6b 100644
--- a/tests/testbench/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java
+++ b/tests/testbench/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java
@@ -489,7 +489,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
components[3] = getTestTabsheet();
components[3].setIcon(new ThemeResource(LOCK_16_PNG));
- AbstractField[] fields = new AbstractField[5];
+ AbstractField<?>[] fields = new AbstractField<?>[5];
fields[0] = new TextField();
fields[0].setRequired(true);
fields[0].setValidationVisible(true);
diff --git a/tests/testbench/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java b/tests/testbench/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java
index 8019ae5aca..ba29e1c476 100644
--- a/tests/testbench/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java
+++ b/tests/testbench/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java
@@ -510,7 +510,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
components[3] = getTestTabsheet();
components[3].setIcon(new ThemeResource(LOCK_16_PNG));
- AbstractField[] fields = new AbstractField[6];
+ AbstractField<?>[] fields = new AbstractField<?>[6];
fields[0] = new TextField();
fields[0].setRequired(true);
fields[0].setValidationVisible(true);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1245.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1245.java
index e83ac6aded..afc04321ae 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1245.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1245.java
@@ -80,7 +80,8 @@ class TreeExample extends CustomComponent {
// get the created item
final Item item = tree.getItem(id);
// set our "caption" property
- final Property p = item.getItemProperty(CAPTION_PROPERTY);
+ @SuppressWarnings("unchecked")
+ final Property<String> p = item.getItemProperty(CAPTION_PROPERTY);
p.setValue(caption);
if (parent != null) {
tree.setChildrenAllowed(parent, true);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer.java
index b8b6cfe5dd..571064f434 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer.java
@@ -65,7 +65,7 @@ public class Ticket1506_TestContainer implements Container {
return a;
}
- public Property getContainerProperty(Object itemId, Object propertyId) {
+ public Property<?> getContainerProperty(Object itemId, Object propertyId) {
if (items.isEmpty()) {
loadItems();
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java
index c39454027a..545418b3ab 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java
@@ -57,7 +57,7 @@ public class Ticket1506_TestContainer2 implements Container {
return items.keySet();
}
- public Property getContainerProperty(Object itemId, Object propertyId) {
+ public Property<?> getContainerProperty(Object itemId, Object propertyId) {
if (items.isEmpty()) {
loadItems();
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java
index 265f3041e9..b5cb3b55c2 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java
@@ -93,7 +93,7 @@ public class Ticket1804 extends com.vaadin.Application {
StringBuffer msg = new StringBuffer();
for (Iterator<Select> i = listOfAllFields.iterator(); i
.hasNext();) {
- AbstractField af = i.next();
+ AbstractField<?> af = i.next();
msg.append("<h1>" + af.getCaption() + "</h1>\n");
msg.append("Value=" + af.getValue() + "<br/>\n");
if (af.isValid()) {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1819.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1819.java
index 6f06055fc4..249b3f7390 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1819.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1819.java
@@ -49,7 +49,7 @@ public class Ticket1819 extends com.vaadin.Application {
StringBuffer msg = new StringBuffer();
for (Iterator<Select> i = listOfAllFields.iterator(); i
.hasNext();) {
- AbstractField af = i.next();
+ AbstractField<?> af = i.next();
msg.append("<h1>" + af.getCaption() + "</h1>\n");
msg.append("Value=" + af.getValue() + "<br/>\n");
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java
index 0bb631aab5..e81a80670a 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java
@@ -184,7 +184,7 @@ public class Ticket1878 extends Application {
form.setItemDataSource(item);
for (Iterator<?> i = item.getItemPropertyIds().iterator(); i.hasNext();) {
Object property = i.next();
- Field f = form.getField(property);
+ Field<?> f = form.getField(property);
f.setRequired(r.nextBoolean());
if (r.nextBoolean()) {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2204.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2204.java
index 6a047cb626..19b92bcc0d 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2204.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2204.java
@@ -128,7 +128,7 @@ public class Ticket2204 extends Application {
Form f = (Form) cc;
f.setFormFieldFactory(new FormFieldFactory() {
- public Field createField(Item item, Object propertyId,
+ public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
formTextArea = new RichTextArea();
formTextArea.setVisible(false);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java
index 297a357f08..54ef8e6faf 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java
@@ -145,7 +145,7 @@ public class Ticket2998 extends Application {
}
@Override
- public Field createField(Container container, Object itemId,
+ public Field<?> createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
/*
@@ -162,7 +162,7 @@ public class Ticket2998 extends Application {
return getSecondaryTypesList(itemId);
}
- final Field f = super.createField(container, itemId, propertyId,
+ final Field<?> f = super.createField(container, itemId, propertyId,
uiContext);
if (f != null) {
if (f instanceof TextField) {
@@ -202,7 +202,7 @@ public class Ticket2998 extends Application {
private Map<Object, ListSelect> workoutIdToList = new HashMap<Object, ListSelect>();
- private Field getSecondaryTypesList(Object itemId) {
+ private Field<?> getSecondaryTypesList(Object itemId) {
ListSelect list = workoutIdToList.get(itemId);
if (list == null) {
list = new ListSelect();
@@ -221,7 +221,7 @@ public class Ticket2998 extends Application {
private Map<Object, ComboBox> workoutIdToCombobox = new HashMap<Object, ComboBox>();
- private Field getTrainingTypeComboboxFor(Object itemId) {
+ private Field<?> getTrainingTypeComboboxFor(Object itemId) {
ComboBox cb = workoutIdToCombobox.get(itemId);
if (cb == null) {
final ComboBox cb2 = new ComboBox();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket677.java b/tests/testbench/com/vaadin/tests/tickets/Ticket677.java
index ee7320e59b..de51306cf8 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket677.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket677.java
@@ -111,9 +111,9 @@ public class Ticket677 extends Application {
form.setFormFieldFactory(new DefaultFieldFactory() {
@Override
- public Field createField(Item item, Object propertyId,
+ public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
- Field f = super.createField(item, propertyId, uiContext);
+ Field<?> f = super.createField(item, propertyId, uiContext);
f.setEnabled(!"disabled".equals(propertyId));
return f;
}
@@ -127,19 +127,19 @@ public class Ticket677 extends Application {
table.addContainerProperty("Text", String.class, null);
for (int i = 0; i < 150; i++) {
Item item = table.addItem("Item" + i);
- Property p = item.getItemProperty("Text");
+ Property<?> p = item.getItemProperty("Text");
p.setValue(i % 5 == 0 ? "enabled" : "disabled");
}
table.setTableFieldFactory(new DefaultFieldFactory() {
@Override
- public Field createField(Container container, Object itemId,
+ public Field<?> createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
- Field f = super.createField(container, itemId, propertyId,
+ Field<?> f = super.createField(container, itemId, propertyId,
uiContext);
Item item = container.getItem(itemId);
- Property p = item.getItemProperty(propertyId);
+ Property<?> p = item.getItemProperty(propertyId);
if ("disabled".equals(p.getValue())) {
f.setEnabled(false);
}
diff --git a/tests/testbench/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java b/tests/testbench/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java
index b1d6a8f068..67fc2afb7d 100644
--- a/tests/testbench/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java
+++ b/tests/testbench/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java
@@ -77,7 +77,7 @@ public class EmptyFieldErrorIndicators extends TestBase {
// hand-crafted form, not using form field factory
final Form form = new Form() {
@Override
- public void addField(Object propertyId, Field field) {
+ public void addField(Object propertyId, Field<?> field) {
super.addField(propertyId, field);
field.setRequired(required);
field.setRequiredError("Missing required value!");