diff options
Diffstat (limited to 'tests/server-side/com/vaadin/data/util')
9 files changed, 52 insertions, 0 deletions
diff --git a/tests/server-side/com/vaadin/data/util/AbstractContainerTest.java b/tests/server-side/com/vaadin/data/util/AbstractContainerTest.java index 6cbe675fa1..d703fb0364 100644 --- a/tests/server-side/com/vaadin/data/util/AbstractContainerTest.java +++ b/tests/server-side/com/vaadin/data/util/AbstractContainerTest.java @@ -62,6 +62,7 @@ public abstract class AbstractContainerTest extends TestCase { protected static class ItemSetChangeCounter extends AbstractEventCounter implements ItemSetChangeListener { + @Override public void containerItemSetChange(ItemSetChangeEvent event) { increment(); } diff --git a/tests/server-side/com/vaadin/data/util/BeanContainerTest.java b/tests/server-side/com/vaadin/data/util/BeanContainerTest.java index d9fa8d896e..9037e303a8 100644 --- a/tests/server-side/com/vaadin/data/util/BeanContainerTest.java +++ b/tests/server-side/com/vaadin/data/util/BeanContainerTest.java @@ -18,6 +18,7 @@ public class BeanContainerTest extends AbstractBeanContainerTest { protected static class PersonNameResolver implements BeanIdResolver<String, Person> { + @Override public String getIdForBean(Person bean) { return bean != null ? bean.getName() : null; } @@ -27,6 +28,7 @@ public class BeanContainerTest extends AbstractBeanContainerTest { protected static class NullResolver implements BeanIdResolver<String, Person> { + @Override public String getIdForBean(Person bean) { return null; } @@ -332,6 +334,7 @@ public class BeanContainerTest extends AbstractBeanContainerTest { container .setBeanIdResolver(new BeanIdResolver<String, AbstractBeanContainerTest.Person>() { + @Override public String getIdForBean(Person bean) { return bean.getName(); } diff --git a/tests/server-side/com/vaadin/data/util/BeanItemTest.java b/tests/server-side/com/vaadin/data/util/BeanItemTest.java index 51e11260f5..e1ad75796c 100644 --- a/tests/server-side/com/vaadin/data/util/BeanItemTest.java +++ b/tests/server-side/com/vaadin/data/util/BeanItemTest.java @@ -127,6 +127,7 @@ public class BeanItemTest extends TestCase { public void setSub(int i); + @Override public int getOverride(); public void setOverride(int i); diff --git a/tests/server-side/com/vaadin/data/util/TestContainerSorting.java b/tests/server-side/com/vaadin/data/util/TestContainerSorting.java index 9e69b94fbb..497699605a 100644 --- a/tests/server-side/com/vaadin/data/util/TestContainerSorting.java +++ b/tests/server-side/com/vaadin/data/util/TestContainerSorting.java @@ -205,6 +205,7 @@ public class TestContainerSorting extends TestCase { public class MyObject implements Comparable<MyObject> { private String data; + @Override public int compareTo(MyObject o) { if (o == null) { return 1; diff --git a/tests/server-side/com/vaadin/data/util/TestHierarchicalContainer.java b/tests/server-side/com/vaadin/data/util/TestHierarchicalContainer.java index 60894dbe6f..9e0558a122 100644 --- a/tests/server-side/com/vaadin/data/util/TestHierarchicalContainer.java +++ b/tests/server-side/com/vaadin/data/util/TestHierarchicalContainer.java @@ -176,11 +176,13 @@ public class TestHierarchicalContainer extends // Dummy filter that does not remove any items c.addContainerFilter(new Filter() { + @Override public boolean passesFilter(Object itemId, Item item) throws UnsupportedOperationException { return true; } + @Override public boolean appliesToProperty(Object propertyId) { return true; } diff --git a/tests/server-side/com/vaadin/data/util/filter/AbstractFilterTest.java b/tests/server-side/com/vaadin/data/util/filter/AbstractFilterTest.java index efc31f0bd4..6f96c3a51a 100644 --- a/tests/server-side/com/vaadin/data/util/filter/AbstractFilterTest.java +++ b/tests/server-side/com/vaadin/data/util/filter/AbstractFilterTest.java @@ -24,22 +24,27 @@ public abstract class AbstractFilterTest<FILTERTYPE extends Filter> extends protected static class NullProperty implements Property<String> { + @Override public String getValue() { return null; } + @Override public void setValue(Object newValue) throws ReadOnlyException { throw new ReadOnlyException(); } + @Override public Class<String> getType() { return String.class; } + @Override public boolean isReadOnly() { return true; } + @Override public void setReadOnly(boolean newStatus) { // do nothing } @@ -60,11 +65,13 @@ public abstract class AbstractFilterTest<FILTERTYPE extends Filter> extends this.propertyId = propertyId; } + @Override public boolean passesFilter(Object itemId, Item item) throws UnsupportedOperationException { return this.item == item; } + @Override public boolean appliesToProperty(Object propertyId) { return this.propertyId != null ? this.propertyId.equals(propertyId) : true; diff --git a/tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java b/tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java index c273bbf590..6649bc16e8 100644 --- a/tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java +++ b/tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java @@ -323,6 +323,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryString(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer<String>() { + @Override public String answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -1132,6 +1133,7 @@ public class SQLContainerTest { delegate.storeRow(EasyMock.isA(Connection.class), EasyMock.isA(RowItem.class))) .andAnswer(new IAnswer<Integer>() { + @Override public Integer answer() throws Throwable { Connection conn = (Connection) EasyMock .getCurrentArguments()[0]; @@ -1163,6 +1165,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryString(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer<String>() { + @Override public String answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -1231,6 +1234,7 @@ public class SQLContainerTest { delegate.storeRow(EasyMock.isA(Connection.class), EasyMock.isA(RowItem.class))) .andAnswer(new IAnswer<Integer>() { + @Override public Integer answer() throws Throwable { Connection conn = (Connection) EasyMock .getCurrentArguments()[0]; @@ -1262,6 +1266,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryString(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer<String>() { + @Override public String answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -1337,6 +1342,7 @@ public class SQLContainerTest { delegate.removeRow(EasyMock.isA(Connection.class), EasyMock.isA(RowItem.class))) .andAnswer(new IAnswer<Boolean>() { + @Override public Boolean answer() throws Throwable { Connection conn = (Connection) EasyMock .getCurrentArguments()[0]; @@ -1352,6 +1358,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryString(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer<String>() { + @Override public String answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -1414,6 +1421,7 @@ public class SQLContainerTest { delegate.storeRow(EasyMock.isA(Connection.class), EasyMock.isA(RowItem.class))) .andAnswer(new IAnswer<Integer>() { + @Override public Integer answer() throws Throwable { Connection conn = (Connection) EasyMock .getCurrentArguments()[0]; @@ -1432,6 +1440,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryString(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer<String>() { + @Override public String answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -1644,6 +1653,7 @@ public class SQLContainerTest { EasyMock.expectLastCall().anyTimes(); delegate.setOrderBy(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() { + @Override public Object answer() throws Throwable { List<OrderBy> orders = (List<OrderBy>) EasyMock .getCurrentArguments()[0]; @@ -1655,6 +1665,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryString(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer<String>() { + @Override public String answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -1756,6 +1767,7 @@ public class SQLContainerTest { EasyMock.expectLastCall().anyTimes(); delegate.setOrderBy(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() { + @Override public Object answer() throws Throwable { List<OrderBy> orders = (List<OrderBy>) EasyMock .getCurrentArguments()[0]; @@ -1767,6 +1779,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryString(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer<String>() { + @Override public String answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -1861,6 +1874,7 @@ public class SQLContainerTest { EasyMock.expectLastCall().anyTimes(); delegate.setFilters(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() { + @Override public Object answer() throws Throwable { List<Filter> orders = (List<Filter>) EasyMock .getCurrentArguments()[0]; @@ -1872,6 +1886,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer<StatementHelper>() { + @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -1882,6 +1897,7 @@ public class SQLContainerTest { }).anyTimes(); EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer<StatementHelper>() { + @Override @SuppressWarnings("deprecation") public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); @@ -1931,6 +1947,7 @@ public class SQLContainerTest { EasyMock.expectLastCall().anyTimes(); delegate.setFilters(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() { + @Override public Object answer() throws Throwable { List<Filter> orders = (List<Filter>) EasyMock .getCurrentArguments()[0]; @@ -1942,6 +1959,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer<StatementHelper>() { + @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -1952,6 +1970,7 @@ public class SQLContainerTest { }).anyTimes(); EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer<StatementHelper>() { + @Override @SuppressWarnings("deprecation") public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); @@ -2000,6 +2019,7 @@ public class SQLContainerTest { EasyMock.expectLastCall().anyTimes(); delegate.setFilters(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() { + @Override public Object answer() throws Throwable { List<Filter> orders = (List<Filter>) EasyMock .getCurrentArguments()[0]; @@ -2011,6 +2031,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer<StatementHelper>() { + @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -2021,6 +2042,7 @@ public class SQLContainerTest { }).anyTimes(); EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer<StatementHelper>() { + @Override public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); StringBuffer query = new StringBuffer( @@ -2069,6 +2091,7 @@ public class SQLContainerTest { EasyMock.expectLastCall().anyTimes(); delegate.setFilters(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() { + @Override public Object answer() throws Throwable { List<Filter> orders = (List<Filter>) EasyMock .getCurrentArguments()[0]; @@ -2080,6 +2103,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer<StatementHelper>() { + @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -2090,6 +2114,7 @@ public class SQLContainerTest { }).anyTimes(); EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer<StatementHelper>() { + @Override @SuppressWarnings("deprecation") public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); @@ -2145,6 +2170,7 @@ public class SQLContainerTest { EasyMock.expectLastCall().anyTimes(); delegate.setFilters(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() { + @Override public Object answer() throws Throwable { List<Filter> orders = (List<Filter>) EasyMock .getCurrentArguments()[0]; @@ -2156,6 +2182,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer<StatementHelper>() { + @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -2166,6 +2193,7 @@ public class SQLContainerTest { }).anyTimes(); EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer<StatementHelper>() { + @Override @SuppressWarnings("deprecation") public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); @@ -2221,6 +2249,7 @@ public class SQLContainerTest { EasyMock.expectLastCall().anyTimes(); delegate.setFilters(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() { + @Override public Object answer() throws Throwable { List<Filter> orders = (List<Filter>) EasyMock .getCurrentArguments()[0]; @@ -2232,6 +2261,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer<StatementHelper>() { + @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -2242,6 +2272,7 @@ public class SQLContainerTest { }).anyTimes(); EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer<StatementHelper>() { + @Override @SuppressWarnings("deprecation") public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); @@ -2323,6 +2354,7 @@ public class SQLContainerTest { EasyMock.expectLastCall().anyTimes(); delegate.setOrderBy(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() { + @Override public Object answer() throws Throwable { List<OrderBy> orders = (List<OrderBy>) EasyMock .getCurrentArguments()[0]; @@ -2334,6 +2366,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryString(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer<String>() { + @Override public String answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); diff --git a/tests/server-side/com/vaadin/data/util/sqlcontainer/TicketTests.java b/tests/server-side/com/vaadin/data/util/sqlcontainer/TicketTests.java index 75ab455678..a12786f13a 100644 --- a/tests/server-side/com/vaadin/data/util/sqlcontainer/TicketTests.java +++ b/tests/server-side/com/vaadin/data/util/sqlcontainer/TicketTests.java @@ -64,6 +64,7 @@ public class TicketTests { EasyMock.expectLastCall().anyTimes(); delegate.setFilters(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() { + @Override public Object answer() throws Throwable { List<Filter> orders = (List<Filter>) EasyMock .getCurrentArguments()[0]; @@ -75,6 +76,7 @@ public class TicketTests { EasyMock.expect( delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer<StatementHelper>() { + @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -85,6 +87,7 @@ public class TicketTests { }).anyTimes(); EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer<StatementHelper>() { + @Override @SuppressWarnings("deprecation") public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); diff --git a/tests/server-side/com/vaadin/data/util/sqlcontainer/connection/MockInitialContextFactory.java b/tests/server-side/com/vaadin/data/util/sqlcontainer/connection/MockInitialContextFactory.java index 3ee260245a..324899e373 100644 --- a/tests/server-side/com/vaadin/data/util/sqlcontainer/connection/MockInitialContextFactory.java +++ b/tests/server-side/com/vaadin/data/util/sqlcontainer/connection/MockInitialContextFactory.java @@ -22,6 +22,7 @@ public class MockInitialContextFactory implements InitialContextFactory { mockCtx = ctx; } + @Override public Context getInitialContext(java.util.Hashtable<?, ?> environment) throws NamingException { if (mockCtx == null) { |