diff options
author | John Ahlroos <john@vaadin.com> | 2012-08-28 09:30:46 +0300 |
---|---|---|
committer | John Ahlroos <john@vaadin.com> | 2012-08-28 09:30:46 +0300 |
commit | 7b9e1566d6e36c10aef3566b20267449586a81cb (patch) | |
tree | 4c577240fd35d863b88b91b24c7d2a07c67adf1b /tests | |
parent | bd5876005947b830a151889a86203fd77a6d6022 (diff) | |
parent | 52986fdf881260994e5465012af2afd80447b8b6 (diff) | |
download | vaadin-framework-7b9e1566d6e36c10aef3566b20267449586a81cb.tar.gz vaadin-framework-7b9e1566d6e36c10aef3566b20267449586a81cb.zip |
Merge branch 'master' into layoutgraph
Diffstat (limited to 'tests')
59 files changed, 244 insertions, 278 deletions
diff --git a/tests/client-side/com/vaadin/terminal/gwt/server/JSONSerializerTest.java b/tests/client-side/com/vaadin/terminal/gwt/server/JSONSerializerTest.java index 16cc0ede98..7775b667a1 100644 --- a/tests/client-side/com/vaadin/terminal/gwt/server/JSONSerializerTest.java +++ b/tests/client-side/com/vaadin/terminal/gwt/server/JSONSerializerTest.java @@ -1,7 +1,7 @@ package com.vaadin.terminal.gwt.server; /* - * Copyright 2011 Vaadin Ltd. + * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -15,9 +15,6 @@ package com.vaadin.terminal.gwt.server; * License for the specific language governing permissions and limitations under * the License. */ -import java.beans.BeanInfo; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; import java.lang.reflect.Type; import java.util.Collection; import java.util.HashMap; @@ -28,6 +25,7 @@ import junit.framework.TestCase; import com.vaadin.shared.ui.splitpanel.AbstractSplitPanelState; import com.vaadin.terminal.gwt.client.communication.JsonDecoder; import com.vaadin.terminal.gwt.client.communication.JsonEncoder; +import com.vaadin.terminal.gwt.server.JsonCodec.BeanProperty; /** * Tests for {@link JsonCodec}, {@link JsonEncoder}, {@link JsonDecoder} @@ -118,15 +116,9 @@ public class JSONSerializerTest extends TestCase { } private boolean equalsBean(Object o1, Object o2) throws Exception { - BeanInfo beanInfo = Introspector.getBeanInfo(o1.getClass()); - for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) { - String fieldName = JsonCodec.getTransportFieldName(pd); - if (fieldName == null) { - continue; - } - - Object c1 = pd.getReadMethod().invoke(o1); - Object c2 = pd.getReadMethod().invoke(o2); + for (BeanProperty property : JsonCodec.getProperties(o1.getClass())) { + Object c1 = property.getValue(o1); + Object c2 = property.getValue(o2); if (!equals(c1, c2)) { return false; } diff --git a/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java b/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java index fa730515a2..74770f8652 100644 --- a/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java +++ b/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java @@ -6,15 +6,16 @@ import java.util.Properties; import junit.framework.TestCase; +import org.easymock.EasyMock; + import com.vaadin.Application; import com.vaadin.Application.ApplicationStartEvent; import com.vaadin.RootRequiresMoreInformationException; +import com.vaadin.terminal.DefaultRootProvider; import com.vaadin.terminal.DeploymentConfiguration; import com.vaadin.terminal.WrappedRequest; import com.vaadin.ui.Root; -import org.easymock.EasyMock; - public class CustomRootClassLoader extends TestCase { /** @@ -111,10 +112,17 @@ public class CustomRootClassLoader extends TestCase { private Application createStubApplication() { return new Application() { + { + addRootProvider(new DefaultRootProvider()); + } + @Override - protected String getRootClassName(WrappedRequest request) { - // Always use the same root class - return MyRoot.class.getName(); + public String getProperty(String name) { + if (name.equals(ROOT_PARAMETER)) { + return MyRoot.class.getName(); + } else { + return super.getProperty(name); + } } @Override 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 bd6dd6c7b1..4bb0177a18 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 @@ -30,9 +30,9 @@ public class TextFieldWithPropertyFormatter extends TestCase { field = new TextField() { @Override - public void requestRepaint() { + public void markAsDirty() { repainted++; - super.requestRepaint(); + super.markAsDirty(); } }; diff --git a/tests/server-side/com/vaadin/tests/server/components/AbstractTestFieldValueChange.java b/tests/server-side/com/vaadin/tests/server/components/AbstractTestFieldValueChange.java index 3512f555c9..f2de4f3c04 100644 --- a/tests/server-side/com/vaadin/tests/server/components/AbstractTestFieldValueChange.java +++ b/tests/server-side/com/vaadin/tests/server/components/AbstractTestFieldValueChange.java @@ -42,8 +42,7 @@ public abstract class AbstractTestFieldValueChange<T> extends TestCase { */ public void testRemoveListener() { getField().setPropertyDataSource(new ObjectProperty<String>("")); - getField().setWriteThrough(true); - getField().setReadThrough(true); + getField().setBuffered(false); // Expectations and start test listener.valueChange(EasyMock.isA(ValueChangeEvent.class)); @@ -76,10 +75,9 @@ public abstract class AbstractTestFieldValueChange<T> extends TestCase { * Field value change notifications closely mirror value changes of the data * source behind the field. */ - public void testWriteThroughReadThrough() { + public void testNonBuffered() { getField().setPropertyDataSource(new ObjectProperty<String>("")); - getField().setWriteThrough(true); - getField().setReadThrough(true); + getField().setBuffered(false); expectValueChangeFromSetValueNotCommit(); } @@ -91,47 +89,9 @@ public abstract class AbstractTestFieldValueChange<T> extends TestCase { * Field value change notifications reflect the buffered value in the field, * not the original data source value changes. */ - public void testNoWriteThroughNoReadThrough() { + public void testBuffered() { getField().setPropertyDataSource(new ObjectProperty<String>("")); - getField().setWriteThrough(false); - getField().setReadThrough(false); - - expectValueChangeFromSetValueNotCommit(); - } - - /** - * Less common partly buffered case: writeThrough (auto-commit) is on and - * readThrough is off. Calling commit() should not cause notifications. - * - * Without readThrough activated, changes to the data source that do not - * cause notifications are not reflected by the field value. - * - * Field value change notifications correspond to changes made to the data - * source value through the text field or the (notifying) property. - */ - public void testWriteThroughNoReadThrough() { - getField().setPropertyDataSource(new ObjectProperty<String>("")); - getField().setWriteThrough(true); - getField().setReadThrough(false); - - expectValueChangeFromSetValueNotCommit(); - } - - /** - * Partly buffered use where the data source is read but not nor modified - * during editing, and is updated at commit(). - * - * When used like this, a field is updated from the data source if necessary - * when its value is requested and the property value has changed but the - * field has not been modified in its buffer. - * - * Field value change notifications reflect the buffered value in the field, - * not the original data source value changes. - */ - public void testNoWriteThroughReadThrough() { - getField().setPropertyDataSource(new ObjectProperty<String>("")); - getField().setWriteThrough(false); - getField().setReadThrough(true); + getField().setBuffered(true); expectValueChangeFromSetValueNotCommit(); } diff --git a/tests/server-side/com/vaadin/tests/server/components/TestTextFieldValueChange.java b/tests/server-side/com/vaadin/tests/server/components/TestTextFieldValueChange.java index f5db67be97..de838e339c 100644 --- a/tests/server-side/com/vaadin/tests/server/components/TestTextFieldValueChange.java +++ b/tests/server-side/com/vaadin/tests/server/components/TestTextFieldValueChange.java @@ -78,59 +78,6 @@ public class TestTextFieldValueChange extends } /** - * If read through is on and value has been modified, but not committed, the - * value should not propagate similar to - * {@link #testValueChangeEventPropagationWithReadThrough()} - * - * TODO make test field type agnostic (eg. combobox) - */ - public void testValueChangePropagationWithReadThroughWithModifiedValue() { - final String initialValue = "initial"; - ObjectProperty<String> property = new ObjectProperty<String>( - initialValue); - getField().setPropertyDataSource(property); - - // write buffering on, read buffering off - getField().setWriteThrough(false); - getField().setReadThrough(true); - - // Expect no value changes calls to listener - EasyMock.replay(getListener()); - - // first set the value (note, write through false -> not forwarded to - // property) - setValue(getField()); - - Assert.assertTrue(getField().isModified()); - - // Add listener and set the value -> should end up in listener once - getField().addListener(getListener()); - - // modify property value, should not fire value change in field as the - // field has uncommitted value (aka isModified() == true) - property.setValue("Foo"); - - // Ensure listener was called once - EasyMock.verify(getListener()); - - // get value should not fire value change again - Object value = getField().getValue(); - // Ensure listener still has been called only once - EasyMock.verify(getListener()); - - // field value should be different from the original value and current - // proeprty value - boolean isValueEqualToInitial = value.equals(initialValue); - Assert.assertFalse(isValueEqualToInitial); - boolean isValueEqualToPropertyValue = value.equals(property.getValue()); - Assert.assertFalse(isValueEqualToPropertyValue); - - // Ensure listener has not been called - EasyMock.verify(getListener()); - - } - - /** * Value change events from property should not propagate if read through is * false. Execpt when the property is being set. * diff --git a/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java b/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java index 6b7b36c3f3..bb37082d30 100644 --- a/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java +++ b/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java @@ -30,6 +30,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.vaadin.Application; +import com.vaadin.RootRequiresMoreInformationException; +import com.vaadin.terminal.AbstractRootProvider; import com.vaadin.terminal.WrappedRequest; import com.vaadin.terminal.gwt.server.AbstractApplicationServlet; import com.vaadin.terminal.gwt.server.WrappedHttpServletRequest; @@ -40,23 +42,6 @@ import com.vaadin.ui.Root; public class ApplicationRunnerServlet extends AbstractApplicationServlet { /** - * Internal implementation of an application with a dynamically selected - * Root implementation; - */ - private static class RootRunnerApplication extends Application { - private final Class<?> runnableClass; - - private RootRunnerApplication(Class<?> runnableClass) { - this.runnableClass = runnableClass; - } - - @Override - protected String getRootClassName(WrappedRequest request) { - return runnableClass.getCanonicalName(); - } - } - - /** * The name of the application class currently used. Only valid within one * request. */ @@ -126,7 +111,17 @@ public class ApplicationRunnerServlet extends AbstractApplicationServlet { try { final Class<?> classToRun = getClassToRun(); if (Root.class.isAssignableFrom(classToRun)) { - return new RootRunnerApplication(classToRun); + Application application = new Application(); + application.addRootProvider(new AbstractRootProvider() { + + @Override + public Class<? extends Root> getRootClass( + Application application, WrappedRequest request) + throws RootRequiresMoreInformationException { + return (Class<? extends Root>) classToRun; + } + }); + return application; } else if (Application.class.isAssignableFrom(classToRun)) { return (Application) classToRun.newInstance(); } else { @@ -221,7 +216,7 @@ public class ApplicationRunnerServlet extends AbstractApplicationServlet { throws ClassNotFoundException { Class<?> classToRun = getClassToRun(); if (Root.class.isAssignableFrom(classToRun)) { - return RootRunnerApplication.class; + return Application.class; } else if (Application.class.isAssignableFrom(classToRun)) { return classToRun.asSubclass(Application.class); } else { diff --git a/tests/testbench/com/vaadin/tests/Parameters.java b/tests/testbench/com/vaadin/tests/Parameters.java index 4fb224eb19..e9824d9c40 100644 --- a/tests/testbench/com/vaadin/tests/Parameters.java +++ b/tests/testbench/com/vaadin/tests/Parameters.java @@ -27,7 +27,7 @@ import com.vaadin.terminal.RequestHandler; import com.vaadin.terminal.WrappedRequest; import com.vaadin.terminal.WrappedResponse; import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; +import com.vaadin.ui.Layout.MarginHandler; import com.vaadin.ui.Link; import com.vaadin.ui.Panel; import com.vaadin.ui.Root.LegacyWindow; @@ -90,7 +90,7 @@ public class Parameters extends com.vaadin.Application.LegacyApplication final Panel panel2 = new Panel("Parameter Handler"); params.setSizeFull(); panel2.setContent(new VerticalLayout()); - ((Layout) panel2.getContent()).setMargin(true); + ((MarginHandler) panel2.getContent()).setMargin(true); params.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_ID); panel2.addComponent(params); diff --git a/tests/testbench/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java b/tests/testbench/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java index aa8814ce4c..8002059227 100644 --- a/tests/testbench/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java +++ b/tests/testbench/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java @@ -62,7 +62,7 @@ public class PerformanceTestLabelsAndOrderedLayouts extends CustomComponent { new ClickListener() { @Override public void buttonClick(ClickEvent event) { - testContainer.requestRepaint(); + testContainer.markAsDirty(); } })); diff --git a/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java b/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java index 50cbe0778b..f33132a709 100644 --- a/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java +++ b/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java @@ -78,7 +78,7 @@ public class TestSizeableIncomponents extends Application.LegacyApplication { getMainWindow().showNotification( "Selected test:" + prev.getTestableName()); select.setValue(prev); - select.requestRepaint(); + select.markAsDirty(); } } }); @@ -94,7 +94,7 @@ public class TestSizeableIncomponents extends Application.LegacyApplication { getMainWindow().showNotification( "Selected test:" + next.getTestableName()); select.setValue(next); - select.requestRepaint(); + select.markAsDirty(); } } }); diff --git a/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java index 36a793bd6d..bd2aea3756 100644 --- a/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java +++ b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java @@ -1,5 +1,8 @@ package com.vaadin.tests.application; +import com.vaadin.Application; +import com.vaadin.RootRequiresMoreInformationException; +import com.vaadin.terminal.AbstractRootProvider; import com.vaadin.terminal.WrappedRequest; import com.vaadin.tests.components.AbstractTestApplication; import com.vaadin.ui.Label; @@ -20,11 +23,14 @@ public class RefreshStatePreserve extends AbstractTestApplication { public void init() { super.init(); setRootPreserved(true); - } - - @Override - protected String getRootClassName(WrappedRequest request) { - return RefreshStateRoot.class.getName(); + addRootProvider(new AbstractRootProvider() { + @Override + public Class<? extends Root> getRootClass(Application application, + WrappedRequest request) + throws RootRequiresMoreInformationException { + return RefreshStateRoot.class; + } + }); } @Override diff --git a/tests/testbench/com/vaadin/tests/components/AbstractLayoutTest.java b/tests/testbench/com/vaadin/tests/components/AbstractLayoutTest.java index af62e5e4a4..c04be3d724 100644 --- a/tests/testbench/com/vaadin/tests/components/AbstractLayoutTest.java +++ b/tests/testbench/com/vaadin/tests/components/AbstractLayoutTest.java @@ -2,11 +2,12 @@ package com.vaadin.tests.components; import java.util.LinkedHashMap; +import com.vaadin.shared.ui.MarginInfo; import com.vaadin.ui.AbstractLayout; import com.vaadin.ui.Alignment; import com.vaadin.ui.Component; import com.vaadin.ui.Layout.AlignmentHandler; -import com.vaadin.ui.Layout.MarginInfo; +import com.vaadin.ui.Layout.MarginHandler; import com.vaadin.ui.Layout.SpacingHandler; public abstract class AbstractLayoutTest<T extends AbstractLayout> extends @@ -17,7 +18,7 @@ public abstract class AbstractLayoutTest<T extends AbstractLayout> extends @Override public void execute(T c, MarginInfo value, Object data) { - c.setMargin(value); + ((MarginHandler) c).setMargin(value); } }; @@ -42,7 +43,9 @@ public abstract class AbstractLayoutTest<T extends AbstractLayout> extends @Override protected void createActions() { super.createActions(); - createMarginsSelect(CATEGORY_LAYOUT_FEATURES); + if (MarginHandler.class.isAssignableFrom(getTestClass())) { + createMarginsSelect(CATEGORY_LAYOUT_FEATURES); + } if (SpacingHandler.class.isAssignableFrom(getTestClass())) { createSpacingSelect(CATEGORY_LAYOUT_FEATURES); } diff --git a/tests/testbench/com/vaadin/tests/components/absolutelayout/MoveComponentsFromAbsoluteLayoutToInnerLayout.java b/tests/testbench/com/vaadin/tests/components/absolutelayout/MoveComponentsFromAbsoluteLayoutToInnerLayout.java index 826b7cee07..c14cda58f1 100644 --- a/tests/testbench/com/vaadin/tests/components/absolutelayout/MoveComponentsFromAbsoluteLayoutToInnerLayout.java +++ b/tests/testbench/com/vaadin/tests/components/absolutelayout/MoveComponentsFromAbsoluteLayoutToInnerLayout.java @@ -40,7 +40,7 @@ public class MoveComponentsFromAbsoluteLayoutToInnerLayout extends TestBase { @Override public void buttonClick(ClickEvent event) { - vl.requestRepaint(); + vl.markAsDirty(); } }); diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java index aa630c79fd..0aaa7c5f13 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java +++ b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java @@ -28,7 +28,7 @@ public class AbstractFieldCommitWithInvalidValues extends TestBase { tf = new TextField("A field, must contain 1-2 chars", new ObjectProperty<String>("a")); tf.addValidator(new StringLengthValidator("Invalid length", 1, 2, false)); - tf.setWriteThrough(false); + tf.setBuffered(true); tf.setRequired(true); Button b = new Button("Commit", new ClickListener() { diff --git a/tests/testbench/com/vaadin/tests/components/customfield/AddressField.java b/tests/testbench/com/vaadin/tests/components/customfield/AddressField.java index a3ee89b3ee..2daeb7bf25 100644 --- a/tests/testbench/com/vaadin/tests/components/customfield/AddressField.java +++ b/tests/testbench/com/vaadin/tests/components/customfield/AddressField.java @@ -34,7 +34,7 @@ public class AddressField extends CustomField<Address> { addressForm = new Form(); } addressForm.setCaption("Address"); - addressForm.setWriteThrough(false); + addressForm.setBuffered(true); // make sure field changes are sent early addressForm.setImmediate(true); diff --git a/tests/testbench/com/vaadin/tests/components/customfield/NestedPersonForm.java b/tests/testbench/com/vaadin/tests/components/customfield/NestedPersonForm.java index 0bc4f45545..9b40074433 100644 --- a/tests/testbench/com/vaadin/tests/components/customfield/NestedPersonForm.java +++ b/tests/testbench/com/vaadin/tests/components/customfield/NestedPersonForm.java @@ -4,6 +4,7 @@ import java.util.Arrays; import com.vaadin.data.Item; import com.vaadin.data.util.BeanItem; +import com.vaadin.shared.ui.MarginInfo; import com.vaadin.tests.util.Person; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; @@ -13,6 +14,7 @@ import com.vaadin.ui.DefaultFieldFactory; import com.vaadin.ui.Field; import com.vaadin.ui.Form; import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.Layout.MarginHandler; /** * Example of nested forms @@ -29,7 +31,7 @@ public class NestedPersonForm extends Form { beanItem = new BeanItem<Person>(person); setCaption("Update person details"); - setWriteThrough(false); + setBuffered(true); setFormFieldFactory(new PersonFieldFactory()); // set the data source and the visible fields // Note that if the nested form is the first or last field in the parent @@ -37,7 +39,8 @@ public class NestedPersonForm extends Form { setItemDataSource(beanItem, Arrays.asList("firstName", "lastName", "address", "email", "phoneNumber")); getFooter().addComponent(getButtonsLayout()); - getFooter().setMargin(false, false, true, true); + ((MarginHandler) getFooter()).setMargin(new MarginInfo(false, false, + true, true)); } /** diff --git a/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.java b/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.java index c4f001ac41..e24f4753ff 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.java @@ -41,7 +41,7 @@ public class CommitInvalid extends TestBase { * Create and configure form. */ final Form form = new Form(); - form.setWriteThrough(false); // set write buffering on + form.setBuffered(true); // set write buffering on form.setImmediate(true); // make form (and especially its fields // immediate) @@ -132,8 +132,8 @@ public class CommitInvalid extends TestBase { } private void printState() { - log.log("Date. Field: " + f((Date) dateField.getValue()) - + " Property: " + f(dateProperty.getValue())); + log.log("Date. Field: " + f(dateField.getValue()) + " Property: " + + f(dateProperty.getValue())); log.log("Integer: Field: " + integerField.getValue() + " Property: " + integerProperty.getValue()); } diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java index 2a7807670b..85f1c80a08 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java @@ -88,7 +88,7 @@ public class DateFieldInSubWindow extends AbstractTestCase { final Form generalForm = new Form(); { generalForm.setCaption("My form"); - generalForm.setWriteThrough(true); + generalForm.setBuffered(false); generalForm.setFormFieldFactory(fieldFactory); BeanItem<MyBean> myBeanItem = new BeanItem<MyBean>(myBean); diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java index befdd65693..c085088917 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java @@ -58,7 +58,7 @@ public class DateFieldRangeValidation extends TestBase { @Override public void valueChange(ValueChangeEvent event) { - actualDateField.requestRepaint(); + actualDateField.markAsDirty(); } }; @@ -125,8 +125,7 @@ public class DateFieldRangeValidation extends TestBase { PopupDateField df = new PopupDateField(); df.setLocale(new Locale("en", "US")); df.setResolution(Resolution.DAY); - df.setWriteThrough(true); - df.setReadThrough(true); + df.setBuffered(false); df.setImmediate(true); return df; } diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DisabledDateFieldWidth.java b/tests/testbench/com/vaadin/tests/components/datefield/DisabledDateFieldWidth.java index 4e256aa947..403b82a2a7 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/DisabledDateFieldWidth.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/DisabledDateFieldWidth.java @@ -18,7 +18,7 @@ public class DisabledDateFieldWidth extends TestBase { new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { - dateField1.requestRepaint(); + dateField1.markAsDirty(); } }); diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java index e316fcc5ec..3020942844 100644 --- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java +++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java @@ -47,7 +47,7 @@ public class EmbeddedImageRefresh extends TestBase { button.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { - embedded.requestRepaint(); + embedded.markAsDirty(); } }); addComponent(button); @@ -57,7 +57,7 @@ public class EmbeddedImageRefresh extends TestBase { public void buttonClick(ClickEvent event) { ((StreamResource) embedded.getSource()).setFilename(new Date() .getTime() + ".png"); - embedded.requestRepaint(); + embedded.markAsDirty(); } }); addComponent(button); diff --git a/tests/testbench/com/vaadin/tests/components/gridlayout/MoveComponentsFromGridLayoutToInnerLayout.java b/tests/testbench/com/vaadin/tests/components/gridlayout/MoveComponentsFromGridLayoutToInnerLayout.java index 1c10b1d9d7..0106f2e218 100644 --- a/tests/testbench/com/vaadin/tests/components/gridlayout/MoveComponentsFromGridLayoutToInnerLayout.java +++ b/tests/testbench/com/vaadin/tests/components/gridlayout/MoveComponentsFromGridLayoutToInnerLayout.java @@ -40,7 +40,7 @@ public class MoveComponentsFromGridLayoutToInnerLayout extends TestBase { @Override public void buttonClick(ClickEvent event) { - vl.requestRepaint(); + vl.markAsDirty(); } }); diff --git a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormRootInLoginHandler.java b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormRootInLoginHandler.java new file mode 100755 index 0000000000..2c0a8744fc --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormRootInLoginHandler.java @@ -0,0 +1,52 @@ +package com.vaadin.tests.components.loginform;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.LoginForm;
+import com.vaadin.ui.LoginForm.LoginEvent;
+import com.vaadin.ui.LoginForm.LoginListener;
+import com.vaadin.ui.Root;
+
+public class LoginFormRootInLoginHandler extends TestBase {
+
+ @Override
+ protected void setup() {
+ LoginForm lf = new LoginForm();
+ lf.addListener(new LoginListener() {
+
+ @Override
+ public void onLogin(LoginEvent event) {
+ Root r1 = Root.getCurrent();
+ if (r1 != null) {
+ addComponent(new Label("Root.getCurrent().data: "
+ + r1.getData()));
+ } else {
+ addComponent(new Label("Root.getCurrent() is null"));
+ }
+ Root r2 = ((LoginForm) event.getSource()).getRoot();
+ if (r2 != null) {
+ addComponent(new Label("event.getSource().data: "
+ + r2.getData()));
+ } else {
+ addComponent(new Label(
+ "event.getSource().getRoot() is null"));
+ }
+ }
+ });
+ addComponent(lf);
+ getLayout().getRoot().setData("This root");
+ }
+
+ @Override
+ protected String getDescription() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/notification/Notifications.java b/tests/testbench/com/vaadin/tests/components/notification/Notifications.java index ab632a2a57..97e038dc1a 100644 --- a/tests/testbench/com/vaadin/tests/components/notification/Notifications.java +++ b/tests/testbench/com/vaadin/tests/components/notification/Notifications.java @@ -7,6 +7,7 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.NativeSelect; import com.vaadin.ui.Notification; +import com.vaadin.ui.Notification.Type; import com.vaadin.ui.TextArea; public class Notifications extends TestBase implements ClickListener { @@ -52,8 +53,7 @@ public class Notifications extends TestBase implements ClickListener { @Override public void buttonClick(ClickEvent event) { - Notification n = new Notification(tf.getValue(), - (Integer) type.getValue()); + Notification n = new Notification(tf.getValue(), (Type) type.getValue()); n.setHtmlContentAllowed(true); n.show(Page.getCurrent()); } diff --git a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java index c3b20c5e7c..ae3182401d 100644 --- a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java +++ b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java @@ -1,5 +1,8 @@ package com.vaadin.tests.components.root; +import com.vaadin.Application; +import com.vaadin.RootRequiresMoreInformationException; +import com.vaadin.terminal.AbstractRootProvider; import com.vaadin.terminal.WrappedRequest; import com.vaadin.tests.components.AbstractTestApplication; import com.vaadin.ui.Label; @@ -19,9 +22,15 @@ public class RootsInMultipleTabs extends AbstractTestApplication { } } - @Override - protected String getRootClassName(WrappedRequest request) { - return TabRoot.class.getName(); + public RootsInMultipleTabs() { + addRootProvider(new AbstractRootProvider() { + @Override + public Class<? extends Root> getRootClass(Application application, + WrappedRequest request) + throws RootRequiresMoreInformationException { + return TabRoot.class; + } + }); } @Override diff --git a/tests/testbench/com/vaadin/tests/components/select/SelectDisplaysOldValue.java b/tests/testbench/com/vaadin/tests/components/select/SelectDisplaysOldValue.java index b9ae958a03..77c187ff60 100644 --- a/tests/testbench/com/vaadin/tests/components/select/SelectDisplaysOldValue.java +++ b/tests/testbench/com/vaadin/tests/components/select/SelectDisplaysOldValue.java @@ -121,8 +121,7 @@ public class SelectDisplaysOldValue extends TestBase { controllerComboBox.setNullSelectionAllowed(false); controllerComboBox.setNewItemsAllowed(false); controllerComboBox.setImmediate(true); - controllerComboBox.setWriteThrough(false); - controllerComboBox.setReadThrough(false); + controllerComboBox.setBuffered(true); } @@ -131,8 +130,7 @@ public class SelectDisplaysOldValue extends TestBase { slaveComboBox.setNullSelectionAllowed(false); slaveComboBox.setNewItemsAllowed(false); slaveComboBox.setImmediate(true); - slaveComboBox.setWriteThrough(false); - slaveComboBox.setReadThrough(false); + slaveComboBox.setBuffered(true); } private void refreshSlaveDropdown(Integer masterId) { diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java index 05e10397ac..00012522ca 100644 --- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java +++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java @@ -62,8 +62,8 @@ public class SplitPanelExtraScrollbars extends AbstractTestCase implements } // Sending all changes in one repaint triggers the bug - hl.requestRepaint(); - sp.requestRepaint(); + hl.markAsDirty(); + sp.markAsDirty(); } } diff --git a/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java b/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java index 88c7c76889..26ac23d5be 100644 --- a/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java +++ b/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java @@ -114,7 +114,7 @@ public class EditableTableLeak extends TestBase { addComponent(new Button("Show size of the table", new ClickListener() { @Override public void buttonClick(ClickEvent event) { - table.requestRepaintAll(); + table.markAsDirtyRecursive(); updateSize(); } diff --git a/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java b/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java index 00df9fa3c3..a37cf48579 100644 --- a/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java +++ b/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java @@ -63,7 +63,7 @@ public class TableClickValueChangeInteraction extends TestBase { @Override public void itemClick(ItemClickEvent event) { - table.requestRepaint(); + table.markAsDirty(); clickLabel.setValue("Click " + event.getItemId()); } }); diff --git a/tests/testbench/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.java b/tests/testbench/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.java index 1895191cc4..0b695b41c7 100644 --- a/tests/testbench/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.java +++ b/tests/testbench/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.java @@ -34,14 +34,14 @@ public class TableColumnResizeContentsWidth extends TestBase { @Override public void buttonClick(ClickEvent event) { table.setColumnWidth(COL1, table.getColumnWidth(COL1) + 20); - table.requestRepaint(); + table.markAsDirty(); } })); addComponent(new Button("Decrease width", new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { table.setColumnWidth(COL1, table.getColumnWidth(COL1) - 40); - table.requestRepaint(); + table.markAsDirty(); } })); } diff --git a/tests/testbench/com/vaadin/tests/components/textfield/OutOfSyncIssueWithKeyboardShortcut.java b/tests/testbench/com/vaadin/tests/components/textfield/OutOfSyncIssueWithKeyboardShortcut.java index 89f9ffda40..955a9c2772 100644 --- a/tests/testbench/com/vaadin/tests/components/textfield/OutOfSyncIssueWithKeyboardShortcut.java +++ b/tests/testbench/com/vaadin/tests/components/textfield/OutOfSyncIssueWithKeyboardShortcut.java @@ -70,7 +70,7 @@ public class OutOfSyncIssueWithKeyboardShortcut extends TestBase { form.setImmediate(true); // this is critical for the problem to occur - form.setWriteThrough(false); + form.setBuffered(true); HorizontalLayout footer = new HorizontalLayout(); footer.setSpacing(true); diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeFiltering.java b/tests/testbench/com/vaadin/tests/components/tree/TreeFiltering.java index bd7984cdeb..be65a335be 100644 --- a/tests/testbench/com/vaadin/tests/components/tree/TreeFiltering.java +++ b/tests/testbench/com/vaadin/tests/components/tree/TreeFiltering.java @@ -51,7 +51,7 @@ public class TreeFiltering extends TestBase { public void valueChange(ValueChangeEvent event) { cont.setIncludeParentsWhenFiltering((Boolean) ((CheckBox) event .getProperty()).getValue()); - ccTree.requestRepaint(); + ccTree.markAsDirty(); } }); addComponent(filterType); diff --git a/tests/testbench/com/vaadin/tests/components/treetable/KeepAllItemsVisible.java b/tests/testbench/com/vaadin/tests/components/treetable/KeepAllItemsVisible.java index 799537f923..f444b781dd 100644 --- a/tests/testbench/com/vaadin/tests/components/treetable/KeepAllItemsVisible.java +++ b/tests/testbench/com/vaadin/tests/components/treetable/KeepAllItemsVisible.java @@ -40,7 +40,7 @@ public class KeepAllItemsVisible extends TestBase implements ExpandListener, @Override public void valueChange(ValueChangeEvent event) { recalculatePageLength(tt); - tt.requestRepaint(); + tt.markAsDirty(); } }); addComponent(tt); diff --git a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java index f34c12607a..537c9be973 100644 --- a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java +++ b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java @@ -76,7 +76,7 @@ public class CheckboxUpdateProblem extends Application.LegacyApplication private TestForm() { setSizeFull(); - setWriteThrough(false); + setBuffered(true); setInvalidCommitted(false); save = new Button("Save", this); diff --git a/tests/testbench/com/vaadin/tests/dd/NotPaintedAcceptSource.java b/tests/testbench/com/vaadin/tests/dd/NotPaintedAcceptSource.java index abe8553267..020a6b56c5 100644 --- a/tests/testbench/com/vaadin/tests/dd/NotPaintedAcceptSource.java +++ b/tests/testbench/com/vaadin/tests/dd/NotPaintedAcceptSource.java @@ -64,7 +64,7 @@ public class NotPaintedAcceptSource extends TestBase { } else { horizontalLayout.replaceComponent(source2, source1); } - target.requestRepaint(); + target.markAsDirty(); } })); diff --git a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java index de028cf0c3..60db95827c 100644 --- a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java +++ b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java @@ -39,7 +39,6 @@ public class HelloWorldExtension extends AbstractExtension { public void setGreeting(String greeting) { getState().setGreeting(greeting); - requestRepaint(); } public String getGreeting() { diff --git a/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java b/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java index b33162d714..7d4f41cfb3 100644 --- a/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java +++ b/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java @@ -84,7 +84,6 @@ public class SimpleJavaScriptExtensionTest extends AbstractTestRoot { public void setPrefix(String prefix) { getState().setPrefix(prefix); - requestRepaint(); } public void greetRpc(String message) { diff --git a/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java b/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java index 1ea800821b..a35b78c219 100644 --- a/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java +++ b/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java @@ -8,6 +8,7 @@ import com.vaadin.Application; import com.vaadin.data.Property; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.event.Action; +import com.vaadin.shared.ui.MarginInfo; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.terminal.ExternalResource; import com.vaadin.terminal.Page; @@ -103,7 +104,6 @@ public class LiferayThemeDemo extends Application.LegacyApplication { mainLayout.addComponent(getTopMenu()); CssLayout margin = new CssLayout(); - margin.setMargin(false, true, true, true); margin.setSizeFull(); tabs = new TabSheet(); tabs.setSizeFull(); @@ -239,7 +239,7 @@ public class LiferayThemeDemo extends Application.LegacyApplication { HorizontalLayout hl = new HorizontalLayout(); hl.setSpacing(true); - hl.setMargin(true, false, false, false); + hl.setMargin(new MarginInfo(true, false, false, false)); l.addComponent(hl); AbstractSelect cb = new ComboBox(); @@ -270,7 +270,7 @@ public class LiferayThemeDemo extends Application.LegacyApplication { HorizontalLayout hl = new HorizontalLayout(); hl.setSpacing(true); - hl.setMargin(true, false, false, false); + hl.setMargin(new MarginInfo(true, false, false, false)); l.addComponent(hl); DateField df = new DateField(); diff --git a/tests/testbench/com/vaadin/tests/layouts/CssLayoutCustomCss.java b/tests/testbench/com/vaadin/tests/layouts/CssLayoutCustomCss.java index 792bcb1aab..2f717d2b64 100644 --- a/tests/testbench/com/vaadin/tests/layouts/CssLayoutCustomCss.java +++ b/tests/testbench/com/vaadin/tests/layouts/CssLayoutCustomCss.java @@ -12,6 +12,7 @@ import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Component; import com.vaadin.ui.CssLayout; +import com.vaadin.ui.Layout.MarginHandler; import com.vaadin.ui.NativeButton; public class CssLayoutCustomCss extends TestBase implements ClickListener { @@ -48,7 +49,7 @@ public class CssLayoutCustomCss extends TestBase implements ClickListener { @Override public void valueChange(ValueChangeEvent event) { - layout.setMargin(cb.getValue()); + ((MarginHandler) layout).setMargin(cb.getValue()); } }); @@ -84,7 +85,7 @@ public class CssLayoutCustomCss extends TestBase implements ClickListener { css.remove(b); b.setCaption("not " + b.getCaption()); } - layout.requestRepaint(); + layout.markAsDirty(); } diff --git a/tests/testbench/com/vaadin/tests/layouts/GridLayoutInsidePanel.java b/tests/testbench/com/vaadin/tests/layouts/GridLayoutInsidePanel.java index 1c864fdb47..e200c40744 100644 --- a/tests/testbench/com/vaadin/tests/layouts/GridLayoutInsidePanel.java +++ b/tests/testbench/com/vaadin/tests/layouts/GridLayoutInsidePanel.java @@ -3,7 +3,7 @@ package com.vaadin.tests.layouts; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; +import com.vaadin.ui.Layout.MarginHandler; import com.vaadin.ui.Panel; public class GridLayoutInsidePanel extends TestBase { @@ -27,7 +27,7 @@ public class GridLayoutInsidePanel extends TestBase { "A label which defines the size of the GL")); Panel p = new Panel("Panel 1"); - ((Layout) p.getContent()).setMargin(false); + ((MarginHandler) p.getContent()).setMargin(false); p.setSizeUndefined(); p.getContent().setSizeUndefined(); @@ -41,7 +41,7 @@ public class GridLayoutInsidePanel extends TestBase { "A label which defines the size of the GL")); Panel p = new Panel("Panel 2", gl); - ((Layout) p.getContent()).setMargin(false); + ((MarginHandler) p.getContent()).setMargin(false); p.setSizeUndefined(); p.getContent().setSizeUndefined(); diff --git a/tests/testbench/com/vaadin/tests/layouts/TestAbsoluteLayout.java b/tests/testbench/com/vaadin/tests/layouts/TestAbsoluteLayout.java index d2f14c114e..33fa0558e7 100644 --- a/tests/testbench/com/vaadin/tests/layouts/TestAbsoluteLayout.java +++ b/tests/testbench/com/vaadin/tests/layouts/TestAbsoluteLayout.java @@ -271,14 +271,14 @@ public class TestAbsoluteLayout extends TestBase { addComponent(addComp); componentEditor = new Form(); - componentEditor.setWriteThrough(false); + componentEditor.setBuffered(true); componentEditor.setCaption("Component properties:"); componentEditor.setFormFieldFactory(MFieldFactory.get()); addComponent(componentEditor); positionEditor = new Form(); positionEditor.setCaption("Component position"); - positionEditor.setWriteThrough(false); + positionEditor.setBuffered(true); positionEditor.setFormFieldFactory(MFieldFactory.get()); addComponent(positionEditor); diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java index c6109eebcd..061eb7a23e 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java @@ -29,7 +29,6 @@ public class ComponentInStateComponent extends AbstractComponent { public void setOtherComponent(Component component) { getState().setOtherComponent(component); - requestRepaint(); } public Component getOtherComponent() { diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponent.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponent.java index b85d49172b..292ac62125 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponent.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponent.java @@ -51,7 +51,6 @@ public class MyComponent extends AbstractComponent { public void setText(String text) { getState().setText(text); - requestRepaint(); } public String getText() { diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetContainer.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetContainer.java index 40bb7b68b8..5c519dbdfe 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetContainer.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetContainer.java @@ -15,14 +15,14 @@ public class WidgetContainer extends AbstractComponentContainer { public void addComponent(Component c) { children.add(c); super.addComponent(c); - requestRepaint(); + markAsDirty(); } @Override public void removeComponent(Component c) { children.remove(c); super.removeComponent(c); - requestRepaint(); + markAsDirty(); } @Override @@ -33,7 +33,7 @@ public class WidgetContainer extends AbstractComponentContainer { children.add(index, newComponent); fireComponentDetachEvent(oldComponent); fireComponentAttachEvent(newComponent); - requestRepaint(); + markAsDirty(); } } diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Flot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Flot.java index 99e6418fdc..816c60cfe5 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Flot.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Flot.java @@ -58,8 +58,6 @@ public class Flot extends AbstractJavaScriptComponent { } getState().getSeries().add(pointList); - - requestRepaint(); } public void highlight(int seriesIndex, int dataIndex) { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1435.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1435.java index 438f7e2d5f..d6d3b132c3 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1435.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1435.java @@ -10,6 +10,7 @@ import com.vaadin.ui.CustomComponent; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; +import com.vaadin.ui.Layout.MarginHandler; import com.vaadin.ui.Panel; import com.vaadin.ui.Root.LegacyWindow; import com.vaadin.ui.Table; @@ -159,7 +160,7 @@ public class Ticket1435 extends Application.LegacyApplication { private void initContainer() { container.setStyleName("custompanel"); container.setSizeFull(); - ((Layout) container.getContent()).setMargin(false); + ((MarginHandler) container.getContent()).setMargin(false); container.getContent().setSizeFull(); root.addComponent(container); root.setExpandRatio(container, 1); diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1572.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1572.java index b9fd2debd5..87ea7e86a8 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1572.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1572.java @@ -1,5 +1,6 @@ package com.vaadin.tests.tickets; +import com.vaadin.shared.ui.MarginInfo; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.GridLayout; @@ -82,19 +83,19 @@ public class Ticket1572 extends com.vaadin.Application.LegacyApplication { state.setValue("Margin on"); break; case 2: - gl.setMargin(true, false, false, false); + gl.setMargin(new MarginInfo(true, false, false, false)); state.setValue("Margin top"); break; case 3: - gl.setMargin(false, true, false, false); + gl.setMargin(new MarginInfo(false, true, false, false)); state.setValue("Margin right"); break; case 4: - gl.setMargin(false, false, true, false); + gl.setMargin(new MarginInfo(false, false, true, false)); state.setValue("Margin bottom"); break; case 5: - gl.setMargin(false, false, false, true); + gl.setMargin(new MarginInfo(false, false, false, true)); state.setValue("Margin left"); break; default: diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java index 01792aeb89..6547572e6d 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java @@ -5,9 +5,12 @@ import java.util.Iterator; import com.vaadin.data.Property; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.util.MethodProperty; +import com.vaadin.shared.ui.AlignmentInfo.Bits; +import com.vaadin.shared.ui.MarginInfo; import com.vaadin.terminal.SystemError; import com.vaadin.terminal.ThemeResource; import com.vaadin.ui.AbstractComponent; +import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Component; @@ -319,84 +322,77 @@ public class Ticket1710 extends com.vaadin.Application.LegacyApplication { hAlign.setNullSelectionAllowed(false); vAlign.setNullSelectionAllowed(false); - vAlign.addItem(new Integer(Layout.AlignmentHandler.ALIGNMENT_TOP)); - vAlign.setItemCaption(new Integer( - Layout.AlignmentHandler.ALIGNMENT_TOP), "top"); - vAlign.addItem(new Integer( - Layout.AlignmentHandler.ALIGNMENT_VERTICAL_CENTER)); - vAlign.setItemCaption(new Integer( - Layout.AlignmentHandler.ALIGNMENT_VERTICAL_CENTER), + vAlign.addItem(new Integer(Bits.ALIGNMENT_TOP)); + vAlign.setItemCaption(new Integer(Bits.ALIGNMENT_TOP), "top"); + vAlign.addItem(new Integer(Bits.ALIGNMENT_VERTICAL_CENTER)); + vAlign.setItemCaption(new Integer(Bits.ALIGNMENT_VERTICAL_CENTER), "center"); - vAlign.addItem(new Integer(Layout.AlignmentHandler.ALIGNMENT_BOTTOM)); - vAlign.setItemCaption(new Integer( - Layout.AlignmentHandler.ALIGNMENT_BOTTOM), "bottom"); - - hAlign.addItem(new Integer(Layout.AlignmentHandler.ALIGNMENT_LEFT)); - hAlign.setItemCaption(new Integer( - Layout.AlignmentHandler.ALIGNMENT_LEFT), "left"); - hAlign.addItem(new Integer( - Layout.AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER)); - hAlign.setItemCaption(new Integer( - Layout.AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER), - "center"); - hAlign.addItem(new Integer(Layout.AlignmentHandler.ALIGNMENT_RIGHT)); - hAlign.setItemCaption(new Integer( - Layout.AlignmentHandler.ALIGNMENT_RIGHT), "right"); + vAlign.addItem(new Integer(Bits.ALIGNMENT_BOTTOM)); + vAlign.setItemCaption(new Integer(Bits.ALIGNMENT_BOTTOM), "bottom"); + + hAlign.addItem(new Integer(Bits.ALIGNMENT_LEFT)); + hAlign.setItemCaption(new Integer(Bits.ALIGNMENT_LEFT), "left"); + hAlign.addItem(new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER)); + hAlign.setItemCaption( + new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER), "center"); + hAlign.addItem(new Integer(Bits.ALIGNMENT_RIGHT)); + hAlign.setItemCaption(new Integer(Bits.ALIGNMENT_RIGHT), "right"); Property.ValueChangeListener alignmentChangeListener = new Property.ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { - updateAlignments(((Integer) hAlign.getValue()).intValue(), - ((Integer) vAlign.getValue()).intValue()); + Integer h = ((Integer) hAlign.getValue()).intValue(); + int v = ((Integer) vAlign.getValue()).intValue(); + + updateAlignments(new Alignment(h + v)); } }; - hAlign.setValue(new Integer(Layout.AlignmentHandler.ALIGNMENT_LEFT)); + hAlign.setValue(new Integer(Bits.ALIGNMENT_LEFT)); vAlign.addListener(alignmentChangeListener); hAlign.addListener(alignmentChangeListener); - vAlign.setValue(new Integer(Layout.AlignmentHandler.ALIGNMENT_TOP)); + vAlign.setValue(new Integer(Bits.ALIGNMENT_TOP)); controls.addComponent(new Label("layout alignment")); final NativeSelect lAlign = new NativeSelect(); controls.addComponent(lAlign); lAlign.setNullSelectionAllowed(false); - lAlign.addItem(new Integer(Layout.AlignmentHandler.ALIGNMENT_LEFT)); - lAlign.setItemCaption(new Integer( - Layout.AlignmentHandler.ALIGNMENT_LEFT), "left"); - lAlign.addItem(new Integer( - Layout.AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER)); - lAlign.setItemCaption(new Integer( - Layout.AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER), - "center"); - lAlign.addItem(new Integer(Layout.AlignmentHandler.ALIGNMENT_RIGHT)); - lAlign.setItemCaption(new Integer( - Layout.AlignmentHandler.ALIGNMENT_RIGHT), "right"); + lAlign.addItem(new Integer(Bits.ALIGNMENT_LEFT)); + lAlign.setItemCaption(new Integer(Bits.ALIGNMENT_LEFT), "left"); + lAlign.addItem(new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER)); + lAlign.setItemCaption( + new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER), "center"); + lAlign.addItem(new Integer(Bits.ALIGNMENT_RIGHT)); + lAlign.setItemCaption(new Integer(Bits.ALIGNMENT_RIGHT), "right"); lAlign.addListener(new Property.ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { - testPanelLayout.setComponentAlignment(testedLayout, - ((Integer) lAlign.getValue()).intValue(), - VerticalLayout.ALIGNMENT_TOP); + testPanelLayout.setComponentAlignment( + testedLayout, + new Alignment(((Integer) lAlign.getValue()) + .intValue() + Bits.ALIGNMENT_TOP)); } }); } - @SuppressWarnings("deprecation") - private void updateAlignments(int h, int v) { + private void updateAlignments(Alignment a) { for (Iterator<Component> i = testedLayout.getComponentIterator(); i .hasNext();) { ((Layout.AlignmentHandler) testedLayout).setComponentAlignment( - i.next(), h, v); + i.next(), a); } } private void updateMarginsAndSpacing() { - testedLayout.setMargin(marginTop.getValue().booleanValue(), - marginRight.getValue().booleanValue(), marginBottom - .getValue().booleanValue(), marginLeft.getValue() - .booleanValue()); + if (testedLayout instanceof Layout.MarginHandler) { + ((Layout.MarginHandler) testedLayout).setMargin(new MarginInfo( + marginTop.getValue().booleanValue(), marginRight + .getValue().booleanValue(), marginBottom + .getValue().booleanValue(), marginLeft + .getValue().booleanValue())); + } if (testedLayout instanceof Layout.SpacingHandler) { ((Layout.SpacingHandler) testedLayout).setSpacing(spacing .getValue().booleanValue()); diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1805.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1805.java index a40f5b25b9..e5fcf59db8 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1805.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1805.java @@ -6,7 +6,7 @@ import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; +import com.vaadin.ui.Layout.MarginHandler; import com.vaadin.ui.Root.LegacyWindow; import com.vaadin.ui.TextField; @@ -17,7 +17,7 @@ public class Ticket1805 extends com.vaadin.Application.LegacyApplication { final LegacyWindow main = new LegacyWindow(getClass().getName() .substring(getClass().getName().lastIndexOf(".") + 1)); setMainWindow(main); - ((Layout) main.getContent()).setMargin(false); + ((MarginHandler) main.getContent()).setMargin(false); Label description = new Label( "GridLayout with 100% (no height), is wanted to " diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1806.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1806.java index 2c979f4600..fa572039aa 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1806.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1806.java @@ -17,8 +17,7 @@ public class Ticket1806 extends com.vaadin.Application.LegacyApplication { final ObjectProperty<String> prop = new ObjectProperty<String>(""); final TextField tf1 = new TextField( "Buffered TextField bound to ObjectProperty"); - tf1.setWriteThrough(false); - tf1.setReadThrough(false); + tf1.setBuffered(true); tf1.setPropertyDataSource(prop); main.addComponent(tf1); main.addComponent(new Button( diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java index de91b04c1c..e31748ec2f 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java @@ -66,7 +66,7 @@ public class Ticket1834PanelScrolling extends b.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { - p.requestRepaint(); + p.markAsDirty(); } }); diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java index 4deb5020ab..4db82c3371 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java @@ -107,7 +107,7 @@ public class Ticket1983 extends Application.LegacyApplication { isLong = true; } // Works the same way with or without repaint request - table.requestRepaint(); + table.markAsDirty(); } }); diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2021.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2021.java index c36bb5c25e..f6d8ce5e01 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2021.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2021.java @@ -9,6 +9,7 @@ import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; +import com.vaadin.ui.Layout.MarginHandler; import com.vaadin.ui.Panel; import com.vaadin.ui.Root.LegacyWindow; import com.vaadin.ui.TextArea; @@ -78,7 +79,7 @@ public class Ticket2021 extends Application.LegacyApplication { p3.setHeight("500px"); // p3.setContent(new GridLayout()); p3.getContent().setSizeFull(); - ((Layout) p3.getContent()).setMargin(false); + ((MarginHandler) p3.getContent()).setMargin(false); GridLayout gl = new GridLayout(); gl.setSizeFull(); diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2040.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2040.java index ac8928d110..d98656b9ca 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2040.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2040.java @@ -2,7 +2,7 @@ package com.vaadin.tests.tickets; import com.vaadin.ui.Accordion; import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; +import com.vaadin.ui.Layout.MarginHandler; import com.vaadin.ui.Root.LegacyWindow; import com.vaadin.ui.TextArea; import com.vaadin.ui.TextField; @@ -17,7 +17,7 @@ public class Ticket2040 extends com.vaadin.Application.LegacyApplication { setMainWindow(main); main.getContent().setSizeFull(); - ((Layout) main.getContent()).setMargin(true); + ((MarginHandler) main.getContent()).setMargin(true); setTheme("tests-tickets"); diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2060.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2060.java index 1d7d8bb006..88404b6ef1 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2060.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2060.java @@ -33,9 +33,9 @@ public class Ticket2060 extends Application.LegacyApplication { @Override public void buttonClick(ClickEvent event) { - button1.requestRepaint(); - button2.requestRepaint(); - button3.requestRepaint(); + button1.markAsDirty(); + button2.markAsDirty(); + button3.markAsDirty(); } diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java index 16a552e37a..c5ef9ec0b0 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java @@ -8,7 +8,7 @@ import com.vaadin.ui.Embedded; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.HorizontalSplitPanel; import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; +import com.vaadin.ui.Layout.MarginHandler; import com.vaadin.ui.Root.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; @@ -31,7 +31,7 @@ public class Ticket2405 extends Application.LegacyApplication { setMainWindow(root); root.getContent().setSizeFull(); - ((Layout) root.getContent()).setMargin(false); + ((MarginHandler) root.getContent()).setMargin(false); // Top area, containing playback and volume controls, play status, view // modes and search diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java index ee60c0ce7e..2d2970d36e 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java @@ -19,6 +19,7 @@ import com.vaadin.ui.DefaultFieldFactory; import com.vaadin.ui.Field; import com.vaadin.ui.FormLayout; import com.vaadin.ui.Layout; +import com.vaadin.ui.Layout.MarginHandler; import com.vaadin.ui.ListSelect; import com.vaadin.ui.Notification; import com.vaadin.ui.Panel; @@ -252,7 +253,7 @@ public class Ticket2998 extends Application.LegacyApplication { // set theme and some layout stuff setMainWindow(w); w.getContent().setSizeFull(); - ((Layout) w.getContent()).setMargin(false); + ((MarginHandler) w.getContent()).setMargin(false); Panel p = new Panel("Workout Log"); p.setStyleName(Reindeer.PANEL_LIGHT); diff --git a/tests/testbench/com/vaadin/tests/vaadincontext/BoostrapModify.html b/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModify.html index 84c02254b4..8888f95d15 100644 --- a/tests/testbench/com/vaadin/tests/vaadincontext/BoostrapModify.html +++ b/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModify.html @@ -13,13 +13,13 @@ </thead><tbody> <tr> <td>open</td> - <td>/run/com.vaadin.tests.vaadincontext.BoostrapModifyRoot?restartApplication</td> + <td>/run/com.vaadin.tests.vaadincontext.BootstrapModifyRoot?restartApplication</td> <td></td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestsvaadincontextBoostrapModifyRoot::/VVerticalLayout[0]/VLabel[0]</td> - <td>There should be a static h1 in the HTML of the bootstrap page for this Root</td> + <td>vaadin=runcomvaadintestsvaadincontextBootstrapModifyRoot::/VVerticalLayout[0]/VLabel[0]</td> + <td>There should be two additional divs in the HTML of the bootstrap page for this Root</td> </tr> <tr> <td>assertText</td> diff --git a/tests/testbench/com/vaadin/tests/vaadincontext/BoostrapModifyRoot.java b/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyRoot.java index ede8d51192..6c17c3005e 100644 --- a/tests/testbench/com/vaadin/tests/vaadincontext/BoostrapModifyRoot.java +++ b/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyRoot.java @@ -19,7 +19,7 @@ package com.vaadin.tests.vaadincontext; import com.vaadin.terminal.WrappedRequest; import com.vaadin.tests.components.AbstractTestRoot; -public class BoostrapModifyRoot extends AbstractTestRoot { +public class BootstrapModifyRoot extends AbstractTestRoot { @Override protected void setup(WrappedRequest request) { @@ -29,7 +29,7 @@ public class BoostrapModifyRoot extends AbstractTestRoot { @Override protected String getTestDescription() { - return "There should be a static h1 in the HTML of the bootstrap page for this Root"; + return "There should be two additional divs in the HTML of the bootstrap page for this Root"; } @Override diff --git a/tests/testbench/com/vaadin/tests/vaadincontext/TestAddonContextListener.java b/tests/testbench/com/vaadin/tests/vaadincontext/TestAddonContextListener.java index 4c93d70b36..da058892b4 100644 --- a/tests/testbench/com/vaadin/tests/vaadincontext/TestAddonContextListener.java +++ b/tests/testbench/com/vaadin/tests/vaadincontext/TestAddonContextListener.java @@ -44,7 +44,7 @@ public class TestAddonContextListener implements AddonContextListener { private boolean shouldModify(BootstrapResponse response) { Root root = response.getRoot(); boolean shouldModify = root != null - && root.getClass() == BoostrapModifyRoot.class; + && root.getClass() == BootstrapModifyRoot.class; return shouldModify; } |