From: Artur Signell Date: Tue, 26 Apr 2011 10:37:14 +0000 (+0000) Subject: Renamed ListenerMethods to AbstractListenerMethodsTest to avoid it being run as a... X-Git-Tag: 6.7.0.beta1~281 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fa5a4f5b27c91fb68048d03f8a8ceb2cc62b558e;p=vaadin-framework.git Renamed ListenerMethods to AbstractListenerMethodsTest to avoid it being run as a test svn changeset:18457/svn branch:6.6 --- diff --git a/tests/src/com/vaadin/tests/server/IndexedContainerListeners.java b/tests/src/com/vaadin/tests/server/IndexedContainerListeners.java index d2e0468956..2dc0caade3 100644 --- a/tests/src/com/vaadin/tests/server/IndexedContainerListeners.java +++ b/tests/src/com/vaadin/tests/server/IndexedContainerListeners.java @@ -5,9 +5,9 @@ import com.vaadin.data.Container.PropertySetChangeListener; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.util.IndexedContainer; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; -public class IndexedContainerListeners extends ListenerMethods { +public class IndexedContainerListeners extends AbstractListenerMethodsTest { public void testValueChangeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(IndexedContainer.class, ValueChangeEvent.class, ValueChangeListener.class); diff --git a/tests/src/com/vaadin/tests/server/PropertysetItemListeners.java b/tests/src/com/vaadin/tests/server/PropertysetItemListeners.java index 0e0192bf11..69cbbbfb7c 100644 --- a/tests/src/com/vaadin/tests/server/PropertysetItemListeners.java +++ b/tests/src/com/vaadin/tests/server/PropertysetItemListeners.java @@ -3,9 +3,9 @@ package com.vaadin.tests.server; import com.vaadin.data.Item.PropertySetChangeEvent; import com.vaadin.data.Item.PropertySetChangeListener; import com.vaadin.data.util.PropertysetItem; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; -public class PropertysetItemListeners extends ListenerMethods { +public class PropertysetItemListeners extends AbstractListenerMethodsTest { public void testPropertySetChangeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(PropertysetItem.class, PropertySetChangeEvent.class, PropertySetChangeListener.class); diff --git a/tests/src/com/vaadin/tests/server/TestAbstractBeanContainerListeners.java b/tests/src/com/vaadin/tests/server/TestAbstractBeanContainerListeners.java index 40b451b557..ae70757b3e 100644 --- a/tests/src/com/vaadin/tests/server/TestAbstractBeanContainerListeners.java +++ b/tests/src/com/vaadin/tests/server/TestAbstractBeanContainerListeners.java @@ -3,9 +3,9 @@ package com.vaadin.tests.server; import com.vaadin.data.Container.PropertySetChangeEvent; import com.vaadin.data.Container.PropertySetChangeListener; import com.vaadin.data.util.BeanItemContainer; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; -public class TestAbstractBeanContainerListeners extends ListenerMethods { +public class TestAbstractBeanContainerListeners extends AbstractListenerMethodsTest { public void testPropertySetChangeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(BeanItemContainer.class, PropertySetChangeEvent.class, PropertySetChangeListener.class, diff --git a/tests/src/com/vaadin/tests/server/TestAbstractContainerListeners.java b/tests/src/com/vaadin/tests/server/TestAbstractContainerListeners.java index fdd2de389b..d10c5d7791 100644 --- a/tests/src/com/vaadin/tests/server/TestAbstractContainerListeners.java +++ b/tests/src/com/vaadin/tests/server/TestAbstractContainerListeners.java @@ -5,9 +5,9 @@ import com.vaadin.data.Container.ItemSetChangeListener; import com.vaadin.data.Container.PropertySetChangeEvent; import com.vaadin.data.Container.PropertySetChangeListener; import com.vaadin.data.util.IndexedContainer; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; -public class TestAbstractContainerListeners extends ListenerMethods { +public class TestAbstractContainerListeners extends AbstractListenerMethodsTest { public void testItemSetChangeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(IndexedContainer.class, diff --git a/tests/src/com/vaadin/tests/server/TestAbstractInMemoryContainerListeners.java b/tests/src/com/vaadin/tests/server/TestAbstractInMemoryContainerListeners.java index 4ea32c71fb..754f152936 100644 --- a/tests/src/com/vaadin/tests/server/TestAbstractInMemoryContainerListeners.java +++ b/tests/src/com/vaadin/tests/server/TestAbstractInMemoryContainerListeners.java @@ -3,9 +3,9 @@ package com.vaadin.tests.server; import com.vaadin.data.Container.ItemSetChangeEvent; import com.vaadin.data.Container.ItemSetChangeListener; import com.vaadin.data.util.IndexedContainer; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; -public class TestAbstractInMemoryContainerListeners extends ListenerMethods { +public class TestAbstractInMemoryContainerListeners extends AbstractListenerMethodsTest { public void testItemSetChangeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(IndexedContainer.class, ItemSetChangeEvent.class, ItemSetChangeListener.class); diff --git a/tests/src/com/vaadin/tests/server/TestAbstractPropertyListeners.java b/tests/src/com/vaadin/tests/server/TestAbstractPropertyListeners.java index dacaedb341..58dee08643 100644 --- a/tests/src/com/vaadin/tests/server/TestAbstractPropertyListeners.java +++ b/tests/src/com/vaadin/tests/server/TestAbstractPropertyListeners.java @@ -6,9 +6,9 @@ import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.util.AbstractProperty; import com.vaadin.data.util.ObjectProperty; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; -public class TestAbstractPropertyListeners extends ListenerMethods { +public class TestAbstractPropertyListeners extends AbstractListenerMethodsTest { public void testValueChangeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(AbstractProperty.class, ValueChangeEvent.class, ValueChangeListener.class, diff --git a/tests/src/com/vaadin/tests/server/component/AbstractListenerMethodsTest.java b/tests/src/com/vaadin/tests/server/component/AbstractListenerMethodsTest.java new file mode 100644 index 0000000000..355f5167d7 --- /dev/null +++ b/tests/src/com/vaadin/tests/server/component/AbstractListenerMethodsTest.java @@ -0,0 +1,170 @@ +package com.vaadin.tests.server.component; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +import junit.framework.TestCase; + +import org.easymock.EasyMock; +import org.junit.Assert; + +import com.vaadin.tests.VaadinClasses; +import com.vaadin.ui.Component; + +public abstract class AbstractListenerMethodsTest extends TestCase { + + public static void main(String[] args) { + findAllListenerMethods(); + } + + private static void findAllListenerMethods() { + Set> classes = new HashSet>(); + for (Class c : VaadinClasses.getAllServerSideClasses()) { + while (c != null && c.getName().startsWith("com.vaadin.")) { + classes.add(c); + c = c.getSuperclass(); + } + } + + for (Class c : classes) { + boolean found = false; + for (Method m : c.getDeclaredMethods()) { + if (m.getName().equals("addListener")) { + if (m.getParameterTypes().length != 1) { + continue; + } + String packageName = "com.vaadin.tests.server"; + if (Component.class.isAssignableFrom(c)) { + packageName += ".component." + + c.getSimpleName().toLowerCase(); + continue; + } + + if (!found) { + found = true; + System.out.println("package " + packageName + ";"); + + System.out.println("import " + + AbstractListenerMethodsTest.class.getName() + ";"); + System.out.println("import " + c.getName() + ";"); + System.out.println("public class " + c.getSimpleName() + + "Listeners extends " + + AbstractListenerMethodsTest.class.getSimpleName() + " {"); + } + + String listenerClassName = m.getParameterTypes()[0] + .getSimpleName(); + String eventClassName = listenerClassName.replaceFirst( + "Listener$", "Event"); + System.out.println("public void test" + listenerClassName + + "() throws Exception {"); + System.out.println(" testListener(" + c.getSimpleName() + + ".class, " + eventClassName + ".class, " + + listenerClassName + ".class);"); + System.out.println("}"); + } + } + if (found) { + System.out.println("}"); + System.out.println(); + } + } + } + + protected void testListenerAddGetRemove(Class testClass, + Class eventClass, Class listenerClass) throws Exception { + // Create a component for testing + Object c = testClass.newInstance(); + testListenerAddGetRemove(testClass, eventClass, listenerClass, c); + + } + + protected void testListenerAddGetRemove(Class cls, Class eventClass, + Class listenerClass, Object c) throws Exception { + + Object mockListener1 = EasyMock.createMock(listenerClass); + Object mockListener2 = EasyMock.createMock(listenerClass); + + // Verify we start from no listeners + verifyListeners(c, eventClass); + + // Add one listener and verify + addListener(c, mockListener1, listenerClass); + verifyListeners(c, eventClass, mockListener1); + + // Add another listener and verify + addListener(c, mockListener2, listenerClass); + verifyListeners(c, eventClass, mockListener1, mockListener2); + + // Ensure we can fetch using parent class also + if (eventClass.getSuperclass() != null) { + verifyListeners(c, eventClass.getSuperclass(), mockListener1, + mockListener2); + } + + // Remove the first and verify + removeListener(c, mockListener1, listenerClass); + verifyListeners(c, eventClass, mockListener2); + + // Remove the remaining and verify + removeListener(c, mockListener2, listenerClass); + verifyListeners(c, eventClass); + + } + + private void removeListener(Object c, Object listener, + Class listenerClass) throws IllegalArgumentException, + IllegalAccessException, InvocationTargetException, + SecurityException, NoSuchMethodException { + Method method = getRemoveListenerMethod(c.getClass(), listenerClass); + method.invoke(c, listener); + + } + + private void addListener(Object c, Object listener1, Class listenerClass) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException, SecurityException, NoSuchMethodException { + Method method = getAddListenerMethod(c.getClass(), listenerClass); + method.invoke(c, listener1); + } + + private Collection getListeners(Object c, Class eventType) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException, SecurityException, NoSuchMethodException { + Method method = getGetListenersMethod(c.getClass()); + return (Collection) method.invoke(c, eventType); + } + + private Method getGetListenersMethod(Class cls) + throws SecurityException, NoSuchMethodException { + return cls.getMethod("getListeners", Class.class); + } + + private Method getAddListenerMethod(Class cls, Class listenerClass) + throws SecurityException, NoSuchMethodException { + return cls.getMethod("addListener", listenerClass); + + } + + private Method getRemoveListenerMethod(Class cls, Class listenerClass) + throws SecurityException, NoSuchMethodException { + return cls.getMethod("removeListener", listenerClass); + + } + + private void verifyListeners(Object c, Class eventClass, + Object... expectedListeners) throws IllegalArgumentException, + SecurityException, IllegalAccessException, + InvocationTargetException, NoSuchMethodException { + Collection registeredListeners = getListeners(c, eventClass); + assertEquals("Number of listeners", expectedListeners.length, + registeredListeners.size()); + + Assert.assertArrayEquals(expectedListeners, + registeredListeners.toArray()); + + } +} diff --git a/tests/src/com/vaadin/tests/server/component/ListenerMethods.java b/tests/src/com/vaadin/tests/server/component/ListenerMethods.java deleted file mode 100644 index 45f44e673c..0000000000 --- a/tests/src/com/vaadin/tests/server/component/ListenerMethods.java +++ /dev/null @@ -1,173 +0,0 @@ -package com.vaadin.tests.server.component; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - -import junit.framework.TestCase; - -import org.easymock.EasyMock; -import org.junit.Assert; - -import com.vaadin.tests.VaadinClasses; -import com.vaadin.ui.Component; - -public abstract class ListenerMethods extends TestCase { - - public void testDummy() { - } - - public static void main(String[] args) { - findAllListenerMethods(); - } - - private static void findAllListenerMethods() { - Set> classes = new HashSet>(); - for (Class c : VaadinClasses.getAllServerSideClasses()) { - while (c != null && c.getName().startsWith("com.vaadin.")) { - classes.add(c); - c = c.getSuperclass(); - } - } - - for (Class c : classes) { - boolean found = false; - for (Method m : c.getDeclaredMethods()) { - if (m.getName().equals("addListener")) { - if (m.getParameterTypes().length != 1) { - continue; - } - String packageName = "com.vaadin.tests.server"; - if (Component.class.isAssignableFrom(c)) { - packageName += ".component." - + c.getSimpleName().toLowerCase(); - continue; - } - - if (!found) { - found = true; - System.out.println("package " + packageName + ";"); - - System.out.println("import " - + ListenerMethods.class.getName() + ";"); - System.out.println("import " + c.getName() + ";"); - System.out.println("public class " + c.getSimpleName() - + "Listeners extends " - + ListenerMethods.class.getSimpleName() + " {"); - } - - String listenerClassName = m.getParameterTypes()[0] - .getSimpleName(); - String eventClassName = listenerClassName.replaceFirst( - "Listener$", "Event"); - System.out.println("public void test" + listenerClassName - + "() throws Exception {"); - System.out.println(" testListener(" + c.getSimpleName() - + ".class, " + eventClassName + ".class, " - + listenerClassName + ".class);"); - System.out.println("}"); - } - } - if (found) { - System.out.println("}"); - System.out.println(); - } - } - } - - protected void testListenerAddGetRemove(Class testClass, - Class eventClass, Class listenerClass) throws Exception { - // Create a component for testing - Object c = testClass.newInstance(); - testListenerAddGetRemove(testClass, eventClass, listenerClass, c); - - } - - protected void testListenerAddGetRemove(Class cls, Class eventClass, - Class listenerClass, Object c) throws Exception { - - Object mockListener1 = EasyMock.createMock(listenerClass); - Object mockListener2 = EasyMock.createMock(listenerClass); - - // Verify we start from no listeners - verifyListeners(c, eventClass); - - // Add one listener and verify - addListener(c, mockListener1, listenerClass); - verifyListeners(c, eventClass, mockListener1); - - // Add another listener and verify - addListener(c, mockListener2, listenerClass); - verifyListeners(c, eventClass, mockListener1, mockListener2); - - // Ensure we can fetch using parent class also - if (eventClass.getSuperclass() != null) { - verifyListeners(c, eventClass.getSuperclass(), mockListener1, - mockListener2); - } - - // Remove the first and verify - removeListener(c, mockListener1, listenerClass); - verifyListeners(c, eventClass, mockListener2); - - // Remove the remaining and verify - removeListener(c, mockListener2, listenerClass); - verifyListeners(c, eventClass); - - } - - private void removeListener(Object c, Object listener, - Class listenerClass) throws IllegalArgumentException, - IllegalAccessException, InvocationTargetException, - SecurityException, NoSuchMethodException { - Method method = getRemoveListenerMethod(c.getClass(), listenerClass); - method.invoke(c, listener); - - } - - private void addListener(Object c, Object listener1, Class listenerClass) - throws IllegalArgumentException, IllegalAccessException, - InvocationTargetException, SecurityException, NoSuchMethodException { - Method method = getAddListenerMethod(c.getClass(), listenerClass); - method.invoke(c, listener1); - } - - private Collection getListeners(Object c, Class eventType) - throws IllegalArgumentException, IllegalAccessException, - InvocationTargetException, SecurityException, NoSuchMethodException { - Method method = getGetListenersMethod(c.getClass()); - return (Collection) method.invoke(c, eventType); - } - - private Method getGetListenersMethod(Class cls) - throws SecurityException, NoSuchMethodException { - return cls.getMethod("getListeners", Class.class); - } - - private Method getAddListenerMethod(Class cls, Class listenerClass) - throws SecurityException, NoSuchMethodException { - return cls.getMethod("addListener", listenerClass); - - } - - private Method getRemoveListenerMethod(Class cls, Class listenerClass) - throws SecurityException, NoSuchMethodException { - return cls.getMethod("removeListener", listenerClass); - - } - - private void verifyListeners(Object c, Class eventClass, - Object... expectedListeners) throws IllegalArgumentException, - SecurityException, IllegalAccessException, - InvocationTargetException, NoSuchMethodException { - Collection registeredListeners = getListeners(c, eventClass); - assertEquals("Number of listeners", expectedListeners.length, - registeredListeners.size()); - - Assert.assertArrayEquals(expectedListeners, - registeredListeners.toArray()); - - } -} diff --git a/tests/src/com/vaadin/tests/server/component/absolutelayout/AbsoluteLayoutListeners.java b/tests/src/com/vaadin/tests/server/component/absolutelayout/AbsoluteLayoutListeners.java index 194df865b4..a569ea03e9 100644 --- a/tests/src/com/vaadin/tests/server/component/absolutelayout/AbsoluteLayoutListeners.java +++ b/tests/src/com/vaadin/tests/server/component/absolutelayout/AbsoluteLayoutListeners.java @@ -2,10 +2,10 @@ package com.vaadin.tests.server.component.absolutelayout; import com.vaadin.event.LayoutEvents.LayoutClickEvent; import com.vaadin.event.LayoutEvents.LayoutClickListener; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.AbsoluteLayout; -public class AbsoluteLayoutListeners extends ListenerMethods { +public class AbsoluteLayoutListeners extends AbstractListenerMethodsTest { public void testLayoutClickListenerAddGetRemove() throws Exception { testListenerAddGetRemove(AbsoluteLayout.class, LayoutClickEvent.class, LayoutClickListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/abstractcomponentcontainer/TestAbstractComponentContainerListeners.java b/tests/src/com/vaadin/tests/server/component/abstractcomponentcontainer/TestAbstractComponentContainerListeners.java index 51cc9fe1f8..adf9c8d72e 100644 --- a/tests/src/com/vaadin/tests/server/component/abstractcomponentcontainer/TestAbstractComponentContainerListeners.java +++ b/tests/src/com/vaadin/tests/server/component/abstractcomponentcontainer/TestAbstractComponentContainerListeners.java @@ -1,6 +1,6 @@ package com.vaadin.tests.server.component.abstractcomponentcontainer; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.ComponentContainer.ComponentAttachEvent; import com.vaadin.ui.ComponentContainer.ComponentAttachListener; import com.vaadin.ui.ComponentContainer.ComponentDetachEvent; @@ -8,7 +8,7 @@ import com.vaadin.ui.ComponentContainer.ComponentDetachListener; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.VerticalLayout; -public class TestAbstractComponentContainerListeners extends ListenerMethods { +public class TestAbstractComponentContainerListeners extends AbstractListenerMethodsTest { public void testComponentDetachListenerAddGetRemove() throws Exception { testListenerAddGetRemove(HorizontalLayout.class, ComponentDetachEvent.class, ComponentDetachListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/abstractfield/TestAbstractFieldListeners.java b/tests/src/com/vaadin/tests/server/component/abstractfield/TestAbstractFieldListeners.java index be48310e0a..63536baf68 100644 --- a/tests/src/com/vaadin/tests/server/component/abstractfield/TestAbstractFieldListeners.java +++ b/tests/src/com/vaadin/tests/server/component/abstractfield/TestAbstractFieldListeners.java @@ -4,10 +4,10 @@ import com.vaadin.data.Property.ReadOnlyStatusChangeEvent; import com.vaadin.data.Property.ReadOnlyStatusChangeListener; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.Button; -public class TestAbstractFieldListeners extends ListenerMethods { +public class TestAbstractFieldListeners extends AbstractListenerMethodsTest { public void testReadOnlyStatusChangeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(Button.class, ReadOnlyStatusChangeEvent.class, ReadOnlyStatusChangeListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/TestAbstractOrderedLayoutListeners.java b/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/TestAbstractOrderedLayoutListeners.java index 86ead80527..05dfc47126 100644 --- a/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/TestAbstractOrderedLayoutListeners.java +++ b/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/TestAbstractOrderedLayoutListeners.java @@ -2,10 +2,10 @@ package com.vaadin.tests.server.component.abstractorderedlayout; import com.vaadin.event.LayoutEvents.LayoutClickEvent; import com.vaadin.event.LayoutEvents.LayoutClickListener; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.VerticalLayout; -public class TestAbstractOrderedLayoutListeners extends ListenerMethods { +public class TestAbstractOrderedLayoutListeners extends AbstractListenerMethodsTest { public void testLayoutClickListenerAddGetRemove() throws Exception { testListenerAddGetRemove(VerticalLayout.class, LayoutClickEvent.class, LayoutClickListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/abstractselect/TestAbstractSelectListeners.java b/tests/src/com/vaadin/tests/server/component/abstractselect/TestAbstractSelectListeners.java index 7e225da707..c1886943fd 100644 --- a/tests/src/com/vaadin/tests/server/component/abstractselect/TestAbstractSelectListeners.java +++ b/tests/src/com/vaadin/tests/server/component/abstractselect/TestAbstractSelectListeners.java @@ -4,10 +4,10 @@ import com.vaadin.data.Container.ItemSetChangeEvent; import com.vaadin.data.Container.ItemSetChangeListener; import com.vaadin.data.Container.PropertySetChangeEvent; import com.vaadin.data.Container.PropertySetChangeListener; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.ComboBox; -public class TestAbstractSelectListeners extends ListenerMethods { +public class TestAbstractSelectListeners extends AbstractListenerMethodsTest { public void testItemSetChangeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(ComboBox.class, ItemSetChangeEvent.class, ItemSetChangeListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/TestAbstractSplitPanelListeners.java b/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/TestAbstractSplitPanelListeners.java index b33f5c7eac..4f66d1446b 100644 --- a/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/TestAbstractSplitPanelListeners.java +++ b/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/TestAbstractSplitPanelListeners.java @@ -1,11 +1,11 @@ package com.vaadin.tests.server.component.abstractsplitpanel; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.AbstractSplitPanel.SplitterClickEvent; import com.vaadin.ui.AbstractSplitPanel.SplitterClickListener; import com.vaadin.ui.HorizontalSplitPanel; -public class TestAbstractSplitPanelListeners extends ListenerMethods { +public class TestAbstractSplitPanelListeners extends AbstractListenerMethodsTest { public void testSplitterClickListenerAddGetRemove() throws Exception { testListenerAddGetRemove(HorizontalSplitPanel.class, SplitterClickEvent.class, SplitterClickListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/abstracttextfield/TestAbstractTextFieldListeners.java b/tests/src/com/vaadin/tests/server/component/abstracttextfield/TestAbstractTextFieldListeners.java index f360d39547..fb8eb65f55 100644 --- a/tests/src/com/vaadin/tests/server/component/abstracttextfield/TestAbstractTextFieldListeners.java +++ b/tests/src/com/vaadin/tests/server/component/abstracttextfield/TestAbstractTextFieldListeners.java @@ -6,10 +6,10 @@ import com.vaadin.event.FieldEvents.FocusEvent; import com.vaadin.event.FieldEvents.FocusListener; import com.vaadin.event.FieldEvents.TextChangeEvent; import com.vaadin.event.FieldEvents.TextChangeListener; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.TextField; -public class TestAbstractTextFieldListeners extends ListenerMethods { +public class TestAbstractTextFieldListeners extends AbstractListenerMethodsTest { public void testTextChangeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(TextField.class, TextChangeEvent.class, TextChangeListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/button/ButtonListeners.java b/tests/src/com/vaadin/tests/server/component/button/ButtonListeners.java index e33b69adc5..59ddad4efe 100644 --- a/tests/src/com/vaadin/tests/server/component/button/ButtonListeners.java +++ b/tests/src/com/vaadin/tests/server/component/button/ButtonListeners.java @@ -4,12 +4,12 @@ import com.vaadin.event.FieldEvents.BlurEvent; import com.vaadin.event.FieldEvents.BlurListener; import com.vaadin.event.FieldEvents.FocusEvent; import com.vaadin.event.FieldEvents.FocusListener; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; -public class ButtonListeners extends ListenerMethods { +public class ButtonListeners extends AbstractListenerMethodsTest { public void testFocusListenerAddGetRemove() throws Exception { testListenerAddGetRemove(Button.class, FocusEvent.class, FocusListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/csslayout/CssLayoutListeners.java b/tests/src/com/vaadin/tests/server/component/csslayout/CssLayoutListeners.java index 040b9938dc..e646467cb2 100644 --- a/tests/src/com/vaadin/tests/server/component/csslayout/CssLayoutListeners.java +++ b/tests/src/com/vaadin/tests/server/component/csslayout/CssLayoutListeners.java @@ -2,10 +2,10 @@ package com.vaadin.tests.server.component.csslayout; import com.vaadin.event.LayoutEvents.LayoutClickEvent; import com.vaadin.event.LayoutEvents.LayoutClickListener; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.CssLayout; -public class CssLayoutListeners extends ListenerMethods { +public class CssLayoutListeners extends AbstractListenerMethodsTest { public void testLayoutClickListenerAddGetRemove() throws Exception { testListenerAddGetRemove(CssLayout.class, LayoutClickEvent.class, LayoutClickListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/datefield/DateFieldListeners.java b/tests/src/com/vaadin/tests/server/component/datefield/DateFieldListeners.java index 2a698e7d09..1d7f729868 100644 --- a/tests/src/com/vaadin/tests/server/component/datefield/DateFieldListeners.java +++ b/tests/src/com/vaadin/tests/server/component/datefield/DateFieldListeners.java @@ -4,10 +4,10 @@ import com.vaadin.event.FieldEvents.BlurEvent; import com.vaadin.event.FieldEvents.BlurListener; import com.vaadin.event.FieldEvents.FocusEvent; import com.vaadin.event.FieldEvents.FocusListener; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.DateField; -public class DateFieldListeners extends ListenerMethods { +public class DateFieldListeners extends AbstractListenerMethodsTest { public void testFocusListenerAddGetRemove() throws Exception { testListenerAddGetRemove(DateField.class, FocusEvent.class, FocusListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/embedded/EmbeddedListeners.java b/tests/src/com/vaadin/tests/server/component/embedded/EmbeddedListeners.java index 687dc71849..66a9a2b5d5 100644 --- a/tests/src/com/vaadin/tests/server/component/embedded/EmbeddedListeners.java +++ b/tests/src/com/vaadin/tests/server/component/embedded/EmbeddedListeners.java @@ -2,10 +2,10 @@ package com.vaadin.tests.server.component.embedded; import com.vaadin.event.MouseEvents.ClickEvent; import com.vaadin.event.MouseEvents.ClickListener; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.Embedded; -public class EmbeddedListeners extends ListenerMethods { +public class EmbeddedListeners extends AbstractListenerMethodsTest { public void testClickListenerAddGetRemove() throws Exception { testListenerAddGetRemove(Embedded.class, ClickEvent.class, ClickListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutListeners.java b/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutListeners.java index 5f667d225e..24db0856da 100644 --- a/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutListeners.java +++ b/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutListeners.java @@ -2,10 +2,10 @@ package com.vaadin.tests.server.component.gridlayout; import com.vaadin.event.LayoutEvents.LayoutClickEvent; import com.vaadin.event.LayoutEvents.LayoutClickListener; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.GridLayout; -public class GridLayoutListeners extends ListenerMethods { +public class GridLayoutListeners extends AbstractListenerMethodsTest { public void testLayoutClickListenerAddGetRemove() throws Exception { testListenerAddGetRemove(GridLayout.class, LayoutClickEvent.class, LayoutClickListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/label/LabelListeners.java b/tests/src/com/vaadin/tests/server/component/label/LabelListeners.java index 86628e1de8..a25309b32f 100644 --- a/tests/src/com/vaadin/tests/server/component/label/LabelListeners.java +++ b/tests/src/com/vaadin/tests/server/component/label/LabelListeners.java @@ -1,11 +1,11 @@ package com.vaadin.tests.server.component.label; import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.Label; import com.vaadin.ui.Label.ValueChangeEvent; -public class LabelListeners extends ListenerMethods { +public class LabelListeners extends AbstractListenerMethodsTest { public void testValueChangeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(Label.class, ValueChangeEvent.class, ValueChangeListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/loginform/LoginFormListeners.java b/tests/src/com/vaadin/tests/server/component/loginform/LoginFormListeners.java index 8a7629664c..a8e7d76710 100644 --- a/tests/src/com/vaadin/tests/server/component/loginform/LoginFormListeners.java +++ b/tests/src/com/vaadin/tests/server/component/loginform/LoginFormListeners.java @@ -1,11 +1,11 @@ package com.vaadin.tests.server.component.loginform; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.LoginForm; import com.vaadin.ui.LoginForm.LoginEvent; import com.vaadin.ui.LoginForm.LoginListener; -public class LoginFormListeners extends ListenerMethods { +public class LoginFormListeners extends AbstractListenerMethodsTest { public void testLoginListenerAddGetRemove() throws Exception { testListenerAddGetRemove(LoginForm.class, LoginEvent.class, LoginListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/optiongroup/OptionGroupListeners.java b/tests/src/com/vaadin/tests/server/component/optiongroup/OptionGroupListeners.java index 1ce7cf76c6..a4c2289da4 100644 --- a/tests/src/com/vaadin/tests/server/component/optiongroup/OptionGroupListeners.java +++ b/tests/src/com/vaadin/tests/server/component/optiongroup/OptionGroupListeners.java @@ -4,10 +4,10 @@ import com.vaadin.event.FieldEvents.BlurEvent; import com.vaadin.event.FieldEvents.BlurListener; import com.vaadin.event.FieldEvents.FocusEvent; import com.vaadin.event.FieldEvents.FocusListener; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.OptionGroup; -public class OptionGroupListeners extends ListenerMethods { +public class OptionGroupListeners extends AbstractListenerMethodsTest { public void testFocusListenerAddGetRemove() throws Exception { testListenerAddGetRemove(OptionGroup.class, FocusEvent.class, FocusListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/panel/PanelListeners.java b/tests/src/com/vaadin/tests/server/component/panel/PanelListeners.java index fe6f4bd302..e6094225e2 100644 --- a/tests/src/com/vaadin/tests/server/component/panel/PanelListeners.java +++ b/tests/src/com/vaadin/tests/server/component/panel/PanelListeners.java @@ -2,10 +2,10 @@ package com.vaadin.tests.server.component.panel; import com.vaadin.event.MouseEvents.ClickEvent; import com.vaadin.event.MouseEvents.ClickListener; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.Panel; -public class PanelListeners extends ListenerMethods { +public class PanelListeners extends AbstractListenerMethodsTest { public void testClickListenerAddGetRemove() throws Exception { testListenerAddGetRemove(Panel.class, ClickEvent.class, ClickListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/popupview/PopupViewListeners.java b/tests/src/com/vaadin/tests/server/component/popupview/PopupViewListeners.java index 3d3d5546da..5b5fc2eb31 100644 --- a/tests/src/com/vaadin/tests/server/component/popupview/PopupViewListeners.java +++ b/tests/src/com/vaadin/tests/server/component/popupview/PopupViewListeners.java @@ -1,12 +1,12 @@ package com.vaadin.tests.server.component.popupview; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.Label; import com.vaadin.ui.PopupView; import com.vaadin.ui.PopupView.PopupVisibilityEvent; import com.vaadin.ui.PopupView.PopupVisibilityListener; -public class PopupViewListeners extends ListenerMethods { +public class PopupViewListeners extends AbstractListenerMethodsTest { public void testPopupVisibilityListenerAddGetRemove() throws Exception { testListenerAddGetRemove(PopupView.class, PopupVisibilityEvent.class, PopupVisibilityListener.class, new PopupView("", new Label())); diff --git a/tests/src/com/vaadin/tests/server/component/select/SelectListeners.java b/tests/src/com/vaadin/tests/server/component/select/SelectListeners.java index 63d857e3b6..8f90f2021e 100644 --- a/tests/src/com/vaadin/tests/server/component/select/SelectListeners.java +++ b/tests/src/com/vaadin/tests/server/component/select/SelectListeners.java @@ -4,10 +4,10 @@ import com.vaadin.event.FieldEvents.BlurEvent; import com.vaadin.event.FieldEvents.BlurListener; import com.vaadin.event.FieldEvents.FocusEvent; import com.vaadin.event.FieldEvents.FocusListener; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.Select; -public class SelectListeners extends ListenerMethods { +public class SelectListeners extends AbstractListenerMethodsTest { public void testFocusListenerAddGetRemove() throws Exception { testListenerAddGetRemove(Select.class, FocusEvent.class, FocusListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/table/TableListeners.java b/tests/src/com/vaadin/tests/server/component/table/TableListeners.java index 46291c5b9a..75ec839823 100644 --- a/tests/src/com/vaadin/tests/server/component/table/TableListeners.java +++ b/tests/src/com/vaadin/tests/server/component/table/TableListeners.java @@ -2,7 +2,7 @@ package com.vaadin.tests.server.component.table; import com.vaadin.event.ItemClickEvent; import com.vaadin.event.ItemClickEvent.ItemClickListener; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.Table; import com.vaadin.ui.Table.ColumnReorderEvent; import com.vaadin.ui.Table.ColumnReorderListener; @@ -13,7 +13,7 @@ import com.vaadin.ui.Table.FooterClickListener; import com.vaadin.ui.Table.HeaderClickEvent; import com.vaadin.ui.Table.HeaderClickListener; -public class TableListeners extends ListenerMethods { +public class TableListeners extends AbstractListenerMethodsTest { public void testColumnResizeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(Table.class, ColumnResizeEvent.class, ColumnResizeListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/tabsheet/TabSheetListeners.java b/tests/src/com/vaadin/tests/server/component/tabsheet/TabSheetListeners.java index 36cbf2d0b0..30dcbca155 100644 --- a/tests/src/com/vaadin/tests/server/component/tabsheet/TabSheetListeners.java +++ b/tests/src/com/vaadin/tests/server/component/tabsheet/TabSheetListeners.java @@ -1,11 +1,11 @@ package com.vaadin.tests.server.component.tabsheet; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.TabSheet; import com.vaadin.ui.TabSheet.SelectedTabChangeEvent; import com.vaadin.ui.TabSheet.SelectedTabChangeListener; -public class TabSheetListeners extends ListenerMethods { +public class TabSheetListeners extends AbstractListenerMethodsTest { public void testSelectedTabChangeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(TabSheet.class, SelectedTabChangeEvent.class, SelectedTabChangeListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/tree/TreeListeners.java b/tests/src/com/vaadin/tests/server/component/tree/TreeListeners.java index 43651b7445..8ba2e1de4d 100644 --- a/tests/src/com/vaadin/tests/server/component/tree/TreeListeners.java +++ b/tests/src/com/vaadin/tests/server/component/tree/TreeListeners.java @@ -2,14 +2,14 @@ package com.vaadin.tests.server.component.tree; import com.vaadin.event.ItemClickEvent; import com.vaadin.event.ItemClickEvent.ItemClickListener; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.Tree; import com.vaadin.ui.Tree.CollapseEvent; import com.vaadin.ui.Tree.CollapseListener; import com.vaadin.ui.Tree.ExpandEvent; import com.vaadin.ui.Tree.ExpandListener; -public class TreeListeners extends ListenerMethods { +public class TreeListeners extends AbstractListenerMethodsTest { public void testExpandListenerAddGetRemove() throws Exception { testListenerAddGetRemove(Tree.class, ExpandEvent.class, ExpandListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/upload/UploadListeners.java b/tests/src/com/vaadin/tests/server/component/upload/UploadListeners.java index 07dc64e34e..ea5fa94326 100644 --- a/tests/src/com/vaadin/tests/server/component/upload/UploadListeners.java +++ b/tests/src/com/vaadin/tests/server/component/upload/UploadListeners.java @@ -1,7 +1,7 @@ package com.vaadin.tests.server.component.upload; import com.vaadin.terminal.StreamVariable.StreamingProgressEvent; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.Upload; import com.vaadin.ui.Upload.FailedEvent; import com.vaadin.ui.Upload.FailedListener; @@ -13,7 +13,7 @@ import com.vaadin.ui.Upload.StartedListener; import com.vaadin.ui.Upload.SucceededEvent; import com.vaadin.ui.Upload.SucceededListener; -public class UploadListeners extends ListenerMethods { +public class UploadListeners extends AbstractListenerMethodsTest { public void testProgressListenerAddGetRemove() throws Exception { testListenerAddGetRemove(Upload.class, StreamingProgressEvent.class, ProgressListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/urifragmentutility/UriFragmentUtilityListeners.java b/tests/src/com/vaadin/tests/server/component/urifragmentutility/UriFragmentUtilityListeners.java index fa5c087275..fe400e55b9 100644 --- a/tests/src/com/vaadin/tests/server/component/urifragmentutility/UriFragmentUtilityListeners.java +++ b/tests/src/com/vaadin/tests/server/component/urifragmentutility/UriFragmentUtilityListeners.java @@ -1,11 +1,11 @@ package com.vaadin.tests.server.component.urifragmentutility; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.UriFragmentUtility; import com.vaadin.ui.UriFragmentUtility.FragmentChangedEvent; import com.vaadin.ui.UriFragmentUtility.FragmentChangedListener; -public class UriFragmentUtilityListeners extends ListenerMethods { +public class UriFragmentUtilityListeners extends AbstractListenerMethodsTest { public void testFragmentChangedListenerAddGetRemove() throws Exception { testListenerAddGetRemove(UriFragmentUtility.class, FragmentChangedEvent.class, FragmentChangedListener.class); diff --git a/tests/src/com/vaadin/tests/server/component/window/WindowListeners.java b/tests/src/com/vaadin/tests/server/component/window/WindowListeners.java index 349d53c311..b8d9579dae 100644 --- a/tests/src/com/vaadin/tests/server/component/window/WindowListeners.java +++ b/tests/src/com/vaadin/tests/server/component/window/WindowListeners.java @@ -4,14 +4,14 @@ import com.vaadin.event.FieldEvents.BlurEvent; import com.vaadin.event.FieldEvents.BlurListener; import com.vaadin.event.FieldEvents.FocusEvent; import com.vaadin.event.FieldEvents.FocusListener; -import com.vaadin.tests.server.component.ListenerMethods; +import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.Window; import com.vaadin.ui.Window.CloseEvent; import com.vaadin.ui.Window.CloseListener; import com.vaadin.ui.Window.ResizeEvent; import com.vaadin.ui.Window.ResizeListener; -public class WindowListeners extends ListenerMethods { +public class WindowListeners extends AbstractListenerMethodsTest { public void testFocusListenerAddGetRemove() throws Exception { testListenerAddGetRemove(Window.class, FocusEvent.class, FocusListener.class);