diff options
author | Artur Signell <artur@vaadin.com> | 2012-04-16 14:05:09 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-04-16 14:05:09 +0300 |
commit | e110414f3d1946c2ff313367ea8752aeece3469c (patch) | |
tree | da4f802317c1de6181217a4a282ca1a47df92345 /tests/server-side | |
parent | 129849db1fdfeafde7d1cf734f48e96bf36d7492 (diff) | |
download | vaadin-framework-e110414f3d1946c2ff313367ea8752aeece3469c.tar.gz vaadin-framework-e110414f3d1946c2ff313367ea8752aeece3469c.zip |
Reformatted all source files
Diffstat (limited to 'tests/server-side')
14 files changed, 64 insertions, 48 deletions
diff --git a/tests/server-side/com/vaadin/data/util/sqlcontainer/DataGenerator.java b/tests/server-side/com/vaadin/data/util/sqlcontainer/DataGenerator.java index 6fa807b007..489f780d61 100644 --- a/tests/server-side/com/vaadin/data/util/sqlcontainer/DataGenerator.java +++ b/tests/server-side/com/vaadin/data/util/sqlcontainer/DataGenerator.java @@ -12,11 +12,12 @@ import com.vaadin.data.util.sqlcontainer.AllTests.DB; import com.vaadin.data.util.sqlcontainer.connection.JDBCConnectionPool; public class DataGenerator { - - @Test - public void testDummy(){ - // Added dummy test so JUnit will not complain about "No runnable methods". - } + + @Test + public void testDummy() { + // Added dummy test so JUnit will not complain about + // "No runnable methods". + } public static void addPeopleToDatabase(JDBCConnectionPool connectionPool) throws SQLException { diff --git a/tests/server-side/com/vaadin/data/util/sqlcontainer/FreeformQueryUtil.java b/tests/server-side/com/vaadin/data/util/sqlcontainer/FreeformQueryUtil.java index 2579a38aa1..b0e2a232ca 100644 --- a/tests/server-side/com/vaadin/data/util/sqlcontainer/FreeformQueryUtil.java +++ b/tests/server-side/com/vaadin/data/util/sqlcontainer/FreeformQueryUtil.java @@ -11,11 +11,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.filter.QueryBuilder; public class FreeformQueryUtil { - @Test - public void testDummy(){ - // Added dummy test so JUnit will not complain about "No runnable methods". - } - + @Test + public void testDummy() { + // Added dummy test so JUnit will not complain about + // "No runnable methods". + } + public static StatementHelper getQueryWithFilters(List<Filter> filters, int offset, int limit) { StatementHelper sh = new StatementHelper(); @@ -30,8 +31,7 @@ public class FreeformQueryUtil { query.append(") AS rownum, * FROM \"PEOPLE\""); if (!filters.isEmpty()) { - query.append(QueryBuilder.getWhereStringForFilters( - filters, sh)); + query.append(QueryBuilder.getWhereStringForFilters(filters, sh)); } query.append(") AS a WHERE a.rownum BETWEEN ").append(offset) .append(" AND ").append(Integer.toString(offset + limit)); @@ -46,8 +46,7 @@ public class FreeformQueryUtil { query.append("SELECT * FROM (SELECT x.*, ROWNUM AS " + "\"rownum\" FROM (SELECT * FROM \"PEOPLE\""); if (!filters.isEmpty()) { - query.append(QueryBuilder.getWhereStringForFilters( - filters, sh)); + query.append(QueryBuilder.getWhereStringForFilters(filters, sh)); } query.append(") x) WHERE \"rownum\" BETWEEN ? AND ?"); sh.addParameterValue(offset); @@ -57,8 +56,7 @@ public class FreeformQueryUtil { } else { StringBuilder query = new StringBuilder("SELECT * FROM people"); if (!filters.isEmpty()) { - query.append(QueryBuilder.getWhereStringForFilters( - filters, sh)); + query.append(QueryBuilder.getWhereStringForFilters(filters, sh)); } if (limit != 0 || offset != 0) { query.append(" LIMIT ? OFFSET ?"); diff --git a/tests/server-side/com/vaadin/data/util/sqlcontainer/UtilTest.java b/tests/server-side/com/vaadin/data/util/sqlcontainer/UtilTest.java index d6a6a72300..31bdf2b81b 100644 --- a/tests/server-side/com/vaadin/data/util/sqlcontainer/UtilTest.java +++ b/tests/server-side/com/vaadin/data/util/sqlcontainer/UtilTest.java @@ -21,7 +21,7 @@ public class UtilTest { @Test public void escapeSQL_severalQuotes_returnsEscapedString() { Assert.assertEquals("asdf''ghjk''qwerty", - SQLUtil.escapeSQL("asdf'ghjk'qwerty")); + SQLUtil.escapeSQL("asdf'ghjk'qwerty")); } @Test @@ -32,12 +32,13 @@ public class UtilTest { @Test public void escapeSQL_multipleDoubleQuotes_returnsEscapedString() { Assert.assertEquals("asdf\\\"foo\\\"bar", - SQLUtil.escapeSQL("asdf\"foo\"bar")); + SQLUtil.escapeSQL("asdf\"foo\"bar")); } @Test public void escapeSQL_backslashes_returnsEscapedString() { - Assert.assertEquals("foo\\\\nbar\\\\r", SQLUtil.escapeSQL("foo\\nbar\\r")); + Assert.assertEquals("foo\\\\nbar\\\\r", + SQLUtil.escapeSQL("foo\\nbar\\r")); } @Test 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 19019eed0b..3ee260245a 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 @@ -11,11 +11,12 @@ import org.junit.Test; */ public class MockInitialContextFactory implements InitialContextFactory { private static Context mockCtx = null; - + @Test - public void testDummy(){ - // Added dummy test so JUnit will not complain about "No runnable methods". - } + public void testDummy() { + // Added dummy test so JUnit will not complain about + // "No runnable methods". + } public static void setMockContext(Context ctx) { mockCtx = ctx; diff --git a/tests/server-side/com/vaadin/tests/server/TestAbstractBeanContainerListeners.java b/tests/server-side/com/vaadin/tests/server/TestAbstractBeanContainerListeners.java index d6598a3b62..0d8433d1c6 100644 --- a/tests/server-side/com/vaadin/tests/server/TestAbstractBeanContainerListeners.java +++ b/tests/server-side/com/vaadin/tests/server/TestAbstractBeanContainerListeners.java @@ -5,7 +5,8 @@ import com.vaadin.data.Container.PropertySetChangeListener; import com.vaadin.data.util.BeanItemContainer; import com.vaadin.tests.server.component.AbstractListenerMethodsTest; -public class TestAbstractBeanContainerListeners extends AbstractListenerMethodsTest { +public class TestAbstractBeanContainerListeners extends + AbstractListenerMethodsTest { public void testPropertySetChangeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(BeanItemContainer.class, PropertySetChangeEvent.class, PropertySetChangeListener.class, diff --git a/tests/server-side/com/vaadin/tests/server/TestAbstractInMemoryContainerListeners.java b/tests/server-side/com/vaadin/tests/server/TestAbstractInMemoryContainerListeners.java index 4be4e35554..a8e2a4aa2a 100644 --- a/tests/server-side/com/vaadin/tests/server/TestAbstractInMemoryContainerListeners.java +++ b/tests/server-side/com/vaadin/tests/server/TestAbstractInMemoryContainerListeners.java @@ -5,7 +5,8 @@ import com.vaadin.data.Container.ItemSetChangeListener; import com.vaadin.data.util.IndexedContainer; import com.vaadin.tests.server.component.AbstractListenerMethodsTest; -public class TestAbstractInMemoryContainerListeners extends AbstractListenerMethodsTest { +public class TestAbstractInMemoryContainerListeners extends + AbstractListenerMethodsTest { public void testItemSetChangeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(IndexedContainer.class, ItemSetChangeEvent.class, ItemSetChangeListener.class); diff --git a/tests/server-side/com/vaadin/tests/server/TestPropertyFormatter.java b/tests/server-side/com/vaadin/tests/server/TestPropertyFormatter.java index 91e36b5caa..48c60c83c4 100644 --- a/tests/server-side/com/vaadin/tests/server/TestPropertyFormatter.java +++ b/tests/server-side/com/vaadin/tests/server/TestPropertyFormatter.java @@ -27,6 +27,7 @@ public class TestPropertyFormatter extends TestCase { return getExpectedClass().newInstance(); } }; + @SuppressWarnings("rawtypes") private Class expectedClass; @@ -34,36 +35,41 @@ public class TestPropertyFormatter extends TestCase { private Class getExpectedClass() { return expectedClass; } - + /** * The object passed to format should be same as property's type. - * @throws IllegalAccessException - * @throws InstantiationException + * + * @throws IllegalAccessException + * @throws InstantiationException */ @Test @SuppressWarnings({ "rawtypes" }) - public void testCorrectTypeForFormat() throws InstantiationException, IllegalAccessException { - Class[] testedTypes = new Class[] {Integer.class, Boolean.class, Double.class, String.class, Date.class}; - Object[] testValues = new Object[] {new Integer(3), Boolean.FALSE, new Double(3.3), "bar", new Date()}; - + public void testCorrectTypeForFormat() throws InstantiationException, + IllegalAccessException { + Class[] testedTypes = new Class[] { Integer.class, Boolean.class, + Double.class, String.class, Date.class }; + Object[] testValues = new Object[] { new Integer(3), Boolean.FALSE, + new Double(3.3), "bar", new Date() }; + int i = 0; for (Class class1 : testedTypes) { expectedClass = class1; - + TestFormatter formatter = new TestFormatter(); - + // Should just return null, without formatting Object value = formatter.getValue(); - + // test with property which value is null - formatter.setPropertyDataSource(new ObjectProperty(null, expectedClass)); + formatter.setPropertyDataSource(new ObjectProperty(null, + expectedClass)); formatter.getValue(); // calls format - + // test with a value - formatter.setPropertyDataSource(new ObjectProperty(testValues[i++], expectedClass)); + formatter.setPropertyDataSource(new ObjectProperty(testValues[i++], + expectedClass)); formatter.getValue(); // calls format } - } } diff --git a/tests/server-side/com/vaadin/tests/server/component/AbstractListenerMethodsTest.java b/tests/server-side/com/vaadin/tests/server/component/AbstractListenerMethodsTest.java index 355f5167d7..e189ffc77d 100644 --- a/tests/server-side/com/vaadin/tests/server/component/AbstractListenerMethodsTest.java +++ b/tests/server-side/com/vaadin/tests/server/component/AbstractListenerMethodsTest.java @@ -48,11 +48,14 @@ public abstract class AbstractListenerMethodsTest extends TestCase { System.out.println("package " + packageName + ";"); System.out.println("import " - + AbstractListenerMethodsTest.class.getName() + ";"); + + AbstractListenerMethodsTest.class.getName() + + ";"); System.out.println("import " + c.getName() + ";"); - System.out.println("public class " + c.getSimpleName() + System.out.println("public class " + + c.getSimpleName() + "Listeners extends " - + AbstractListenerMethodsTest.class.getSimpleName() + " {"); + + AbstractListenerMethodsTest.class + .getSimpleName() + " {"); } String listenerClassName = m.getParameterTypes()[0] diff --git a/tests/server-side/com/vaadin/tests/server/component/abstractcomponentcontainer/TestAbstractComponentContainerListeners.java b/tests/server-side/com/vaadin/tests/server/component/abstractcomponentcontainer/TestAbstractComponentContainerListeners.java index 6a8267f296..f9f170eb2a 100644 --- a/tests/server-side/com/vaadin/tests/server/component/abstractcomponentcontainer/TestAbstractComponentContainerListeners.java +++ b/tests/server-side/com/vaadin/tests/server/component/abstractcomponentcontainer/TestAbstractComponentContainerListeners.java @@ -8,7 +8,8 @@ import com.vaadin.ui.ComponentContainer.ComponentDetachListener; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.VerticalLayout; -public class TestAbstractComponentContainerListeners extends AbstractListenerMethodsTest { +public class TestAbstractComponentContainerListeners extends + AbstractListenerMethodsTest { public void testComponentDetachListenerAddGetRemove() throws Exception { testListenerAddGetRemove(HorizontalLayout.class, ComponentDetachEvent.class, ComponentDetachListener.class); diff --git a/tests/server-side/com/vaadin/tests/server/component/abstractorderedlayout/TestAbstractOrderedLayoutListeners.java b/tests/server-side/com/vaadin/tests/server/component/abstractorderedlayout/TestAbstractOrderedLayoutListeners.java index 02143a2796..a0b34aca78 100644 --- a/tests/server-side/com/vaadin/tests/server/component/abstractorderedlayout/TestAbstractOrderedLayoutListeners.java +++ b/tests/server-side/com/vaadin/tests/server/component/abstractorderedlayout/TestAbstractOrderedLayoutListeners.java @@ -5,7 +5,8 @@ import com.vaadin.event.LayoutEvents.LayoutClickListener; import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.VerticalLayout; -public class TestAbstractOrderedLayoutListeners extends AbstractListenerMethodsTest { +public class TestAbstractOrderedLayoutListeners extends + AbstractListenerMethodsTest { public void testLayoutClickListenerAddGetRemove() throws Exception { testListenerAddGetRemove(VerticalLayout.class, LayoutClickEvent.class, LayoutClickListener.class); diff --git a/tests/server-side/com/vaadin/tests/server/component/abstractsplitpanel/TestAbstractSplitPanelListeners.java b/tests/server-side/com/vaadin/tests/server/component/abstractsplitpanel/TestAbstractSplitPanelListeners.java index 5e9556c182..2b6cdaa6cc 100644 --- a/tests/server-side/com/vaadin/tests/server/component/abstractsplitpanel/TestAbstractSplitPanelListeners.java +++ b/tests/server-side/com/vaadin/tests/server/component/abstractsplitpanel/TestAbstractSplitPanelListeners.java @@ -5,7 +5,8 @@ import com.vaadin.ui.AbstractSplitPanel.SplitterClickEvent; import com.vaadin.ui.AbstractSplitPanel.SplitterClickListener; import com.vaadin.ui.HorizontalSplitPanel; -public class TestAbstractSplitPanelListeners extends AbstractListenerMethodsTest { +public class TestAbstractSplitPanelListeners extends + AbstractListenerMethodsTest { public void testSplitterClickListenerAddGetRemove() throws Exception { testListenerAddGetRemove(HorizontalSplitPanel.class, SplitterClickEvent.class, SplitterClickListener.class); diff --git a/tests/server-side/com/vaadin/tests/server/component/table/TableListeners.java b/tests/server-side/com/vaadin/tests/server/component/table/TableListeners.java index 6d9c7ed0eb..6cc522f8c7 100644 --- a/tests/server-side/com/vaadin/tests/server/component/table/TableListeners.java +++ b/tests/server-side/com/vaadin/tests/server/component/table/TableListeners.java @@ -20,7 +20,8 @@ public class TableListeners extends AbstractListenerMethodsTest { } public void testItemClickListenerAddGetRemove() throws Exception { - testListenerAddGetRemove(Table.class, ItemClickEvent.class, ItemClickListener.class); + testListenerAddGetRemove(Table.class, ItemClickEvent.class, + ItemClickListener.class); } public void testFooterClickListenerAddGetRemove() throws Exception { diff --git a/tests/server-side/com/vaadin/tests/server/component/tabsheet/TestTabSheet.java b/tests/server-side/com/vaadin/tests/server/component/tabsheet/TestTabSheet.java index 1832d1bd95..85c88e29bb 100644 --- a/tests/server-side/com/vaadin/tests/server/component/tabsheet/TestTabSheet.java +++ b/tests/server-side/com/vaadin/tests/server/component/tabsheet/TestTabSheet.java @@ -120,5 +120,5 @@ public class TestTabSheet { assertEquals(tab2, tabSheet.getTab(1)); assertEquals(tab3, tabSheet.getTab(2)); } - + } diff --git a/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java b/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java index a67c7bb387..7423ba8669 100644 --- a/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java +++ b/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java @@ -206,7 +206,7 @@ public class AttachDetachWindow { */ private void assertAttached(TestContainer win) { TestContent testContent = win.getTestContent(); - + assertTrue("window attach not called", win.attachCalled()); assertTrue("window content attach not called", testContent.contentAttachCalled); |