summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/integration-testscripts/common/integration_test.tpl2
-rw-r--r--tests/integration_tests.xml90
-rw-r--r--tests/ivy.xml16
-rw-r--r--tests/server-side/com/vaadin/data/util/BeanItemTest.java7
-rw-r--r--tests/server-side/com/vaadin/data/util/NestedMethodPropertyTest.java89
-rw-r--r--tests/server-side/com/vaadin/data/util/ObjectPropertyTest.java8
-rw-r--r--tests/server-side/com/vaadin/data/util/PropertyDescriptorTest.java11
-rw-r--r--tests/server-side/com/vaadin/data/util/PropertySetItemTest.java8
-rw-r--r--tests/server-side/com/vaadin/data/util/TestContainerSorting.java23
-rw-r--r--tests/server-side/com/vaadin/data/util/filter/AbstractFilterTest.java9
-rw-r--r--tests/server-side/com/vaadin/data/util/filter/AndOrFilterTest.java4
-rw-r--r--tests/server-side/com/vaadin/data/util/filter/CompareFilterTest.java2
-rw-r--r--tests/server-side/com/vaadin/data/util/filter/IsNullFilterTest.java4
-rw-r--r--tests/server-side/com/vaadin/data/util/filter/NotFilterTest.java4
-rw-r--r--tests/server-side/com/vaadin/data/util/filter/SimpleStringFilterTest.java5
-rw-r--r--tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java2
-rw-r--r--tests/server-side/com/vaadin/data/util/sqlcontainer/filters/BetweenTest.java2
-rw-r--r--tests/server-side/com/vaadin/terminal/gwt/server/TestAbstractApplicationServletStaticFilesLocation.java9
-rw-r--r--tests/server-side/com/vaadin/tests/VaadinClasses.java14
-rw-r--r--tests/server-side/com/vaadin/tests/data/bean/Address.java63
-rw-r--r--tests/server-side/com/vaadin/tests/data/bean/BeanToValidate.java56
-rw-r--r--tests/server-side/com/vaadin/tests/data/bean/Country.java18
-rw-r--r--tests/server-side/com/vaadin/tests/data/bean/Person.java133
-rw-r--r--tests/server-side/com/vaadin/tests/data/bean/PersonWithBeanValidationAnnotations.java156
-rw-r--r--tests/server-side/com/vaadin/tests/data/bean/Sex.java20
-rw-r--r--tests/server-side/com/vaadin/tests/server/LicenseInJavaFiles.java57
-rw-r--r--tests/server-side/com/vaadin/tests/server/TestSerialization.java19
-rw-r--r--tests/server-side/com/vaadin/tests/server/TransactionListenersConcurrency.java2
-rw-r--r--tests/server-side/com/vaadin/tests/server/component/absolutelayout/ComponentPosition.java53
-rw-r--r--tests/server-side/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java162
-rw-r--r--tests/server-side/com/vaadin/tests/server/component/abstractfield/DefaultConverterFactory.java48
-rw-r--r--tests/server-side/com/vaadin/tests/server/component/abstractfield/TestAbstractFieldListeners.java7
-rw-r--r--tests/server-side/com/vaadin/tests/server/component/datefield/ResolutionTest.java61
-rw-r--r--tests/server-side/com/vaadin/tests/server/component/slider/SliderTest.java25
-rw-r--r--tests/server-side/com/vaadin/tests/server/component/table/TableColumnAlignments.java64
-rw-r--r--tests/server-side/com/vaadin/tests/server/component/textfield/TextFieldWithPropertyFormatter.java14
-rw-r--r--tests/server-side/com/vaadin/tests/server/component/urifragmentutility/UriFragmentUtilityListeners.java13
-rw-r--r--tests/server-side/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java20
-rw-r--r--tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java201
-rw-r--r--tests/server-side/com/vaadin/tests/server/components/AbstractTestFieldValueChange.java10
-rw-r--r--tests/server-side/com/vaadin/tests/server/components/TestComboBoxValueChange.java5
-rw-r--r--tests/server-side/com/vaadin/tests/server/components/TestTextFieldValueChange.java11
-rw-r--r--tests/server-side/com/vaadin/tests/server/components/TestWindow.java2
-rw-r--r--tests/server-side/com/vaadin/tests/server/validation/RangeValidatorTest.java52
-rw-r--r--tests/server-side/com/vaadin/tests/server/validation/TestBeanValidation.java57
-rw-r--r--tests/server-side/com/vaadin/tests/server/validation/TestReadOnlyValidation.java2
-rw-r--r--tests/server-side/com/vaadin/tests/util/GraphVizClassHierarchyCreator.java149
-rw-r--r--tests/server-side/com/vaadin/tests/util/TestUtil.java43
-rw-r--r--tests/test.xml110
-rw-r--r--tests/testbench/com/vaadin/tests/Components.java15
-rw-r--r--tests/testbench/com/vaadin/tests/CustomLayoutDemo.java22
-rw-r--r--tests/testbench/com/vaadin/tests/LayoutDemo.java25
-rw-r--r--tests/testbench/com/vaadin/tests/ListenerOrder.java16
-rw-r--r--tests/testbench/com/vaadin/tests/ModalWindow.java7
-rw-r--r--tests/testbench/com/vaadin/tests/NativeWindowing.java14
-rw-r--r--tests/testbench/com/vaadin/tests/Parameters.java43
-rw-r--r--tests/testbench/com/vaadin/tests/PerformanceTestBasicComponentRendering.java3
-rw-r--r--tests/testbench/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java3
-rw-r--r--tests/testbench/com/vaadin/tests/PerformanceTestSubTreeCaching.java16
-rw-r--r--tests/testbench/com/vaadin/tests/RandomLayoutStress.java7
-rw-r--r--tests/testbench/com/vaadin/tests/ScrollbarStressTest.java5
-rw-r--r--tests/testbench/com/vaadin/tests/TestBench.java22
-rw-r--r--tests/testbench/com/vaadin/tests/TestCaptionWrapper.java3
-rw-r--r--tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java21
-rw-r--r--tests/testbench/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java6
-rw-r--r--tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java16
-rw-r--r--tests/testbench/com/vaadin/tests/TestForContainerFilterable.java8
-rw-r--r--tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java21
-rw-r--r--tests/testbench/com/vaadin/tests/TestForNativeWindowing.java14
-rw-r--r--tests/testbench/com/vaadin/tests/TestForPreconfiguredComponents.java7
-rw-r--r--tests/testbench/com/vaadin/tests/TestForRichTextEditor.java10
-rw-r--r--tests/testbench/com/vaadin/tests/TestForStyledUpload.java31
-rw-r--r--tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java6
-rw-r--r--tests/testbench/com/vaadin/tests/TestForTrees.java7
-rw-r--r--tests/testbench/com/vaadin/tests/TestForUpload.java25
-rw-r--r--tests/testbench/com/vaadin/tests/TestForWindowOpen.java8
-rw-r--r--tests/testbench/com/vaadin/tests/TestForWindowing.java3
-rw-r--r--tests/testbench/com/vaadin/tests/TestIFrames.java3
-rw-r--r--tests/testbench/com/vaadin/tests/TestSetVisibleAndCaching.java8
-rw-r--r--tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java8
-rw-r--r--tests/testbench/com/vaadin/tests/TestSplitPanel.java6
-rw-r--r--tests/testbench/com/vaadin/tests/TreeFilesystem.java13
-rw-r--r--tests/testbench/com/vaadin/tests/TreeFilesystemContainer.java10
-rw-r--r--tests/testbench/com/vaadin/tests/UpgradingSample.java22
-rw-r--r--tests/testbench/com/vaadin/tests/UsingObjectsInSelect.java11
-rw-r--r--tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java16
-rw-r--r--tests/testbench/com/vaadin/tests/application/ApplicationCloseTest.java5
-rw-r--r--tests/testbench/com/vaadin/tests/application/ErrorInUnloadEvent.java20
-rw-r--r--tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.html52
-rw-r--r--tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java39
-rw-r--r--tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.html112
-rw-r--r--tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java114
-rw-r--r--tests/testbench/com/vaadin/tests/applicationcontext/ChangeSessionId.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/AbstractComponentContainerTest.java10
-rw-r--r--tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java51
-rw-r--r--tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/AbstractTestApplication.java23
-rw-r--r--tests/testbench/com/vaadin/tests/components/AbstractTestCase.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/AbstractTestRoot.java70
-rw-r--r--tests/testbench/com/vaadin/tests/components/ComponentTestCase.java15
-rw-r--r--tests/testbench/com/vaadin/tests/components/LayoutAttachListenerInfo.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/TestBase.java9
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java33
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java117
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java62
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBackedByString.java17
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBasedOnLong.java34
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/DoubleInTextField.java31
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/IntegerDoubleFieldsWithDataSource.java64
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/IntegerFieldWithoutDataSource.java59
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/TextFieldConversions.java51
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java35
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/ButtonDisableOnClick.html9
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/ButtonMouseDetails.java8
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/Buttons.java8
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/Buttons2.java20
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/ButtonsInHorizontalLayout.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java9
-rw-r--r--tests/testbench/com/vaadin/tests/components/caption/IconsInCaption.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes2.java31
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboBoxReapperingOldValue.java8
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSuggestionOnDetach.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java11
-rw-r--r--tests/testbench/com/vaadin/tests/components/customcomponent/ClipContent.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/AbstractNestedFormExample.java75
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/AddressField.java97
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/AddressFormExample.java45
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/BooleanField.java45
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.html47
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.java89
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/EmbeddedForm.java67
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/EmbeddedFormExample.html82
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/EmbeddedFormExample.java17
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/NestedFormExample.html82
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/NestedFormExample.java15
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/NestedPersonForm.java94
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.html4
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java9
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldPopupOffScreen.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.html96
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java144
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldTest.java21
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.html4
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldUnparsableDate.java17
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DefaultHandleUnparsableDateField.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/InlineDateFieldResolutionMsec.html36
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/InlineDateFields.java22
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldResolutions.html61
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/PopupDateFields.java22
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/RequiredInvalidDateField.java23
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullInlineDateField.html49
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullPopupDateField.html20
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/form/FormCommitWithInvalidValues.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/form/FormTest.java30
-rw-r--r--tests/testbench/com/vaadin/tests/components/form/FormWithEnterShortCut.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/form/UndefinedWideFormWithRelativeWideFooter.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.html42
-rw-r--r--tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.java57
-rw-r--r--tests/testbench/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/label/LabelModes.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/label/LabelTest.java20
-rw-r--r--tests/testbench/com/vaadin/tests/components/label/Labels.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java27
-rw-r--r--tests/testbench/com/vaadin/tests/components/menubar/MenuBarInSplitPanel.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/menubar/MenuBarRunsOutOfBrowser.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonDisableOnClick.html8
-rw-r--r--tests/testbench/com/vaadin/tests/components/notification/Notifications.java13
-rw-r--r--tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.html53
-rw-r--r--tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java24
-rw-r--r--tests/testbench/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java13
-rw-r--r--tests/testbench/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/panel/PanelShouldNotScroll.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/popupview/PopupViewNullValues.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/popupview/PopupViewOffScreen.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/popupview/PopupViewWithRTE.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java8
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.html46
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java89
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/RootInitTest.java27
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.html47
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java36
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/TestRootTheme.html27
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/TestRootTheme.java28
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.java25
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.html77
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.java49
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/AbstractSplitPanelTest.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/HorizontalSplitPanelBasicStates.html2
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java20
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelSplitterWidth.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanels.java37
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/VerticalSplitPanelBasicStates.html3
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/ColumnHeaderAlignments.java18
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/DoublesInTable.java277
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/EditableModeChange.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java19
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/Footer.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/FooterClick.java27
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/HeaderClick.java33
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/HeaderUpdateWhenNoRows.java24
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/HugeRowCount.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/ModifyContainerProperty.html4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/MultiSelectWithNotIdentityEqualIds.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/PropertyValueChange.java15
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/ScrollCausesRequestLoop.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/ScrollDetachSynchronization.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/SortLongTable.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableCacheBuildEfficiency.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.html128
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java20
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableExtraScrollbars.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableHeaderZoom.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableHeightWhenHidingHeaders.java42
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.java95
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableMultiSelectSimple.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TablePageLengthUpdate.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableScrollOnFocus.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableSingleSelect.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableToggleVisibility.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.html33
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.java85
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableUnregisterComponent.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableWithManyColumns.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/Tables.java77
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TestCurrentPageFirstItem.java8
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTest.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetNPE.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/SelectionAndCursorPosition.java56
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/SizedTextFields.java9
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextChangeEvents.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextChangeEventsWithNonImmediateValueChange.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextChangeListenerChangingNonTextProperties.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextFieldInLayoutInTable.java8
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextFieldInputPromptAndClickShortcut.java26
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextFieldSecret.html196
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextFieldTest.java39
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextFieldWithPropertyFormatter.java23
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreeFiltering.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreeFocusGaining.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java9
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators.java9
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreePerformanceTest.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreeScrolling.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/DisappearingComponents.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.html41
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.java62
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/ExecuteJavaScript.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/ExtraWindowShown.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java56
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/LongNotifications.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.html42
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.java46
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/SubWindowFocusAndBlurListeners.java9
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/SubWindowOrder.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/WindowClickEvents.html9
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/WindowResizeListener.java38
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/WindowScrollingComponentIntoView.java17
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/WindowScrollingUp.java6
-rw-r--r--tests/testbench/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java24
-rw-r--r--tests/testbench/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java3
-rw-r--r--tests/testbench/com/vaadin/tests/containers/IndexedContainerFilteringTest.java10
-rw-r--r--tests/testbench/com/vaadin/tests/containers/TableWithFileSystemContainer.java4
-rw-r--r--tests/testbench/com/vaadin/tests/containers/TestItemSorter.java4
-rw-r--r--tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java15
-rw-r--r--tests/testbench/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java6
-rw-r--r--tests/testbench/com/vaadin/tests/converter/ConverterThatEnforcesAFormat.java46
-rw-r--r--tests/testbench/com/vaadin/tests/converter/StringToDoubleConverterWithThreeFractionDigits.java18
-rw-r--r--tests/testbench/com/vaadin/tests/dd/CustomDDImplementation.java4
-rw-r--r--tests/testbench/com/vaadin/tests/dd/DDTest2.java20
-rw-r--r--tests/testbench/com/vaadin/tests/dd/DDTest4.java4
-rw-r--r--tests/testbench/com/vaadin/tests/dd/DDTest5.java4
-rw-r--r--tests/testbench/com/vaadin/tests/dd/DDTest6.java2
-rw-r--r--tests/testbench/com/vaadin/tests/dd/DDTest7.java4
-rw-r--r--tests/testbench/com/vaadin/tests/dd/TreeDragStart.java2
-rw-r--r--tests/testbench/com/vaadin/tests/dd/VMyDragSource.java22
-rw-r--r--tests/testbench/com/vaadin/tests/dd/VMyDragSourcePaintable.java25
-rw-r--r--tests/testbench/com/vaadin/tests/dd/VMyDropTarget.java22
-rw-r--r--tests/testbench/com/vaadin/tests/dd/VMyDropTargetPaintable.java31
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/AbstractBeanFieldGroupTest.java96
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/BasicPersonForm.java192
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/BooleanTextField.html147
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/CommitHandlerFailures.html220
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/CommitWithValidationOrConversionError.html150
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java106
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/FieldGroupDiscard.html164
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/FormBuilderWithNestedProperties.java47
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/FormManyToMany.java28
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/FormOneToMany.java43
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/FormOneToOne.java38
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/FormWithNestedProperties.java67
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/IntegerRangeValidator.html95
-rw-r--r--tests/testbench/com/vaadin/tests/fields/FormManyToMany.java28
-rw-r--r--tests/testbench/com/vaadin/tests/fields/FormOneToMany.java43
-rw-r--r--tests/testbench/com/vaadin/tests/fields/FormOneToOne.java38
-rw-r--r--tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java39
-rw-r--r--tests/testbench/com/vaadin/tests/integration/IntegrationTestApplication.java6
-rw-r--r--tests/testbench/com/vaadin/tests/integration/JSR286PortletApplication.java21
-rw-r--r--tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java101
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/CaptionsInLayouts.java10
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java6
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponent.html9
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java29
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java15
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java4
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java6
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/HiddenHorizontalLayout.java3
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.html165
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java4
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/TestAbsoluteLayout.java9
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/TestLayoutClickListeners.java7
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/TestLayoutPerformance.java9
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/TreeWithBordersInLayout.java4
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java4
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/WidgetImplementationSwap.html182
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/WidgetImplementationSwap.java157
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java18
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java5
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.html6
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.java6
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java13
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/CustomConverterFactoryRoot.java33
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/DynamicImageRoot.java79
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/FormUsingExistingLayout.java98
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/FormatTableValue.java60
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/IntegerTextFieldDataSource.java69
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/IntegerTextFieldStandalone.java57
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/MyConverterFactory.java17
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/MyStringToDoubleConverter.java18
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/StringMyTypeConverter.java108
-rw-r--r--tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.html66
-rw-r--r--tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.java41
-rw-r--r--tests/testbench/com/vaadin/tests/themes/ButtonsTest.java44
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1225.java11
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1230.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket124.java10
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1245.java14
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1362Login.java275
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1365.java9
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1368.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1397.java19
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1435.java13
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1444.java9
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1465ModalNotification.java20
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer.java2
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java2
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1519.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1572.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1581.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1589.java27
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1598.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket161.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1632.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1659.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1663.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1673.java13
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1710.java9
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1737.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1767.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1772.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1775.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1804.java18
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1805.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1806.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1811.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1819.java10
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java9
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1857.java11
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1868.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1869.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1878.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1900.java14
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1904.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1916.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1919.java19
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1921.java33
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1923.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1924ThemeChanging.java51
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1925.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1939.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1940.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1953.java10
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1966.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1966_2.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1966_3.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1969.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1970.java31
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1972.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1973.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1973_2.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1975.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1982.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1983.java21
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1986.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1991.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1995.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket20.java37
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2001.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2002.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2007.java10
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2009.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2011.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2014.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2021.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2022.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2023.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2024.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2026.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2029.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2037.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2038.java10
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2040.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2042.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2043.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2048.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2051.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2053.java17
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2060.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2061.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2061b.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2061c.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2062.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2083.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2090.java16
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2095.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2098.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2099.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2101.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2103.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2104.java19
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2106.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2107.java16
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2117.java19
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2119.java23
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2125.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2126.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2151.java50
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2157.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2178.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2179.java14
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2180.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2181.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2186.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2204.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2208.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2209.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2209OL.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2209OL2.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2215.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2221.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2222.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2231.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2232.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2234.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2235.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2240.java9
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2242.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2244.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2245.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2267.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2271.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2279.java11
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2282.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2283.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2287.java11
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2289.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2292.java29
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2294.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2296.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2297.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2303.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2304.java11
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2310.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2319.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2323.java5
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2325.java5
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2329.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2337.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2339.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2341.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2344.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2347.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2364.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2365.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2398.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2404.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2405.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2406.java5
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2407.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2411.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2415.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2420.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2425.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2426.java20
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2431.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2432.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2434.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2436.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2440.java77
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2526.java5
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2742.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2901.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2998.java32
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket3146.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket34.java35
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket5053.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket5157.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket5952.java36
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket6002.java4
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket677.java21
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket695.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket736.java71
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket846.java26
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket932.java7
-rw-r--r--tests/testbench/com/vaadin/tests/util/Address.java66
-rw-r--r--tests/testbench/com/vaadin/tests/util/AlwaysFailValidator.java23
-rw-r--r--tests/testbench/com/vaadin/tests/util/Log.java3
-rw-r--r--tests/testbench/com/vaadin/tests/util/Millionaire.java22
-rw-r--r--tests/testbench/com/vaadin/tests/util/Person.java56
-rw-r--r--tests/testbench/com/vaadin/tests/util/PersonContainer.java14
-rw-r--r--tests/testbench/com/vaadin/tests/util/Role.java37
-rw-r--r--tests/testbench/com/vaadin/tests/util/SampleDirectory.java10
-rw-r--r--tests/testbench/com/vaadin/tests/util/TestUtils.java4
-rw-r--r--tests/testbench/com/vaadin/tests/util/User.java54
-rw-r--r--tests/testbench/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java13
-rw-r--r--tests/testbench/com/vaadin/tests/validation/RequiredErrorMessage.java4
-rw-r--r--tests/testbench/com/vaadin/tests/validation/TestValidators.java10
-rw-r--r--tests/vaadin-server.xml55
543 files changed, 9031 insertions, 4291 deletions
diff --git a/tests/integration-testscripts/common/integration_test.tpl b/tests/integration-testscripts/common/integration_test.tpl
index 4275d3fab0..ed97710282 100644
--- a/tests/integration-testscripts/common/integration_test.tpl
+++ b/tests/integration-testscripts/common/integration_test.tpl
@@ -18,7 +18,7 @@
</tr>
<tr>
<td>pause</td>
- <td>500</td>
+ <td>1000</td>
<td></td>
</tr>
<tr>
diff --git a/tests/integration_tests.xml b/tests/integration_tests.xml
index be928aacf4..22ad356338 100644
--- a/tests/integration_tests.xml
+++ b/tests/integration_tests.xml
@@ -1,6 +1,10 @@
<?xml version="1.0"?>
-<project name="Vaadin Integration Tests" basedir="." default="integration-test-all">
+<project xmlns:antcontrib="antlib:net.sf.antcontrib"
+ name="Vaadin Integration Tests" basedir="." default="integration-test-all">
+
+ <!-- Import common targets -->
+ <import file="../build/common.xml" />
<!-- Target deploying demo.war -->
<fail unless="test.integration.server" message="test.integration.server must be set for integration tests to run" />
@@ -28,13 +32,6 @@
<property name="user" value="${test.integration.user}" />
<property name="passphrase" value="" />
- <!-- add ant contrib -->
- <taskdef resource="net/sf/antcontrib/antcontrib.properties">
- <classpath>
- <pathelement location="../build/lib/ant-contrib-1.0b3.jar" />
- </classpath>
- </taskdef>
-
<!-- Upload war to deploy to ssh host -->
<target name="integration-test-upload-demo">
<scp file="${demo.war}" todir="${user}@${test.integration.server}:integration-tests/servers/demo.war" keyfile="${sshkey.file}" passphrase="${passphrase}" />
@@ -100,14 +97,6 @@
<param name="target-server" value="tomcat7" />
</antcall>
</target>
-
- <target name="integration-test-tomcat4">
- <antcall target="run-generic-integration-test">
- <param name="startDelay" value="10" />
- <param name="target-server" value="tomcat4" />
- </antcall>
- </target>
-
<target name="integration-test-tomcat5">
<antcall target="run-generic-integration-test">
<param name="startDelay" value="10" />
@@ -142,17 +131,11 @@
<target name="integration-test-jetty8">
<antcall target="run-generic-integration-test">
+ <param name="startDelay" value="300" />
<param name="target-server" value="jetty8" />
</antcall>
</target>
- <target name="integration-test-jboss3">
- <antcall target="run-generic-integration-test">
- <param name="startDelay" value="10" />
- <param name="target-server" value="jboss3" />
- </antcall>
- </target>
-
<target name="integration-test-jboss4">
<antcall target="run-generic-integration-test">
<param name="startDelay" value="10" />
@@ -294,10 +277,9 @@
</target>
<!-- Upload demo, clean error screenshots and test deployment on all servers -->
- <target name="integration-test-all">
-
+ <target name="integration-test-all" depends="common.init-deps">
<parallel>
- <trycatch property="tried">
+ <antcontrib:trycatch property="tried">
<try>
<!-- Still running GAE test from the old server which requires its own lock -->
<echo message="Getting lock" />
@@ -318,8 +300,7 @@
<catch>
<echo message="Uploading of demo.war failed. ${tried}" />
</catch>
- </trycatch>
-
+ </antcontrib:trycatch>
<antcall target="integration-test-liferay6" />
<antcall target="integration-test-liferay6ee" />
<antcall target="integration-test-exo3" />
@@ -331,7 +312,6 @@
<antcall target="integration-test-gatein3" />
<antcall target="integration-test-glassfish2" />
<antcall target="integration-test-glassfish3" />
- <antcall target="integration-test-jboss3" />
<antcall target="integration-test-jboss4" />
<antcall target="integration-test-jboss5" />
<antcall target="integration-test-jboss6" />
@@ -340,7 +320,6 @@
<antcall target="integration-test-jetty6" />
<antcall target="integration-test-jetty7" />
<antcall target="integration-test-jetty8" />
- <antcall target="integration-test-tomcat4" />
<antcall target="integration-test-tomcat5" />
<antcall target="integration-test-tomcat6" />
<antcall target="integration-test-tomcat7" />
@@ -352,31 +331,30 @@
<target name="do-run-generic-test">
<property name="target-host" value="${target-server}.devnet.vaadin.com" />
<property name="target-port" value="8080" />
-
- <if>
+ <antcontrib:if>
<isset property="startDelay" />
<then>
- <math result="sleepTime" datatype="int">
+ <antcontrib:math result="sleepTime" datatype="int">
<op op="rint">
<op op="*">
<num value="${startDelay}" />
<op op="random" />
</op>
</op>
- </math>
- <echo>Delaying startup of ${target-server} with ${sleepTime} seconds</echo>
+ </antcontrib:math>
+ <echo>Delaying startup of ${target-server} with ${sleepTime} seconds</echo>
<sleep seconds="${sleepTime}" />
</then>
- </if>
-
- <scp todir="${user}@${target-host}:." keyfile="${sshkey.file}" trust="yes" passphrase="${passphrase}">
+ </antcontrib:if>
+
+ <scp todir="${user}@${target-host}:." keyfile="${sshkey.file}" trust="yes" passphrase="${passphrase}" >
<fileset dir="integration_base_files">
<include name="*" />
</fileset>
</scp>
<!-- trycatch probably not needed any more as it just fails with the original message and doesn't do anything in the finally block -->
- <trycatch property="error_message">
+ <antcontrib:trycatch property="error_message">
<try>
<!-- timeout in one hour (remote end should timeout in 55 minutes) -->
<sshexec host="${target-host}" outputproperty="lock-output" timeout="3600000" username="${user}" keyfile="${sshkey.file}" trust="yes" command="chmod +x *.sh; ant -f deploy.xml get-lock" />
@@ -409,16 +387,16 @@
</antcall>
<!-- Run theme tests in all browsers if there's a property with the test files -->
- <if>
+ <antcontrib:if>
<isset property="testfiles-theme" />
- <then>
+ <antcontrib:then>
<antcall target="integration-test-theme">
<param name="server-name" value="${target-server}" />
<param name="deployment.url" value="http://${target-host}:${target-port}" />
</antcall>
- </then>
- </if>
-
+ </antcontrib:then>
+ </antcontrib:if>
+
<!-- timeout in five minutes -->
<sshexec host="${target-host}" outputproperty="stop-output" timeout="600000" username="${user}" keyfile="${sshkey.file}" trust="yes" command="ant -f deploy.xml shutdown-and-cleanup" failonerror="false" />
<antcall target="echo-prefix">
@@ -429,28 +407,28 @@
<catch>
<fail message="${error_message}" />
</catch>
- </trycatch>
+ </antcontrib:trycatch>
</target>
<target name="echo-prefix">
- <propertyregex property="message-prefixed" input="${prefix}${message}" regexp="\n" replace="\0${prefix}" global="true" defaultValue="${prefix}${message}" />
+ <antcontrib:propertyregex property="message-prefixed" input="${prefix}${message}" regexp="\n" replace="\0${prefix}" global="true" defaultValue="${prefix}${message}" />
<echo message="${message-prefixed}" />
</target>
<target name="run-generic-integration-test">
<concat>##teamcity[testStarted name='${target-server}' flowId='${target-server}']</concat>
- <trycatch property="tried">
+ <antcontrib:trycatch property="tried">
<try>
<antcall target="do-run-generic-test" />
</try>
<catch>
- <antcallback target="teamcity-escape" return="tried-escaped">
+ <antcontrib:antcallback target="teamcity-escape" return="tried-escaped">
<param name="returnTo" value="tried-escaped" />
<param name="message" value="${tried}" />
- </antcallback>
+ </antcontrib:antcallback>
<concat>##teamcity[testFailed name='${target-server}' flowId='${target-server}' message='Integration test for ${target-server} failed.' details='${tried-escaped}']</concat>
</catch>
- </trycatch>
+ </antcontrib:trycatch>
<concat>##teamcity[testFinished name='${target-server}' flowId='${target-server}']"</concat>
</target>
@@ -459,16 +437,16 @@
<!-- Should also perform other escaping (\u0085, \u2028 and \u2029) - see http://confluence.jetbrains.net/display/TCD65/Build+Script+Interaction+with+TeamCity -->
<!-- Immutable properties -> needs to create a new one every time -->
- <propertyregex property="details-escaped1" input="${message}" regexp="['|\[\]]" replace="|\0" global="true" defaultValue="${message}" />
- <propertyregex property="details-escaped2" input="${details-escaped1}" regexp="\n" replace="|n" global="true" defaultValue="${details-escaped1}" />
- <propertyregex property="details-escaped3" input="${details-escaped2}" regexp="\r" replace="|r" global="true" defaultValue="${details-escaped2}" />
+ <antcontrib:propertyregex property="details-escaped1" input="${message}" regexp="['|\[\]]" replace="|\0" global="true" defaultValue="${message}" />
+ <antcontrib:propertyregex property="details-escaped2" input="${details-escaped1}" regexp="\n" replace="|n" global="true" defaultValue="${details-escaped1}" />
+ <antcontrib:propertyregex property="details-escaped3" input="${details-escaped2}" regexp="\r" replace="|r" global="true" defaultValue="${details-escaped2}" />
<property name="${returnTo}" value="${details-escaped3}" />
</target>
<target name="run-integration-test">
<concat>##teamcity[testStarted name='${target-server}' flowId='${target-server}']</concat>
- <trycatch property="tried">
+ <antcontrib:trycatch property="tried">
<try>
<antcall target="integration-test-${target-server}" />
</try>
@@ -479,7 +457,7 @@
</antcallback>
<concat>##teamcity[testFailed name='${target-server}' flowId='${target-server}' message='Integration test for ${target-server} failed.' details='${tried-escaped}']"</concat>
</catch>
- </trycatch>
+ </antcontrib:trycatch>
<concat>##teamcity[testFinished name='${target-server}' flowId='${target-server}']"</concat>
</target>
@@ -495,4 +473,4 @@
<target name="integration-test-clean">
<sshexec host="${test.integration.server}" username="${user}" keyfile="${sshkey.file}" command="ant -f ${ant.hub} clean" />
</target>
-</project> \ No newline at end of file
+</project>
diff --git a/tests/ivy.xml b/tests/ivy.xml
new file mode 100644
index 0000000000..6c7171166b
--- /dev/null
+++ b/tests/ivy.xml
@@ -0,0 +1,16 @@
+<ivy-module version="2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation= "http://ant.apache.org/ivy/schemas/ivy.xsd">
+
+ <info organisation="com.vaadin" module="tests"/>
+ <configurations>
+ <conf name="jetty" visibility="private" />
+ <conf name="emma" visibility="private" />
+ <conf name="server" visibility="private" />
+ </configurations>
+ <publications />
+ <dependencies>
+ <dependency org="org.mortbay.jetty" name="jetty" rev="6.1.7" conf="server,jetty->default(*)" />
+ <dependency org="emma" name="emma" rev="2.0.5312-patched" conf="server,emma -> default(*)"/>
+ </dependencies>
+</ivy-module> \ No newline at end of file
diff --git a/tests/server-side/com/vaadin/data/util/BeanItemTest.java b/tests/server-side/com/vaadin/data/util/BeanItemTest.java
index 044a410803..51e11260f5 100644
--- a/tests/server-side/com/vaadin/data/util/BeanItemTest.java
+++ b/tests/server-side/com/vaadin/data/util/BeanItemTest.java
@@ -12,11 +12,6 @@ import java.util.Map;
import junit.framework.Assert;
import junit.framework.TestCase;
-import com.vaadin.data.util.BeanItem;
-import com.vaadin.data.util.MethodProperty;
-import com.vaadin.data.util.MethodPropertyDescriptor;
-import com.vaadin.data.util.VaadinPropertyDescriptor;
-
/**
* Test BeanItem specific features.
*
@@ -322,7 +317,7 @@ public class BeanItemTest extends TestCase {
MyClass.class.getDeclaredMethod("getName"),
MyClass.class.getDeclaredMethod("setName", String.class));
- BeanItem<MyClass> item = new BeanItem(new MyClass("bean1"));
+ BeanItem<MyClass> item = new BeanItem<MyClass>(new MyClass("bean1"));
Assert.assertEquals(6, item.getItemPropertyIds().size());
Assert.assertEquals(null, item.getItemProperty("myname"));
diff --git a/tests/server-side/com/vaadin/data/util/NestedMethodPropertyTest.java b/tests/server-side/com/vaadin/data/util/NestedMethodPropertyTest.java
index b110ea1c6b..640ede8743 100644
--- a/tests/server-side/com/vaadin/data/util/NestedMethodPropertyTest.java
+++ b/tests/server-side/com/vaadin/data/util/NestedMethodPropertyTest.java
@@ -10,8 +10,6 @@ import java.io.Serializable;
import junit.framework.Assert;
import junit.framework.TestCase;
-import com.vaadin.data.util.NestedMethodProperty;
-
public class NestedMethodPropertyTest extends TestCase {
public static class Address implements Serializable {
@@ -126,34 +124,34 @@ public class NestedMethodPropertyTest extends TestCase {
}
public void testSingleLevelNestedSimpleProperty() {
- NestedMethodProperty nameProperty = new NestedMethodProperty(vaadin,
- "name");
+ NestedMethodProperty<String> nameProperty = new NestedMethodProperty<String>(
+ vaadin, "name");
Assert.assertEquals(String.class, nameProperty.getType());
Assert.assertEquals("Vaadin", nameProperty.getValue());
}
public void testSingleLevelNestedObjectProperty() {
- NestedMethodProperty managerProperty = new NestedMethodProperty(vaadin,
- "manager");
+ NestedMethodProperty<Person> managerProperty = new NestedMethodProperty<Person>(
+ vaadin, "manager");
Assert.assertEquals(Person.class, managerProperty.getType());
Assert.assertEquals(joonas, managerProperty.getValue());
}
public void testMultiLevelNestedProperty() {
- NestedMethodProperty managerNameProperty = new NestedMethodProperty(
+ NestedMethodProperty<String> managerNameProperty = new NestedMethodProperty<String>(
vaadin, "manager.name");
- NestedMethodProperty addressProperty = new NestedMethodProperty(vaadin,
- "manager.address");
- NestedMethodProperty streetProperty = new NestedMethodProperty(vaadin,
- "manager.address.street");
- NestedMethodProperty postalCodePrimitiveProperty = new NestedMethodProperty(
+ NestedMethodProperty<Address> addressProperty = new NestedMethodProperty<Address>(
+ vaadin, "manager.address");
+ NestedMethodProperty<String> streetProperty = new NestedMethodProperty<String>(
+ vaadin, "manager.address.street");
+ NestedMethodProperty<Integer> postalCodePrimitiveProperty = new NestedMethodProperty<Integer>(
vaadin, "manager.address.postalCodePrimitive");
- NestedMethodProperty postalCodeObjectProperty = new NestedMethodProperty(
+ NestedMethodProperty<Integer> postalCodeObjectProperty = new NestedMethodProperty<Integer>(
vaadin, "manager.address.postalCodeObject");
- NestedMethodProperty booleanProperty = new NestedMethodProperty(vaadin,
- "manager.address.boolean");
+ NestedMethodProperty<Boolean> booleanProperty = new NestedMethodProperty<Boolean>(
+ vaadin, "manager.address.boolean");
Assert.assertEquals(String.class, managerNameProperty.getType());
Assert.assertEquals("Joonas", managerNameProperty.getValue());
@@ -166,25 +164,27 @@ public class NestedMethodPropertyTest extends TestCase {
Assert.assertEquals(Integer.class,
postalCodePrimitiveProperty.getType());
- Assert.assertEquals(20540, postalCodePrimitiveProperty.getValue());
+ Assert.assertEquals(Integer.valueOf(20540),
+ postalCodePrimitiveProperty.getValue());
Assert.assertEquals(Integer.class, postalCodeObjectProperty.getType());
- Assert.assertEquals(20540, postalCodeObjectProperty.getValue());
+ Assert.assertEquals(Integer.valueOf(20540),
+ postalCodeObjectProperty.getValue());
Assert.assertEquals(Boolean.class, booleanProperty.getType());
- Assert.assertEquals(true, booleanProperty.getValue());
+ Assert.assertEquals(Boolean.TRUE, booleanProperty.getValue());
}
public void testEmptyPropertyName() {
try {
- new NestedMethodProperty(vaadin, "");
+ new NestedMethodProperty<Object>(vaadin, "");
fail();
} catch (IllegalArgumentException e) {
// should get exception
}
try {
- new NestedMethodProperty(vaadin, " ");
+ new NestedMethodProperty<Object>(vaadin, " ");
fail();
} catch (IllegalArgumentException e) {
// should get exception
@@ -193,25 +193,25 @@ public class NestedMethodPropertyTest extends TestCase {
public void testInvalidPropertyName() {
try {
- new NestedMethodProperty(vaadin, ".");
+ new NestedMethodProperty<Object>(vaadin, ".");
fail();
} catch (IllegalArgumentException e) {
// should get exception
}
try {
- new NestedMethodProperty(vaadin, ".manager");
+ new NestedMethodProperty<Object>(vaadin, ".manager");
fail();
} catch (IllegalArgumentException e) {
// should get exception
}
try {
- new NestedMethodProperty(vaadin, "manager.");
+ new NestedMethodProperty<Object>(vaadin, "manager.");
fail();
} catch (IllegalArgumentException e) {
// should get exception
}
try {
- new NestedMethodProperty(vaadin, "manager..name");
+ new NestedMethodProperty<Object>(vaadin, "manager..name");
fail();
} catch (IllegalArgumentException e) {
// should get exception
@@ -220,21 +220,21 @@ public class NestedMethodPropertyTest extends TestCase {
public void testInvalidNestedPropertyName() {
try {
- new NestedMethodProperty(vaadin, "member");
+ new NestedMethodProperty<Object>(vaadin, "member");
fail();
} catch (IllegalArgumentException e) {
// should get exception
}
try {
- new NestedMethodProperty(vaadin, "manager.pet");
+ new NestedMethodProperty<Object>(vaadin, "manager.pet");
fail();
} catch (IllegalArgumentException e) {
// should get exception
}
try {
- new NestedMethodProperty(vaadin, "manager.address.city");
+ new NestedMethodProperty<Object>(vaadin, "manager.address.city");
fail();
} catch (IllegalArgumentException e) {
// should get exception
@@ -242,10 +242,10 @@ public class NestedMethodPropertyTest extends TestCase {
}
public void testNullNestedProperty() {
- NestedMethodProperty managerNameProperty = new NestedMethodProperty(
+ NestedMethodProperty<String> managerNameProperty = new NestedMethodProperty<String>(
vaadin, "manager.name");
- NestedMethodProperty streetProperty = new NestedMethodProperty(vaadin,
- "manager.address.street");
+ NestedMethodProperty<String> streetProperty = new NestedMethodProperty<String>(
+ vaadin, "manager.address.street");
joonas.setAddress(null);
try {
@@ -274,15 +274,15 @@ public class NestedMethodPropertyTest extends TestCase {
}
public void testMultiLevelNestedPropertySetValue() {
- NestedMethodProperty managerNameProperty = new NestedMethodProperty(
+ NestedMethodProperty<String> managerNameProperty = new NestedMethodProperty<String>(
vaadin, "manager.name");
- NestedMethodProperty addressProperty = new NestedMethodProperty(vaadin,
- "manager.address");
- NestedMethodProperty streetProperty = new NestedMethodProperty(vaadin,
- "manager.address.street");
- NestedMethodProperty postalCodePrimitiveProperty = new NestedMethodProperty(
+ NestedMethodProperty<Address> addressProperty = new NestedMethodProperty<Address>(
+ vaadin, "manager.address");
+ NestedMethodProperty<String> streetProperty = new NestedMethodProperty<String>(
+ vaadin, "manager.address.street");
+ NestedMethodProperty<Integer> postalCodePrimitiveProperty = new NestedMethodProperty<Integer>(
vaadin, "manager.address.postalCodePrimitive");
- NestedMethodProperty postalCodeObjectProperty = new NestedMethodProperty(
+ NestedMethodProperty<Integer> postalCodeObjectProperty = new NestedMethodProperty<Integer>(
vaadin, "manager.address.postalCodeObject");
managerNameProperty.setValue("Joonas L");
@@ -303,21 +303,22 @@ public class NestedMethodPropertyTest extends TestCase {
}
public void testSerialization() throws IOException, ClassNotFoundException {
- NestedMethodProperty streetProperty = new NestedMethodProperty(vaadin,
- "manager.address.street");
+ NestedMethodProperty<String> streetProperty = new NestedMethodProperty<String>(
+ vaadin, "manager.address.street");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
new ObjectOutputStream(baos).writeObject(streetProperty);
- NestedMethodProperty property2 = (NestedMethodProperty) new ObjectInputStream(
+ @SuppressWarnings("unchecked")
+ NestedMethodProperty<String> property2 = (NestedMethodProperty<String>) new ObjectInputStream(
new ByteArrayInputStream(baos.toByteArray())).readObject();
Assert.assertEquals("Ruukinkatu 2-4", property2.getValue());
}
public void testIsReadOnly() {
- NestedMethodProperty streetProperty = new NestedMethodProperty(vaadin,
- "manager.address.street");
- NestedMethodProperty booleanProperty = new NestedMethodProperty(vaadin,
- "manager.address.boolean");
+ NestedMethodProperty<String> streetProperty = new NestedMethodProperty<String>(
+ vaadin, "manager.address.street");
+ NestedMethodProperty<Boolean> booleanProperty = new NestedMethodProperty<Boolean>(
+ vaadin, "manager.address.boolean");
Assert.assertFalse(streetProperty.isReadOnly());
Assert.assertTrue(booleanProperty.isReadOnly());
diff --git a/tests/server-side/com/vaadin/data/util/ObjectPropertyTest.java b/tests/server-side/com/vaadin/data/util/ObjectPropertyTest.java
index 11676099e6..99ca58ba42 100644
--- a/tests/server-side/com/vaadin/data/util/ObjectPropertyTest.java
+++ b/tests/server-side/com/vaadin/data/util/ObjectPropertyTest.java
@@ -4,8 +4,6 @@ import junit.framework.TestCase;
import org.junit.Assert;
-import com.vaadin.data.util.ObjectProperty;
-
public class ObjectPropertyTest extends TestCase {
public static class TestSuperClass {
@@ -70,7 +68,7 @@ public class ObjectPropertyTest extends TestCase {
ObjectProperty<TestSuperClass> prop = new ObjectProperty<TestSuperClass>(
super1, TestSuperClass.class);
Assert.assertEquals("super1", prop.getValue().getName());
- prop.setValue("super2");
+ prop.setValue(new TestSuperClass("super2"));
Assert.assertEquals("super1", super1.getName());
Assert.assertEquals("super2", prop.getValue().getName());
}
@@ -79,7 +77,7 @@ public class ObjectPropertyTest extends TestCase {
ObjectProperty<TestSubClass> prop = new ObjectProperty<TestSubClass>(
sub1, TestSubClass.class);
Assert.assertEquals("Subclass: sub1", prop.getValue().getName());
- prop.setValue("sub2");
+ prop.setValue(new TestSubClass("sub2"));
Assert.assertEquals("Subclass: sub1", sub1.getName());
Assert.assertEquals("Subclass: sub2", prop.getValue().getName());
}
@@ -92,7 +90,7 @@ public class ObjectPropertyTest extends TestCase {
// create correct subclass based on the runtime type of the instance
// given to ObjectProperty constructor, which is a subclass of the type
// parameter
- prop.setValue("sub2");
+ prop.setValue(new TestSubClass("sub2"));
Assert.assertEquals("Subclass: sub2", prop.getValue().getName());
}
diff --git a/tests/server-side/com/vaadin/data/util/PropertyDescriptorTest.java b/tests/server-side/com/vaadin/data/util/PropertyDescriptorTest.java
index c3621fa99b..14e70d76d4 100644
--- a/tests/server-side/com/vaadin/data/util/PropertyDescriptorTest.java
+++ b/tests/server-side/com/vaadin/data/util/PropertyDescriptorTest.java
@@ -11,9 +11,6 @@ import junit.framework.Assert;
import junit.framework.TestCase;
import com.vaadin.data.Property;
-import com.vaadin.data.util.MethodPropertyDescriptor;
-import com.vaadin.data.util.NestedPropertyDescriptor;
-import com.vaadin.data.util.VaadinPropertyDescriptor;
import com.vaadin.data.util.NestedMethodPropertyTest.Person;
public class PropertyDescriptorTest extends TestCase {
@@ -33,11 +30,12 @@ public class PropertyDescriptorTest extends TestCase {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
new ObjectOutputStream(baos).writeObject(descriptor);
+ @SuppressWarnings("unchecked")
VaadinPropertyDescriptor<Person> descriptor2 = (VaadinPropertyDescriptor<Person>) new ObjectInputStream(
new ByteArrayInputStream(baos.toByteArray())).readObject();
- Property property = descriptor2
- .createProperty(new Person("John", null));
+ Property<?> property = descriptor2.createProperty(new Person("John",
+ null));
Assert.assertEquals("John", property.getValue());
}
@@ -47,10 +45,11 @@ public class PropertyDescriptorTest extends TestCase {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
new ObjectOutputStream(baos).writeObject(pd);
+ @SuppressWarnings("unchecked")
VaadinPropertyDescriptor<Person> pd2 = (VaadinPropertyDescriptor<Person>) new ObjectInputStream(
new ByteArrayInputStream(baos.toByteArray())).readObject();
- Property property = pd2.createProperty(new Person("John", null));
+ Property<?> property = pd2.createProperty(new Person("John", null));
Assert.assertEquals("John", property.getValue());
}
}
diff --git a/tests/server-side/com/vaadin/data/util/PropertySetItemTest.java b/tests/server-side/com/vaadin/data/util/PropertySetItemTest.java
index 4516e8d109..a3169332ec 100644
--- a/tests/server-side/com/vaadin/data/util/PropertySetItemTest.java
+++ b/tests/server-side/com/vaadin/data/util/PropertySetItemTest.java
@@ -9,8 +9,6 @@ import org.easymock.EasyMock;
import com.vaadin.data.Item.PropertySetChangeEvent;
import com.vaadin.data.Item.PropertySetChangeListener;
-import com.vaadin.data.util.ObjectProperty;
-import com.vaadin.data.util.PropertysetItem;
public class PropertySetItemTest extends TestCase {
@@ -395,13 +393,13 @@ public class PropertySetItemTest extends TestCase {
item.addItemProperty(ID1, prop1);
- Assert.assertEquals(String.valueOf(prop1), item.toString());
+ Assert.assertEquals(String.valueOf(prop1.getValue()), item.toString());
item.addItemProperty(ID2, prop2);
Assert.assertEquals(
- String.valueOf(prop1) + " " + String.valueOf(prop2),
- item.toString());
+ String.valueOf(prop1.getValue()) + " "
+ + String.valueOf(prop2.getValue()), item.toString());
}
}
diff --git a/tests/server-side/com/vaadin/data/util/TestContainerSorting.java b/tests/server-side/com/vaadin/data/util/TestContainerSorting.java
index d9a8e6e51c..9e69b94fbb 100644
--- a/tests/server-side/com/vaadin/data/util/TestContainerSorting.java
+++ b/tests/server-side/com/vaadin/data/util/TestContainerSorting.java
@@ -8,8 +8,7 @@ import junit.framework.TestCase;
import com.vaadin.data.Container;
import com.vaadin.data.Item;
-import com.vaadin.data.util.HierarchicalContainer;
-import com.vaadin.data.util.IndexedContainer;
+import com.vaadin.tests.util.TestUtil;
public class TestContainerSorting extends TestCase {
@@ -93,12 +92,12 @@ public class TestContainerSorting extends TestCase {
"Might and Magic", "Natural languages", "PHP",
"Programming languages", "Python", "Red Alert", "Swedish",
"Toyota", "Volvo" });
- assertArrays(
+ TestUtil.assertArrays(
hc.rootItemIds().toArray(),
new Integer[] { nameToId.get("Cars"), nameToId.get("Games"),
nameToId.get("Natural languages"),
nameToId.get("Programming languages") });
- assertArrays(
+ TestUtil.assertArrays(
hc.getChildren(nameToId.get("Games")).toArray(),
new Integer[] { nameToId.get("Call of Duty"),
nameToId.get("Fallout"),
@@ -168,21 +167,7 @@ public class TestContainerSorting extends TestCase {
actual[index++] = o;
}
- assertArrays(actual, idOrder);
-
- }
-
- private void assertArrays(Object[] actualObjects, Object[] expectedObjects) {
- assertEquals(
- "Actual contains a different number of values than was expected",
- expectedObjects.length, actualObjects.length);
-
- for (int i = 0; i < actualObjects.length; i++) {
- Object actual = actualObjects[i];
- Object expected = expectedObjects[i];
-
- assertEquals("Item[" + i + "] does not match", expected, actual);
- }
+ TestUtil.assertArrays(actual, idOrder);
}
diff --git a/tests/server-side/com/vaadin/data/util/filter/AbstractFilterTest.java b/tests/server-side/com/vaadin/data/util/filter/AbstractFilterTest.java
index beaa1c4e8f..efc31f0bd4 100644
--- a/tests/server-side/com/vaadin/data/util/filter/AbstractFilterTest.java
+++ b/tests/server-side/com/vaadin/data/util/filter/AbstractFilterTest.java
@@ -22,18 +22,17 @@ public abstract class AbstractFilterTest<FILTERTYPE extends Filter> extends
}
}
- protected static class NullProperty implements Property {
+ protected static class NullProperty implements Property<String> {
- public Object getValue() {
+ public String getValue() {
return null;
}
- public void setValue(Object newValue) throws ReadOnlyException,
- ConversionException {
+ public void setValue(Object newValue) throws ReadOnlyException {
throw new ReadOnlyException();
}
- public Class<?> getType() {
+ public Class<String> getType() {
return String.class;
}
diff --git a/tests/server-side/com/vaadin/data/util/filter/AndOrFilterTest.java b/tests/server-side/com/vaadin/data/util/filter/AndOrFilterTest.java
index bdd852bd41..fdd5b8a645 100644
--- a/tests/server-side/com/vaadin/data/util/filter/AndOrFilterTest.java
+++ b/tests/server-side/com/vaadin/data/util/filter/AndOrFilterTest.java
@@ -5,10 +5,8 @@ import junit.framework.Assert;
import com.vaadin.data.Container.Filter;
import com.vaadin.data.Item;
import com.vaadin.data.util.BeanItem;
-import com.vaadin.data.util.filter.And;
-import com.vaadin.data.util.filter.Or;
-public class AndOrFilterTest extends AbstractFilterTest {
+public class AndOrFilterTest extends AbstractFilterTest<AbstractJunctionFilter> {
protected Item item1 = new BeanItem<Integer>(1);
protected Item item2 = new BeanItem<Integer>(2);
diff --git a/tests/server-side/com/vaadin/data/util/filter/CompareFilterTest.java b/tests/server-side/com/vaadin/data/util/filter/CompareFilterTest.java
index 4cd683bfde..99e8429a51 100644
--- a/tests/server-side/com/vaadin/data/util/filter/CompareFilterTest.java
+++ b/tests/server-side/com/vaadin/data/util/filter/CompareFilterTest.java
@@ -14,7 +14,7 @@ import com.vaadin.data.util.filter.Compare.GreaterOrEqual;
import com.vaadin.data.util.filter.Compare.Less;
import com.vaadin.data.util.filter.Compare.LessOrEqual;
-public class CompareFilterTest extends AbstractFilterTest {
+public class CompareFilterTest extends AbstractFilterTest<Compare> {
protected Item itemNull;
protected Item itemEmpty;
diff --git a/tests/server-side/com/vaadin/data/util/filter/IsNullFilterTest.java b/tests/server-side/com/vaadin/data/util/filter/IsNullFilterTest.java
index 24d5152cf7..6f90273de1 100644
--- a/tests/server-side/com/vaadin/data/util/filter/IsNullFilterTest.java
+++ b/tests/server-side/com/vaadin/data/util/filter/IsNullFilterTest.java
@@ -6,10 +6,8 @@ import com.vaadin.data.Container.Filter;
import com.vaadin.data.Item;
import com.vaadin.data.util.ObjectProperty;
import com.vaadin.data.util.PropertysetItem;
-import com.vaadin.data.util.filter.And;
-import com.vaadin.data.util.filter.IsNull;
-public class IsNullFilterTest extends AbstractFilterTest {
+public class IsNullFilterTest extends AbstractFilterTest<IsNull> {
public void testIsNull() {
Item item1 = new PropertysetItem();
diff --git a/tests/server-side/com/vaadin/data/util/filter/NotFilterTest.java b/tests/server-side/com/vaadin/data/util/filter/NotFilterTest.java
index be6417ccdf..c3b666e6f7 100644
--- a/tests/server-side/com/vaadin/data/util/filter/NotFilterTest.java
+++ b/tests/server-side/com/vaadin/data/util/filter/NotFilterTest.java
@@ -5,10 +5,8 @@ import junit.framework.Assert;
import com.vaadin.data.Container.Filter;
import com.vaadin.data.Item;
import com.vaadin.data.util.BeanItem;
-import com.vaadin.data.util.filter.And;
-import com.vaadin.data.util.filter.Not;
-public class NotFilterTest extends AbstractFilterTest {
+public class NotFilterTest extends AbstractFilterTest<Not> {
protected Item item1 = new BeanItem<Integer>(1);
protected Item item2 = new BeanItem<Integer>(2);
diff --git a/tests/server-side/com/vaadin/data/util/filter/SimpleStringFilterTest.java b/tests/server-side/com/vaadin/data/util/filter/SimpleStringFilterTest.java
index c36a764a54..bc63d57752 100644
--- a/tests/server-side/com/vaadin/data/util/filter/SimpleStringFilterTest.java
+++ b/tests/server-side/com/vaadin/data/util/filter/SimpleStringFilterTest.java
@@ -2,9 +2,8 @@ package com.vaadin.data.util.filter;
import junit.framework.Assert;
-import com.vaadin.data.util.filter.SimpleStringFilter;
-
-public class SimpleStringFilterTest extends AbstractFilterTest {
+public class SimpleStringFilterTest extends
+ AbstractFilterTest<SimpleStringFilter> {
protected static TestItem<String, String> createTestItem() {
return new TestItem<String, String>("abcde", "TeSt");
diff --git a/tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java b/tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java
index 56c9921a0b..c273bbf590 100644
--- a/tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java
+++ b/tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java
@@ -1344,7 +1344,7 @@ public class SQLContainerTest {
Statement statement = conn.createStatement();
statement
.executeUpdate("DELETE FROM people WHERE \"ID\"="
- + item.getItemProperty("ID"));
+ + item.getItemProperty("ID").getValue());
statement.close();
return true;
}
diff --git a/tests/server-side/com/vaadin/data/util/sqlcontainer/filters/BetweenTest.java b/tests/server-side/com/vaadin/data/util/sqlcontainer/filters/BetweenTest.java
index 5faa859b67..da4cfe4522 100644
--- a/tests/server-side/com/vaadin/data/util/sqlcontainer/filters/BetweenTest.java
+++ b/tests/server-side/com/vaadin/data/util/sqlcontainer/filters/BetweenTest.java
@@ -12,7 +12,7 @@ import com.vaadin.data.util.filter.Between;
public class BetweenTest {
private Item itemWithPropertyValue(Object propertyId, Object value) {
- Property property = EasyMock.createMock(Property.class);
+ Property<?> property = EasyMock.createMock(Property.class);
property.getValue();
EasyMock.expectLastCall().andReturn(value).anyTimes();
EasyMock.replay(property);
diff --git a/tests/server-side/com/vaadin/terminal/gwt/server/TestAbstractApplicationServletStaticFilesLocation.java b/tests/server-side/com/vaadin/terminal/gwt/server/TestAbstractApplicationServletStaticFilesLocation.java
index fcd9970717..7e45ea50d7 100644
--- a/tests/server-side/com/vaadin/terminal/gwt/server/TestAbstractApplicationServletStaticFilesLocation.java
+++ b/tests/server-side/com/vaadin/terminal/gwt/server/TestAbstractApplicationServletStaticFilesLocation.java
@@ -17,9 +17,6 @@ import javax.servlet.http.HttpServletRequest;
import junit.framework.TestCase;
-import com.vaadin.terminal.gwt.server.AbstractApplicationServlet;
-import com.vaadin.terminal.gwt.server.ApplicationServlet;
-
public class TestAbstractApplicationServletStaticFilesLocation extends TestCase {
ApplicationServlet servlet;
@@ -147,9 +144,6 @@ public class TestAbstractApplicationServletStaticFilesLocation extends TestCase
.andReturn(realContextPath).anyTimes();
expect(request.getAttribute("javax.servlet.include.servlet_path"))
.andReturn(realServletPath).anyTimes();
- expect(
- request.getAttribute(AbstractApplicationServlet.REQUEST_VAADIN_STATIC_FILE_PATH))
- .andReturn(null).anyTimes();
return request;
}
@@ -163,9 +157,6 @@ public class TestAbstractApplicationServletStaticFilesLocation extends TestCase
.andReturn(null).anyTimes();
expect(request.getAttribute("javax.servlet.include.servlet_path"))
.andReturn(null).anyTimes();
- expect(
- request.getAttribute(ApplicationServlet.REQUEST_VAADIN_STATIC_FILE_PATH))
- .andReturn(null).anyTimes();
return request;
}
diff --git a/tests/server-side/com/vaadin/tests/VaadinClasses.java b/tests/server-side/com/vaadin/tests/VaadinClasses.java
index e02c4f0b6e..b74af660e4 100644
--- a/tests/server-side/com/vaadin/tests/VaadinClasses.java
+++ b/tests/server-side/com/vaadin/tests/VaadinClasses.java
@@ -22,10 +22,11 @@ import com.vaadin.ui.Component;
import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.DragAndDropWrapper;
+import com.vaadin.ui.Field;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.LoginForm;
import com.vaadin.ui.PopupView;
-import com.vaadin.ui.SplitPanel;
+import com.vaadin.ui.Root;
import com.vaadin.ui.VerticalSplitPanel;
import com.vaadin.ui.Window;
@@ -61,6 +62,15 @@ public class VaadinClasses {
}
}
+ public static List<Class<? extends Field>> getFields() {
+ try {
+ return findClasses(Field.class, "com.vaadin.ui");
+ } catch (IOException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
public static List<Class<? extends Object>> getAllServerSideClasses() {
try {
return findClassesNoTests(Object.class, "com.vaadin", new String[] {
@@ -87,13 +97,13 @@ public class VaadinClasses {
classes.remove(DragAndDropWrapper.class);
classes.remove(CustomComponent.class);
classes.remove(LoginForm.class);
+ classes.remove(Root.class);
return classes;
}
public static List<Class<? extends ComponentContainer>> getComponentContainersSupportingUnlimitedNumberOfComponents() {
List<Class<? extends ComponentContainer>> classes = getComponentContainersSupportingAddRemoveComponent();
- classes.remove(SplitPanel.class);
classes.remove(VerticalSplitPanel.class);
classes.remove(HorizontalSplitPanel.class);
classes.remove(Window.class);
diff --git a/tests/server-side/com/vaadin/tests/data/bean/Address.java b/tests/server-side/com/vaadin/tests/data/bean/Address.java
new file mode 100644
index 0000000000..15cdf34ae5
--- /dev/null
+++ b/tests/server-side/com/vaadin/tests/data/bean/Address.java
@@ -0,0 +1,63 @@
+package com.vaadin.tests.data.bean;
+
+import java.io.Serializable;
+
+@SuppressWarnings("serial")
+public class Address implements Serializable {
+
+ private String streetAddress = "";
+ private Integer postalCode = null;
+ private String city = "";
+ private Country country = null;
+
+ public Address() {
+
+ }
+
+ public Address(String streetAddress, int postalCode, String city,
+ Country country) {
+ setStreetAddress(streetAddress);
+ setPostalCode(postalCode);
+ setCity(city);
+ setCountry(country);
+ }
+
+ @Override
+ public String toString() {
+ return "Address [streetAddress=" + streetAddress + ", postalCode="
+ + postalCode + ", city=" + city + ", country=" + country + "]";
+ }
+
+ public String getStreetAddress() {
+ return streetAddress;
+ }
+
+ public void setStreetAddress(String streetAddress) {
+ this.streetAddress = streetAddress;
+ }
+
+ public Integer getPostalCode() {
+ return postalCode;
+ }
+
+ public void setPostalCode(Integer postalCode) {
+ this.postalCode = postalCode;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public Country getCountry() {
+ return country;
+ }
+
+ public void setCountry(Country country) {
+ this.country = country;
+ }
+
+}
diff --git a/tests/server-side/com/vaadin/tests/data/bean/BeanToValidate.java b/tests/server-side/com/vaadin/tests/data/bean/BeanToValidate.java
new file mode 100644
index 0000000000..416563baba
--- /dev/null
+++ b/tests/server-side/com/vaadin/tests/data/bean/BeanToValidate.java
@@ -0,0 +1,56 @@
+package com.vaadin.tests.data.bean;
+
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+
+public class BeanToValidate {
+ @NotNull
+ @Size(min = 3, max = 16)
+ private String firstname;
+
+ @NotNull(message = "Last name must not be empty")
+ private String lastname;
+
+ @Min(value = 18, message = "Must be 18 or above")
+ @Max(150)
+ private int age;
+
+ @Digits(integer = 3, fraction = 2)
+ private String decimals;
+
+ public String getFirstname() {
+ return firstname;
+ }
+
+ public void setFirstname(String firstname) {
+ this.firstname = firstname;
+ }
+
+ public String getLastname() {
+ return lastname;
+ }
+
+ public void setLastname(String lastname) {
+ this.lastname = lastname;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ public String getDecimals() {
+ return decimals;
+ }
+
+ public void setDecimals(String decimals) {
+ this.decimals = decimals;
+ }
+
+}
diff --git a/tests/server-side/com/vaadin/tests/data/bean/Country.java b/tests/server-side/com/vaadin/tests/data/bean/Country.java
new file mode 100644
index 0000000000..afdf8dcfa1
--- /dev/null
+++ b/tests/server-side/com/vaadin/tests/data/bean/Country.java
@@ -0,0 +1,18 @@
+package com.vaadin.tests.data.bean;
+
+public enum Country {
+
+ FINLAND("Finland"), SWEDEN("Sweden"), USA("USA"), RUSSIA("Russia"), NETHERLANDS(
+ "Netherlands"), SOUTH_AFRICA("South Africa");
+
+ private String name;
+
+ private Country(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String toString() {
+ return name;
+ }
+}
diff --git a/tests/server-side/com/vaadin/tests/data/bean/Person.java b/tests/server-side/com/vaadin/tests/data/bean/Person.java
new file mode 100644
index 0000000000..2cb3a29368
--- /dev/null
+++ b/tests/server-side/com/vaadin/tests/data/bean/Person.java
@@ -0,0 +1,133 @@
+package com.vaadin.tests.data.bean;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class Person {
+ private String firstName;
+ private String lastName;
+ private String email;
+ private int age;
+ private Sex sex;
+ private Address address;
+ private boolean deceased;
+ private Date birthDate;
+
+ private Integer salary; // null if unknown
+ private Double salaryDouble; // null if unknown
+
+ private BigDecimal rent;
+
+ public Person() {
+
+ }
+
+ @Override
+ public String toString() {
+ return "Person [firstName=" + firstName + ", lastName=" + lastName
+ + ", email=" + email + ", age=" + age + ", sex=" + sex
+ + ", address=" + address + ", deceased=" + deceased
+ + ", salary=" + salary + ", salaryDouble=" + salaryDouble
+ + ", rent=" + rent + "]";
+ }
+
+ public Person(String firstName, String lastName, String email, int age,
+ Sex sex, Address address) {
+ super();
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.email = email;
+ this.age = age;
+ this.sex = sex;
+ this.address = address;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ public Address getAddress() {
+ return address;
+ }
+
+ public void setAddress(Address address) {
+ this.address = address;
+ }
+
+ public Sex getSex() {
+ return sex;
+ }
+
+ public void setSex(Sex sex) {
+ this.sex = sex;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public boolean getDeceased() {
+ return deceased;
+ }
+
+ public void setDeceased(boolean deceased) {
+ this.deceased = deceased;
+ }
+
+ public Integer getSalary() {
+ return salary;
+ }
+
+ public void setSalary(Integer salary) {
+ this.salary = salary;
+ }
+
+ public BigDecimal getRent() {
+ return rent;
+ }
+
+ public void setRent(BigDecimal rent) {
+ this.rent = rent;
+ }
+
+ public Double getSalaryDouble() {
+ return salaryDouble;
+ }
+
+ public void setSalaryDouble(Double salaryDouble) {
+ this.salaryDouble = salaryDouble;
+ }
+
+ public Date getBirthDate() {
+ return birthDate;
+ }
+
+ public void setBirthDate(Date birthDate) {
+ this.birthDate = birthDate;
+ }
+
+}
diff --git a/tests/server-side/com/vaadin/tests/data/bean/PersonWithBeanValidationAnnotations.java b/tests/server-side/com/vaadin/tests/data/bean/PersonWithBeanValidationAnnotations.java
new file mode 100644
index 0000000000..93b2273263
--- /dev/null
+++ b/tests/server-side/com/vaadin/tests/data/bean/PersonWithBeanValidationAnnotations.java
@@ -0,0 +1,156 @@
+package com.vaadin.tests.data.bean;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Past;
+import javax.validation.constraints.Size;
+
+public class PersonWithBeanValidationAnnotations {
+ @NotNull
+ @Size(min = 5, max = 20)
+ private String firstName;
+ @NotNull
+ private String lastName;
+
+ private String email;
+
+ @Min(0)
+ @Max(100)
+ private int age;
+
+ @NotNull
+ private Sex sex;
+
+ private Address address;
+ private boolean deceased;
+
+ @NotNull
+ @Past
+ private Date birthDate;
+
+ @Min(0)
+ private Integer salary; // null if unknown
+
+ @Digits(integer = 6, fraction = 2)
+ private Double salaryDouble; // null if unknown
+
+ private BigDecimal rent;
+
+ public PersonWithBeanValidationAnnotations() {
+
+ }
+
+ @Override
+ public String toString() {
+ return "Person [firstName=" + firstName + ", lastName=" + lastName
+ + ", email=" + email + ", age=" + age + ", sex=" + sex
+ + ", address=" + address + ", deceased=" + deceased
+ + ", salary=" + salary + ", salaryDouble=" + salaryDouble
+ + ", rent=" + rent + "]";
+ }
+
+ public PersonWithBeanValidationAnnotations(String firstName,
+ String lastName, String email, int age, Sex sex, Address address) {
+ super();
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.email = email;
+ this.age = age;
+ this.sex = sex;
+ this.address = address;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ public Address getAddress() {
+ return address;
+ }
+
+ public void setAddress(Address address) {
+ this.address = address;
+ }
+
+ public Sex getSex() {
+ return sex;
+ }
+
+ public void setSex(Sex sex) {
+ this.sex = sex;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public boolean getDeceased() {
+ return deceased;
+ }
+
+ public void setDeceased(boolean deceased) {
+ this.deceased = deceased;
+ }
+
+ public Integer getSalary() {
+ return salary;
+ }
+
+ public void setSalary(Integer salary) {
+ this.salary = salary;
+ }
+
+ public BigDecimal getRent() {
+ return rent;
+ }
+
+ public void setRent(BigDecimal rent) {
+ this.rent = rent;
+ }
+
+ public Double getSalaryDouble() {
+ return salaryDouble;
+ }
+
+ public void setSalaryDouble(Double salaryDouble) {
+ this.salaryDouble = salaryDouble;
+ }
+
+ public Date getBirthDate() {
+ return birthDate;
+ }
+
+ public void setBirthDate(Date birthDate) {
+ this.birthDate = birthDate;
+ }
+
+}
diff --git a/tests/server-side/com/vaadin/tests/data/bean/Sex.java b/tests/server-side/com/vaadin/tests/data/bean/Sex.java
new file mode 100644
index 0000000000..a4e3f20a11
--- /dev/null
+++ b/tests/server-side/com/vaadin/tests/data/bean/Sex.java
@@ -0,0 +1,20 @@
+package com.vaadin.tests.data.bean;
+
+public enum Sex {
+ MALE("Male"), FEMALE("Female"), UNKNOWN("Unknown");
+
+ private String stringRepresentation;
+
+ private Sex(String stringRepresentation) {
+ this.stringRepresentation = stringRepresentation;
+ }
+
+ public String getStringRepresentation() {
+ return stringRepresentation;
+ }
+
+ @Override
+ public String toString() {
+ return getStringRepresentation();
+ }
+}
diff --git a/tests/server-side/com/vaadin/tests/server/LicenseInJavaFiles.java b/tests/server-side/com/vaadin/tests/server/LicenseInJavaFiles.java
new file mode 100644
index 0000000000..abde241451
--- /dev/null
+++ b/tests/server-side/com/vaadin/tests/server/LicenseInJavaFiles.java
@@ -0,0 +1,57 @@
+package com.vaadin.tests.server;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.HashSet;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.commons.io.IOUtils;
+
+public class LicenseInJavaFiles extends TestCase {
+
+ /**
+ * The tests are run in the build directory.
+ */
+ public static String SRC_DIR = "../src";
+
+ public void testJavaFilesContainsLicense() throws IOException {
+ File srcDir = new File(SRC_DIR);
+ System.out.println(new File(".").getAbsolutePath());
+ HashSet<String> missing = new HashSet<String>();
+ checkForLicense(srcDir, missing);
+ if (!missing.isEmpty()) {
+ throw new RuntimeException(
+ "The following files are missing license information:\n"
+ + missing.toString());
+ }
+ }
+
+ private void checkForLicense(File srcDir, HashSet<String> missing)
+ throws IOException {
+ Assert.assertTrue("Source directory " + srcDir + " does not exist",
+ srcDir.exists());
+
+ for (File f : srcDir.listFiles()) {
+ if (f.isDirectory()) {
+ if (f.getPath().endsWith("com/vaadin/external")) {
+ continue;
+ }
+ checkForLicense(f, missing);
+ } else if (f.getName().endsWith(".java")) {
+ checkForLicenseInFile(f, missing);
+ }
+ }
+ }
+
+ private void checkForLicenseInFile(File f, HashSet<String> missing)
+ throws IOException {
+ String contents = IOUtils.toString(new FileInputStream(f));
+ if (!contents.contains("@" + "VaadinApache2LicenseForJavaFiles" + "@")) {
+ missing.add(f.getPath());
+ }
+
+ }
+}
diff --git a/tests/server-side/com/vaadin/tests/server/TestSerialization.java b/tests/server-side/com/vaadin/tests/server/TestSerialization.java
index 03a9d3e262..84ff5ad6fa 100644
--- a/tests/server-side/com/vaadin/tests/server/TestSerialization.java
+++ b/tests/server-side/com/vaadin/tests/server/TestSerialization.java
@@ -10,6 +10,7 @@ import java.io.Serializable;
import junit.framework.TestCase;
import com.vaadin.data.Item;
+import com.vaadin.data.Property;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.data.util.MethodProperty;
import com.vaadin.data.validator.RegexpValidator;
@@ -19,9 +20,9 @@ public class TestSerialization extends TestCase {
public void testValidators() throws Exception {
RegexpValidator validator = new RegexpValidator(".*", "Error");
- validator.isValid("aaa");
+ validator.validate("aaa");
RegexpValidator validator2 = (RegexpValidator) serializeAndDeserialize(validator);
- validator2.isValid("aaa");
+ validator2.validate("aaa");
}
public void testForm() throws Exception {
@@ -78,15 +79,25 @@ public class TestSerialization extends TestCase {
data));
Serializable s2 = (Serializable) in.readObject();
+ // using special toString(Object) method to avoid calling
+ // Property.toString(), which will be temporarily disabled
if (s.equals(s2)) {
- System.out.println(s + " equals " + s2);
+ System.out.println(toString(s) + " equals " + toString(s2));
} else {
- System.out.println(s + " does NOT equal " + s2);
+ System.out.println(toString(s) + " does NOT equal " + toString(s2));
}
return s2;
}
+ private static String toString(Object o) {
+ if (o instanceof Property) {
+ return String.valueOf(((Property<?>) o).getValue());
+ } else {
+ return String.valueOf(o);
+ }
+ }
+
public static class Data implements Serializable {
private String dummyGetter;
private String dummyGetterAndSetter;
diff --git a/tests/server-side/com/vaadin/tests/server/TransactionListenersConcurrency.java b/tests/server-side/com/vaadin/tests/server/TransactionListenersConcurrency.java
index 224c9f5964..6c762c666d 100644
--- a/tests/server-side/com/vaadin/tests/server/TransactionListenersConcurrency.java
+++ b/tests/server-side/com/vaadin/tests/server/TransactionListenersConcurrency.java
@@ -71,7 +71,7 @@ public class TransactionListenersConcurrency extends TestCase {
try {
app.start(new URL("http://localhost/"),
- new Properties(), context);
+ new Properties(), context, true);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
diff --git a/tests/server-side/com/vaadin/tests/server/component/absolutelayout/ComponentPosition.java b/tests/server-side/com/vaadin/tests/server/component/absolutelayout/ComponentPosition.java
index ee8ef6bfbc..4458872c79 100644
--- a/tests/server-side/com/vaadin/tests/server/component/absolutelayout/ComponentPosition.java
+++ b/tests/server-side/com/vaadin/tests/server/component/absolutelayout/ComponentPosition.java
@@ -3,6 +3,7 @@ package com.vaadin.tests.server.component.absolutelayout;
import junit.framework.TestCase;
import com.vaadin.terminal.Sizeable;
+import com.vaadin.terminal.Sizeable.Unit;
import com.vaadin.ui.AbsoluteLayout;
import com.vaadin.ui.Button;
@@ -12,7 +13,7 @@ public class ComponentPosition extends TestCase {
private static final String PARTIAL_CSS = "top:7.0px;left:7.0em;";
private static final Float CSS_VALUE = Float.valueOf(7);
- private static final int UNIT_UNSET = Sizeable.UNITS_PIXELS;
+ private static final Unit UNIT_UNSET = Sizeable.Unit.PIXELS;
/**
* Add component w/o giving positions, assert that everything is unset
@@ -51,11 +52,11 @@ public class ComponentPosition extends TestCase {
assertEquals(CSS_VALUE, layout.getPosition(b).getLeftValue());
assertEquals(CSS_VALUE, layout.getPosition(b).getRightValue());
- assertEquals(Sizeable.UNITS_PIXELS, layout.getPosition(b).getTopUnits());
- assertEquals(Sizeable.UNITS_PICAS, layout.getPosition(b)
+ assertEquals(Sizeable.Unit.PIXELS, layout.getPosition(b).getTopUnits());
+ assertEquals(Sizeable.Unit.PICAS, layout.getPosition(b)
.getBottomUnits());
- assertEquals(Sizeable.UNITS_EM, layout.getPosition(b).getLeftUnits());
- assertEquals(Sizeable.UNITS_PERCENTAGE, layout.getPosition(b)
+ assertEquals(Sizeable.Unit.EM, layout.getPosition(b).getLeftUnits());
+ assertEquals(Sizeable.Unit.PERCENTAGE, layout.getPosition(b)
.getRightUnits());
assertEquals(7, layout.getPosition(b).getZIndex());
@@ -77,9 +78,9 @@ public class ComponentPosition extends TestCase {
assertEquals(CSS_VALUE, layout.getPosition(b).getLeftValue());
assertNull(layout.getPosition(b).getRightValue());
- assertEquals(Sizeable.UNITS_PIXELS, layout.getPosition(b).getTopUnits());
+ assertEquals(Sizeable.Unit.PIXELS, layout.getPosition(b).getTopUnits());
assertEquals(UNIT_UNSET, layout.getPosition(b).getBottomUnits());
- assertEquals(Sizeable.UNITS_EM, layout.getPosition(b).getLeftUnits());
+ assertEquals(Sizeable.Unit.EM, layout.getPosition(b).getLeftUnits());
assertEquals(UNIT_UNSET, layout.getPosition(b).getRightUnits());
assertEquals(-1, layout.getPosition(b).getZIndex());
@@ -104,9 +105,9 @@ public class ComponentPosition extends TestCase {
assertEquals(CSS_VALUE, layout.getPosition(b).getLeftValue());
assertNull(layout.getPosition(b).getRightValue());
- assertEquals(Sizeable.UNITS_PIXELS, layout.getPosition(b).getTopUnits());
+ assertEquals(Sizeable.Unit.PIXELS, layout.getPosition(b).getTopUnits());
assertEquals(UNIT_UNSET, layout.getPosition(b).getBottomUnits());
- assertEquals(Sizeable.UNITS_EM, layout.getPosition(b).getLeftUnits());
+ assertEquals(Sizeable.Unit.EM, layout.getPosition(b).getLeftUnits());
assertEquals(UNIT_UNSET, layout.getPosition(b).getRightUnits());
assertEquals(-1, layout.getPosition(b).getZIndex());
@@ -131,21 +132,20 @@ public class ComponentPosition extends TestCase {
layout.getPosition(b).setBottomValue(SIZE);
layout.getPosition(b).setLeftValue(SIZE);
- layout.getPosition(b).setTopUnits(Sizeable.UNITS_CM);
- layout.getPosition(b).setRightUnits(Sizeable.UNITS_EX);
- layout.getPosition(b).setBottomUnits(Sizeable.UNITS_INCH);
- layout.getPosition(b).setLeftUnits(Sizeable.UNITS_MM);
+ layout.getPosition(b).setTopUnits(Sizeable.Unit.CM);
+ layout.getPosition(b).setRightUnits(Sizeable.Unit.EX);
+ layout.getPosition(b).setBottomUnits(Sizeable.Unit.INCH);
+ layout.getPosition(b).setLeftUnits(Sizeable.Unit.MM);
assertEquals(SIZE, layout.getPosition(b).getTopValue());
assertEquals(SIZE, layout.getPosition(b).getRightValue());
assertEquals(SIZE, layout.getPosition(b).getBottomValue());
assertEquals(SIZE, layout.getPosition(b).getLeftValue());
- assertEquals(Sizeable.UNITS_CM, layout.getPosition(b).getTopUnits());
- assertEquals(Sizeable.UNITS_EX, layout.getPosition(b).getRightUnits());
- assertEquals(Sizeable.UNITS_INCH, layout.getPosition(b)
- .getBottomUnits());
- assertEquals(Sizeable.UNITS_MM, layout.getPosition(b).getLeftUnits());
+ assertEquals(Sizeable.Unit.CM, layout.getPosition(b).getTopUnits());
+ assertEquals(Sizeable.Unit.EX, layout.getPosition(b).getRightUnits());
+ assertEquals(Sizeable.Unit.INCH, layout.getPosition(b).getBottomUnits());
+ assertEquals(Sizeable.Unit.MM, layout.getPosition(b).getLeftUnits());
}
@@ -159,21 +159,20 @@ public class ComponentPosition extends TestCase {
Button b = new Button();
layout.addComponent(b);
- layout.getPosition(b).setTop(SIZE, Sizeable.UNITS_CM);
- layout.getPosition(b).setRight(SIZE, Sizeable.UNITS_EX);
- layout.getPosition(b).setBottom(SIZE, Sizeable.UNITS_INCH);
- layout.getPosition(b).setLeft(SIZE, Sizeable.UNITS_MM);
+ layout.getPosition(b).setTop(SIZE, Sizeable.Unit.CM);
+ layout.getPosition(b).setRight(SIZE, Sizeable.Unit.EX);
+ layout.getPosition(b).setBottom(SIZE, Sizeable.Unit.INCH);
+ layout.getPosition(b).setLeft(SIZE, Sizeable.Unit.MM);
assertEquals(SIZE, layout.getPosition(b).getTopValue());
assertEquals(SIZE, layout.getPosition(b).getRightValue());
assertEquals(SIZE, layout.getPosition(b).getBottomValue());
assertEquals(SIZE, layout.getPosition(b).getLeftValue());
- assertEquals(Sizeable.UNITS_CM, layout.getPosition(b).getTopUnits());
- assertEquals(Sizeable.UNITS_EX, layout.getPosition(b).getRightUnits());
- assertEquals(Sizeable.UNITS_INCH, layout.getPosition(b)
- .getBottomUnits());
- assertEquals(Sizeable.UNITS_MM, layout.getPosition(b).getLeftUnits());
+ assertEquals(Sizeable.Unit.CM, layout.getPosition(b).getTopUnits());
+ assertEquals(Sizeable.Unit.EX, layout.getPosition(b).getRightUnits());
+ assertEquals(Sizeable.Unit.INCH, layout.getPosition(b).getBottomUnits());
+ assertEquals(Sizeable.Unit.MM, layout.getPosition(b).getLeftUnits());
}
diff --git a/tests/server-side/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java b/tests/server-side/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java
new file mode 100644
index 0000000000..050ab282a6
--- /dev/null
+++ b/tests/server-side/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java
@@ -0,0 +1,162 @@
+package com.vaadin.tests.server.component.abstractfield;
+
+import java.util.Locale;
+
+import junit.framework.TestCase;
+
+import com.vaadin.data.util.MethodProperty;
+import com.vaadin.data.util.converter.Converter;
+import com.vaadin.data.util.converter.StringToIntegerConverter;
+import com.vaadin.tests.data.bean.Address;
+import com.vaadin.tests.data.bean.Country;
+import com.vaadin.tests.data.bean.Person;
+import com.vaadin.tests.data.bean.Sex;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.TextField;
+
+public class AbstractFieldValueConversions extends TestCase {
+
+ Person paulaBean = new Person("Paula", "Brilliant", "paula@brilliant.com",
+ 34, Sex.FEMALE, new Address("Paula street 1", 12345, "P-town",
+ Country.FINLAND));
+
+ public void testWithoutConversion() {
+ TextField tf = new TextField();
+ tf.setPropertyDataSource(new MethodProperty<String>(paulaBean,
+ "firstName"));
+ assertEquals("Paula", tf.getValue());
+ assertEquals("Paula", tf.getPropertyDataSource().getValue());
+ tf.setValue("abc");
+ assertEquals("abc", tf.getValue());
+ assertEquals("abc", tf.getPropertyDataSource().getValue());
+ assertEquals("abc", paulaBean.getFirstName());
+ }
+
+ public void testStringIdentityConversion() {
+ TextField tf = new TextField();
+ tf.setConverter(new Converter<String, String>() {
+
+ public String convertToModel(String value, Locale locale) {
+ return value;
+ }
+
+ public String convertToPresentation(String value, Locale locale) {
+ return value;
+ }
+
+ public Class<String> getModelType() {
+ return String.class;
+ }
+
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+ });
+ tf.setPropertyDataSource(new MethodProperty<String>(paulaBean,
+ "firstName"));
+ assertEquals("Paula", tf.getValue());
+ assertEquals("Paula", tf.getPropertyDataSource().getValue());
+ tf.setValue("abc");
+ assertEquals("abc", tf.getValue());
+ assertEquals("abc", tf.getPropertyDataSource().getValue());
+ assertEquals("abc", paulaBean.getFirstName());
+ }
+
+ public void testFailingConversion() {
+ TextField tf = new TextField();
+ tf.setConverter(new Converter<String, Integer>() {
+
+ public Integer convertToModel(String value, Locale locale) {
+ throw new ConversionException("Failed");
+ }
+
+ public String convertToPresentation(Integer value, Locale locale) {
+ throw new ConversionException("Failed");
+ }
+
+ public Class<Integer> getModelType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Class<String> getPresentationType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ });
+ try {
+ tf.setValue(1);
+ fail("setValue(Integer) should throw an exception");
+ } catch (Converter.ConversionException e) {
+ // OK, expected
+ }
+ }
+
+ public void testIntegerStringConversion() {
+ TextField tf = new TextField();
+
+ tf.setConverter(new StringToIntegerConverter());
+ tf.setPropertyDataSource(new MethodProperty<Integer>(paulaBean, "age"));
+ assertEquals(34, tf.getPropertyDataSource().getValue());
+ assertEquals("34", tf.getValue());
+ tf.setValue("12");
+ assertEquals(12, tf.getPropertyDataSource().getValue());
+ assertEquals("12", tf.getValue());
+ tf.getPropertyDataSource().setValue(42);
+ assertEquals(42, tf.getPropertyDataSource().getValue());
+ assertEquals("42", tf.getValue());
+ }
+
+ public void testBooleanNullConversion() {
+ CheckBox cb = new CheckBox();
+ cb.setConverter(new Converter<Boolean, Boolean>() {
+
+ public Boolean convertToModel(Boolean value, Locale locale) {
+ // value from a CheckBox should never be null as long as it is
+ // not set to null (handled by conversion below).
+ assertNotNull(value);
+ return value;
+ }
+
+ public Boolean convertToPresentation(Boolean value, Locale locale) {
+ // Datamodel -> field
+ if (value == null) {
+ return false;
+ }
+
+ return value;
+ }
+
+ public Class<Boolean> getModelType() {
+ return Boolean.class;
+ }
+
+ public Class<Boolean> getPresentationType() {
+ return Boolean.class;
+ }
+
+ });
+ MethodProperty<Boolean> property = new MethodProperty<Boolean>(
+ paulaBean, "deceased");
+ cb.setPropertyDataSource(property);
+ assertEquals(Boolean.FALSE, property.getValue());
+ assertEquals(Boolean.FALSE, cb.getValue());
+ Boolean newDmValue = cb.getConverter().convertToPresentation(
+ cb.getValue(), new Locale("fi", "FI"));
+ assertEquals(Boolean.FALSE, newDmValue);
+
+ // FIXME: Should be able to set to false here to cause datamodel to be
+ // set to false but the change will not be propagated to the Property
+ // (field value is already false)
+
+ cb.setValue(true);
+ assertEquals(Boolean.TRUE, cb.getValue());
+ assertEquals(Boolean.TRUE, property.getValue());
+
+ cb.setValue(false);
+ assertEquals(Boolean.FALSE, cb.getValue());
+ assertEquals(Boolean.FALSE, property.getValue());
+
+ }
+
+}
diff --git a/tests/server-side/com/vaadin/tests/server/component/abstractfield/DefaultConverterFactory.java b/tests/server-side/com/vaadin/tests/server/component/abstractfield/DefaultConverterFactory.java
new file mode 100644
index 0000000000..e39b5d6629
--- /dev/null
+++ b/tests/server-side/com/vaadin/tests/server/component/abstractfield/DefaultConverterFactory.java
@@ -0,0 +1,48 @@
+package com.vaadin.tests.server.component.abstractfield;
+
+import java.math.BigDecimal;
+import java.util.Locale;
+
+import junit.framework.TestCase;
+
+import com.vaadin.Application;
+import com.vaadin.data.util.MethodProperty;
+import com.vaadin.tests.data.bean.Address;
+import com.vaadin.tests.data.bean.Country;
+import com.vaadin.tests.data.bean.Person;
+import com.vaadin.tests.data.bean.Sex;
+import com.vaadin.ui.TextField;
+
+public class DefaultConverterFactory extends TestCase {
+
+ Person paulaBean = new Person("Paula", "Brilliant", "paula@brilliant.com",
+ 34, Sex.FEMALE, new Address("Paula street 1", 12345, "P-town",
+ Country.FINLAND));
+ {
+ paulaBean.setSalary(49000);
+ BigDecimal rent = new BigDecimal(57223);
+ rent = rent.scaleByPowerOfTen(-2);
+ paulaBean.setRent(rent);
+ }
+
+ public void testDefaultNumberConversion() {
+ Application app = new Application();
+ Application.setCurrentApplication(app);
+ TextField tf = new TextField();
+ tf.setLocale(new Locale("en", "US"));
+ tf.setPropertyDataSource(new MethodProperty<Integer>(paulaBean,
+ "salary"));
+ assertEquals("49,000", tf.getValue());
+
+ tf.setLocale(new Locale("fi", "FI"));
+ // FIXME: The following line should not be necessary and should be
+ // removed
+ tf.setPropertyDataSource(new MethodProperty<Integer>(paulaBean,
+ "salary"));
+ String value = tf.getValue();
+ // Java uses a non-breaking space (ascii 160) instead of space when
+ // formatting
+ String expected = "49" + (char) 160 + "000";
+ assertEquals(expected, value);
+ }
+}
diff --git a/tests/server-side/com/vaadin/tests/server/component/abstractfield/TestAbstractFieldListeners.java b/tests/server-side/com/vaadin/tests/server/component/abstractfield/TestAbstractFieldListeners.java
index 7ee70bde13..9937bf92d5 100644
--- a/tests/server-side/com/vaadin/tests/server/component/abstractfield/TestAbstractFieldListeners.java
+++ b/tests/server-side/com/vaadin/tests/server/component/abstractfield/TestAbstractFieldListeners.java
@@ -5,16 +5,17 @@ import com.vaadin.data.Property.ReadOnlyStatusChangeListener;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.tests.server.component.AbstractListenerMethodsTest;
-import com.vaadin.ui.Button;
+import com.vaadin.ui.CheckBox;
public class TestAbstractFieldListeners extends AbstractListenerMethodsTest {
public void testReadOnlyStatusChangeListenerAddGetRemove() throws Exception {
- testListenerAddGetRemove(Button.class, ReadOnlyStatusChangeEvent.class,
+ testListenerAddGetRemove(CheckBox.class,
+ ReadOnlyStatusChangeEvent.class,
ReadOnlyStatusChangeListener.class);
}
public void testValueChangeListenerAddGetRemove() throws Exception {
- testListenerAddGetRemove(Button.class, ValueChangeEvent.class,
+ testListenerAddGetRemove(CheckBox.class, ValueChangeEvent.class,
ValueChangeListener.class);
}
}
diff --git a/tests/server-side/com/vaadin/tests/server/component/datefield/ResolutionTest.java b/tests/server-side/com/vaadin/tests/server/component/datefield/ResolutionTest.java
new file mode 100644
index 0000000000..00b5c60dad
--- /dev/null
+++ b/tests/server-side/com/vaadin/tests/server/component/datefield/ResolutionTest.java
@@ -0,0 +1,61 @@
+package com.vaadin.tests.server.component.datefield;
+
+import java.util.ArrayList;
+
+import junit.framework.TestCase;
+
+import com.vaadin.tests.util.TestUtil;
+import com.vaadin.ui.DateField.Resolution;
+
+public class ResolutionTest extends TestCase {
+
+ public void testResolutionHigherOrEqualToYear() {
+ Iterable<Resolution> higherOrEqual = Resolution
+ .getResolutionsHigherOrEqualTo(Resolution.YEAR);
+ ArrayList<Resolution> expected = new ArrayList<Resolution>();
+ expected.add(Resolution.YEAR);
+ TestUtil.assertIterableEquals(expected, higherOrEqual);
+ }
+
+ public void testResolutionHigherOrEqualToDay() {
+ Iterable<Resolution> higherOrEqual = Resolution
+ .getResolutionsHigherOrEqualTo(Resolution.DAY);
+ ArrayList<Resolution> expected = new ArrayList<Resolution>();
+ expected.add(Resolution.DAY);
+ expected.add(Resolution.MONTH);
+ expected.add(Resolution.YEAR);
+ TestUtil.assertIterableEquals(expected, higherOrEqual);
+
+ }
+
+ public void testResolutionLowerThanDay() {
+ Iterable<Resolution> higherOrEqual = Resolution
+ .getResolutionsLowerThan(Resolution.DAY);
+ ArrayList<Resolution> expected = new ArrayList<Resolution>();
+ expected.add(Resolution.HOUR);
+ expected.add(Resolution.MINUTE);
+ expected.add(Resolution.SECOND);
+ TestUtil.assertIterableEquals(expected, higherOrEqual);
+
+ }
+
+ public void testResolutionLowerThanSecond() {
+ Iterable<Resolution> higherOrEqual = Resolution
+ .getResolutionsLowerThan(Resolution.SECOND);
+ ArrayList<Resolution> expected = new ArrayList<Resolution>();
+ TestUtil.assertIterableEquals(expected, higherOrEqual);
+ }
+
+ public void testResolutionLowerThanYear() {
+ Iterable<Resolution> higherOrEqual = Resolution
+ .getResolutionsLowerThan(Resolution.YEAR);
+ ArrayList<Resolution> expected = new ArrayList<Resolution>();
+ expected.add(Resolution.MONTH);
+ expected.add(Resolution.DAY);
+ expected.add(Resolution.HOUR);
+ expected.add(Resolution.MINUTE);
+ expected.add(Resolution.SECOND);
+ TestUtil.assertIterableEquals(expected, higherOrEqual);
+
+ }
+}
diff --git a/tests/server-side/com/vaadin/tests/server/component/slider/SliderTest.java b/tests/server-side/com/vaadin/tests/server/component/slider/SliderTest.java
new file mode 100644
index 0000000000..b969bf5e53
--- /dev/null
+++ b/tests/server-side/com/vaadin/tests/server/component/slider/SliderTest.java
@@ -0,0 +1,25 @@
+package com.vaadin.tests.server.component.slider;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import com.vaadin.ui.Slider;
+import com.vaadin.ui.Slider.ValueOutOfBoundsException;
+
+public class SliderTest extends TestCase {
+
+ public void testOutOfBounds() {
+ Slider s = new Slider(0, 10);
+ s.setValue(0);
+ Assert.assertEquals(0.0, s.getValue());
+ s.setValue(10);
+ Assert.assertEquals(10.0, s.getValue());
+ try {
+ s.setValue(20);
+ fail("Should throw out of bounds exception");
+ } catch (ValueOutOfBoundsException e) {
+ // TODO: handle exception
+ }
+
+ }
+}
diff --git a/tests/server-side/com/vaadin/tests/server/component/table/TableColumnAlignments.java b/tests/server-side/com/vaadin/tests/server/component/table/TableColumnAlignments.java
index 04f436f5c4..299f9c79d4 100644
--- a/tests/server-side/com/vaadin/tests/server/component/table/TableColumnAlignments.java
+++ b/tests/server-side/com/vaadin/tests/server/component/table/TableColumnAlignments.java
@@ -5,6 +5,7 @@ import static org.junit.Assert.assertArrayEquals;
import org.junit.Test;
import com.vaadin.ui.Table;
+import com.vaadin.ui.Table.Align;
public class TableColumnAlignments {
@@ -15,7 +16,7 @@ public class TableColumnAlignments {
properties, 10);
Object[] expected = new Object[properties];
for (int i = 0; i < properties; i++) {
- expected[i] = Table.ALIGN_LEFT;
+ expected[i] = Align.LEFT;
}
org.junit.Assert.assertArrayEquals("getColumnAlignments", expected,
t.getColumnAlignments());
@@ -27,9 +28,8 @@ public class TableColumnAlignments {
int properties = 5;
Table t = TableGenerator
.createTableWithDefaultContainer(properties, 10);
- String[] explicitAlignments = new String[] { Table.ALIGN_CENTER,
- Table.ALIGN_LEFT, Table.ALIGN_RIGHT, Table.ALIGN_RIGHT,
- Table.ALIGN_LEFT };
+ Align[] explicitAlignments = new Align[] { Align.CENTER, Align.LEFT,
+ Align.RIGHT, Align.RIGHT, Align.LEFT };
t.setColumnAlignments(explicitAlignments);
@@ -40,28 +40,10 @@ public class TableColumnAlignments {
@Test
public void invalidColumnAlignmentStrings() {
Table t = TableGenerator.createTableWithDefaultContainer(3, 7);
- String[] defaultAlignments = new String[] { Table.ALIGN_LEFT,
- Table.ALIGN_LEFT, Table.ALIGN_LEFT };
+ Align[] defaultAlignments = new Align[] { Align.LEFT, Align.LEFT,
+ Align.LEFT };
try {
- t.setColumnAlignments(new String[] { "a", "b", "c" });
- junit.framework.Assert
- .fail("No exception thrown for invalid array length");
- } catch (IllegalArgumentException e) {
- // Ok, expected
- }
-
- assertArrayEquals("Invalid change affected alignments",
- defaultAlignments, t.getColumnAlignments());
-
- }
-
- @Test
- public void invalidColumnAlignmentString() {
- Table t = TableGenerator.createTableWithDefaultContainer(3, 7);
- String[] defaultAlignments = new String[] { Table.ALIGN_LEFT,
- Table.ALIGN_LEFT, Table.ALIGN_LEFT };
- try {
- t.setColumnAlignment("Property 1", "a");
+ t.setColumnAlignments(new Align[] { Align.RIGHT, Align.RIGHT });
junit.framework.Assert
.fail("No exception thrown for invalid array length");
} catch (IllegalArgumentException e) {
@@ -76,10 +58,10 @@ public class TableColumnAlignments {
@Test
public void columnAlignmentForPropertyNotInContainer() {
Table t = TableGenerator.createTableWithDefaultContainer(3, 7);
- String[] defaultAlignments = new String[] { Table.ALIGN_LEFT,
- Table.ALIGN_LEFT, Table.ALIGN_LEFT };
+ Align[] defaultAlignments = new Align[] { Align.LEFT, Align.LEFT,
+ Align.LEFT };
try {
- t.setColumnAlignment("Property 1200", Table.ALIGN_LEFT);
+ t.setColumnAlignment("Property 1200", Align.LEFT);
// FIXME: Uncomment as there should be an exception (#6475)
// junit.framework.Assert
// .fail("No exception thrown for property not in container");
@@ -100,12 +82,11 @@ public class TableColumnAlignments {
@Test
public void invalidColumnAlignmentsLength() {
Table t = TableGenerator.createTableWithDefaultContainer(7, 7);
- String[] defaultAlignments = new String[] { Table.ALIGN_LEFT,
- Table.ALIGN_LEFT, Table.ALIGN_LEFT, Table.ALIGN_LEFT,
- Table.ALIGN_LEFT, Table.ALIGN_LEFT, Table.ALIGN_LEFT };
+ Align[] defaultAlignments = new Align[] { Align.LEFT, Align.LEFT,
+ Align.LEFT, Align.LEFT, Align.LEFT, Align.LEFT, Align.LEFT };
try {
- t.setColumnAlignments(new String[] { Table.ALIGN_LEFT });
+ t.setColumnAlignments(new Align[] { Align.LEFT });
junit.framework.Assert
.fail("No exception thrown for invalid array length");
} catch (IllegalArgumentException e) {
@@ -115,7 +96,7 @@ public class TableColumnAlignments {
defaultAlignments, t.getColumnAlignments());
try {
- t.setColumnAlignments(new String[] {});
+ t.setColumnAlignments(new Align[] {});
junit.framework.Assert
.fail("No exception thrown for invalid array length");
} catch (IllegalArgumentException e) {
@@ -125,10 +106,9 @@ public class TableColumnAlignments {
defaultAlignments, t.getColumnAlignments());
try {
- t.setColumnAlignments(new String[] { Table.ALIGN_LEFT,
- Table.ALIGN_LEFT, Table.ALIGN_LEFT, Table.ALIGN_LEFT,
- Table.ALIGN_LEFT, Table.ALIGN_LEFT, Table.ALIGN_LEFT,
- Table.ALIGN_LEFT });
+ t.setColumnAlignments(new Align[] { Align.LEFT, Align.LEFT,
+ Align.LEFT, Align.LEFT, Align.LEFT, Align.LEFT, Align.LEFT,
+ Align.LEFT });
junit.framework.Assert
.fail("No exception thrown for invalid array length");
} catch (IllegalArgumentException e) {
@@ -144,13 +124,11 @@ public class TableColumnAlignments {
int properties = 5;
Table t = TableGenerator
.createTableWithDefaultContainer(properties, 10);
- String[] explicitAlignments = new String[] { Table.ALIGN_CENTER,
- Table.ALIGN_LEFT, Table.ALIGN_RIGHT, Table.ALIGN_RIGHT,
- Table.ALIGN_LEFT };
+ Align[] explicitAlignments = new Align[] { Align.CENTER, Align.LEFT,
+ Align.RIGHT, Align.RIGHT, Align.LEFT };
- String[] currentAlignments = new String[] { Table.ALIGN_LEFT,
- Table.ALIGN_LEFT, Table.ALIGN_LEFT, Table.ALIGN_LEFT,
- Table.ALIGN_LEFT };
+ Align[] currentAlignments = new Align[] { Align.LEFT, Align.LEFT,
+ Align.LEFT, Align.LEFT, Align.LEFT };
for (int i = 0; i < properties; i++) {
t.setColumnAlignment("Property " + i, explicitAlignments[i]);
diff --git a/tests/server-side/com/vaadin/tests/server/component/textfield/TextFieldWithPropertyFormatter.java b/tests/server-side/com/vaadin/tests/server/component/textfield/TextFieldWithPropertyFormatter.java
index 5a494b8ccd..d7b38cecfc 100644
--- a/tests/server-side/com/vaadin/tests/server/component/textfield/TextFieldWithPropertyFormatter.java
+++ b/tests/server-side/com/vaadin/tests/server/component/textfield/TextFieldWithPropertyFormatter.java
@@ -2,6 +2,8 @@ package com.vaadin.tests.server.component.textfield;
import java.util.Collections;
+import junit.framework.TestCase;
+
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
@@ -11,8 +13,6 @@ import com.vaadin.terminal.Paintable;
import com.vaadin.terminal.Paintable.RepaintRequestEvent;
import com.vaadin.ui.TextField;
-import junit.framework.TestCase;
-
public class TextFieldWithPropertyFormatter extends TestCase {
private static final String INPUT_VALUE = "foo";
@@ -20,7 +20,7 @@ public class TextFieldWithPropertyFormatter extends TestCase {
private static final String FORMATTED_VALUE = "FOOBAR";
private static final String ORIGINAL_VALUE = "Original";
private TextField field;
- private PropertyFormatter formatter;
+ private PropertyFormatter<String> formatter;
private ObjectProperty<String> property;
private ValueChangeListener listener;
private int listenerCalled;
@@ -32,16 +32,16 @@ public class TextFieldWithPropertyFormatter extends TestCase {
field = new TextField();
- formatter = new PropertyFormatter() {
+ formatter = new PropertyFormatter<String>() {
@Override
- public Object parse(String formattedValue) throws Exception {
+ public String parse(String formattedValue) throws Exception {
assertEquals(INPUT_VALUE, formattedValue);
return PARSED_VALUE;
}
@Override
- public String format(Object value) {
+ public String format(String value) {
return FORMATTED_VALUE;
}
};
@@ -59,7 +59,7 @@ public class TextFieldWithPropertyFormatter extends TestCase {
assertEquals(FORMATTED_VALUE, event.getProperty().getValue());
}
};
-
+
field.addListener(listener);
field.addListener(new Paintable.RepaintRequestListener() {
public void repaintRequested(RepaintRequestEvent event) {
diff --git a/tests/server-side/com/vaadin/tests/server/component/urifragmentutility/UriFragmentUtilityListeners.java b/tests/server-side/com/vaadin/tests/server/component/urifragmentutility/UriFragmentUtilityListeners.java
deleted file mode 100644
index 70fb68b9ec..0000000000
--- a/tests/server-side/com/vaadin/tests/server/component/urifragmentutility/UriFragmentUtilityListeners.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.vaadin.tests.server.component.urifragmentutility;
-
-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 AbstractListenerMethodsTest {
- public void testFragmentChangedListenerAddGetRemove() throws Exception {
- testListenerAddGetRemove(UriFragmentUtility.class,
- FragmentChangedEvent.class, FragmentChangedListener.class);
- }
-}
diff --git a/tests/server-side/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java b/tests/server-side/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java
index 50de91e2af..f8901803c3 100644
--- a/tests/server-side/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java
+++ b/tests/server-side/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java
@@ -1,22 +1,23 @@
package com.vaadin.tests.server.component.window;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.vaadin.Application;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Window;
public class AddRemoveSubWindow {
- public class TestApp extends Application {
+ public class TestApp extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window("Main window");
+ LegacyWindow w = new LegacyWindow("Main window");
setMainWindow(w);
}
}
@@ -26,7 +27,7 @@ public class AddRemoveSubWindow {
TestApp app = new TestApp();
app.init();
Window subWindow = new Window("Sub window");
- Window mainWindow = app.getMainWindow();
+ Root mainWindow = app.getMainWindow();
mainWindow.addWindow(subWindow);
// Added to main window so the parent of the sub window should be the
@@ -44,7 +45,7 @@ public class AddRemoveSubWindow {
// Try to add the same sub window to another window
try {
- Window w = new Window();
+ LegacyWindow w = new LegacyWindow();
w.addWindow(subWindow);
assertTrue("Window.addWindow did not throw the expected exception",
false);
@@ -60,23 +61,18 @@ public class AddRemoveSubWindow {
TestApp app = new TestApp();
app.init();
Window subWindow = new Window("Sub window");
- Window mainWindow = app.getMainWindow();
+ Root mainWindow = app.getMainWindow();
mainWindow.addWindow(subWindow);
// Added to main window so the parent of the sub window should be the
// main window
assertEquals(subWindow.getParent(), mainWindow);
- // Remove from the wrong window, should result in an exception
- boolean removed = subWindow.removeWindow(subWindow);
- assertFalse("Window was removed even though it should not have been",
- removed);
-
// Parent should still be set
assertEquals(subWindow.getParent(), mainWindow);
// Remove from the main window and assert it has been removed
- removed = mainWindow.removeWindow(subWindow);
+ boolean removed = mainWindow.removeWindow(subWindow);
assertTrue("Window was not removed correctly", removed);
assertNull(subWindow.getParent());
}
diff --git a/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java b/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java
index 5fabe40bb7..a67c7bb387 100644
--- a/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java
+++ b/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java
@@ -3,61 +3,36 @@ package com.vaadin.tests.server.component.window;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+
import com.vaadin.Application;
-import com.vaadin.ui.Component;
+import com.vaadin.terminal.WrappedRequest;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-import org.junit.Test;
-
public class AttachDetachWindow {
- private Application testApp = new Application() {
- @Override
- public void init() {
- }
- };
+ private Application testApp = new Application();
+
+ private interface TestContainer {
+ public boolean attachCalled();
+
+ public boolean detachCalled();
- private class TestWindow extends Window {
+ public TestContent getTestContent();
+
+ public Application getApplication();
+ }
+
+ private class TestWindow extends Window implements TestContainer {
boolean windowAttachCalled = false;
- boolean contentAttachCalled = false;
- boolean childAttachCalled = false;
boolean windowDetachCalled = false;
- boolean contentDetachCalled = false;
- boolean childDetachCalled = false;
+ private TestContent testContent = new TestContent();;
TestWindow() {
- setContent(new VerticalLayout() {
- @Override
- public void attach() {
- super.attach();
- contentAttachCalled = true;
- }
-
- @Override
- public void detach() {
- super.detach();
- contentDetachCalled = true;
- }
- });
- addComponent(new Label() {
- @Override
- public void attach() {
- super.attach();
- childAttachCalled = true;
- }
-
- @Override
- public void detach() {
- super.detach();
- childDetachCalled = true;
- }
- });
- }
-
- Component getChild() {
- return getComponentIterator().next();
+ setContent(testContent);
}
@Override
@@ -71,9 +46,97 @@ public class AttachDetachWindow {
super.detach();
windowDetachCalled = true;
}
+
+ public boolean attachCalled() {
+ return windowAttachCalled;
+ }
+
+ public boolean detachCalled() {
+ return windowDetachCalled;
+ }
+
+ public TestContent getTestContent() {
+ return testContent;
+ }
}
- TestWindow main = new TestWindow();
+ private class TestContent extends VerticalLayout {
+ boolean contentDetachCalled = false;
+ boolean childDetachCalled = false;
+ boolean contentAttachCalled = false;
+ boolean childAttachCalled = false;
+
+ private Label child = new Label() {
+ @Override
+ public void attach() {
+ super.attach();
+ childAttachCalled = true;
+ }
+
+ @Override
+ public void detach() {
+ super.detach();
+ childDetachCalled = true;
+ }
+ };
+
+ public TestContent() {
+ addComponent(child);
+ }
+
+ @Override
+ public void attach() {
+ super.attach();
+ contentAttachCalled = true;
+ }
+
+ @Override
+ public void detach() {
+ super.detach();
+ contentDetachCalled = true;
+ }
+ }
+
+ private class TestRoot extends Root implements TestContainer {
+ boolean rootAttachCalled = false;
+ boolean rootDetachCalled = false;
+ private TestContent testContent = new TestContent();;
+
+ public TestRoot() {
+ setContent(testContent);
+ }
+
+ @Override
+ protected void init(WrappedRequest request) {
+ // Do nothing
+ }
+
+ public boolean attachCalled() {
+ return rootAttachCalled;
+ }
+
+ public boolean detachCalled() {
+ return rootDetachCalled;
+ }
+
+ public TestContent getTestContent() {
+ return testContent;
+ }
+
+ @Override
+ public void attach() {
+ super.attach();
+ rootAttachCalled = true;
+ }
+
+ @Override
+ public void detach() {
+ super.detach();
+ rootDetachCalled = true;
+ }
+ }
+
+ TestRoot main = new TestRoot();
TestWindow sub = new TestWindow();
@Test
@@ -86,7 +149,7 @@ public class AttachDetachWindow {
assertUnattached(sub);
// attaching main should recurse to sub
- testApp.setMainWindow(main);
+ main.setApplication(testApp);
assertAttached(main);
assertAttached(sub);
}
@@ -96,7 +159,7 @@ public class AttachDetachWindow {
assertUnattached(main);
assertUnattached(sub);
- testApp.setMainWindow(main);
+ main.setApplication(testApp);
assertAttached(main);
assertUnattached(sub);
@@ -108,7 +171,7 @@ public class AttachDetachWindow {
@Test
public void removeSubWindowBeforeDetachingMainWindow() {
- testApp.addWindow(main);
+ main.setApplication(testApp);
main.addWindow(sub);
// sub should be detached when removing from attached main
@@ -117,18 +180,18 @@ public class AttachDetachWindow {
assertDetached(sub);
// main detach should recurse to sub
- testApp.removeWindow(main);
+ main.setApplication(null);
assertDetached(main);
assertDetached(sub);
}
@Test
public void removeSubWindowAfterDetachingMainWindow() {
- testApp.addWindow(main);
+ main.setApplication(testApp);
main.addWindow(sub);
// main detach should recurse to sub
- testApp.removeWindow(main);
+ main.setApplication(null);
assertDetached(main);
assertDetached(sub);
@@ -141,27 +204,31 @@ public class AttachDetachWindow {
* Asserts that win and its children are attached to testApp and their
* attach() methods have been called.
*/
- private void assertAttached(TestWindow win) {
- assertTrue("window attach not called", win.windowAttachCalled);
- assertTrue("window content attach not called", win.contentAttachCalled);
- assertTrue("window child attach not called", win.childAttachCalled);
+ private void assertAttached(TestContainer win) {
+ TestContent testContent = win.getTestContent();
+
+ assertTrue("window attach not called", win.attachCalled());
+ assertTrue("window content attach not called",
+ testContent.contentAttachCalled);
+ assertTrue("window child attach not called",
+ testContent.childAttachCalled);
assertSame("window not attached", win.getApplication(), testApp);
- assertSame("window content not attached", win.getContent()
- .getApplication(), testApp);
- assertSame("window children not attached", win.getChild()
- .getApplication(), testApp);
+ assertSame("window content not attached", testContent.getApplication(),
+ testApp);
+ assertSame("window children not attached",
+ testContent.child.getApplication(), testApp);
}
/**
* Asserts that win and its children are not attached.
*/
- private void assertUnattached(TestWindow win) {
+ private void assertUnattached(TestContainer win) {
assertSame("window not detached", win.getApplication(), null);
- assertSame("window content not detached", win.getContent()
- .getApplication(), null);
- assertSame("window children not detached", win.getChild()
+ assertSame("window content not detached", win.getTestContent()
.getApplication(), null);
+ assertSame("window children not detached",
+ win.getTestContent().child.getApplication(), null);
}
/**
@@ -170,10 +237,12 @@ public class AttachDetachWindow {
*
* @param win
*/
- private void assertDetached(TestWindow win) {
+ private void assertDetached(TestContainer win) {
assertUnattached(win);
- assertTrue("window detach not called", win.windowDetachCalled);
- assertTrue("window content detach not called", win.contentDetachCalled);
- assertTrue("window child detach not called", win.childDetachCalled);
+ assertTrue("window detach not called", win.detachCalled());
+ assertTrue("window content detach not called",
+ win.getTestContent().contentDetachCalled);
+ assertTrue("window child detach not called",
+ win.getTestContent().childDetachCalled);
}
}
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 fcea309e84..3512f555c9 100644
--- a/tests/server-side/com/vaadin/tests/server/components/AbstractTestFieldValueChange.java
+++ b/tests/server-side/com/vaadin/tests/server/components/AbstractTestFieldValueChange.java
@@ -22,12 +22,12 @@ import com.vaadin.ui.AbstractField;
* override {@link #setValue(AbstractField)} to set the field value via
* <code>changeVariables()</code>.
*/
-public abstract class AbstractTestFieldValueChange extends TestCase {
+public abstract class AbstractTestFieldValueChange<T> extends TestCase {
- private AbstractField field;
+ private AbstractField<T> field;
private ValueChangeListener listener;
- protected void setUp(AbstractField field) throws Exception {
+ protected void setUp(AbstractField<T> field) throws Exception {
this.field = field;
listener = EasyMock.createStrictMock(ValueChangeListener.class);
@@ -155,14 +155,14 @@ public abstract class AbstractTestFieldValueChange extends TestCase {
EasyMock.verify(listener);
}
- protected AbstractField getField() {
+ protected AbstractField<T> getField() {
return field;
}
/**
* Override in subclasses to set value with changeVariables().
*/
- protected void setValue(AbstractField field) {
+ protected void setValue(AbstractField<T> field) {
field.setValue("newValue");
}
diff --git a/tests/server-side/com/vaadin/tests/server/components/TestComboBoxValueChange.java b/tests/server-side/com/vaadin/tests/server/components/TestComboBoxValueChange.java
index 3fbe1406f2..1ca06a86aa 100644
--- a/tests/server-side/com/vaadin/tests/server/components/TestComboBoxValueChange.java
+++ b/tests/server-side/com/vaadin/tests/server/components/TestComboBoxValueChange.java
@@ -12,7 +12,8 @@ import com.vaadin.ui.ComboBox;
*
* See <a href="http://dev.vaadin.com/ticket/4394">Ticket 4394</a>.
*/
-public class TestComboBoxValueChange extends AbstractTestFieldValueChange {
+public class TestComboBoxValueChange extends
+ AbstractTestFieldValueChange<Object> {
@Override
protected void setUp() throws Exception {
ComboBox combo = new ComboBox();
@@ -21,7 +22,7 @@ public class TestComboBoxValueChange extends AbstractTestFieldValueChange {
}
@Override
- protected void setValue(AbstractField field) {
+ protected void setValue(AbstractField<Object> field) {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("selected", new String[] { "myvalue" });
field.changeVariables(field, variables);
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 2c911d5f3f..758c09d66e 100644
--- a/tests/server-side/com/vaadin/tests/server/components/TestTextFieldValueChange.java
+++ b/tests/server-side/com/vaadin/tests/server/components/TestTextFieldValueChange.java
@@ -18,7 +18,8 @@ import com.vaadin.ui.TextField;
*
* See <a href="http://dev.vaadin.com/ticket/4394">Ticket 4394</a>.
*/
-public class TestTextFieldValueChange extends AbstractTestFieldValueChange {
+public class TestTextFieldValueChange extends
+ AbstractTestFieldValueChange<String> {
@Override
protected void setUp() throws Exception {
@@ -36,7 +37,7 @@ public class TestTextFieldValueChange extends AbstractTestFieldValueChange {
}
@Override
- protected void setValue(AbstractField field) {
+ protected void setValue(AbstractField<String> field) {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("text", "newValue");
field.changeVariables(field, variables);
@@ -54,8 +55,7 @@ public class TestTextFieldValueChange extends AbstractTestFieldValueChange {
getField().setPropertyDataSource(property);
// defaults, buffering off
- getField().setWriteThrough(true);
- getField().setReadThrough(true);
+ getField().setBuffered(false);
// Expectations and start test
getListener().valueChange(EasyMock.isA(ValueChangeEvent.class));
@@ -142,8 +142,7 @@ public class TestTextFieldValueChange extends AbstractTestFieldValueChange {
initialValue);
// set buffering
- getField().setWriteThrough(false);
- getField().setReadThrough(false);
+ getField().setBuffered(true);
// Value change should only happen once, when setting the property,
// further changes via property should not cause value change listener
diff --git a/tests/server-side/com/vaadin/tests/server/components/TestWindow.java b/tests/server-side/com/vaadin/tests/server/components/TestWindow.java
index 89d018c8a5..7713f69f68 100644
--- a/tests/server-side/com/vaadin/tests/server/components/TestWindow.java
+++ b/tests/server-side/com/vaadin/tests/server/components/TestWindow.java
@@ -7,6 +7,7 @@ import junit.framework.TestCase;
import org.easymock.EasyMock;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Window;
import com.vaadin.ui.Window.CloseEvent;
import com.vaadin.ui.Window.CloseListener;
@@ -20,6 +21,7 @@ public class TestWindow extends TestCase {
@Override
protected void setUp() throws Exception {
window = new Window();
+ new LegacyWindow().addWindow(window);
}
public void testCloseListener() {
diff --git a/tests/server-side/com/vaadin/tests/server/validation/RangeValidatorTest.java b/tests/server-side/com/vaadin/tests/server/validation/RangeValidatorTest.java
new file mode 100644
index 0000000000..e3320b8699
--- /dev/null
+++ b/tests/server-side/com/vaadin/tests/server/validation/RangeValidatorTest.java
@@ -0,0 +1,52 @@
+package com.vaadin.tests.server.validation;
+
+import junit.framework.TestCase;
+
+import com.vaadin.data.validator.IntegerRangeValidator;
+
+public class RangeValidatorTest extends TestCase {
+
+ // This test uses IntegerRangeValidator for simplicity.
+ // IntegerRangeValidator contains no code so we really are testing
+ // RangeValidator
+ public void testMinValueNonInclusive() {
+ IntegerRangeValidator iv = new IntegerRangeValidator("Failed", 0, 10);
+ iv.setMinValueIncluded(false);
+ assertFalse(iv.isValid(0));
+ assertTrue(iv.isValid(10));
+ assertFalse(iv.isValid(11));
+ assertFalse(iv.isValid(-1));
+ }
+
+ public void testMinMaxValuesInclusive() {
+ IntegerRangeValidator iv = new IntegerRangeValidator("Failed", 0, 10);
+ assertTrue(iv.isValid(0));
+ assertTrue(iv.isValid(1));
+ assertTrue(iv.isValid(10));
+ assertFalse(iv.isValid(11));
+ assertFalse(iv.isValid(-1));
+ }
+
+ public void testMaxValueNonInclusive() {
+ IntegerRangeValidator iv = new IntegerRangeValidator("Failed", 0, 10);
+ iv.setMaxValueIncluded(false);
+ assertTrue(iv.isValid(0));
+ assertTrue(iv.isValid(9));
+ assertFalse(iv.isValid(10));
+ assertFalse(iv.isValid(11));
+ assertFalse(iv.isValid(-1));
+ }
+
+ public void testMinMaxValuesNonInclusive() {
+ IntegerRangeValidator iv = new IntegerRangeValidator("Failed", 0, 10);
+ iv.setMinValueIncluded(false);
+ iv.setMaxValueIncluded(false);
+
+ assertFalse(iv.isValid(0));
+ assertTrue(iv.isValid(1));
+ assertTrue(iv.isValid(9));
+ assertFalse(iv.isValid(10));
+ assertFalse(iv.isValid(11));
+ assertFalse(iv.isValid(-1));
+ }
+}
diff --git a/tests/server-side/com/vaadin/tests/server/validation/TestBeanValidation.java b/tests/server-side/com/vaadin/tests/server/validation/TestBeanValidation.java
new file mode 100644
index 0000000000..8f6928fc35
--- /dev/null
+++ b/tests/server-side/com/vaadin/tests/server/validation/TestBeanValidation.java
@@ -0,0 +1,57 @@
+package com.vaadin.tests.server.validation;
+
+import org.junit.Test;
+
+import com.vaadin.data.Validator.InvalidValueException;
+import com.vaadin.data.validator.BeanValidator;
+import com.vaadin.tests.data.bean.BeanToValidate;
+
+public class TestBeanValidation {
+ @Test(expected = InvalidValueException.class)
+ public void testBeanValidationNull() {
+ BeanValidator validator = new BeanValidator(BeanToValidate.class,
+ "firstname");
+ validator.validate(null);
+ }
+
+ @Test(expected = InvalidValueException.class)
+ public void testBeanValidationStringTooShort() {
+ BeanValidator validator = new BeanValidator(BeanToValidate.class,
+ "firstname");
+ validator.validate("aa");
+ }
+
+ @Test
+ public void testBeanValidationStringOk() {
+ BeanValidator validator = new BeanValidator(BeanToValidate.class,
+ "firstname");
+ validator.validate("aaa");
+ }
+
+ @Test(expected = InvalidValueException.class)
+ public void testBeanValidationIntegerTooSmall() {
+ BeanValidator validator = new BeanValidator(BeanToValidate.class, "age");
+ validator.validate(17);
+ }
+
+ @Test
+ public void testBeanValidationIntegerOk() {
+ BeanValidator validator = new BeanValidator(BeanToValidate.class, "age");
+ validator.validate(18);
+ }
+
+ @Test(expected = InvalidValueException.class)
+ public void testBeanValidationTooManyDigits() {
+ BeanValidator validator = new BeanValidator(BeanToValidate.class,
+ "decimals");
+ validator.validate("1234.567");
+ }
+
+ @Test
+ public void testBeanValidationDigitsOk() {
+ BeanValidator validator = new BeanValidator(BeanToValidate.class,
+ "decimals");
+ validator.validate("123.45");
+ }
+
+}
diff --git a/tests/server-side/com/vaadin/tests/server/validation/TestReadOnlyValidation.java b/tests/server-side/com/vaadin/tests/server/validation/TestReadOnlyValidation.java
index c4052c2db8..e37b97e02c 100644
--- a/tests/server-side/com/vaadin/tests/server/validation/TestReadOnlyValidation.java
+++ b/tests/server-side/com/vaadin/tests/server/validation/TestReadOnlyValidation.java
@@ -11,7 +11,7 @@ public class TestReadOnlyValidation {
public void testIntegerValidation() {
TextField field = new TextField();
field.addValidator(new IntegerValidator("Enter a Valid Number"));
- field.setValue(Integer.valueOf(10));
+ field.setValue(String.valueOf(10));
field.validate();
}
}
diff --git a/tests/server-side/com/vaadin/tests/util/GraphVizClassHierarchyCreator.java b/tests/server-side/com/vaadin/tests/util/GraphVizClassHierarchyCreator.java
new file mode 100644
index 0000000000..9e791500b0
--- /dev/null
+++ b/tests/server-side/com/vaadin/tests/util/GraphVizClassHierarchyCreator.java
@@ -0,0 +1,149 @@
+package com.vaadin.tests.util;
+
+import java.lang.reflect.Modifier;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import com.vaadin.tests.VaadinClasses;
+
+public class GraphVizClassHierarchyCreator {
+
+ public static void main(String[] args) {
+ String gv = getGraphVizHierarchy((List) VaadinClasses.getComponents(),
+ "com.vaadin");
+ System.out.println(gv);
+ }
+
+ private static String getGraphVizHierarchy(List<Class> classes,
+ String packageToInclude) {
+ boolean includeInterfaces = false;
+
+ StringBuilder header = new StringBuilder();
+ header.append("digraph finite_state_machine {\n"
+ + " rankdir=BT;\n" + " dpi=\"150\";\n"
+ + " ratio=\"0.25\";\n");
+
+ StringBuilder sb = new StringBuilder();
+
+ Set<Class> classesAndParents = new HashSet<Class>();
+ for (Class<?> cls : classes) {
+ addClassAndParents(classesAndParents, cls, packageToInclude);
+ }
+
+ Set<Class> interfaces = new HashSet<Class>();
+ for (Object cls : classesAndParents.toArray()) {
+ for (Class<?> c : ((Class) cls).getInterfaces()) {
+ addClassAndParentInterfaces(classesAndParents, c,
+ packageToInclude);
+ }
+ }
+
+ for (Class<?> c : classesAndParents) {
+ appendClass(sb, c, c.getSuperclass(), packageToInclude,
+ includeInterfaces);
+ for (Class ci : c.getInterfaces()) {
+ appendClass(sb, c, ci, packageToInclude, includeInterfaces);
+ }
+ }
+
+ header.append(" node [shape = ellipse, style=\"dotted\"] ");
+ for (Class c : classesAndParents) {
+ if (!c.isInterface() && Modifier.isAbstract(c.getModifiers())) {
+ header.append(c.getSimpleName() + " ");
+ }
+ }
+ if (includeInterfaces) {
+ System.out.print(" node [shape = ellipse, style=\"solid\"] ");
+ for (Class c : classesAndParents) {
+ if (c.isInterface()) {
+ header.append(c.getSimpleName() + " ");
+ }
+ }
+ header.append(";\n");
+ }
+ header.append(";\n");
+ header.append(" node [shape = rectangle, style=\"solid\"];\n");
+ return header.toString() + sb.toString() + "}";
+ }
+
+ private static void addClassAndParents(Set<Class> classesAndParents,
+ Class<?> cls, String packageToInclude) {
+
+ if (cls == null) {
+ return;
+ }
+
+ if (classesAndParents.contains(cls)) {
+ return;
+ }
+
+ if (!cls.getPackage().getName().startsWith(packageToInclude)) {
+ return;
+ }
+
+ classesAndParents.add(cls);
+ addClassAndParents(classesAndParents, cls.getSuperclass(),
+ packageToInclude);
+
+ }
+
+ private static void addClassAndParentInterfaces(
+ Set<Class> classesAndParents, Class<?> cls, String packageToInclude) {
+
+ if (cls == null) {
+ return;
+ }
+
+ if (classesAndParents.contains(cls)) {
+ return;
+ }
+
+ if (!cls.getPackage().getName().startsWith(packageToInclude)) {
+ return;
+ }
+
+ classesAndParents.add(cls);
+ for (Class iClass : cls.getInterfaces()) {
+ addClassAndParentInterfaces(classesAndParents, iClass,
+ packageToInclude);
+ }
+
+ }
+
+ private static void appendClass(StringBuilder sb, Class<?> c,
+ Class<?> superClass, String packageToInclude,
+ boolean includeInterfaces) {
+ if (superClass == null) {
+ return;
+ }
+ if (!c.getPackage().getName().startsWith(packageToInclude)) {
+ return;
+ }
+ if (!superClass.getPackage().getName().startsWith(packageToInclude)) {
+ return;
+ }
+ if (!includeInterfaces && (c.isInterface() || superClass.isInterface())) {
+ return;
+ }
+
+ sb.append(c.getSimpleName()).append(" -> ")
+ .append(superClass.getSimpleName()).append("\n");
+
+ }
+
+ private static void addInterfaces(Set<Class> interfaces, Class<?> cls) {
+ if (interfaces.contains(cls)) {
+ return;
+ }
+
+ if (cls.isInterface()) {
+ interfaces.add(cls);
+ }
+
+ for (Class c : cls.getInterfaces()) {
+ addInterfaces(interfaces, c);
+ }
+ }
+
+}
diff --git a/tests/server-side/com/vaadin/tests/util/TestUtil.java b/tests/server-side/com/vaadin/tests/util/TestUtil.java
new file mode 100644
index 0000000000..e84f9dd8b9
--- /dev/null
+++ b/tests/server-side/com/vaadin/tests/util/TestUtil.java
@@ -0,0 +1,43 @@
+package com.vaadin.tests.util;
+
+import java.util.Iterator;
+
+import junit.framework.Assert;
+
+public class TestUtil {
+ public static void assertArrays(Object[] actualObjects,
+ Object[] expectedObjects) {
+ Assert.assertEquals(
+ "Actual contains a different number of values than was expected",
+ expectedObjects.length, actualObjects.length);
+
+ for (int i = 0; i < actualObjects.length; i++) {
+ Object actual = actualObjects[i];
+ Object expected = expectedObjects[i];
+
+ Assert.assertEquals("Item[" + i + "] does not match", expected,
+ actual);
+ }
+
+ }
+
+ public static void assertIterableEquals(Iterable<?> iterable1,
+ Iterable<?> iterable2) {
+ Iterator<?> i1 = iterable1.iterator();
+ Iterator<?> i2 = iterable2.iterator();
+
+ while (i1.hasNext()) {
+ Object o1 = i1.next();
+ if (!i2.hasNext()) {
+ Assert.fail("The second iterable contains fewer items than the first. The object "
+ + o1 + " has no match in the second iterable.");
+ }
+ Object o2 = i2.next();
+ Assert.assertEquals(o1, o2);
+ }
+ if (i2.hasNext()) {
+ Assert.fail("The second iterable contains more items than the first. The object "
+ + i2.next() + " has no match in the first iterable.");
+ }
+ }
+}
diff --git a/tests/test.xml b/tests/test.xml
index 39d45d2a74..9d060c9a29 100644
--- a/tests/test.xml
+++ b/tests/test.xml
@@ -1,11 +1,17 @@
<?xml version="1.0"?>
-
-<project name="Run Vaadin Testbench Tests" basedir="." default="run-and-clean-up">
+<project xmlns:antcontrib="antlib:net.sf.antcontrib"
+ xmlns:ivy="antlib:org.apache.ivy.ant"
+ name="Run Vaadin Testbench Tests" basedir="." default="run-and-clean-up">
+
+ <property name="project.root" value=".."/>
+ <!-- Import common targets -->
+ <import file="../build/common.xml" />
+
<!-- ================================================================== -->
<!-- Configuration -->
<!-- ================================================================== -->
<!-- Browsers to use for testing -->
- <property name="browsers-windows" value="winxp-ie6,winxp-ie7,winxp-ie8,win7-ie9,winxp-firefox36,winxp-firefox9,winxp-safari4,winxp-safari5,winxp-googlechrome13,winxp-googlechrome-stable,winxp-opera1060,winxp-opera11" />
+ <property name="browsers-windows" value="winxp-ie8,win7-ie9,winxp-firefox9,winxp-safari5,winxp-googlechrome-stable,winxp-opera11" />
<property name="browsers-linux" value="linux-firefox3,linux-opera10,linux-googlechrome8" />
<property name="browsers-mac" value="osx-firefox3,osx-opera10,osx-googlechrome8,osx-safari4,osx-safari5" />
@@ -27,21 +33,19 @@
<property name="com.vaadin.testbench.debug" value="false"/>
<!-- Temporary output directory, created and removed by this script -->
- <!-- <property name="test-output-dir" value="../build/test-output" /> -->
- <fail unless="test-output-dir" message="The 'test-output-dir' property must be defined." />
-
+ <fail unless="test-output-dir" message="The 'test-output-dir' property must be defined." />
+
<property name="class-dir" value="${test-output-dir}/classes" />
- <taskdef resource="net/sf/antcontrib/antlib.xml">
- <classpath>
- <pathelement location="../build/lib/ant-contrib-1.0b3.jar" />
- </classpath>
- </taskdef>
-
- <!-- classpath must include test bench jar and its dependencies -->
- <path id="classpath">
- <fileset dir="${com.vaadin.testbench.lib.dir}" includes="**/*.jar" />
- <fileset dir="../build/lib" includes="emma*.jar" />
- </path>
+
+ <target name="initialize" depends="common.init-deps">
+ <ivy:resolve conf="emma"/>
+ <ivy:cachepath pathid="emma.lib" conf="emma" />
+ <!-- classpath must include test bench jar and its dependencies -->
+ <path id="classpath">
+ <fileset dir="${com.vaadin.testbench.lib.dir}" includes="**/*.jar" />
+ <path refid="emma.lib" />
+ </path>
+ </target>
<!-- fileset containing all TestBench tests to run -->
<fileset dir=".." id="html-test-files">
@@ -51,7 +55,7 @@
</fileset>
<!-- This target converts HTML tests files to java junit tests. One test file for each browser is created. -->
- <target name="create-tests" depends="remove-temp-testclasses" if="server.start.succeeded">
+ <target name="create-tests" depends="initialize, remove-temp-testclasses">
<pathconvert pathsep=" " property="testfiles" refid="html-test-files" />
<java classname="com.vaadin.testbench.util.TestConverter" classpathref="classpath" fork="true">
@@ -68,51 +72,13 @@
<!-- This target complies the generated java junit tests. -->
<target name="compile-tests" depends="create-tests">
<mkdir dir="${class-dir}" />
- <javac srcdir="${test-output-dir}" destdir="${class-dir}" debug="on" fork="yes" failonerror="false" encoding="UTF8">
+ <javac includeantruntime="false" srcdir="${test-output-dir}" destdir="${class-dir}" debug="on" fork="yes" failonerror="false" encoding="UTF8">
<classpath>
<path refid="classpath" />
</classpath>
</javac>
</target>
-
- <!-- ================================================================== -->
- <!-- Vaadin Server Management -->
- <!-- ================================================================== -->
-
- <target name="server-start">
- <fail unless="output-dir" message="The 'output-dir' (usually build/result/vaadin-xxx) should be given to test script." />
- <fail unless="package.name" message="The 'package.name' property must be defined." />
- <fail unless="package.filename" message="The 'package.filename' property must be defined." />
- <fail unless="testing.testarea" message="The 'testing.testarea' property must be defined." />
-
- <echo>Package name: ${package.name}</echo>
- <echo>Package filename: ${package.filename}</echo>
- <echo>Testing area: ${testing.testarea}</echo>
-
- <exec executable="python" searchpath="true" dir=".." resultproperty="server.start.result">
- <arg value="build/testing/vaadin-server.py" />
- <arg value="start" />
- <arg value="${package.name}" />
- <arg value="${package.filename}" />
- <arg value="${output-dir}" />
- <arg value="${testing.testarea}" />
- </exec>
-
- <condition property="server.start.succeeded">
- <equals arg1="${server.start.result}" arg2="0" />
- </condition>
- </target>
-
- <target name="server-stop">
- <sleep seconds="5" />
- <exec executable="python" dir=".." searchpath="true" resultproperty="server.stop.result">
- <arg value="build/testing/vaadin-server.py" />
- <arg value="stop" />
- </exec>
- <move file="${testing.testarea}/${package.name}/war.ec" todir="../build/result" failonerror="false" />
- </target>
-
<!-- ================================================================== -->
<!-- Running Tests -->
<!-- ================================================================== -->
@@ -123,22 +89,22 @@
<fail unless="com.vaadin.testbench.deployment.url" message="The 'com.vaadin.testbench.deployment.url' property must be defined." />
</target>
- <target name="run-tests" depends="compile-tests" if="server.start.succeeded">
+ <target name="run-tests" depends="compile-tests">
<fileset dir="${test-output-dir}" id="tests-fileset">
<include name="**/**.java" />
</fileset>
-
-
- <for threadCount="30" parallel="true" keepgoing="true" param="target">
+
+ <antcontrib:for threadCount="30" parallel="true" keepgoing="true" param="target">
<path>
<fileset refid="tests-fileset" />
</path>
<sequential>
<antcall target="execute-tests">
<param name="target" value="@{target}" />
+ <reference refid="classpath" />
</antcall>
</sequential>
- </for>
+ </antcontrib:for>
</target>
<!-- This target runs the generated and compiled junit tests -->
@@ -198,11 +164,19 @@
<!-- ================================================================== -->
<!-- The default target. -->
- <target name="run-and-clean-up" depends="check-parameters,remove-error-screens,run-tests" if="server.start.succeeded">
- </target>
+ <target name="run-and-clean-up" depends="check-parameters,remove-error-screens,run-tests" />
<!-- Also starts the server. -->
- <target name="test-package" depends="server-start, run-and-clean-up, server-stop">
- </target>
-
-</project> \ No newline at end of file
+ <target name="test-package">
+ <parallel>
+ <daemons>
+ <ant antfile="vaadin-server.xml" inheritall="true" inheritrefs="true" target="deploy-and-start" />
+ </daemons>
+ <sequential>
+ <ant antfile="vaadin-server.xml" target="wait-for-startup" />
+ <antcall inheritall="true" inheritrefs="true" target="run-and-clean-up" />
+ <move file="${testing.testarea}/${package.name}/war.ec" todir="../build/result" failonerror="false" />
+ </sequential>
+ </parallel>
+ </target>
+</project>
diff --git a/tests/testbench/com/vaadin/tests/Components.java b/tests/testbench/com/vaadin/tests/Components.java
index 3366f6db43..fa82948e2b 100644
--- a/tests/testbench/com/vaadin/tests/Components.java
+++ b/tests/testbench/com/vaadin/tests/Components.java
@@ -24,18 +24,19 @@ import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Tree;
import com.vaadin.ui.Tree.ItemStyleGenerator;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Components extends Application {
+public class Components extends Application.LegacyApplication {
private static final Object CAPTION = "c";
private Map<Class<? extends AbstractComponentTest>, String> tests = new HashMap<Class<? extends AbstractComponentTest>, String>();
private Tree naviTree;
private HorizontalSplitPanel sp;
- private Window mainWindow;
+ private LegacyWindow mainWindow;
private final Embedded applicationEmbedder = new Embedded();
private String baseUrl;
private List<Class<? extends Component>> componentsWithoutTests = new ArrayList<Class<? extends Component>>();
@@ -85,7 +86,7 @@ public class Components extends Application {
@Override
public void init() {
- mainWindow = new Window();
+ mainWindow = new LegacyWindow();
setTheme("tests-components");
mainWindow.getContent().setSizeFull();
setMainWindow(mainWindow);
@@ -95,7 +96,7 @@ public class Components extends Application {
naviLayout
.addComponent(new Label(
"Click to open a test case.<br/>Right click to open test in a new window<br/><br/>",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
naviLayout.addComponent(createMenu());
naviLayout.addComponent(createMissingTestsList());
@@ -106,7 +107,7 @@ public class Components extends Application {
embeddingLayout
.addComponent(new Label(
"<b>Do not use the embedded version for creating automated tests. Open the test in a new window before recording.</b><br/>",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
applicationEmbedder.setSizeFull();
embeddingLayout.addComponent(applicationEmbedder);
embeddingLayout.setExpandRatio(applicationEmbedder, 1);
@@ -129,7 +130,7 @@ public class Components extends Application {
+ component.getSimpleName() + "</font><br/>";
}
return new Label("<b>Components without a test:</B><br/>"
- + missingTests, Label.CONTENT_XHTML);
+ + missingTests, ContentMode.XHTML);
}
private Component createMenu() {
diff --git a/tests/testbench/com/vaadin/tests/CustomLayoutDemo.java b/tests/testbench/com/vaadin/tests/CustomLayoutDemo.java
index 2b45ef7458..62340b7c9e 100644
--- a/tests/testbench/com/vaadin/tests/CustomLayoutDemo.java
+++ b/tests/testbench/com/vaadin/tests/CustomLayoutDemo.java
@@ -5,16 +5,18 @@
package com.vaadin.tests;
import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component.Event;
import com.vaadin.ui.Component.Listener;
import com.vaadin.ui.CustomLayout;
import com.vaadin.ui.Field;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Panel;
import com.vaadin.ui.PasswordField;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Tree;
-import com.vaadin.ui.Window;
/**
* This example demonstrates custom layout. All components created here are
@@ -29,8 +31,8 @@ import com.vaadin.ui.Window;
* @since 4.0.0
*
*/
-public class CustomLayoutDemo extends com.vaadin.Application implements
- Listener {
+public class CustomLayoutDemo extends com.vaadin.Application.LegacyApplication
+ implements Listener {
private CustomLayout mainLayout = null;
@@ -40,7 +42,13 @@ public class CustomLayoutDemo extends com.vaadin.Application implements
private final PasswordField loginPwd = new PasswordField("Password");
- private final Button loginButton = new Button("Login", this, "loginClicked");
+ private final Button loginButton = new Button("Login",
+ new Button.ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ loginClicked();
+ }
+ });
private final Tree menu = new Tree();
@@ -49,7 +57,7 @@ public class CustomLayoutDemo extends com.vaadin.Application implements
*/
@Override
public void init() {
- final Window mainWindow = new Window("CustomLayout demo");
+ final LegacyWindow mainWindow = new LegacyWindow("CustomLayout demo");
setMainWindow(mainWindow);
// set the application to use example -theme
@@ -89,7 +97,7 @@ public class CustomLayoutDemo extends com.vaadin.Application implements
// Add heading label and custom layout panel to main window
mainWindow.addComponent(new Label("<h3>Custom layout demo</h3>",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
mainWindow.addComponent(customLayoutPanel);
}
@@ -105,7 +113,7 @@ public class CustomLayoutDemo extends com.vaadin.Application implements
username.setValue("Anonymous");
}
mainLayout.replaceComponent(loginButton, new Label("Welcome user <em>"
- + username.getValue() + "</em>", Label.CONTENT_XHTML));
+ + username.getValue() + "</em>", ContentMode.XHTML));
}
/**
diff --git a/tests/testbench/com/vaadin/tests/LayoutDemo.java b/tests/testbench/com/vaadin/tests/LayoutDemo.java
index 989a4822ad..d88285468e 100644
--- a/tests/testbench/com/vaadin/tests/LayoutDemo.java
+++ b/tests/testbench/com/vaadin/tests/LayoutDemo.java
@@ -10,11 +10,12 @@ import com.vaadin.ui.Embedded;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
/**
* This example demonstrates layouts. Layouts are populated with sample Vaadin
@@ -24,14 +25,14 @@ import com.vaadin.ui.Window;
* @since 4.0.0
*
*/
-public class LayoutDemo extends com.vaadin.Application {
+public class LayoutDemo extends com.vaadin.Application.LegacyApplication {
/**
* Initialize Application. Demo components are added to main window.
*/
@Override
public void init() {
- final Window mainWindow = new Window("Layout demo");
+ final LegacyWindow mainWindow = new LegacyWindow("Layout demo");
setMainWindow(mainWindow);
//
@@ -85,25 +86,23 @@ public class LayoutDemo extends com.vaadin.Application {
//
mainWindow.addComponent(new Label(
"<h3>Horizontal ordered layout</h3>Added four components.",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
mainWindow.addComponent(layoutA);
mainWindow.addComponent(new Label(
"<br /><h3>Vertical ordered layout</h3>Added four components.",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
mainWindow.addComponent(layoutB);
mainWindow.addComponent(new Label(
"<br /><h3>Grid Layout (4 x 4)</h3>Added 16 components.",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
mainWindow.addComponent(layoutG);
- mainWindow
- .addComponent(new Label("<br /><h3>Grid Layout (4 x 4)</h3>"
- + "Added four panels and four embedded components "
- + "diagonally with absolute coordinates.",
- Label.CONTENT_XHTML));
+ mainWindow.addComponent(new Label("<br /><h3>Grid Layout (4 x 4)</h3>"
+ + "Added four panels and four embedded components "
+ + "diagonally with absolute coordinates.", ContentMode.XHTML));
mainWindow.addComponent(layoutG2);
mainWindow.addComponent(new Label(
"<br /><h3>TabSheet</h3>Added above layouts as tabs.",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
mainWindow.addComponent(tabsheet);
}
@@ -124,7 +123,7 @@ public class LayoutDemo extends com.vaadin.Application {
+ "extremities and may have a caption to clarify the nature of the contained components' purpose."
+ " Panel contains an layout where the actual contained components are added, "
+ "this layout may be switched on the fly.",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
panel.setWidth("222px");
return panel;
}
diff --git a/tests/testbench/com/vaadin/tests/ListenerOrder.java b/tests/testbench/com/vaadin/tests/ListenerOrder.java
index c1d6245222..797561eb00 100644
--- a/tests/testbench/com/vaadin/tests/ListenerOrder.java
+++ b/tests/testbench/com/vaadin/tests/ListenerOrder.java
@@ -13,12 +13,12 @@ import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Select;
-import com.vaadin.ui.Window;
-public class ListenerOrder extends com.vaadin.Application implements
- Button.ClickListener, PropertySetChangeListener, ItemSetChangeListener,
- ValueChangeListener {
+public class ListenerOrder extends com.vaadin.Application.LegacyApplication
+ implements Button.ClickListener, PropertySetChangeListener,
+ ItemSetChangeListener, ValueChangeListener {
Button b1;
@@ -32,7 +32,7 @@ public class ListenerOrder extends com.vaadin.Application implements
}
public void createNewView() {
- final Window main = new Window("Test window");
+ final LegacyWindow main = new LegacyWindow("Test window");
setMainWindow(main);
main.removeAllComponents();
@@ -49,12 +49,12 @@ public class ListenerOrder extends com.vaadin.Application implements
addListeners(b1, 1);
b1.addListener(mutualListener);
b1.addListener(mutualListener);
- b1.addListener((Button.ClickListener) this);
+ b1.addListener(this);
b1.addListener(mutualListener);
Button.ClickListener b1Listener = addListeners(b1, 3);
b1.addListener(mutualListener);
- b1.addListener((Button.ClickListener) this);
- b1.addListener((ValueChangeListener) this);
+ b1.addListener(this);
+ // b1.addListener((ValueChangeListener) this);
b1.addListener(mutualListener);
b1.removeListener(b1Listener);
// remove non-existing listener
diff --git a/tests/testbench/com/vaadin/tests/ModalWindow.java b/tests/testbench/com/vaadin/tests/ModalWindow.java
index 84adaf1a39..c848803642 100644
--- a/tests/testbench/com/vaadin/tests/ModalWindow.java
+++ b/tests/testbench/com/vaadin/tests/ModalWindow.java
@@ -8,6 +8,7 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Window;
@@ -21,8 +22,8 @@ import com.vaadin.ui.Window;
* @see com.vaadin.ui.Window
* @see com.vaadin.ui.Label
*/
-public class ModalWindow extends com.vaadin.Application implements
- ClickListener {
+public class ModalWindow extends com.vaadin.Application.LegacyApplication
+ implements ClickListener {
private Window test;
private Button reopen;
@@ -31,7 +32,7 @@ public class ModalWindow extends com.vaadin.Application implements
public void init() {
// Create main window
- final Window main = new Window("ModalWindow demo");
+ final LegacyWindow main = new LegacyWindow("ModalWindow demo");
setMainWindow(main);
main.addComponent(new Label("ModalWindow demo"));
diff --git a/tests/testbench/com/vaadin/tests/NativeWindowing.java b/tests/testbench/com/vaadin/tests/NativeWindowing.java
index f148c6a835..1a22b5a4d2 100644
--- a/tests/testbench/com/vaadin/tests/NativeWindowing.java
+++ b/tests/testbench/com/vaadin/tests/NativeWindowing.java
@@ -11,11 +11,13 @@ import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Window;
-public class NativeWindowing extends Application {
+public class NativeWindowing extends Application.LegacyApplication {
- Window main = new Window("Windowing test");
+ LegacyWindow main = new LegacyWindow("Windowing test");
@Override
public void init() {
@@ -68,7 +70,7 @@ public class NativeWindowing extends Application {
+ "<p>Lorem ipsum dolor sit amet.</p>"
+ "<p>Lorem ipsum dolor sit amet.</p>"
+ "<p>Lorem ipsum dolor sit amet.</p>",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
}
}));
@@ -95,16 +97,16 @@ public class NativeWindowing extends Application {
}
@Override
- public Window getWindow(String name) {
+ public LegacyWindow getWindow(String name) {
- final Window w = super.getWindow(name);
+ final LegacyWindow w = super.getWindow(name);
if (w != null) {
return w;
}
if (name != null && name.startsWith("mainwin-")) {
final String postfix = name.substring("mainwin-".length());
- final Window ww = new Window("Window: " + postfix);
+ final LegacyWindow ww = new LegacyWindow("Window: " + postfix);
ww.setName(name);
ww.addComponent(new Label(
"This is a application-level window opened with name: "
diff --git a/tests/testbench/com/vaadin/tests/Parameters.java b/tests/testbench/com/vaadin/tests/Parameters.java
index 8b8bec8834..8d940101c3 100644
--- a/tests/testbench/com/vaadin/tests/Parameters.java
+++ b/tests/testbench/com/vaadin/tests/Parameters.java
@@ -4,21 +4,23 @@
package com.vaadin.tests;
+import java.io.IOException;
import java.net.URL;
import java.util.Iterator;
import java.util.Map;
-import com.vaadin.terminal.DownloadStream;
+import com.vaadin.Application;
import com.vaadin.terminal.ExternalResource;
-import com.vaadin.terminal.ParameterHandler;
-import com.vaadin.terminal.URIHandler;
+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.Link;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
/**
* This is a demonstration of how URL parameters can be recieved and handled.
@@ -27,8 +29,8 @@ import com.vaadin.ui.Window;
*
* @since 3.1.1
*/
-public class Parameters extends com.vaadin.Application implements URIHandler,
- ParameterHandler {
+public class Parameters extends com.vaadin.Application.LegacyApplication
+ implements RequestHandler {
private final Label context = new Label();
@@ -38,12 +40,11 @@ public class Parameters extends com.vaadin.Application implements URIHandler,
@Override
public void init() {
- final Window main = new Window("Parameters demo");
+ final LegacyWindow main = new LegacyWindow("Parameters demo");
setMainWindow(main);
// This class acts both as URI handler and parameter handler
- main.addURIHandler(this);
- main.addParameterHandler(this);
+ addRequestHandler(this);
final VerticalLayout layout = new VerticalLayout();
final Label info = new Label("To test URI and Parameter Handlers, "
@@ -92,24 +93,14 @@ public class Parameters extends com.vaadin.Application implements URIHandler,
main.setContent(layout);
}
- /**
- * Update URI
- *
- * @see com.vaadin.terminal.URIHandler#handleURI(URL, String)
- */
- @Override
- public DownloadStream handleURI(URL context, String relativeUri) {
- this.context.setValue(context.toString());
- relative.setValue(relativeUri);
- return null;
- }
+ public boolean handleRequest(Application application,
+ WrappedRequest request, WrappedResponse response)
+ throws IOException {
+ context.setValue("Context not available");
+ relative.setValue(request.getRequestPathInfo());
- /**
- * Handles GET parameters, in this demo GET parameteres are used to
- * communicate with EmbeddedToolkit.jsp
- */
- public void handleParameters(Map<String, String[]> parameters) {
params.removeAllItems();
+ Map<String, String[]> parameters = request.getParameterMap();
for (final Iterator<String> i = parameters.keySet().iterator(); i
.hasNext();) {
final String name = i.next();
@@ -123,5 +114,7 @@ public class Parameters extends com.vaadin.Application implements URIHandler,
}
params.addItem(new Object[] { name, v }, name);
}
+
+ return false;
}
}
diff --git a/tests/testbench/com/vaadin/tests/PerformanceTestBasicComponentRendering.java b/tests/testbench/com/vaadin/tests/PerformanceTestBasicComponentRendering.java
index 00f98657b8..a0bd894ebe 100644
--- a/tests/testbench/com/vaadin/tests/PerformanceTestBasicComponentRendering.java
+++ b/tests/testbench/com/vaadin/tests/PerformanceTestBasicComponentRendering.java
@@ -13,6 +13,7 @@ import com.vaadin.ui.ComboBox;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.DateField;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
@@ -102,7 +103,7 @@ public class PerformanceTestBasicComponentRendering extends CustomComponent {
}
private void addInfo() {
- main.addComponent(new Label(DESCRIPTION, Label.CONTENT_XHTML));
+ main.addComponent(new Label(DESCRIPTION, ContentMode.XHTML));
}
}
diff --git a/tests/testbench/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java b/tests/testbench/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java
index 9e4aac05d4..93df046fa0 100644
--- a/tests/testbench/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java
+++ b/tests/testbench/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java
@@ -12,6 +12,7 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.VerticalLayout;
public class PerformanceTestLabelsAndOrderedLayouts extends CustomComponent {
@@ -73,7 +74,7 @@ public class PerformanceTestLabelsAndOrderedLayouts extends CustomComponent {
}
private void addInfo() {
- main.addComponent(new Label(DESCRIPTION, Label.CONTENT_XHTML));
+ main.addComponent(new Label(DESCRIPTION, ContentMode.XHTML));
}
}
diff --git a/tests/testbench/com/vaadin/tests/PerformanceTestSubTreeCaching.java b/tests/testbench/com/vaadin/tests/PerformanceTestSubTreeCaching.java
index 4d36da40b5..40433fae84 100644
--- a/tests/testbench/com/vaadin/tests/PerformanceTestSubTreeCaching.java
+++ b/tests/testbench/com/vaadin/tests/PerformanceTestSubTreeCaching.java
@@ -7,8 +7,10 @@ package com.vaadin.tests;
import java.util.Date;
import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
@@ -36,10 +38,18 @@ public class PerformanceTestSubTreeCaching extends CustomComponent {
setCompositionRoot(main);
addInfo();
- Button b = new Button("start test", this, "startTest");
+ Button b = new Button("start test", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ startTest();
+ }
+ });
b.setDescription("Push this button to start test. A test label will be rendered above existing components.");
main.addComponent(b);
- b = new Button("end test", this, "endTest");
+ b = new Button("end test", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ endTest();
+ }
+ });
b.setDescription("Push this button as soon as test componenet is rendered.");
main.addComponent(b);
@@ -77,7 +87,7 @@ public class PerformanceTestSubTreeCaching extends CustomComponent {
}
private void addInfo() {
- main.addComponent(new Label(DESCRIPTION, Label.CONTENT_XHTML));
+ main.addComponent(new Label(DESCRIPTION, ContentMode.XHTML));
}
}
diff --git a/tests/testbench/com/vaadin/tests/RandomLayoutStress.java b/tests/testbench/com/vaadin/tests/RandomLayoutStress.java
index d6f896527b..0390ea8157 100644
--- a/tests/testbench/com/vaadin/tests/RandomLayoutStress.java
+++ b/tests/testbench/com/vaadin/tests/RandomLayoutStress.java
@@ -17,11 +17,11 @@ import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Link;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Select;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
/**
* This example demonstrates layouts. Layouts are populated with sample Vaadin
@@ -30,7 +30,8 @@ import com.vaadin.ui.Window;
* @author Vaadin Ltd.
*
*/
-public class RandomLayoutStress extends com.vaadin.Application {
+public class RandomLayoutStress extends
+ com.vaadin.Application.LegacyApplication {
private final Random seededRandom = new Random(1);
@@ -48,7 +49,7 @@ public class RandomLayoutStress extends com.vaadin.Application {
*/
@Override
public void init() {
- final Window mainWindow = new Window("Layout demo");
+ final LegacyWindow mainWindow = new LegacyWindow("Layout demo");
setMainWindow(mainWindow);
// Create horizontal ordered layout
diff --git a/tests/testbench/com/vaadin/tests/ScrollbarStressTest.java b/tests/testbench/com/vaadin/tests/ScrollbarStressTest.java
index a66274a635..bd40a7fb7b 100644
--- a/tests/testbench/com/vaadin/tests/ScrollbarStressTest.java
+++ b/tests/testbench/com/vaadin/tests/ScrollbarStressTest.java
@@ -10,15 +10,16 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.OptionGroup;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
import com.vaadin.ui.Window;
-public class ScrollbarStressTest extends Application {
+public class ScrollbarStressTest extends Application.LegacyApplication {
- final Window main = new Window("Scrollbar Stress Test");
+ final LegacyWindow main = new LegacyWindow("Scrollbar Stress Test");
final Panel panel = new Panel("Panel");
final VerticalSplitPanel splitPanel = new VerticalSplitPanel();
diff --git a/tests/testbench/com/vaadin/tests/TestBench.java b/tests/testbench/com/vaadin/tests/TestBench.java
index b15e3994b5..c3bb24cbef 100644
--- a/tests/testbench/com/vaadin/tests/TestBench.java
+++ b/tests/testbench/com/vaadin/tests/TestBench.java
@@ -23,11 +23,11 @@ import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Link;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.Root.FragmentChangedEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Tree;
-import com.vaadin.ui.UriFragmentUtility;
-import com.vaadin.ui.UriFragmentUtility.FragmentChangedEvent;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
/**
* TestBench finds out testable classes within given java packages and adds them
@@ -39,8 +39,8 @@ import com.vaadin.ui.Window;
* @author Vaadin Ltd.
*
*/
-public class TestBench extends com.vaadin.Application implements
- Property.ValueChangeListener {
+public class TestBench extends com.vaadin.Application.LegacyApplication
+ implements Property.ValueChangeListener {
// Add here packages which are used for finding testable classes
String[] testablePackages = { "com.vaadin.tests",
@@ -48,7 +48,7 @@ public class TestBench extends com.vaadin.Application implements
HierarchicalContainer testables = new HierarchicalContainer();
- Window mainWindow = new Window("TestBench window");
+ LegacyWindow mainWindow = new LegacyWindow("TestBench window");
// Main layout consists of tree menu and body layout
HorizontalSplitPanel mainLayout = new HorizontalSplitPanel();
@@ -119,12 +119,9 @@ public class TestBench extends com.vaadin.Application implements
VerticalLayout lo = new VerticalLayout();
lo.addComponent(menu);
- UriFragmentUtility uri = new UriFragmentUtility();
- lo.addComponent(uri);
-
- uri.addListener(new UriFragmentUtility.FragmentChangedListener() {
+ mainWindow.addListener(new Root.FragmentChangedListener() {
public void fragmentChanged(FragmentChangedEvent source) {
- String fragment = source.getUriFragmentUtility().getFragment();
+ String fragment = source.getFragment();
if (fragment != null && !"".equals(fragment)) {
// try to find a proper test class
@@ -213,7 +210,8 @@ public class TestBench extends com.vaadin.Application implements
private Component createTestable(Class<?> c) {
try {
- final Application app = (Application) c.newInstance();
+ final Application.LegacyApplication app = (Application.LegacyApplication) c
+ .newInstance();
app.init();
Layout lo = (Layout) app.getMainWindow().getContent();
lo.setParent(null);
diff --git a/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java b/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java
index b0ccca2480..89822a9574 100644
--- a/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java
+++ b/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java
@@ -17,6 +17,7 @@ import com.vaadin.ui.DateField;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Link;
import com.vaadin.ui.NativeSelect;
@@ -161,7 +162,7 @@ public class TestCaptionWrapper extends CustomComponent implements Listener {
// Custom components
layout.addComponent(new Label("<B>Below are few custom components</B>",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
final TestForUpload tfu = new TestForUpload();
layout.addComponent(tfu);
diff --git a/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java b/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java
index 62a67cb747..48eff0336e 100644
--- a/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java
+++ b/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java
@@ -8,9 +8,10 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
/**
* @author marc
@@ -91,12 +92,13 @@ public class TestComponentAddAndRecursion extends CustomComponent {
public void buttonClick(ClickEvent event) {
try {
p3.addComponent(p2);
- getWindow().showNotification("ERROR",
+ Root.getCurrentRoot().showNotification("ERROR",
"This should have failed",
- Window.Notification.TYPE_ERROR_MESSAGE);
+ Notification.TYPE_ERROR_MESSAGE);
} catch (Exception e) {
- getWindow().showNotification("OK", "threw, as expected",
- Window.Notification.TYPE_ERROR_MESSAGE);
+ Root.getCurrentRoot().showNotification("OK",
+ "threw, as expected",
+ Notification.TYPE_ERROR_MESSAGE);
}
}
@@ -109,12 +111,13 @@ public class TestComponentAddAndRecursion extends CustomComponent {
p.addComponent(p2);
try {
p3.addComponent(p);
- getWindow().showNotification("ERROR",
+ Root.getCurrentRoot().showNotification("ERROR",
"This should have failed",
- Window.Notification.TYPE_ERROR_MESSAGE);
+ Notification.TYPE_ERROR_MESSAGE);
} catch (Exception e) {
- getWindow().showNotification("OK", "threw, as expected",
- Window.Notification.TYPE_ERROR_MESSAGE);
+ Root.getCurrentRoot().showNotification("OK",
+ "threw, as expected",
+ Notification.TYPE_ERROR_MESSAGE);
}
}
diff --git a/tests/testbench/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java b/tests/testbench/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java
index 74ca67987d..c4b96e59b4 100644
--- a/tests/testbench/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java
+++ b/tests/testbench/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java
@@ -7,15 +7,15 @@ package com.vaadin.tests;
import com.vaadin.Application;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
-import com.vaadin.ui.Window;
public class TestForApplicationLayoutThatUsesWholeBrosersSpace extends
- Application {
+ Application.LegacyApplication {
- Window main = new Window("Windowing test");
+ LegacyWindow main = new LegacyWindow("Windowing test");
VerticalLayout rootLayout;
diff --git a/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java b/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java
index 0dd0fdb1bb..eb18f70e2f 100644
--- a/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java
+++ b/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java
@@ -9,6 +9,7 @@ import java.util.Iterator;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
@@ -51,14 +52,21 @@ public class TestForChildComponentRendering extends CustomComponent {
se.addItem("valinta1");
se.addItem("Valinta 2");
- Button b = new Button("refresh view", this, "createNewView");
+ Button b = new Button("refresh view", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ createNewView();
+ }
+ });
main.addComponent(b);
- b = new Button("reorder view", this, "randomReorder");
+ b = new Button("reorder view", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ randomReorder();
+ }
+ });
main.addComponent(b);
- b = new Button("remove randomly one component", this,
- "removeRandomComponent");
+ b = new Button("remove randomly one component", new Button.ClickListener() { public void buttonClick(ClickEvent event) { removeRandomComponent();}});
main.addComponent(b);
}
diff --git a/tests/testbench/com/vaadin/tests/TestForContainerFilterable.java b/tests/testbench/com/vaadin/tests/TestForContainerFilterable.java
index 395f677723..92b7ae4f62 100644
--- a/tests/testbench/com/vaadin/tests/TestForContainerFilterable.java
+++ b/tests/testbench/com/vaadin/tests/TestForContainerFilterable.java
@@ -62,12 +62,12 @@ public class TestForContainerFilterable extends CustomComponent {
filterButton.addListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
ic.removeAllContainerFilters();
- if (fooFilter.toString().length() > 0) {
- ic.addContainerFilter("foo", fooFilter.toString(), false,
+ if (fooFilter.getValue().length() > 0) {
+ ic.addContainerFilter("foo", fooFilter.getValue(), false,
false);
}
- if (barFilter.toString().length() > 0) {
- ic.addContainerFilter("bar", barFilter.toString(), true,
+ if (barFilter.getValue().length() > 0) {
+ ic.addContainerFilter("bar", barFilter.getValue(), true,
true);
}
count.setValue("Rows in table: " + ic.size());
diff --git a/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java b/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java
index c1cb7d6bb8..6adcf49ec6 100644
--- a/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java
+++ b/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java
@@ -9,6 +9,7 @@ import java.util.Iterator;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.GridLayout;
@@ -52,14 +53,26 @@ public class TestForGridLayoutChildComponentRendering extends CustomComponent {
main.addComponent(se, 0, 1, 1, 1);
- Button b = new Button("refresh view", this, "createNewView");
+ Button b = new Button("refresh view", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ createNewView();
+ }
+ });
main.addComponent(b);
- b = new Button("reorder view", this, "randomReorder");
+ b = new Button("reorder view", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ randomReorder();
+ }
+ });
main.addComponent(b);
- b = new Button("remove randomly one component", this,
- "removeRandomComponent");
+ b = new Button("remove randomly one component",
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ removeRandomComponent();
+ }
+ });
main.addComponent(b);
}
diff --git a/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java b/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java
index b417d57a56..91ade9b403 100644
--- a/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java
+++ b/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java
@@ -11,11 +11,13 @@ import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Window;
-public class TestForNativeWindowing extends Application {
+public class TestForNativeWindowing extends Application.LegacyApplication {
- Window main = new Window("Windowing test");
+ LegacyWindow main = new LegacyWindow("Windowing test");
@Override
public void init() {
@@ -68,7 +70,7 @@ public class TestForNativeWindowing extends Application {
+ "<p>Lorem ipsum dolor sit amet.</p>"
+ "<p>Lorem ipsum dolor sit amet.</p>"
+ "<p>Lorem ipsum dolor sit amet.</p>",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
}
}));
@@ -95,16 +97,16 @@ public class TestForNativeWindowing extends Application {
}
@Override
- public Window getWindow(String name) {
+ public LegacyWindow getWindow(String name) {
- final Window w = super.getWindow(name);
+ final LegacyWindow w = super.getWindow(name);
if (w != null) {
return w;
}
if (name != null && name.startsWith("mainwin-")) {
final String postfix = name.substring("mainwin-".length());
- final Window ww = new Window("Window: " + postfix);
+ final LegacyWindow ww = new LegacyWindow("Window: " + postfix);
ww.setName(name);
ww.addComponent(new Label(
"This is a application-level window opened with name: "
diff --git a/tests/testbench/com/vaadin/tests/TestForPreconfiguredComponents.java b/tests/testbench/com/vaadin/tests/TestForPreconfiguredComponents.java
index 7ca9fd0cfc..74fdb0c35f 100644
--- a/tests/testbench/com/vaadin/tests/TestForPreconfiguredComponents.java
+++ b/tests/testbench/com/vaadin/tests/TestForPreconfiguredComponents.java
@@ -90,7 +90,11 @@ public class TestForPreconfiguredComponents extends CustomComponent implements
test.setCaption("OptionGroup + multiselect manually (configured from select)");
main.addComponent(test);
- final Button b = new Button("refresh view", this, "createNewView");
+ final Button b = new Button("refresh view", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ createNewView();
+ }
+ });
main.addComponent(b);
}
@@ -160,6 +164,7 @@ public class TestForPreconfiguredComponents extends CustomComponent implements
t.addListener(new Listener() {
public void componentEvent(Event event) {
status.addComponent(new Label(event.getClass().getName()));
+ // TODO should not use Field.toString()
status.addComponent(new Label("selected: "
+ event.getSource().toString()));
}
diff --git a/tests/testbench/com/vaadin/tests/TestForRichTextEditor.java b/tests/testbench/com/vaadin/tests/TestForRichTextEditor.java
index 15caf21b3c..302d28af35 100644
--- a/tests/testbench/com/vaadin/tests/TestForRichTextEditor.java
+++ b/tests/testbench/com/vaadin/tests/TestForRichTextEditor.java
@@ -4,13 +4,14 @@
package com.vaadin.tests;
+import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.RichTextArea;
import com.vaadin.ui.VerticalLayout;
@@ -45,13 +46,14 @@ public class TestForRichTextEditor extends CustomComponent implements
main.addComponent(new Button("commit content to label below"));
- l = new Label("", Label.CONTENT_XHTML);
+ l = new Label("", ContentMode.XHTML);
main.addComponent(l);
CheckBox b = new CheckBox("enabled");
b.setImmediate(true);
- b.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ b.addListener(new Property.ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
rte.setEnabled(!rte.isEnabled());
}
});
diff --git a/tests/testbench/com/vaadin/tests/TestForStyledUpload.java b/tests/testbench/com/vaadin/tests/TestForStyledUpload.java
index 88b71185ae..3b1100bb66 100644
--- a/tests/testbench/com/vaadin/tests/TestForStyledUpload.java
+++ b/tests/testbench/com/vaadin/tests/TestForStyledUpload.java
@@ -19,10 +19,12 @@ import com.vaadin.terminal.StreamResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Link;
import com.vaadin.ui.Panel;
import com.vaadin.ui.ProgressIndicator;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Upload;
import com.vaadin.ui.Upload.FailedEvent;
import com.vaadin.ui.Upload.FailedListener;
@@ -33,10 +35,9 @@ import com.vaadin.ui.Upload.StartedListener;
import com.vaadin.ui.Upload.SucceededEvent;
import com.vaadin.ui.Upload.SucceededListener;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class TestForStyledUpload extends Application implements
- Upload.FinishedListener, FailedListener, SucceededListener,
+public class TestForStyledUpload extends Application.LegacyApplication
+ implements Upload.FinishedListener, FailedListener, SucceededListener,
StartedListener {
Layout main = new VerticalLayout();
@@ -80,9 +81,19 @@ public class TestForStyledUpload extends Application implements
});
- final Button b = new Button("Update status", this, "readState");
+ final Button b = new Button("Update status",
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ readState();
+ }
+ });
- final Button c = new Button("Update status with gc", this, "gc");
+ final Button c = new Button("Update status with gc",
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ gc();
+ }
+ });
main.addComponent(up);
l = new Label("Idle");
@@ -153,11 +164,11 @@ public class TestForStyledUpload extends Application implements
"Upload finished, but output buffer is null!!"));
} else {
status.addComponent(new Label(
- "<b>Name:</b> " + event.getFilename(), Label.CONTENT_XHTML));
+ "<b>Name:</b> " + event.getFilename(), ContentMode.XHTML));
status.addComponent(new Label("<b>Mimetype:</b> "
- + event.getMIMEType(), Label.CONTENT_XHTML));
+ + event.getMIMEType(), ContentMode.XHTML));
status.addComponent(new Label("<b>Size:</b> " + event.getLength()
- + " bytes.", Label.CONTENT_XHTML));
+ + " bytes.", ContentMode.XHTML));
status.addComponent(new Link("Download " + buffer.getFileName(),
new StreamResource(buffer, buffer.getFileName(), this)));
@@ -276,8 +287,8 @@ public class TestForStyledUpload extends Application implements
@Override
public void init() {
- Window w = new Window();
- w.setTheme("runo");
+ LegacyWindow w = new LegacyWindow();
+ setTheme("runo");
w.addComponent(main);
setMainWindow(w);
diff --git a/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java b/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java
index 5b301fbc5d..48c056ff58 100644
--- a/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java
+++ b/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java
@@ -102,7 +102,11 @@ public class TestForTablesInitialColumnWidthLogicRendering extends
t.setWidth("200px");
main.addComponent(t);
- final Button b = new Button("refresh view", this, "createNewView");
+ final Button b = new Button("refresh view", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ createNewView();
+ }
+ });
main.addComponent(b);
}
diff --git a/tests/testbench/com/vaadin/tests/TestForTrees.java b/tests/testbench/com/vaadin/tests/TestForTrees.java
index 0499ceb8ec..37030a25c2 100644
--- a/tests/testbench/com/vaadin/tests/TestForTrees.java
+++ b/tests/testbench/com/vaadin/tests/TestForTrees.java
@@ -86,7 +86,11 @@ public class TestForTrees extends CustomComponent implements Handler {
main.addComponent(ol);
contextTree = t;
- final Button b = new Button("refresh view", this, "createNewView");
+ final Button b = new Button("refresh view", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ createNewView();
+ }
+ });
main.addComponent(b);
}
@@ -142,6 +146,7 @@ public class TestForTrees extends CustomComponent implements Handler {
t.addListener(new Listener() {
public void componentEvent(Event event) {
status.addComponent(new Label(event.getClass().getName()));
+ // TODO should not use Field.toString()
status.addComponent(new Label("selected: "
+ event.getSource().toString()));
}
diff --git a/tests/testbench/com/vaadin/tests/TestForUpload.java b/tests/testbench/com/vaadin/tests/TestForUpload.java
index 399669357d..fdda4dfd2a 100644
--- a/tests/testbench/com/vaadin/tests/TestForUpload.java
+++ b/tests/testbench/com/vaadin/tests/TestForUpload.java
@@ -24,6 +24,7 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Link;
import com.vaadin.ui.Panel;
@@ -136,12 +137,11 @@ public class TestForUpload extends CustomComponent implements
"Upload finished, but output buffer is null"));
} else {
status.addComponent(new Label("<b>Name:</b> "
- + event.getFilename(), Label.CONTENT_XHTML));
+ + event.getFilename(), ContentMode.XHTML));
status.addComponent(new Label("<b>Mimetype:</b> "
- + event.getMIMEType(), Label.CONTENT_XHTML));
+ + event.getMIMEType(), ContentMode.XHTML));
status.addComponent(new Label("<b>Size:</b> "
- + event.getLength() + " bytes.",
- Label.CONTENT_XHTML));
+ + event.getLength() + " bytes.", ContentMode.XHTML));
status.addComponent(new Link("Download "
+ buffer.getFileName(), new StreamResource(buffer,
@@ -164,9 +164,18 @@ public class TestForUpload extends CustomComponent implements
});
- final Button b = new Button("Reed state from upload", this, "readState");
+ final Button b = new Button("Reed state from upload",
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ readState();
+ }
+ });
- final Button c = new Button("Force GC", this, "gc");
+ final Button c = new Button("Force GC", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ gc();
+ }
+ });
main.addComponent(b);
main.addComponent(c);
@@ -413,7 +422,7 @@ public class TestForUpload extends CustomComponent implements
}
private void beSluggish() {
- if (beSluggish.booleanValue()) {
+ if (beSluggish.getValue()) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
@@ -424,7 +433,7 @@ public class TestForUpload extends CustomComponent implements
}
private void throwExecption() {
- if (throwExecption.booleanValue()) {
+ if (throwExecption.getValue()) {
throwExecption.setValue(false);
throw new RuntimeException("Test execption in receiver.");
}
diff --git a/tests/testbench/com/vaadin/tests/TestForWindowOpen.java b/tests/testbench/com/vaadin/tests/TestForWindowOpen.java
index b523813c0b..c9dbf8dabe 100644
--- a/tests/testbench/com/vaadin/tests/TestForWindowOpen.java
+++ b/tests/testbench/com/vaadin/tests/TestForWindowOpen.java
@@ -8,6 +8,7 @@ import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CustomComponent;
+import com.vaadin.ui.Root;
import com.vaadin.ui.VerticalLayout;
public class TestForWindowOpen extends CustomComponent {
@@ -23,7 +24,7 @@ public class TestForWindowOpen extends CustomComponent {
public void buttonClick(ClickEvent event) {
final ExternalResource r = new ExternalResource(
"http://www.google.com");
- getApplication().getMainWindow().open(r);
+ Root.getCurrentRoot().open(r);
}
@@ -35,7 +36,7 @@ public class TestForWindowOpen extends CustomComponent {
public void buttonClick(ClickEvent event) {
final ExternalResource r = new ExternalResource(
"http://www.google.com");
- getApplication().getMainWindow().open(r, "mytarget");
+ Root.getCurrentRoot().open(r, "mytarget");
}
@@ -47,8 +48,7 @@ public class TestForWindowOpen extends CustomComponent {
public void buttonClick(ClickEvent event) {
final ExternalResource r = new ExternalResource(
"http://www.google.com");
- getApplication().getMainWindow()
- .open(r, "secondtarget");
+ Root.getCurrentRoot().open(r, "secondtarget");
}
diff --git a/tests/testbench/com/vaadin/tests/TestForWindowing.java b/tests/testbench/com/vaadin/tests/TestForWindowing.java
index bf6d794c13..f97ea33d61 100644
--- a/tests/testbench/com/vaadin/tests/TestForWindowing.java
+++ b/tests/testbench/com/vaadin/tests/TestForWindowing.java
@@ -14,6 +14,7 @@ import com.vaadin.ui.CheckBox;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
import com.vaadin.ui.OptionGroup;
+import com.vaadin.ui.Root;
import com.vaadin.ui.Select;
import com.vaadin.ui.Slider;
import com.vaadin.ui.VerticalLayout;
@@ -84,7 +85,7 @@ public class TestForWindowing extends CustomComponent {
w.addComponent(s);
- getApplication().getMainWindow().addWindow(w);
+ Root.getCurrentRoot().addWindow(w);
}
diff --git a/tests/testbench/com/vaadin/tests/TestIFrames.java b/tests/testbench/com/vaadin/tests/TestIFrames.java
index 5bbe58ee62..a8a9d1c2ca 100644
--- a/tests/testbench/com/vaadin/tests/TestIFrames.java
+++ b/tests/testbench/com/vaadin/tests/TestIFrames.java
@@ -6,6 +6,7 @@ package com.vaadin.tests;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.VerticalLayout;
public class TestIFrames extends CustomComponent {
@@ -31,7 +32,7 @@ public class TestIFrames extends CustomComponent {
final int height = 250;
final String iFrame = "<iframe height=\"" + height + "\" width=\""
+ width + "\" src=\"" + URL + "\" />";
- return new Label(iFrame, Label.CONTENT_XHTML);
+ return new Label(iFrame, ContentMode.XHTML);
}
}
diff --git a/tests/testbench/com/vaadin/tests/TestSetVisibleAndCaching.java b/tests/testbench/com/vaadin/tests/TestSetVisibleAndCaching.java
index 2da22f7f5d..a46253598f 100644
--- a/tests/testbench/com/vaadin/tests/TestSetVisibleAndCaching.java
+++ b/tests/testbench/com/vaadin/tests/TestSetVisibleAndCaching.java
@@ -9,9 +9,10 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class TestSetVisibleAndCaching extends com.vaadin.Application {
+public class TestSetVisibleAndCaching extends
+ com.vaadin.Application.LegacyApplication {
Panel panelA = new Panel("Panel A");
Panel panelB = new Panel("Panel B");
@@ -23,7 +24,8 @@ public class TestSetVisibleAndCaching extends com.vaadin.Application {
@Override
public void init() {
- final Window mainWindow = new Window("TestSetVisibleAndCaching");
+ final LegacyWindow mainWindow = new LegacyWindow(
+ "TestSetVisibleAndCaching");
setMainWindow(mainWindow);
panelA.addComponent(new Label(
diff --git a/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java b/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java
index a140b56285..a9005e7fd3 100644
--- a/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java
+++ b/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java
@@ -25,11 +25,11 @@ import com.vaadin.ui.Embedded;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class TestSizeableIncomponents extends Application {
+public class TestSizeableIncomponents extends Application.LegacyApplication {
private IndexedContainer cont;
private ComboBox select;
@@ -42,9 +42,9 @@ public class TestSizeableIncomponents extends Application {
initComponentList();
- Window w = new Window();
+ LegacyWindow w = new LegacyWindow();
setMainWindow(w);
- w.setTheme("tests-components");
+ setTheme("tests-components");
final VerticalLayout main = new VerticalLayout();
w.setContent(main);
diff --git a/tests/testbench/com/vaadin/tests/TestSplitPanel.java b/tests/testbench/com/vaadin/tests/TestSplitPanel.java
index 9e03cd4f89..87c8309faf 100644
--- a/tests/testbench/com/vaadin/tests/TestSplitPanel.java
+++ b/tests/testbench/com/vaadin/tests/TestSplitPanel.java
@@ -5,16 +5,16 @@
package com.vaadin.tests;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalSplitPanel;
-import com.vaadin.ui.Window;
-public class TestSplitPanel extends com.vaadin.Application {
+public class TestSplitPanel extends com.vaadin.Application.LegacyApplication {
VerticalSplitPanel verticalSplit = new VerticalSplitPanel();
@Override
public void init() {
- final Window mainWindow = new Window("Feature Browser");
+ final LegacyWindow mainWindow = new LegacyWindow("Feature Browser");
setMainWindow(mainWindow);
verticalSplit.setFirstComponent(new Label("vertical first"));
diff --git a/tests/testbench/com/vaadin/tests/TreeFilesystem.java b/tests/testbench/com/vaadin/tests/TreeFilesystem.java
index 761fd688d3..28fb289af4 100644
--- a/tests/testbench/com/vaadin/tests/TreeFilesystem.java
+++ b/tests/testbench/com/vaadin/tests/TreeFilesystem.java
@@ -9,10 +9,11 @@ import java.io.File;
import com.vaadin.data.Item;
import com.vaadin.tests.util.SampleDirectory;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Tree;
import com.vaadin.ui.Tree.ExpandEvent;
-import com.vaadin.ui.Window;
/**
* Browsable file explorer using Vaadin Tree component. Demonstrates: how to add
@@ -23,8 +24,8 @@ import com.vaadin.ui.Window;
* @since 4.0.0
*
*/
-public class TreeFilesystem extends com.vaadin.Application implements
- Tree.ExpandListener {
+public class TreeFilesystem extends com.vaadin.Application.LegacyApplication
+ implements Tree.ExpandListener {
// Filesystem explorer panel and it's components
private final Panel explorerPanel = new Panel("Filesystem explorer");
@@ -33,11 +34,11 @@ public class TreeFilesystem extends com.vaadin.Application implements
@Override
public void init() {
- final Window main = new Window("Tree filesystem demo");
+ final LegacyWindow main = new LegacyWindow("Tree filesystem demo");
setMainWindow(main);
// Main window contains heading and panel
- main.addComponent(new Label("<h2>Tree demo</h2>", Label.CONTENT_XHTML));
+ main.addComponent(new Label("<h2>Tree demo</h2>", ContentMode.XHTML));
// configure file structure panel
main.addComponent(explorerPanel);
@@ -48,7 +49,7 @@ public class TreeFilesystem extends com.vaadin.Application implements
tree.addListener(this);
// Get sample directory
- final File sampleDir = SampleDirectory.getDirectory(this);
+ final File sampleDir = SampleDirectory.getDirectory(this, main);
// populate tree's root node with example directory
if (sampleDir != null) {
populateNode(sampleDir.getAbsolutePath(), null);
diff --git a/tests/testbench/com/vaadin/tests/TreeFilesystemContainer.java b/tests/testbench/com/vaadin/tests/TreeFilesystemContainer.java
index 60d0f24b4e..1b32a35a38 100644
--- a/tests/testbench/com/vaadin/tests/TreeFilesystemContainer.java
+++ b/tests/testbench/com/vaadin/tests/TreeFilesystemContainer.java
@@ -14,9 +14,9 @@ import com.vaadin.ui.Component.Listener;
import com.vaadin.ui.Field;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
/**
* Browsable file explorer using Vaadin Tree component. Demonstrates: how to use
@@ -28,8 +28,8 @@ import com.vaadin.ui.Window;
* @since 4.0.0
*
*/
-public class TreeFilesystemContainer extends com.vaadin.Application implements
- Listener {
+public class TreeFilesystemContainer extends
+ com.vaadin.Application.LegacyApplication implements Listener {
// Filesystem explorer panel and it's components
private final Panel explorerPanel = new Panel("Filesystem explorer");
@@ -43,7 +43,7 @@ public class TreeFilesystemContainer extends com.vaadin.Application implements
@Override
public void init() {
- final Window w = new Window("Tree FilesystemContainer demo");
+ final LegacyWindow w = new LegacyWindow("Tree FilesystemContainer demo");
setMainWindow(w);
final VerticalLayout main = new VerticalLayout();
w.setContent(main);
@@ -65,7 +65,7 @@ public class TreeFilesystemContainer extends com.vaadin.Application implements
propertyPanel.setEnabled(false);
// Get sample directory
- final File sampleDir = SampleDirectory.getDirectory(this);
+ final File sampleDir = SampleDirectory.getDirectory(this, w);
// Populate tree with FilesystemContainer
final FilesystemContainer fsc = new FilesystemContainer(sampleDir, true);
filesystem.setContainerDataSource(fsc);
diff --git a/tests/testbench/com/vaadin/tests/UpgradingSample.java b/tests/testbench/com/vaadin/tests/UpgradingSample.java
index 2b3a85624f..0db63ca789 100644
--- a/tests/testbench/com/vaadin/tests/UpgradingSample.java
+++ b/tests/testbench/com/vaadin/tests/UpgradingSample.java
@@ -14,14 +14,15 @@ package com.vaadin.tests;
import com.vaadin.Application;
import com.vaadin.data.Property;
import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
/**
* <p>
@@ -34,7 +35,7 @@ import com.vaadin.ui.Window;
* @since 3.1.1
* @author Vaadin Ltd.
*/
-public class UpgradingSample extends Application implements
+public class UpgradingSample extends Application.LegacyApplication implements
Property.ValueChangeListener {
/* Menu for navigating inside the application. */
@@ -56,7 +57,7 @@ public class UpgradingSample extends Application implements
public void init() {
// Create the main window of the application
- final Window main = new Window("Login example", layout);
+ final LegacyWindow main = new LegacyWindow("Login example", layout);
setMainWindow(main);
// Add menu and loginbox to the application
@@ -113,14 +114,23 @@ public class UpgradingSample extends Application implements
// The components this loginbox is composed of
private final TextField loginName = new TextField("Name");
- private final Button loginButton = new Button("Enter", this, "login");
+ private final Button loginButton = new Button("Enter",
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ login();
+ }
+ });
private final Panel loginPanel = new Panel("Login");
private final Panel statusPanel = new Panel();
private final Button logoutButton = new Button("Logout",
- UpgradingSample.this, "close");
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ close();
+ }
+ });
private final Label statusLabel = new Label();
@@ -145,7 +155,7 @@ public class UpgradingSample extends Application implements
// Login into application
public void login() {
- final String name = (String) loginName.getValue();
+ final String name = loginName.getValue();
if (name != null && name.length() > 0) {
setUser(name);
}
diff --git a/tests/testbench/com/vaadin/tests/UsingObjectsInSelect.java b/tests/testbench/com/vaadin/tests/UsingObjectsInSelect.java
index 405f23ef91..780b7d94e1 100644
--- a/tests/testbench/com/vaadin/tests/UsingObjectsInSelect.java
+++ b/tests/testbench/com/vaadin/tests/UsingObjectsInSelect.java
@@ -10,16 +10,17 @@ import java.util.Random;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Select;
-import com.vaadin.ui.Window;
-public class UsingObjectsInSelect extends com.vaadin.Application implements
- ValueChangeListener {
+public class UsingObjectsInSelect extends
+ com.vaadin.Application.LegacyApplication implements ValueChangeListener {
private final Select select = new Select();
private final Label selectedTask = new Label("Selected task",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
public LinkedList<?> exampleTasks = new LinkedList<Object>();
@@ -27,7 +28,7 @@ public class UsingObjectsInSelect extends com.vaadin.Application implements
@Override
public void init() {
- final Window main = new Window("Select demo");
+ final LegacyWindow main = new LegacyWindow("Select demo");
setMainWindow(main);
final Panel panel = new Panel("Select demo");
diff --git a/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java b/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java
index 2b6656f11a..7d5e298286 100644
--- a/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java
+++ b/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java
@@ -11,11 +11,11 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
-public class GAESyncTest extends Application {
+public class GAESyncTest extends Application.LegacyApplication {
/**
*
@@ -45,7 +45,7 @@ public class GAESyncTest extends Application {
}
- private class IntrWindow extends Window {
+ private class IntrWindow extends LegacyWindow {
private int n = 0;
private static final long serialVersionUID = -6521351715072191625l;
TextField tf;
@@ -90,8 +90,8 @@ public class GAESyncTest extends Application {
Button b = new Button("Add", new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- if (getWindow() == getApplication().getMainWindow()) {
- getWindow().showNotification("main");
+ if (getRoot() == getMainWindow()) {
+ getRoot().showNotification("main");
try {
Thread.sleep((5000));
} catch (InterruptedException e) {
@@ -139,8 +139,8 @@ public class GAESyncTest extends Application {
}
@Override
- public Window getWindow(String name) {
- Window w = super.getWindow(name);
+ public LegacyWindow getWindow(String name) {
+ LegacyWindow w = super.getWindow(name);
if (w == null) {
w = new IntrWindow(this);
addWindow(w);
diff --git a/tests/testbench/com/vaadin/tests/application/ApplicationCloseTest.java b/tests/testbench/com/vaadin/tests/application/ApplicationCloseTest.java
index 3d767eb016..2706134c27 100644
--- a/tests/testbench/com/vaadin/tests/application/ApplicationCloseTest.java
+++ b/tests/testbench/com/vaadin/tests/application/ApplicationCloseTest.java
@@ -6,6 +6,7 @@ import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
public class ApplicationCloseTest extends TestBase {
@@ -14,7 +15,7 @@ public class ApplicationCloseTest extends TestBase {
@Override
protected void setup() {
Label applications = new Label("Applications in session: <br/>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
for (Application a : ((WebApplicationContext) getContext())
.getApplications()) {
applications.setValue(applications.getValue() + "App: " + a
@@ -50,7 +51,7 @@ public class ApplicationCloseTest extends TestBase {
/ 1000
/ 1000
+ "MiB memory for this application.<br/>Total memory usage reported as "
- + totalUsageString + "<br/>", Label.CONTENT_XHTML);
+ + totalUsageString + "<br/>", ContentMode.XHTML);
addComponent(thisApp);
addComponent(memoryUsage);
diff --git a/tests/testbench/com/vaadin/tests/application/ErrorInUnloadEvent.java b/tests/testbench/com/vaadin/tests/application/ErrorInUnloadEvent.java
index f212e74ca3..fcc4e26b55 100644
--- a/tests/testbench/com/vaadin/tests/application/ErrorInUnloadEvent.java
+++ b/tests/testbench/com/vaadin/tests/application/ErrorInUnloadEvent.java
@@ -9,13 +9,14 @@ import com.vaadin.ui.Component;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.PasswordField;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class ErrorInUnloadEvent extends AbstractTestCase {
- private Window mainWindow;
+ private LegacyWindow mainWindow;
@Override
public void init() {
@@ -28,7 +29,8 @@ public class ErrorInUnloadEvent extends AbstractTestCase {
private void showLoginWindow() {
if (mainWindow == null) {
- mainWindow = new Window();
+ mainWindow = new LegacyWindow();
+ setMainWindow(mainWindow);
} else {
mainWindow.removeAllComponents();
}
@@ -37,9 +39,8 @@ public class ErrorInUnloadEvent extends AbstractTestCase {
FormLayout formLayout = new FormLayout();
final TextField userField = new TextField("Username");
userField.setDebugId("user");
- final TextField passwordField = new TextField("Password");
+ final PasswordField passwordField = new PasswordField("Password");
passwordField.setDebugId("pwd");
- passwordField.setSecret(true);
Button login = new Button("login");
login.setDebugId("loginButton");
login.setClickShortcut(KeyCode.ENTER);
@@ -50,20 +51,19 @@ public class ErrorInUnloadEvent extends AbstractTestCase {
login.addListener(new ClickListener() {
public void buttonClick(final ClickEvent event) {
- String username = (String) userField.getValue();
- String password = (String) passwordField.getValue();
+ String username = userField.getValue();
+ String password = passwordField.getValue();
setUser(username);
showMainWindow();
}
});
-
- setMainWindow(mainWindow);
}
private void showMainWindow() {
if (mainWindow == null) {
- mainWindow = new Window();
+ mainWindow = new LegacyWindow();
+ setMainWindow(mainWindow);
} else {
mainWindow.removeAllComponents();
}
diff --git a/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.html b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.html
new file mode 100644
index 0000000000..d48ab220b5
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.html
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.application.RefreshStatePreserve?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationRefreshStatePreserve::/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td>
+ <td>Root id: 0</td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.application.RefreshStatePreserve</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationRefreshStatePreserve::/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td>
+ <td>Root id: 0</td>
+</tr>
+<tr>
+ <td>runScript</td>
+ <td>history.back()</td>
+ <td></td>
+</tr>
+<tr>
+ <td>pause</td>
+ <td></td>
+ <td>1000</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationRefreshStatePreserve::/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td>
+ <td>Root id: 0</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java
new file mode 100644
index 0000000000..36a793bd6d
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java
@@ -0,0 +1,39 @@
+package com.vaadin.tests.application;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestApplication;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Root;
+
+public class RefreshStatePreserve extends AbstractTestApplication {
+ public static class RefreshStateRoot extends Root {
+ @Override
+ public void init(WrappedRequest request) {
+ getContent().addComponent(
+ new Label("window.name: "
+ + request.getBrowserDetails().getWindowName()));
+ getContent().addComponent(new Label("Root id: " + getRootId()));
+ }
+ }
+
+ @Override
+ public void init() {
+ super.init();
+ setRootPreserved(true);
+ }
+
+ @Override
+ protected String getRootClassName(WrappedRequest request) {
+ return RefreshStateRoot.class.getName();
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Refreshing the browser window should preserve the state";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(8068);
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.html b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.html
new file mode 100644
index 0000000000..9f16ef5ce2
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.html
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.application.ThreadLocalInstances?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementHeight</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::/VVerticalLayout[0]/ChildComponentContainer[1]/VEmbedded[0]/domChild[0]</td>
+ <td>11</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_15</td>
+ <td>1. null app in class init</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_14</td>
+ <td>2. null root in class init</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_13</td>
+ <td>3. null app in app constructor</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_12</td>
+ <td>4. null root in app constructor</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_11</td>
+ <td>5. this app in app init</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_10</td>
+ <td>6. null root in app init</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_9</td>
+ <td>7. this app in root init</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_8</td>
+ <td>8. null root in root init</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_7</td>
+ <td>9. this app in root paint</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_6</td>
+ <td>10. this root in root paint</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_5</td>
+ <td>11. null app in background thread</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_4</td>
+ <td>12. null root in background thread</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_3</td>
+ <td>13. this app in resource handler</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_2</td>
+ <td>14. null root in resource handler</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_1</td>
+ <td>15. this app in button listener</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_0</td>
+ <td>16. this root in button listener</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java
new file mode 100644
index 0000000000..68a0bb3805
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java
@@ -0,0 +1,114 @@
+package com.vaadin.tests.application;
+
+import com.vaadin.Application;
+import com.vaadin.RootRequiresMoreInformationException;
+import com.vaadin.terminal.ApplicationResource;
+import com.vaadin.terminal.DownloadStream;
+import com.vaadin.terminal.PaintException;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestApplication;
+import com.vaadin.tests.integration.FlagSeResource;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Embedded;
+import com.vaadin.ui.Root;
+
+public class ThreadLocalInstances extends AbstractTestApplication {
+ private static final Application staticInitApplication = Application
+ .getCurrentApplication();
+ private static final Root staticInitRoot = Root.getCurrentRoot();
+
+ private final Root mainWindow = new Root() {
+ boolean paintReported = false;
+
+ @Override
+ protected void init(WrappedRequest request) {
+ reportCurrentStatus("root init");
+ }
+
+ @Override
+ public void paintContent(com.vaadin.terminal.PaintTarget target)
+ throws PaintException {
+ if (!paintReported) {
+ reportCurrentStatus("root paint");
+ Thread thread = new Thread() {
+ @Override
+ public void run() {
+ synchronized (ThreadLocalInstances.this) {
+ reportCurrentStatus("background thread");
+ }
+ }
+ };
+ thread.start();
+ paintReported = true;
+ }
+ super.paintContent(target);
+ }
+ };
+
+ private final ApplicationResource resource = new FlagSeResource(this) {
+ @Override
+ public DownloadStream getStream() {
+ reportCurrentStatus("resource handler");
+ return super.getStream();
+ }
+ };
+
+ private final Log log = new Log(16);
+
+ public ThreadLocalInstances() {
+ mainWindow.addComponent(log);
+ mainWindow.addComponent(new Embedded("Icon", resource));
+ mainWindow.addComponent(new Button("Sync", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ reportCurrentStatus("button listener");
+ }
+ }));
+
+ reportStatus("class init", staticInitApplication, staticInitRoot);
+ reportCurrentStatus("app constructor");
+ }
+
+ @Override
+ public void init() {
+ reportCurrentStatus("app init");
+ }
+
+ @Override
+ protected Root getRoot(WrappedRequest request)
+ throws RootRequiresMoreInformationException {
+ return mainWindow;
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Tests the precence of Application.getCurrentApplication() and Root.getCurrentRoot() from different contexts";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(7895);
+ }
+
+ private void reportCurrentStatus(String phase) {
+ reportStatus(phase, Application.getCurrentApplication(),
+ Root.getCurrentRoot());
+ }
+
+ private void reportStatus(String phase, Application application, Root root) {
+ log.log(getState(application, this) + " app in " + phase);
+ log.log(getState(root, mainWindow) + " root in " + phase);
+ }
+
+ private static String getState(Object value, Object reference) {
+ if (value == null) {
+ return "null";
+ } else if (value == reference) {
+ return "this";
+ } else {
+ return value.toString();
+ }
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/applicationcontext/ChangeSessionId.java b/tests/testbench/com/vaadin/tests/applicationcontext/ChangeSessionId.java
index c0141a72d5..17ac74e5a3 100644
--- a/tests/testbench/com/vaadin/tests/applicationcontext/ChangeSessionId.java
+++ b/tests/testbench/com/vaadin/tests/applicationcontext/ChangeSessionId.java
@@ -6,7 +6,7 @@ import com.vaadin.tests.util.Log;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
public class ChangeSessionId extends AbstractTestCase {
@@ -16,7 +16,7 @@ public class ChangeSessionId extends AbstractTestCase {
@Override
public void init() {
- Window mainWindow = new Window("Sestest Application");
+ LegacyWindow mainWindow = new LegacyWindow("Sestest Application");
mainWindow.addComponent(log);
mainWindow.addComponent(loginButton);
mainWindow.addComponent(new Button("Show session id",
diff --git a/tests/testbench/com/vaadin/tests/components/AbstractComponentContainerTest.java b/tests/testbench/com/vaadin/tests/components/AbstractComponentContainerTest.java
index 2a98988487..6e9e4e8930 100644
--- a/tests/testbench/com/vaadin/tests/components/AbstractComponentContainerTest.java
+++ b/tests/testbench/com/vaadin/tests/components/AbstractComponentContainerTest.java
@@ -1,5 +1,6 @@
package com.vaadin.tests.components;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
@@ -284,6 +285,11 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
addCommands.put("PopupDateField", addPopupDateFieldCommand);
addCommands.put("VerticalSplitPanel", addVerticalSplitPanelCommand);
addCommands.put("HorizontalSplitPanel", addHorizontalSplitPanelCommand);
+
+ HashSet<String> noVerticalSize = new HashSet<String>();
+ noVerticalSize.add("TextField");
+ noVerticalSize.add("Button");
+
// addCommands.put("AbsoluteLayout", addAbsoluteLayoutCommand);
// addCommands.put("HorizontalLayout", addHorizontalLayoutCommand);
// addCommands.put("VerticalLayout", addVerticalLayoutCommand);
@@ -303,6 +309,10 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
createCategory(componentCategory, subCategory);
for (ComponentSize size : sizes) {
+ if (size.getHeight() != null
+ && noVerticalSize.contains(componentCategory)) {
+ continue;
+ }
createClickAction(size.toString(), componentCategory,
addCommands.get(componentCategory), size);
}
diff --git a/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java b/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java
index fe61df8913..e8ac213049 100644
--- a/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java
+++ b/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java
@@ -8,6 +8,12 @@ import java.util.Locale;
import java.util.Map;
import java.util.Set;
+import com.vaadin.event.FieldEvents.BlurEvent;
+import com.vaadin.event.FieldEvents.BlurListener;
+import com.vaadin.event.FieldEvents.BlurNotifier;
+import com.vaadin.event.FieldEvents.FocusEvent;
+import com.vaadin.event.FieldEvents.FocusListener;
+import com.vaadin.event.FieldEvents.FocusNotifier;
import com.vaadin.terminal.Resource;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.tests.util.Log;
@@ -17,7 +23,8 @@ import com.vaadin.ui.MenuBar;
import com.vaadin.ui.MenuBar.MenuItem;
public abstract class AbstractComponentTest<T extends AbstractComponent>
- extends AbstractComponentTestCase<T> {
+ extends AbstractComponentTestCase<T> implements FocusListener,
+ BlurListener {
protected static final String TEXT_SHORT = "Short";
protected static final String TEXT_MEDIUM = "This is a semi-long text that might wrap.";
@@ -221,6 +228,39 @@ public abstract class AbstractComponentTest<T extends AbstractComponent>
}
+ protected Command<T, Boolean> focusListenerCommand = new Command<T, Boolean>() {
+
+ public void execute(T c, Boolean value, Object data) {
+ if (value) {
+ ((FocusNotifier) c).addListener(AbstractComponentTest.this);
+ } else {
+ ((FocusNotifier) c).removeListener(AbstractComponentTest.this);
+ }
+ }
+ };
+ protected Command<T, Boolean> blurListenerCommand = new Command<T, Boolean>() {
+
+ public void execute(T c, Boolean value, Object data) {
+ if (value) {
+ ((BlurNotifier) c).addListener(AbstractComponentTest.this);
+ } else {
+ ((BlurNotifier) c).removeListener(AbstractComponentTest.this);
+ }
+ }
+ };
+
+ protected void createFocusListener(String category) {
+ createBooleanAction("Focus listener", category, false,
+ focusListenerCommand);
+
+ }
+
+ protected void createBlurListener(String category) {
+ createBooleanAction("Blur listener", category, false,
+ blurListenerCommand);
+
+ }
+
private void createStyleNameSelect(String category) {
LinkedHashMap<String, String> options = new LinkedHashMap<String, String>();
options.put("-", null);
@@ -668,4 +708,13 @@ public abstract class AbstractComponentTest<T extends AbstractComponent>
}
}
+
+ public void focus(FocusEvent event) {
+ log(event.getClass().getSimpleName());
+ }
+
+ public void blur(BlurEvent event) {
+ log(event.getClass().getSimpleName());
+ }
+
}
diff --git a/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java b/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java
index 1b04198da0..57a32aafc4 100644
--- a/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java
+++ b/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java
@@ -126,7 +126,7 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent>
public void execute(T c, Boolean enabled, Object data) {
if (c instanceof Field) {
- ((Field) c).setRequired(enabled);
+ ((Field<?>) c).setRequired(enabled);
} else {
throw new IllegalArgumentException(c.getClass().getName()
+ " is not a field and cannot be set to required");
@@ -136,7 +136,7 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent>
protected Command<T, String> requiredErrorMessageCommand = new Command<T, String>() {
public void execute(T c, String value, Object data) {
- ((Field) c).setRequiredError(value);
+ ((Field<?>) c).setRequiredError(value);
}
};
diff --git a/tests/testbench/com/vaadin/tests/components/AbstractTestApplication.java b/tests/testbench/com/vaadin/tests/components/AbstractTestApplication.java
new file mode 100644
index 0000000000..8de1e68b4b
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/AbstractTestApplication.java
@@ -0,0 +1,23 @@
+package com.vaadin.tests.components;
+
+import com.vaadin.Application;
+import com.vaadin.service.ApplicationContext;
+import com.vaadin.terminal.gwt.server.AbstractWebApplicationContext;
+import com.vaadin.terminal.gwt.server.WebBrowser;
+
+public abstract class AbstractTestApplication extends Application {
+ protected abstract String getTestDescription();
+
+ protected abstract Integer getTicketNumber();
+
+ protected WebBrowser getBrowser() {
+ ApplicationContext context = getContext();
+ if (context instanceof AbstractWebApplicationContext) {
+ WebBrowser webBrowser = ((AbstractWebApplicationContext) context)
+ .getBrowser();
+ return webBrowser;
+ }
+
+ return null;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/components/AbstractTestCase.java b/tests/testbench/com/vaadin/tests/components/AbstractTestCase.java
index e2b3ad0fe1..11d960e143 100644
--- a/tests/testbench/com/vaadin/tests/components/AbstractTestCase.java
+++ b/tests/testbench/com/vaadin/tests/components/AbstractTestCase.java
@@ -5,7 +5,7 @@ import com.vaadin.service.ApplicationContext;
import com.vaadin.terminal.gwt.server.AbstractWebApplicationContext;
import com.vaadin.terminal.gwt.server.WebBrowser;
-public abstract class AbstractTestCase extends Application {
+public abstract class AbstractTestCase extends Application.LegacyApplication {
protected abstract String getDescription();
diff --git a/tests/testbench/com/vaadin/tests/components/AbstractTestRoot.java b/tests/testbench/com/vaadin/tests/components/AbstractTestRoot.java
new file mode 100644
index 0000000000..eb27d18ca0
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/AbstractTestRoot.java
@@ -0,0 +1,70 @@
+package com.vaadin.tests.components;
+
+import com.vaadin.Application;
+import com.vaadin.service.ApplicationContext;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.terminal.gwt.server.AbstractWebApplicationContext;
+import com.vaadin.terminal.gwt.server.WebBrowser;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.VerticalLayout;
+
+public abstract class AbstractTestRoot extends Root {
+
+ @Override
+ public void init(WrappedRequest request) {
+ setCaption(getClass().getName());
+
+ Label label = new Label(getTestDescription(), ContentMode.XHTML);
+ label.setWidth("100%");
+
+ layout = new VerticalLayout();
+
+ getContent().addComponent(label);
+ getContent().addComponent(layout);
+ ((VerticalLayout) getContent()).setExpandRatio(layout, 1);
+
+ setup(request);
+ }
+
+ private VerticalLayout layout;
+
+ protected VerticalLayout getLayout() {
+ return layout;
+ }
+
+ protected abstract void setup(WrappedRequest request);
+
+ @Override
+ public void addComponent(Component c) {
+ getLayout().addComponent(c);
+ }
+
+ @Override
+ public void removeComponent(Component c) {
+ getLayout().removeComponent(c);
+ }
+
+ @Override
+ public void replaceComponent(Component oldComponent, Component newComponent) {
+ getLayout().replaceComponent(oldComponent, newComponent);
+ }
+
+ protected abstract String getTestDescription();
+
+ protected abstract Integer getTicketNumber();
+
+ protected WebBrowser getBrowser() {
+ ApplicationContext context = Application.getCurrentApplication()
+ .getContext();
+ if (context instanceof AbstractWebApplicationContext) {
+ AbstractWebApplicationContext webContext = (AbstractWebApplicationContext) context;
+ return webContext.getBrowser();
+ }
+
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/ComponentTestCase.java b/tests/testbench/com/vaadin/tests/components/ComponentTestCase.java
index 1e15f7a47b..a2c186df7e 100644
--- a/tests/testbench/com/vaadin/tests/components/ComponentTestCase.java
+++ b/tests/testbench/com/vaadin/tests/components/ComponentTestCase.java
@@ -7,6 +7,7 @@ import java.util.List;
import com.vaadin.data.Item;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
@@ -111,9 +112,10 @@ public abstract class ComponentTestCase<T extends AbstractComponent> extends
boolean initialState, final Command<T, Boolean> command) {
CheckBox checkBox = new CheckBox(caption);
- checkBox.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- boolean enabled = (Boolean) event.getButton().getValue();
+ checkBox.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ boolean enabled = (Boolean) event.getProperty().getValue();
doCommand(command, enabled);
}
});
@@ -132,10 +134,13 @@ public abstract class ComponentTestCase<T extends AbstractComponent> extends
final Command<T, Boolean> command) {
Button button = new Button(caption);
+ button.setData(Boolean.FALSE);
button.addListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- boolean enabled = (Boolean) event.getButton().getValue();
- doCommand(command, enabled);
+ Button b = event.getButton();
+ boolean state = (Boolean) b.getData();
+ b.setData(!state);
+ doCommand(command, state);
}
});
diff --git a/tests/testbench/com/vaadin/tests/components/LayoutAttachListenerInfo.java b/tests/testbench/com/vaadin/tests/components/LayoutAttachListenerInfo.java
index 7ed44768fd..671958383f 100644
--- a/tests/testbench/com/vaadin/tests/components/LayoutAttachListenerInfo.java
+++ b/tests/testbench/com/vaadin/tests/components/LayoutAttachListenerInfo.java
@@ -11,10 +11,9 @@ import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.ComponentContainer.ComponentAttachEvent;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.OptionGroup;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window.Notification;
-
public class LayoutAttachListenerInfo extends TestBase {
diff --git a/tests/testbench/com/vaadin/tests/components/TestBase.java b/tests/testbench/com/vaadin/tests/components/TestBase.java
index c7380d3d7c..4825e09404 100644
--- a/tests/testbench/com/vaadin/tests/components/TestBase.java
+++ b/tests/testbench/com/vaadin/tests/components/TestBase.java
@@ -2,18 +2,19 @@ package com.vaadin.tests.components;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public abstract class TestBase extends AbstractTestCase {
@Override
public final void init() {
- window = new Window(getClass().getName());
+ window = new LegacyWindow(getClass().getName());
setMainWindow(window);
window.getContent().setSizeFull();
- Label label = new Label(getDescription(), Label.CONTENT_XHTML);
+ Label label = new Label(getDescription(), ContentMode.XHTML);
label.setWidth("100%");
window.getContent().addComponent(label);
@@ -24,7 +25,7 @@ public abstract class TestBase extends AbstractTestCase {
setup();
}
- private Window window;
+ private LegacyWindow window;
private VerticalLayout layout;
public TestBase() {
diff --git a/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java b/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java
index a5498660be..9261962b0d 100644
--- a/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java
+++ b/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java
@@ -1,25 +1,27 @@
package com.vaadin.tests.components.abstractcomponent;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
public class EnableState extends AbstractTestCase {
@Override
public void init() {
- Window mainWindow = new Window("Helloworld Application");
+ LegacyWindow mainWindow = new LegacyWindow("Helloworld Application");
final Panel panel = new Panel("Test");
final Button button = new Button("ablebutton");
panel.addComponent(button);
CheckBox enable = new CheckBox("Toggle button enabled", true);
- enable.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- boolean enabled = (Boolean) event.getButton().getValue();
+ enable.addListener(new Property.ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ boolean enabled = (Boolean) event.getProperty().getValue();
button.setEnabled(enabled);
// button.requestRepaint();
}
@@ -27,17 +29,19 @@ public class EnableState extends AbstractTestCase {
enable.setImmediate(true);
CheckBox caption = new CheckBox("Toggle button caption", true);
- caption.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ caption.addListener(new Property.ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
button.setCaption(button.getCaption() + "+");
}
});
caption.setImmediate(true);
CheckBox visible = new CheckBox("Toggle panel visibility", true);
- visible.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- boolean visible = (Boolean) event.getButton().getValue();
+ visible.addListener(new Property.ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ boolean visible = (Boolean) event.getProperty().getValue();
panel.setVisible(visible);
}
@@ -45,9 +49,10 @@ public class EnableState extends AbstractTestCase {
visible.setImmediate(true);
CheckBox panelEnable = new CheckBox("Toggle panel enabled", true);
- panelEnable.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- boolean enabled = (Boolean) event.getButton().getValue();
+ panelEnable.addListener(new Property.ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ boolean enabled = (Boolean) event.getProperty().getValue();
panel.setEnabled(enabled);
}
});
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java
new file mode 100644
index 0000000000..93ba858e37
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java
@@ -0,0 +1,117 @@
+package com.vaadin.tests.components.abstractfield;
+
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Set;
+
+import com.vaadin.data.Container;
+import com.vaadin.data.Item;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.AbstractField;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.Component;
+
+public abstract class AbstractComponentDataBindingTest extends TestBase
+ implements ValueChangeListener {
+ private static final Object CAPTION = "CAPTION";
+ private Log log = new Log(5);
+ private ComboBox localeSelect;
+
+ @Override
+ protected void setup() {
+ addComponent(log);
+ localeSelect = createLocaleSelect();
+ addComponent(localeSelect);
+
+ // Causes fields to be created
+ localeSelect.setValue(Locale.US);
+ }
+
+ private ComboBox createLocaleSelect() {
+ ComboBox cb = new ComboBox("Locale");
+ cb.addContainerProperty(CAPTION, String.class, "");
+ cb.setItemCaptionPropertyId(CAPTION);
+ cb.setNullSelectionAllowed(false);
+ for (Locale l : Locale.getAvailableLocales()) {
+ Item i = cb.addItem(l);
+ i.getItemProperty(CAPTION).setValue(
+ l.getDisplayName(Locale.ENGLISH));
+ }
+ ((Container.Sortable) cb.getContainerDataSource()).sort(
+ new Object[] { CAPTION }, new boolean[] { true });
+ cb.setImmediate(true);
+ cb.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ updateLocale((Locale) localeSelect.getValue());
+ }
+ });
+ return cb;
+ }
+
+ protected void updateLocale(Locale locale) {
+ setLocale(locale);
+ for (Component c : fields) {
+ removeComponent(c);
+ }
+ fields.clear();
+ createFields();
+ }
+
+ protected abstract void createFields();
+
+ private Set<Component> fields = new HashSet<Component>();
+
+ @Override
+ protected void addComponent(Component c) {
+ super.addComponent(c);
+ if (c instanceof AbstractField) {
+ configureField((AbstractField<?>) c);
+ if (c != localeSelect) {
+ fields.add(c);
+ }
+ }
+ }
+
+ protected void configureField(AbstractField<?> field) {
+ field.setImmediate(true);
+ field.addListener(this);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+ public void valueChange(ValueChangeEvent event) {
+ AbstractField field = (AbstractField) event.getProperty();
+ // if (field == localeSelect) {
+ // return;
+ // }
+
+ Object newValue = field.getValue();
+ if (newValue != null) {
+ newValue = newValue + " (" + newValue.getClass().getName() + ")";
+ }
+
+ String message = "Value of " + field.getCaption() + " changed to "
+ + newValue + ".";
+ if (field.getPropertyDataSource() != null) {
+ Object dataSourceValue = field.getPropertyDataSource().getValue();
+ message += "Data model value is " + dataSourceValue;
+ message += " (" + field.getPropertyDataSource().getType().getName()
+ + ")";
+ }
+ log.log(message);
+
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java
index a08f8999a6..5d0e0fe488 100644
--- a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java
@@ -6,8 +6,8 @@ import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window.Notification;
public class AbstractFieldCommitWithInvalidValues extends TestBase {
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java
index 40cc2948ee..716f80e23f 100644
--- a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java
@@ -13,26 +13,29 @@ import com.vaadin.data.Property;
import com.vaadin.data.Property.ReadOnlyStatusChangeEvent;
import com.vaadin.data.Property.ReadOnlyStatusChangeListener;
import com.vaadin.data.Property.ValueChangeListener;
-import com.vaadin.event.FieldEvents.BlurEvent;
-import com.vaadin.event.FieldEvents.BlurListener;
import com.vaadin.event.FieldEvents.BlurNotifier;
-import com.vaadin.event.FieldEvents.FocusEvent;
-import com.vaadin.event.FieldEvents.FocusListener;
import com.vaadin.event.FieldEvents.FocusNotifier;
import com.vaadin.tests.components.AbstractComponentTest;
import com.vaadin.ui.AbstractField;
import com.vaadin.ui.MenuBar;
import com.vaadin.ui.MenuBar.MenuItem;
-public abstract class AbstractFieldTest<T extends AbstractField> extends
+public abstract class AbstractFieldTest<T extends AbstractField<?>> extends
AbstractComponentTest<T> implements ValueChangeListener,
- ReadOnlyStatusChangeListener, FocusListener, BlurListener {
+ ReadOnlyStatusChangeListener {
@Override
protected void createActions() {
super.createActions();
createBooleanAction("Required", CATEGORY_STATE, false, requiredCommand);
createRequiredErrorSelect(CATEGORY_DECORATIONS);
+ if (FocusNotifier.class.isAssignableFrom(getTestClass())) {
+ createFocusListener(CATEGORY_LISTENERS);
+ }
+
+ if (BlurNotifier.class.isAssignableFrom(getTestClass())) {
+ createBlurListener(CATEGORY_LISTENERS);
+ }
createValueChangeListener(CATEGORY_LISTENERS);
createReadOnlyStatusChangeListener(CATEGORY_LISTENERS);
@@ -82,14 +85,6 @@ public abstract class AbstractFieldTest<T extends AbstractField> extends
createSelectAction("Required error message", category, options, "-",
requiredErrorMessageCommand);
- if (FocusNotifier.class.isAssignableFrom(getTestClass())) {
- createFocusListener(CATEGORY_LISTENERS);
- }
-
- if (BlurNotifier.class.isAssignableFrom(getTestClass())) {
- createBlurListener(CATEGORY_LISTENERS);
- }
-
}
private void createValueChangeListener(String category) {
@@ -104,18 +99,6 @@ public abstract class AbstractFieldTest<T extends AbstractField> extends
false, readonlyStatusChangeListenerCommand);
}
- private void createFocusListener(String category) {
- createBooleanAction("Focus listener", category, false,
- focusListenerCommand);
-
- }
-
- private void createBlurListener(String category) {
- createBooleanAction("Blur listener", category, false,
- blurListenerCommand);
-
- }
-
protected Command<T, Boolean> valueChangeListenerCommand = new Command<T, Boolean>() {
public void execute(T c, Boolean value, Object data) {
@@ -136,26 +119,7 @@ public abstract class AbstractFieldTest<T extends AbstractField> extends
}
}
};
- protected Command<T, Boolean> focusListenerCommand = new Command<T, Boolean>() {
-
- public void execute(T c, Boolean value, Object data) {
- if (value) {
- ((FocusNotifier) c).addListener(AbstractFieldTest.this);
- } else {
- ((FocusNotifier) c).removeListener(AbstractFieldTest.this);
- }
- }
- };
- protected Command<T, Boolean> blurListenerCommand = new Command<T, Boolean>() {
- public void execute(T c, Boolean value, Object data) {
- if (value) {
- ((BlurNotifier) c).addListener(AbstractFieldTest.this);
- } else {
- ((BlurNotifier) c).removeListener(AbstractFieldTest.this);
- }
- }
- };
protected Command<T, Object> setValueCommand = new Command<T, Object>() {
public void execute(T c, Object value, Object data) {
@@ -208,14 +172,6 @@ public abstract class AbstractFieldTest<T extends AbstractField> extends
log(event.getClass().getSimpleName());
}
- public void focus(FocusEvent event) {
- log(event.getClass().getSimpleName());
- }
-
- public void blur(BlurEvent event) {
- log(event.getClass().getSimpleName());
- }
-
protected void createSetTextValueAction(String category) {
String subCategory = "Set text value";
createCategory(subCategory, category);
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBackedByString.java b/tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBackedByString.java
new file mode 100644
index 0000000000..d4b2f89522
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBackedByString.java
@@ -0,0 +1,17 @@
+package com.vaadin.tests.components.abstractfield;
+
+import com.vaadin.ui.DateField;
+
+public class DateFieldBackedByString extends AbstractComponentDataBindingTest {
+
+ private String s = null;
+
+ @Override
+ protected void createFields() {
+ DateField df = new DateField("Date field");
+ addComponent(df);
+ df.setPropertyDataSource(new com.vaadin.data.util.ObjectProperty<String>(
+ s, String.class));
+
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBasedOnLong.java b/tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBasedOnLong.java
new file mode 100644
index 0000000000..deea0fbe0a
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBasedOnLong.java
@@ -0,0 +1,34 @@
+package com.vaadin.tests.components.abstractfield;
+
+import java.util.Date;
+
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.PopupDateField;
+
+public class DateFieldBasedOnLong extends AbstractComponentDataBindingTest {
+
+ private Long l = null;
+ private ObjectProperty<Long> property;
+
+ @Override
+ protected void createFields() {
+ PopupDateField pdf = new PopupDateField("DateField");
+ addComponent(pdf);
+ property = new ObjectProperty<Long>(l, Long.class);
+ pdf.setPropertyDataSource(property);
+
+ property.setValue(new Date(2011 - 1900, 4, 6).getTime());
+
+ addComponent(new Button("Set property value to 10000L",
+ new Button.ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ property.setValue(10000L);
+
+ }
+ }));
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/DoubleInTextField.java b/tests/testbench/com/vaadin/tests/components/abstractfield/DoubleInTextField.java
new file mode 100644
index 0000000000..4fd81081ea
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/DoubleInTextField.java
@@ -0,0 +1,31 @@
+package com.vaadin.tests.components.abstractfield;
+
+import com.vaadin.data.util.MethodProperty;
+import com.vaadin.tests.data.bean.Address;
+import com.vaadin.tests.data.bean.Country;
+import com.vaadin.tests.data.bean.Person;
+import com.vaadin.tests.data.bean.Sex;
+import com.vaadin.ui.TextField;
+
+public class DoubleInTextField extends AbstractComponentDataBindingTest {
+
+ @Override
+ protected void createFields() {
+ Person person = new Person("John", "Doe", "john@doe.com", 78, Sex.MALE,
+ new Address("Dovestreet 12", 12233, "Johnston",
+ Country.SOUTH_AFRICA));
+
+ TextField salary = new TextField("Vaadin 7 - TextField with Double");
+ addComponent(salary);
+ salary.setPropertyDataSource(new MethodProperty<Double>(person,
+ "salaryDouble"));
+
+ TextField salary6 = new TextField("Vaadin 6 - TextField with Double");
+ addComponent(salary6);
+ salary6.setPropertyDataSource(new MethodProperty<Double>(person,
+ "salaryDouble"));
+ salary6.setConverter(new Vaadin6ImplicitDoubleConverter());
+
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/IntegerDoubleFieldsWithDataSource.java b/tests/testbench/com/vaadin/tests/components/abstractfield/IntegerDoubleFieldsWithDataSource.java
new file mode 100644
index 0000000000..c13aadd895
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/IntegerDoubleFieldsWithDataSource.java
@@ -0,0 +1,64 @@
+package com.vaadin.tests.components.abstractfield;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.data.validator.DoubleValidator;
+import com.vaadin.data.validator.IntegerValidator;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.TextField;
+
+public class IntegerDoubleFieldsWithDataSource extends TestBase {
+
+ private Log log = new Log(5);
+
+ @Override
+ protected void setup() {
+ addComponent(log);
+
+ TextField tf = createIntegerTextField();
+ tf.addValidator(new IntegerValidator("Must be an Integer"));
+ addComponent(tf);
+
+ tf = createIntegerTextField();
+ tf.setCaption("Enter a double");
+ tf.setPropertyDataSource(new ObjectProperty<Double>(2.1));
+ tf.addValidator(new DoubleValidator("Must be a Double"));
+ addComponent(tf);
+ }
+
+ private TextField createIntegerTextField() {
+ final TextField tf = new TextField("Enter an integer");
+ tf.setPropertyDataSource(new ObjectProperty<Integer>(new Integer(2)));
+ tf.setImmediate(true);
+ tf.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ try {
+ log.log("Value for " + tf.getCaption() + " changed to "
+ + tf.getValue());
+ log.log("Converted value is " + tf.getConvertedValue());
+ } catch (Exception e) {
+ // TODO: handle exception
+ e.printStackTrace();
+ }
+ }
+ });
+
+ return tf;
+ }
+
+ @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/abstractfield/IntegerFieldWithoutDataSource.java b/tests/testbench/com/vaadin/tests/components/abstractfield/IntegerFieldWithoutDataSource.java
new file mode 100644
index 0000000000..b25dc9d953
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/IntegerFieldWithoutDataSource.java
@@ -0,0 +1,59 @@
+package com.vaadin.tests.components.abstractfield;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.TextField;
+
+public class IntegerFieldWithoutDataSource extends TestBase {
+
+ private Log log = new Log(5);
+
+ @Override
+ protected void setup() {
+ addComponent(log);
+
+ TextField tf = createIntegerTextField();
+ tf.setCaption(tf.getCaption() + "(invalid allowed)");
+ addComponent(tf);
+ tf = createIntegerTextField();
+ tf.setInvalidAllowed(false);
+ tf.setCaption(tf.getCaption() + "(invalid not allowed)");
+ addComponent(tf);
+ }
+
+ private TextField createIntegerTextField() {
+ final TextField tf = new TextField("Enter an integer");
+ tf.setConverter(Integer.class);
+ tf.setImmediate(true);
+ tf.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ try {
+ log.log("Value for " + tf.getCaption() + " changed to "
+ + tf.getValue());
+ log.log("Converted value is " + tf.getConvertedValue());
+ } catch (Exception e) {
+ // TODO: handle exception
+ e.printStackTrace();
+ }
+ }
+ });
+
+ return tf;
+ }
+
+ @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/abstractfield/TextFieldConversions.java b/tests/testbench/com/vaadin/tests/components/abstractfield/TextFieldConversions.java
new file mode 100644
index 0000000000..8ce214918d
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/TextFieldConversions.java
@@ -0,0 +1,51 @@
+package com.vaadin.tests.components.abstractfield;
+
+import java.util.Date;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.terminal.UserError;
+import com.vaadin.ui.AbstractComponent.ComponentErrorEvent;
+import com.vaadin.ui.AbstractComponent.ComponentErrorHandler;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.TextField;
+
+public class TextFieldConversions extends AbstractComponentDataBindingTest {
+
+ private TextField tf;
+
+ private Object o;
+
+ private ComboBox dataType;
+
+ @Override
+ protected void createFields() {
+ dataType = new ComboBox("Data type");
+ dataType.setImmediate(true);
+ dataType.addItem(Long.class);
+ dataType.addItem(Integer.class);
+ dataType.addItem(Double.class);
+ dataType.addItem(Date.class);
+ dataType.addItem(String.class);
+
+ dataType.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ tf.setPropertyDataSource(new ObjectProperty<Object>(o,
+ (Class<Object>) dataType.getValue()));
+ }
+ });
+ addComponent(dataType);
+
+ tf = new TextField("TextField");
+ addComponent(tf);
+ tf.setErrorHandler(new ComponentErrorHandler() {
+
+ public boolean handleComponentError(ComponentErrorEvent event) {
+ tf.setComponentError(new UserError("Invalid value"));
+ return true;
+ }
+ });
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java b/tests/testbench/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java
new file mode 100644
index 0000000000..0228a59f06
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java
@@ -0,0 +1,35 @@
+package com.vaadin.tests.components.abstractfield;
+
+import java.util.Locale;
+
+import com.vaadin.data.util.converter.Converter;
+
+public class Vaadin6ImplicitDoubleConverter implements
+ Converter<String, Double> {
+
+ public Double convertToModel(String value, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ if (null == value) {
+ return null;
+ }
+ return new Double(value.toString());
+ }
+
+ public String convertToPresentation(Double value, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ if (value == null) {
+ return null;
+ }
+ return value.toString();
+
+ }
+
+ public Class<Double> getModelType() {
+ return Double.class;
+ }
+
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonDisableOnClick.html b/tests/testbench/com/vaadin/tests/components/button/ButtonDisableOnClick.html
index 850d553b5b..d39f72ef1f 100644
--- a/tests/testbench/com/vaadin/tests/components/button/ButtonDisableOnClick.html
+++ b/tests/testbench/com/vaadin/tests/components/button/ButtonDisableOnClick.html
@@ -16,7 +16,7 @@
<td>/run/com.vaadin.tests.components.button.Buttons2?restartApplication</td>
<td></td>
</tr>
-<!--value change listener-->
+<!--click listener-->
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsbuttonButtons2::PID_Smenu#item0</td>
@@ -29,7 +29,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::Root/VOverlay[1]/VMenuBar[0]#item4</td>
+ <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::Root/VOverlay[1]/VMenuBar[0]#item2</td>
<td>35,8</td>
</tr>
<!--disable on click-->
@@ -45,7 +45,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::Root/VOverlay[1]/VMenuBar[0]#item1</td>
+ <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::Root/VOverlay[1]/VMenuBar[0]#item0</td>
<td>22,4</td>
</tr>
<tr>
@@ -133,7 +133,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::Root/VOverlay[1]/VMenuBar[0]#item1</td>
+ <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::Root/VOverlay[1]/VMenuBar[0]#item0</td>
<td>36,3</td>
</tr>
<tr>
@@ -151,7 +151,6 @@
<td>vaadin=runcomvaadintestscomponentsbuttonButtons2::PID_StestComponent</td>
<td>v-disabled</td>
</tr>
-
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonMouseDetails.java b/tests/testbench/com/vaadin/tests/components/button/ButtonMouseDetails.java
index 40caf620a8..deab87f8a2 100644
--- a/tests/testbench/com/vaadin/tests/components/button/ButtonMouseDetails.java
+++ b/tests/testbench/com/vaadin/tests/components/button/ButtonMouseDetails.java
@@ -3,12 +3,12 @@ package com.vaadin.tests.components.button;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
public class ButtonMouseDetails extends TestBase {
- private Label out = new Label("", Label.CONTENT_PREFORMATTED);
+ private Label out = new Label("", ContentMode.PREFORMATTED);
private int clickCounter = 1;
@@ -46,10 +46,6 @@ public class ButtonMouseDetails extends TestBase {
button.setImmediate(true);
addComponent(button);
- CheckBox cb = new CheckBox("CHECK ME!", clickListener);
- cb.setImmediate(true);
- addComponent(cb);
-
addComponent(out);
}
diff --git a/tests/testbench/com/vaadin/tests/components/button/Buttons.java b/tests/testbench/com/vaadin/tests/components/button/Buttons.java
index afbc90d197..573c95c2b8 100644
--- a/tests/testbench/com/vaadin/tests/components/button/Buttons.java
+++ b/tests/testbench/com/vaadin/tests/components/button/Buttons.java
@@ -46,13 +46,7 @@ public class Buttons extends ComponentTestCase<Button> {
l.setWidth("100%");
l.setHeight("65px");
- boolean ie6 = (getBrowser().isIE() && getBrowser()
- .getBrowserMajorVersion() == 6);
- if (!ie6 || !nat) {
- // Skip this NativeButton for IE6 as it can't decide how to
- // render it
- addTestComponent(l);
- }
+ addTestComponent(l);
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/button/Buttons2.java b/tests/testbench/com/vaadin/tests/components/button/Buttons2.java
index b65a9fc0cd..e04d50bddb 100644
--- a/tests/testbench/com/vaadin/tests/components/button/Buttons2.java
+++ b/tests/testbench/com/vaadin/tests/components/button/Buttons2.java
@@ -2,22 +2,14 @@ package com.vaadin.tests.components.button;
import java.util.LinkedHashMap;
-import com.vaadin.tests.components.abstractfield.AbstractFieldTest;
+import com.vaadin.tests.components.AbstractComponentTest;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.themes.Reindeer;
-public class Buttons2<T extends Button> extends AbstractFieldTest<T> implements
- ClickListener {
-
- private Command<T, Boolean> switchModeCommand = new Command<T, Boolean>() {
-
- @SuppressWarnings("deprecation")
- public void execute(T c, Boolean value, Object data) {
- c.setSwitchMode(value);
- }
- };
+public class Buttons2<T extends Button> extends AbstractComponentTest<T>
+ implements ClickListener {
private Command<T, Boolean> disableOnClickCommand = new Command<T, Boolean>() {
@@ -38,6 +30,7 @@ public class Buttons2<T extends Button> extends AbstractFieldTest<T> implements
}
};
+ @SuppressWarnings("unchecked")
@Override
protected Class<T> getTestClass() {
return (Class<T>) Button.class;
@@ -47,8 +40,9 @@ public class Buttons2<T extends Button> extends AbstractFieldTest<T> implements
protected void createActions() {
super.createActions();
- createBooleanAction("Switch mode", CATEGORY_FEATURES, false,
- switchModeCommand);
+ createFocusListener(CATEGORY_LISTENERS);
+ createBlurListener(CATEGORY_LISTENERS);
+
createBooleanAction("Disable on click", CATEGORY_FEATURES, false,
disableOnClickCommand);
addClickListener(CATEGORY_LISTENERS);
diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonsInHorizontalLayout.java b/tests/testbench/com/vaadin/tests/components/button/ButtonsInHorizontalLayout.java
index 46d92c3a03..bdabed3032 100644
--- a/tests/testbench/com/vaadin/tests/components/button/ButtonsInHorizontalLayout.java
+++ b/tests/testbench/com/vaadin/tests/components/button/ButtonsInHorizontalLayout.java
@@ -3,8 +3,8 @@ package com.vaadin.tests.components.button;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
import com.vaadin.ui.themes.BaseTheme;
public class ButtonsInHorizontalLayout extends AbstractTestCase {
@@ -18,7 +18,7 @@ public class ButtonsInHorizontalLayout extends AbstractTestCase {
content.addComponent(createButtonLayout(null));
content.addComponent(createButtonLayout(BaseTheme.BUTTON_LINK));
- setMainWindow(new Window("", content));
+ setMainWindow(new LegacyWindow("", content));
}
private HorizontalLayout createButtonLayout(String style) {
diff --git a/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java b/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java
index 3d4dfeda04..f338b1ac90 100644
--- a/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java
+++ b/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java
@@ -6,8 +6,8 @@ import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
@SuppressWarnings("serial")
public class ShortCutListenerModification extends TestBase implements
@@ -36,6 +36,9 @@ public class ShortCutListenerModification extends TestBase implements
Button button1 = new Button("b1 (CTRL-C)");
Button button2 = new Button("b2 (CTRL-V)");
+ button1.setData(window);
+ button2.setData(window);
+
button1.addListener(this);
button2.addListener(this);
@@ -60,8 +63,8 @@ public class ShortCutListenerModification extends TestBase implements
}
public void buttonClick(ClickEvent event) {
- Window window2 = event.getButton().getWindow();
- window2.getParent().removeWindow(window2);
+ Window window2 = (Window) event.getButton().getData();
+ window2.close();
Button prev = (Button) event.getButton().getData();
if (prev != null) {
prev.focus();
diff --git a/tests/testbench/com/vaadin/tests/components/caption/IconsInCaption.java b/tests/testbench/com/vaadin/tests/components/caption/IconsInCaption.java
index 926088ff48..428ebdb66b 100644
--- a/tests/testbench/com/vaadin/tests/components/caption/IconsInCaption.java
+++ b/tests/testbench/com/vaadin/tests/components/caption/IconsInCaption.java
@@ -10,6 +10,7 @@ import com.vaadin.ui.ComboBox;
import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.VerticalLayout;
public class IconsInCaption extends TestBase {
@@ -103,7 +104,7 @@ public class IconsInCaption extends TestBase {
ComponentContainer container = containerClass.newInstance();
for (String size : sizes) {
Label title = new Label("<h3>" + size + "x" + size + "</h3>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
container.addComponent(title);
for (String icon : icons) {
ThemeResource res = new ThemeResource("../runo/icons/" + size
diff --git a/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes2.java b/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes2.java
index 2af1e41867..4f9cd10ecc 100644
--- a/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes2.java
+++ b/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes2.java
@@ -8,46 +8,15 @@ import com.vaadin.ui.CheckBox;
public class CheckBoxes2 extends AbstractFieldTest<CheckBox> implements
ClickListener {
- // cannot extend Buttons2 because of Switch mode problems
-
@Override
protected Class<CheckBox> getTestClass() {
return CheckBox.class;
}
- private Command<CheckBox, Boolean> switchModeCommand = new Command<CheckBox, Boolean>() {
-
- @SuppressWarnings("deprecation")
- public void execute(CheckBox c, Boolean value, Object data) {
- c.setSwitchMode(value);
- }
- };
-
- private Command<CheckBox, Boolean> clickListenerCommand = new Command<CheckBox, Boolean>() {
-
- public void execute(CheckBox c, Boolean value, Object data) {
- if (value) {
- c.addListener((ClickListener) CheckBoxes2.this);
- } else {
- c.removeListener((ClickListener) CheckBoxes2.this);
- }
-
- }
- };
-
@Override
protected void createActions() {
super.createActions();
- createBooleanAction("Switch mode", CATEGORY_FEATURES, true,
- switchModeCommand);
- addClickListener(CATEGORY_LISTENERS);
- }
-
- private void addClickListener(String category) {
- createBooleanAction("Click listener", category, false,
- clickListenerCommand);
-
}
public void buttonClick(ClickEvent event) {
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java
index 8160fb576e..70aad31364 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java
@@ -18,13 +18,13 @@ public class ComboBoxInPopup extends TestBase {
Button close = new Button("Close window", new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- w.getParent().removeWindow(w);
+ w.close();
}
});
close.setClickShortcut(KeyCode.ESCAPE, null);
w.addComponent(close);
- getLayout().getWindow().addWindow(w);
+ getLayout().getRoot().addWindow(w);
}
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxReapperingOldValue.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxReapperingOldValue.java
index 0e295231c5..c78ff7675f 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxReapperingOldValue.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxReapperingOldValue.java
@@ -8,19 +8,19 @@ import com.vaadin.data.util.IndexedContainer;
import com.vaadin.ui.AbstractSelect;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
@SuppressWarnings("serial")
-public class ComboBoxReapperingOldValue extends Application implements
- ValueChangeListener {
+public class ComboBoxReapperingOldValue extends Application.LegacyApplication
+ implements ValueChangeListener {
ComboBox cbox1 = new ComboBox();
ComboBox cbox2 = new ComboBox();
@Override
public void init() {
- Window mainWindow = new Window("ComboBoxCacheTest");
+ LegacyWindow mainWindow = new LegacyWindow("ComboBoxCacheTest");
setMainWindow(mainWindow);
VerticalLayout layout = new VerticalLayout();
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSuggestionOnDetach.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSuggestionOnDetach.java
index 134e13e49c..09354fdacf 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSuggestionOnDetach.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSuggestionOnDetach.java
@@ -17,7 +17,7 @@ public class ComboBoxSuggestionOnDetach extends TestBase {
"Option 2", "Option 3"));
comboBox.addListener(new FieldEvents.FocusListener() {
public void focus(FocusEvent event) {
- popup.getParent().removeWindow(popup);
+ popup.close();
}
});
popup.addComponent(comboBox);
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java
index 6681342ea6..027cf5fd24 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java
@@ -10,6 +10,7 @@ import com.vaadin.event.FieldEvents.FocusEvent;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.TextField;
public class ComboFocusBlurEvents extends TestBase {
@@ -18,18 +19,18 @@ public class ComboFocusBlurEvents extends TestBase {
@Override
protected void setup() {
-
+
List<String> list = new ArrayList<String>();
for (int i = 0; i < 100; i++) {
list.add("Item " + i);
}
-
+
ComboBox cb = new ComboBox("Combobox", list);
cb.setImmediate(true);
cb.setInputPrompt("Enter text");
cb.setDescription("Some Combobox");
addComponent(cb);
-
+
final ObjectProperty<String> log = new ObjectProperty<String>("");
cb.addListener(new FieldEvents.FocusListener() {
@@ -47,7 +48,7 @@ public class ComboFocusBlurEvents extends TestBase {
counter++;
}
});
-
+
TextField field = new TextField("Some textfield");
field.setImmediate(true);
addComponent(field);
@@ -55,7 +56,7 @@ public class ComboFocusBlurEvents extends TestBase {
Label output = new Label(log);
output.setCaption("Events:");
- output.setContentMode(Label.CONTENT_XHTML);
+ output.setContentMode(ContentMode.XHTML);
addComponent(output);
}
diff --git a/tests/testbench/com/vaadin/tests/components/customcomponent/ClipContent.java b/tests/testbench/com/vaadin/tests/components/customcomponent/ClipContent.java
index 8bc464f176..7ba26e54a9 100644
--- a/tests/testbench/com/vaadin/tests/components/customcomponent/ClipContent.java
+++ b/tests/testbench/com/vaadin/tests/components/customcomponent/ClipContent.java
@@ -5,6 +5,7 @@ import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.TextField;
public class ClipContent extends TestBase {
@@ -14,7 +15,7 @@ public class ClipContent extends TestBase {
Label text = new Label(
"1_long_line_that_should_be_clipped<br/>2_long_line_that_should_be_clipped<br/>3_long_line_that_should_be_clipped<br/>4_long_line_that_should_be_clipped<br/>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
final CustomComponent cc = new CustomComponent(text);
cc.setWidth("20px");
@@ -24,7 +25,7 @@ public class ClipContent extends TestBase {
w.setValue("20px");
w.addListener(new TextField.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- cc.setWidth((String) w.getValue());
+ cc.setWidth(w.getValue());
}
});
addComponent(w);
@@ -32,7 +33,7 @@ public class ClipContent extends TestBase {
h.setValue("20px");
h.addListener(new TextField.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- cc.setHeight((String) h.getValue());
+ cc.setHeight(h.getValue());
}
});
addComponent(h);
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/AbstractNestedFormExample.java b/tests/testbench/com/vaadin/tests/components/customfield/AbstractNestedFormExample.java
new file mode 100644
index 0000000000..c15ca1916a
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/AbstractNestedFormExample.java
@@ -0,0 +1,75 @@
+package com.vaadin.tests.components.customfield;
+
+import com.vaadin.data.Item;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Person;
+import com.vaadin.ui.Table;
+
+/**
+ * Demonstrate the use of a form as a custom field within another form.
+ */
+public abstract class AbstractNestedFormExample extends TestBase {
+ private NestedPersonForm personForm;
+ private boolean embeddedAddress;
+
+ public void setup(boolean embeddedAddress) {
+ this.embeddedAddress = embeddedAddress;
+
+ addComponent(getPersonTable());
+ }
+
+ /**
+ * Creates a table with two person objects
+ */
+ public Table getPersonTable() {
+ Table table = new Table();
+ table.setPageLength(5);
+ table.setSelectable(true);
+ table.setImmediate(true);
+ table.setNullSelectionAllowed(true);
+ table.addContainerProperty("Name", String.class, null);
+ table.addListener(getTableValueChangeListener());
+ Person person = new Person("Teppo", "Testaaja",
+ "teppo.testaaja@example.com", "", "Ruukinkatu 2–4", 20540,
+ "Turku");
+ Person person2 = new Person("Taina", "Testaaja",
+ "taina.testaaja@example.com", "", "Ruukinkatu 2–4", 20540,
+ "Turku");
+ Item item = table.addItem(person);
+ item.getItemProperty("Name").setValue(
+ person.getFirstName() + " " + person.getLastName());
+ item = table.addItem(person2);
+ item.getItemProperty("Name").setValue(
+ person2.getFirstName() + " " + person2.getLastName());
+ return table;
+ }
+
+ /**
+ * Creates value change listener for the table
+ */
+ private Property.ValueChangeListener getTableValueChangeListener() {
+ return new Property.ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ if (personForm != null) {
+ removeComponent(personForm);
+ }
+ if (event.getProperty().getValue() != null) {
+ personForm = new NestedPersonForm((Person) event
+ .getProperty().getValue(), embeddedAddress);
+ personForm.setWidth("350px");
+ addComponent(personForm);
+ }
+ }
+
+ };
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/AddressField.java b/tests/testbench/com/vaadin/tests/components/customfield/AddressField.java
new file mode 100644
index 0000000000..a3ee89b3ee
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/AddressField.java
@@ -0,0 +1,97 @@
+package com.vaadin.tests.components.customfield;
+
+import java.util.Arrays;
+import java.util.List;
+
+import com.vaadin.data.Buffered;
+import com.vaadin.data.Validator.InvalidValueException;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.util.Address;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.CustomField;
+import com.vaadin.ui.Form;
+
+/**
+ * Nested form for the Address object of the Person object
+ */
+public class AddressField extends CustomField<Address> {
+ private Form addressForm;
+ private final Form parentForm;
+
+ public AddressField() {
+ this(null);
+ }
+
+ public AddressField(Form parentForm) {
+ this.parentForm = parentForm;
+ }
+
+ @Override
+ protected Component initContent() {
+ if (parentForm != null) {
+ addressForm = new EmbeddedForm(parentForm);
+ } else {
+ addressForm = new Form();
+ }
+ addressForm.setCaption("Address");
+ addressForm.setWriteThrough(false);
+
+ // make sure field changes are sent early
+ addressForm.setImmediate(true);
+
+ return addressForm;
+ }
+
+ @Override
+ protected Form getContent() {
+ return (Form) super.getContent();
+ }
+
+ @Override
+ public void setInternalValue(Address address) throws ReadOnlyException {
+ // create the address if not given
+ if (null == address) {
+ address = new Address();
+ }
+
+ super.setInternalValue(address);
+
+ // set item data source and visible properties in a single operation to
+ // avoid creating fields multiple times
+ List<String> visibleProperties = Arrays.asList("streetAddress",
+ "postalCode", "city");
+ getContent().setItemDataSource(new BeanItem<Address>(address),
+ visibleProperties);
+ }
+
+ /**
+ * commit changes of the address form
+ */
+ @Override
+ public void commit() throws Buffered.SourceException, InvalidValueException {
+ addressForm.commit();
+ super.commit();
+ }
+
+ /**
+ * discard changes of the address form
+ */
+ @Override
+ public void discard() throws Buffered.SourceException {
+ // Do not discard the top-level value
+ // super.discard();
+ addressForm.discard();
+ }
+
+ @Override
+ public boolean isReadOnly() {
+ // In this application, the address is modified implicitly by
+ // addressForm.commit(), not by setting the Address object for a Person.
+ return false;
+ }
+
+ @Override
+ public Class<Address> getType() {
+ return Address.class;
+ }
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/AddressFormExample.java b/tests/testbench/com/vaadin/tests/components/customfield/AddressFormExample.java
new file mode 100644
index 0000000000..55e61e3980
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/AddressFormExample.java
@@ -0,0 +1,45 @@
+package com.vaadin.tests.components.customfield;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Address;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+
+/**
+ * Demonstrate a custom field which is a form, and contains another custom field
+ * for the selection of a city.
+ */
+public class AddressFormExample extends TestBase {
+
+ @Override
+ protected void setup() {
+ Address address = new Address("Ruukinkatu 2-4", 20540, "Turku");
+ final AddressField field = new AddressField();
+ field.setValue(address);
+
+ addComponent(field);
+
+ Button commitButton = new Button("Save", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ field.commit();
+ Address address = field.getValue();
+ field.getRoot().showNotification(
+ "Address saved: " + address.getStreetAddress() + ", "
+ + address.getPostalCode() + ", "
+ + address.getCity());
+ }
+ });
+ addComponent(commitButton);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Custom field for editing an Address";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/BooleanField.java b/tests/testbench/com/vaadin/tests/components/customfield/BooleanField.java
new file mode 100644
index 0000000000..dc60d7e517
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/BooleanField.java
@@ -0,0 +1,45 @@
+package com.vaadin.tests.components.customfield;
+
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.CustomField;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.VerticalLayout;
+
+/**
+ * An example of a custom field for editing a boolean value. The field is
+ * composed of multiple components, and could also edit a more complex data
+ * structures. Here, the commit etc. logic is not overridden.
+ */
+public class BooleanField extends CustomField {
+
+ @Override
+ protected Component initContent() {
+ VerticalLayout layout = new VerticalLayout();
+
+ layout.addComponent(new Label("Please click the button"));
+
+ final Button button = new Button("Click me");
+ button.addListener(new ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ Object value = getValue();
+ boolean newValue = true;
+ if ((value instanceof Boolean) && ((Boolean) value)) {
+ newValue = false;
+ }
+ setValue(newValue);
+ button.setCaption(newValue ? "On" : "Off");
+ }
+ });
+ layout.addComponent(button);
+
+ return layout;
+ }
+
+ @Override
+ public Class<?> getType() {
+ return Boolean.class;
+ }
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.html b/tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.html
new file mode 100644
index 0000000000..6b1b3e8a2d
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.html
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>BooleanFieldExample</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">BooleanFieldExample</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.customfield.BooleanFieldExample?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>initial</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldBooleanFieldExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCustomComponent[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>on</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldBooleanFieldExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCustomComponent[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>off</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.java b/tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.java
new file mode 100644
index 0000000000..2f9720a1c1
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.java
@@ -0,0 +1,89 @@
+package com.vaadin.tests.components.customfield;
+
+import com.vaadin.data.Item;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.DefaultFieldFactory;
+import com.vaadin.ui.Field;
+import com.vaadin.ui.Form;
+import com.vaadin.ui.VerticalLayout;
+
+public class BooleanFieldExample extends TestBase {
+
+ /**
+ * Data model class with two boolean fields.
+ */
+ public static class TwoBooleans {
+ private boolean normal;
+ private boolean custom;
+
+ public void setNormal(boolean normal) {
+ this.normal = normal;
+ }
+
+ public boolean isNormal() {
+ return normal;
+ }
+
+ public void setCustom(boolean custom) {
+ this.custom = custom;
+ }
+
+ public boolean isCustom() {
+ return custom;
+ }
+ }
+
+ @Override
+ protected void setup() {
+ final VerticalLayout layout = new VerticalLayout();
+ layout.setMargin(true);
+
+ final Form form = new Form();
+ form.setFormFieldFactory(new DefaultFieldFactory() {
+ @Override
+ public Field createField(Item item, Object propertyId,
+ Component uiContext) {
+ if ("custom".equals(propertyId)) {
+ return new BooleanField();
+ }
+ return super.createField(item, propertyId, uiContext);
+ }
+ });
+ final TwoBooleans data = new TwoBooleans();
+ form.setItemDataSource(new BeanItem<TwoBooleans>(data));
+
+ layout.addComponent(form);
+
+ Button submit = new Button("Submit", new ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ form.commit();
+ layout.getRoot()
+ .showNotification(
+ "The custom boolean field value is "
+ + data.isCustom()
+ + ".<br>"
+ + "The checkbox (default boolean field) value is "
+ + data.isNormal() + ".");
+ }
+ });
+ layout.addComponent(submit);
+
+ addComponent(layout);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "A customized field (a two-state button) for editing a boolean value.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/EmbeddedForm.java b/tests/testbench/com/vaadin/tests/components/customfield/EmbeddedForm.java
new file mode 100644
index 0000000000..d305afde1d
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/EmbeddedForm.java
@@ -0,0 +1,67 @@
+package com.vaadin.tests.components.customfield;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.vaadin.ui.CustomLayout;
+import com.vaadin.ui.Field;
+import com.vaadin.ui.Form;
+import com.vaadin.ui.Layout;
+
+/**
+ * Form that displays its fields in the layout of another form.
+ *
+ * The fields are still logically part of this form even though they are in the
+ * layout of the parent form. The embedded form itself is automatically hidden.
+ *
+ * TODO Known issue: any field factory creating an {@link EmbeddedForm}
+ * (directly or indirectly) should re-use the field once it has been created to
+ * avoid the creation of duplicate fields when e.g. setting the visible item
+ * properties.
+ */
+public class EmbeddedForm extends Form {
+ private Form parentForm;
+ private Map<Object, Field> fields = new HashMap<Object, Field>();
+
+ /**
+ * Create a form that places its fields in another {@link Form}.
+ *
+ * @param parentForm
+ * form to which to embed the fields, not null
+ */
+ public EmbeddedForm(Form parentForm) {
+ this.parentForm = parentForm;
+ setVisible(false);
+ }
+
+ @Override
+ protected void attachField(Object propertyId, Field field) {
+ if (propertyId == null || field == null) {
+ return;
+ }
+
+ Layout layout = parentForm.getLayout();
+
+ Field oldField = fields.get(propertyId);
+ if (oldField != null) {
+ layout.removeComponent(oldField);
+ }
+
+ fields.put(propertyId, field);
+
+ if (layout instanceof CustomLayout) {
+ ((CustomLayout) layout).addComponent(field, propertyId.toString());
+ } else {
+ layout.addComponent(field);
+ }
+ }
+
+ @Override
+ public boolean removeItemProperty(Object id) {
+ // remove the field from the parent layout if already added there
+ parentForm.getLayout().removeComponent(fields.get(id));
+ fields.remove(id);
+
+ return super.removeItemProperty(id);
+ }
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/EmbeddedFormExample.html b/tests/testbench/com/vaadin/tests/components/customfield/EmbeddedFormExample.html
new file mode 100644
index 0000000000..2af441bc83
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/EmbeddedFormExample.html
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="http://localhost:8888/" />
+<title>EmbeddedFormExample</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">EmbeddedFormExample</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.customfield.EmbeddedFormExample?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>66,10</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>initial</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[4]</td>
+ <td>Turkuaa</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[4]</td>
+ <td>Turku</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[4]</td>
+ <td>Helsinki</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[4]</td>
+ <td>Helsinki</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>52,15</td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[4]</td>
+ <td>Turku</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>56,10</td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[4]</td>
+ <td>Helsinki</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/EmbeddedFormExample.java b/tests/testbench/com/vaadin/tests/components/customfield/EmbeddedFormExample.java
new file mode 100644
index 0000000000..aeb1984937
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/EmbeddedFormExample.java
@@ -0,0 +1,17 @@
+package com.vaadin.tests.components.customfield;
+
+public class EmbeddedFormExample extends AbstractNestedFormExample {
+
+ @Override
+ protected void setup() {
+ super.setup(true);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "An address form embedded in a person form.\n"
+ + "The address fields are placed in the layout of the parent (person) form.\n"
+ + "Note that in many cases the same result can be achieved with a property that maps subfields to the top level.";
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/NestedFormExample.html b/tests/testbench/com/vaadin/tests/components/customfield/NestedFormExample.html
new file mode 100644
index 0000000000..f9f5783c05
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/NestedFormExample.html
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>NestedFormExample</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">NestedFormExample</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.customfield.NestedFormExample?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>33,9</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[2]</td>
+ <td>Turkuaa</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[2]</td>
+ <td>Turku</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[2]</td>
+ <td>Helsinki</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[2]</td>
+ <td>Helsinki</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>56,14</td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[2]</td>
+ <td>Turku</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>30,9</td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[2]</td>
+ <td>Helsinki</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/NestedFormExample.java b/tests/testbench/com/vaadin/tests/components/customfield/NestedFormExample.java
new file mode 100644
index 0000000000..91fb43f4e2
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/NestedFormExample.java
@@ -0,0 +1,15 @@
+package com.vaadin.tests.components.customfield;
+
+public class NestedFormExample extends AbstractNestedFormExample {
+
+ @Override
+ protected void setup() {
+ super.setup(false);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "An address form nested in a person form.";
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/NestedPersonForm.java b/tests/testbench/com/vaadin/tests/components/customfield/NestedPersonForm.java
new file mode 100644
index 0000000000..e0a3b08bc7
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/NestedPersonForm.java
@@ -0,0 +1,94 @@
+package com.vaadin.tests.components.customfield;
+
+import java.util.Arrays;
+
+import com.vaadin.data.Item;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.util.Person;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.DefaultFieldFactory;
+import com.vaadin.ui.Field;
+import com.vaadin.ui.Form;
+import com.vaadin.ui.HorizontalLayout;
+
+/**
+ * Example of nested forms
+ */
+public class NestedPersonForm extends Form {
+ private BeanItem<Person> beanItem;
+ private final boolean embeddedAddress;
+
+ /**
+ * Creates a person form which contains nested form for the persons address
+ */
+ public NestedPersonForm(Person person, boolean embeddedAddress) {
+ this.embeddedAddress = embeddedAddress;
+
+ beanItem = new BeanItem<Person>(person);
+ setCaption("Update person details");
+ setWriteThrough(false);
+ 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
+ // form, styles from the parent (padding, ...) may leak to its contents.
+ setItemDataSource(beanItem, Arrays.asList("firstName", "lastName",
+ "address", "email", "phoneNumber"));
+ getFooter().addComponent(getButtonsLayout());
+ getFooter().setMargin(false, false, true, true);
+ }
+
+ /**
+ * Get apply and discard button in the layout
+ */
+ private Component getButtonsLayout() {
+ HorizontalLayout buttons = new HorizontalLayout();
+ buttons.setSpacing(true);
+ Button discardChanges = new Button("Discard changes",
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ NestedPersonForm.this.discard();
+ }
+ });
+ buttons.addComponent(discardChanges);
+ buttons.setComponentAlignment(discardChanges, Alignment.MIDDLE_LEFT);
+
+ Button apply = new Button("Apply", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ try {
+ NestedPersonForm.this.commit();
+ } catch (Exception e) {
+ // Ignored, we'll let the Form handle the errors
+ }
+ }
+ });
+ buttons.addComponent(apply);
+ return buttons;
+ }
+
+ /**
+ * Field factory for person form
+ */
+ private class PersonFieldFactory extends DefaultFieldFactory {
+ // reuse the address field - required by EmbeddedForm
+ private AddressField addressField;
+
+ @Override
+ public Field createField(Item item, Object propertyId,
+ Component uiContext) {
+ Field f = super.createField(item, propertyId, uiContext);
+ if ("address".equals(propertyId)) {
+ // create a custom field for the Address object
+ if (addressField == null) {
+ Form form = (embeddedAddress && uiContext instanceof Form) ? (Form) uiContext
+ : null;
+ addressField = new AddressField(form);
+ }
+ f = addressField;
+ }
+ return f;
+ }
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.html b/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.html
index 29ad93c6c6..8420888098 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.html
+++ b/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.html
@@ -45,12 +45,12 @@
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldCommitInvalid::PID_SLog_row_2</td>
- <td>4. Commit failed : Not an integer</td>
+ <td>4. Commit failed : Could not convert value to Integer</td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldCommitInvalid::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/domChild[0]/domChild[2]/domChild[0]</td>
- <td>Not an integer</td>
+ <td>Could not convert value to Integer</td>
</tr>
<tr>
<td>assertText</td>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.java b/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.java
index 36ee068af4..1395b4d735 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.java
@@ -6,7 +6,6 @@ import java.util.Locale;
import com.vaadin.data.Validator.InvalidValueException;
import com.vaadin.data.util.ObjectProperty;
-import com.vaadin.data.validator.IntegerValidator;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Log;
import com.vaadin.ui.Button;
@@ -64,7 +63,6 @@ public class CommitInvalid extends TestBase {
*/
integerProperty = new ObjectProperty<Integer>(42);
integerField = new TextField("Another Field", integerProperty);
- integerField.addValidator(new IntegerValidator("Not an integer"));
integerField.setDebugId("_IF");
form.addField("text", integerField);
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java
index 440f004531..37fb09ab29 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java
@@ -14,6 +14,7 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.DateField;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.PopupDateField;
@SuppressWarnings("serial")
@@ -36,7 +37,7 @@ public class DateFieldEmptyValid extends TestBase {
@Override
protected void setup() {
- addComponent(new Label("<br/><br/>", Label.CONTENT_XHTML));
+ addComponent(new Label("<br/><br/>", ContentMode.XHTML));
log = new Log(8);
addComponent(log);
df = new MyDateField();
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java
index 18bc719850..298359068e 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java
@@ -13,6 +13,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.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
@@ -59,9 +60,9 @@ public class DateFieldInSubWindow extends AbstractTestCase {
public static final String COMMON_FIELD_WIDTH = "12em";
@Override
- public Field createField(Item item, Object propertyId,
+ public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
- Field f = super.createField(item, propertyId, uiContext);
+ Field<?> f = super.createField(item, propertyId, uiContext);
if ("myDate".equals(propertyId)) {
((DateField) f).setResolution(DateField.RESOLUTION_MIN);
@@ -106,7 +107,7 @@ public class DateFieldInSubWindow extends AbstractTestCase {
Button b = new Button("Close", new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- (getParent()).removeWindow(TestCaseWindow.this);
+ TestCaseWindow.this.close();
}
});
buttons.addComponent(b);
@@ -118,7 +119,7 @@ public class DateFieldInSubWindow extends AbstractTestCase {
@Override
public void init() {
- Window mainWindow = new Window();
+ LegacyWindow mainWindow = new LegacyWindow();
setMainWindow(mainWindow);
Button open = new Button("Open window", new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldPopupOffScreen.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldPopupOffScreen.java
index 122fd4347f..6d64898e28 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldPopupOffScreen.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldPopupOffScreen.java
@@ -5,8 +5,9 @@ import java.sql.Date;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.DateField;
+import com.vaadin.ui.DateField.Resolution;
import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
public class DateFieldPopupOffScreen extends AbstractTestCase {
@@ -22,7 +23,7 @@ public class DateFieldPopupOffScreen extends AbstractTestCase {
@Override
public void init() {
- Window mainWindow = new Window(getClass().getName());
+ LegacyWindow mainWindow = new LegacyWindow(getClass().getName());
GridLayout mainLayout = new GridLayout(3, 3);
mainLayout.setSizeFull();
@@ -55,6 +56,7 @@ public class DateFieldPopupOffScreen extends AbstractTestCase {
private DateField createDateField() {
DateField df = new DateField();
+ df.setResolution(Resolution.SECOND);
df.setDescription("This is a long, multiline tooltip.<br/>It should always be on screen so it can be read.");
df.setValue(new Date(1000000L));
return df;
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.html b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.html
new file mode 100644
index 0000000000..25bd6357c3
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.html
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="http://localhost:8888/" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.datefield.DateFieldRangeValidation?restartApplication</td>
+ <td></td>
+</tr>
+<!--select 15.12.2011-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VPopupCalendar[0]#popupButton</td>
+ <td>11,17</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::Root/VOverlay[0]/VCalendarPanel[0]#day15</td>
+ <td>7,5</td>
+</tr>
+<!--should not be error-->
+<tr>
+ <td>assertElementNotPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[4]/domChild[1]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VCheckBox[0]/domChild[0]</td>
+ <td>26,6</td>
+</tr>
+<!--should be error-->
+<tr>
+ <td>assertElementPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[4]/domChild[1]/domChild[0]</td>
+ <td></td>
+</tr>
+<!--select 3.12.2011-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VPopupCalendar[0]#popupButton</td>
+ <td>13,17</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::Root/VOverlay[0]/VCalendarPanel[0]#day3</td>
+ <td>13,13</td>
+</tr>
+<!--should be error-->
+<tr>
+ <td>assertElementPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[4]/domChild[1]/domChild[0]</td>
+ <td></td>
+</tr>
+<!--change to 4.12.2011 by writing-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VPopupCalendar[0]#field</td>
+ <td>52,6</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VPopupCalendar[0]#field</td>
+ <td>12/4/11</td>
+</tr>
+<!--should not be error-->
+<tr>
+ <td>assertElementNotPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[4]/domChild[1]/domChild[0]</td>
+ <td></td>
+</tr>
+<!--no longer include start date-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VCheckBox[0]/domChild[0]</td>
+ <td>6,8</td>
+</tr>
+<!--should be error-->
+<tr>
+ <td>assertElementPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[4]/domChild[1]/domChild[0]</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java
new file mode 100644
index 0000000000..bf93d8c8b9
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java
@@ -0,0 +1,144 @@
+package com.vaadin.tests.components.datefield;
+
+import java.util.Date;
+import java.util.Locale;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.data.validator.RangeValidator;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.DateField.Resolution;
+import com.vaadin.ui.PopupDateField;
+
+public class DateFieldRangeValidation extends TestBase {
+
+ public class Range {
+ private Date from, to;
+ private boolean fromInclusive = true;
+ private boolean toInclusive = true;
+
+ public boolean isFromInclusive() {
+ return fromInclusive;
+ }
+
+ public void setFromInclusive(boolean fromInclusive) {
+ this.fromInclusive = fromInclusive;
+ }
+
+ public boolean isToInclusive() {
+ return toInclusive;
+ }
+
+ public void setToInclusive(boolean toInclusive) {
+ this.toInclusive = toInclusive;
+ }
+
+ public Date getFrom() {
+ return from;
+ }
+
+ public void setFrom(Date from) {
+ this.from = from;
+ }
+
+ public Date getTo() {
+ return to;
+ }
+
+ public void setTo(Date to) {
+ this.to = to;
+ }
+
+ }
+
+ private Range range = new Range();
+ private ValueChangeListener refreshField = new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ actualDateField.requestRepaint();
+ }
+ };
+
+ private PopupDateField actualDateField;
+
+ @Override
+ protected void setup() {
+ BeanItem<Range> bi = new BeanItem<Range>(range);
+ range.setFrom(new Date(2011 - 1900, 12 - 1, 4));
+ range.setTo(new Date(2011 - 1900, 12 - 1, 15));
+
+ PopupDateField fromField = createDateField();
+ fromField.setPropertyDataSource(bi.getItemProperty("from"));
+ CheckBox fromInclusive = new CheckBox("From inclusive",
+ bi.getItemProperty("fromInclusive"));
+ CheckBox toInclusive = new CheckBox("To inclusive",
+ bi.getItemProperty("toInclusive"));
+ fromInclusive.setImmediate(true);
+ fromInclusive.addListener(refreshField);
+ toInclusive.setImmediate(true);
+ toInclusive.addListener(refreshField);
+
+ PopupDateField toField = createDateField();
+ toField.setPropertyDataSource(bi.getItemProperty("to"));
+
+ actualDateField = createDateField();
+ actualDateField.setValue(new Date(2011 - 1900, 12 - 1, 1));
+ actualDateField.addValidator(new RangeValidator<Date>("", Date.class,
+ null, null) {
+ @Override
+ public boolean isMinValueIncluded() {
+ return range.isFromInclusive();
+ }
+
+ @Override
+ public boolean isMaxValueIncluded() {
+ return range.isToInclusive();
+ }
+
+ @Override
+ public Date getMaxValue() {
+ return range.getTo();
+ }
+
+ @Override
+ public Date getMinValue() {
+ return range.getFrom();
+ }
+
+ @Override
+ public String getErrorMessage() {
+ return "Date must be in range " + getMinValue() + " - "
+ + getMaxValue();
+ }
+ });
+ addComponent(fromField);
+ addComponent(fromInclusive);
+ addComponent(toField);
+ addComponent(toInclusive);
+ addComponent(actualDateField);
+ }
+
+ private PopupDateField createDateField() {
+ PopupDateField df = new PopupDateField();
+ df.setLocale(new Locale("en", "US"));
+ df.setResolution(Resolution.DAY);
+ df.setWriteThrough(true);
+ df.setReadThrough(true);
+ df.setImmediate(true);
+ return df;
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Tests the DateField range validator. The first field sets the minimum date, the second the maximum. Checkboxes control if the selected date is ok or not.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTest.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTest.java
index 7d1bdfc2c8..e8c8b69f9f 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTest.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTest.java
@@ -9,9 +9,11 @@ import java.util.Locale;
import com.vaadin.tests.components.abstractfield.AbstractFieldTest;
import com.vaadin.ui.DateField;
+import com.vaadin.ui.DateField.Resolution;
public class DateFieldTest<T extends DateField> extends AbstractFieldTest<T> {
+ @SuppressWarnings("unchecked")
@Override
protected Class<T> getTestClass() {
return (Class<T>) DateField.class;
@@ -93,22 +95,21 @@ public class DateFieldTest<T extends DateField> extends AbstractFieldTest<T> {
}
private void createResolutionSelectAction(String category) {
- LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();
- options.put("Year", DateField.RESOLUTION_YEAR);
- options.put("Month", DateField.RESOLUTION_MONTH);
- options.put("Day", DateField.RESOLUTION_DAY);
- options.put("Hour", DateField.RESOLUTION_HOUR);
- options.put("Min", DateField.RESOLUTION_MIN);
- options.put("Sec", DateField.RESOLUTION_SEC);
- options.put("Msec", DateField.RESOLUTION_MSEC);
+ LinkedHashMap<String, Resolution> options = new LinkedHashMap<String, Resolution>();
+ options.put("Year", DateField.Resolution.YEAR);
+ options.put("Month", DateField.Resolution.MONTH);
+ options.put("Day", DateField.Resolution.DAY);
+ options.put("Hour", DateField.Resolution.HOUR);
+ options.put("Min", DateField.Resolution.MINUTE);
+ options.put("Sec", DateField.Resolution.SECOND);
createSelectAction("Resolution", category, options, "Year",
resolutionCommand);
}
- private Command<T, Integer> resolutionCommand = new Command<T, Integer>() {
+ private Command<T, Resolution> resolutionCommand = new Command<T, Resolution>() {
- public void execute(T c, Integer value, Object data) {
+ public void execute(T c, Resolution value, Object data) {
c.setResolution(value);
}
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.html b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.html
index 2a67b16170..be325ef2eb 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.html
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.html
@@ -39,12 +39,12 @@
<tr>
<td>assertValue</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldTimezone::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VPopupCalendar[0]#field</td>
- <td>1/1/10 02:00:00.000 AM</td>
+ <td>1/1/10 02:00:00 AM</td>
</tr>
<tr>
<td>type</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldTimezone::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VPopupCalendar[0]#field</td>
- <td>1/1/10 01:00:00.000 AM</td>
+ <td>1/1/10 01:00:00 AM</td>
</tr>
<tr>
<td>assertText</td>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.java
index 6562e5412e..340b647931 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.java
@@ -14,6 +14,7 @@ import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Log;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.DateField;
+import com.vaadin.ui.DateField.Resolution;
public class DateFieldTimezone extends TestBase {
@@ -25,6 +26,8 @@ public class DateFieldTimezone extends TestBase {
@Override
protected void setup() {
+ dateField.setResolution(Resolution.SECOND);
+
ArrayList<String> timeZoneCodes = new ArrayList<String>();
timeZoneCodes.add(nullValue);
timeZoneCodes.addAll(Arrays.asList(TimeZone.getAvailableIDs()));
@@ -73,7 +76,7 @@ public class DateFieldTimezone extends TestBase {
dateField.setLocale(EN);
dateField.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- Date date = (Date) dateField.getValue();
+ Date date = dateField.getValue();
DateFormat format = DateFormat.getDateTimeInstance(
DateFormat.SHORT, DateFormat.LONG, EN);
format.setTimeZone(UTC);
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldUnparsableDate.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldUnparsableDate.java
index 4f83575b39..9b4a3c3383 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldUnparsableDate.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldUnparsableDate.java
@@ -3,6 +3,7 @@ package com.vaadin.tests.components.datefield;
import java.util.Date;
import com.vaadin.data.Property;
+import com.vaadin.data.util.converter.Converter;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.DateField;
@@ -16,14 +17,14 @@ public class DateFieldUnparsableDate extends TestBase {
addListener(new Property.ValueChangeListener() {
public void valueChange(
com.vaadin.data.Property.ValueChangeEvent event) {
- oldDate = (Date) getValue();
+ oldDate = getValue();
}
});
}
@Override
protected Date handleUnparsableDateString(String dateString)
- throws ConversionException {
+ throws Converter.ConversionException {
return oldDate;
}
}
@@ -35,7 +36,7 @@ public class DateFieldUnparsableDate extends TestBase {
@Override
protected Date handleUnparsableDateString(String dateString)
- throws ConversionException {
+ throws Converter.ConversionException {
return null;
}
}
@@ -47,8 +48,9 @@ public class DateFieldUnparsableDate extends TestBase {
@Override
protected Date handleUnparsableDateString(String dateString)
- throws ConversionException {
- throw new ConversionException("You should not enter invalid dates!");
+ throws Converter.ConversionException {
+ throw new Converter.ConversionException(
+ "You should not enter invalid dates!");
}
}
@@ -59,11 +61,12 @@ public class DateFieldUnparsableDate extends TestBase {
@Override
protected Date handleUnparsableDateString(String dateString)
- throws ConversionException {
+ throws Converter.ConversionException {
if (dateString != null && dateString.equals("today")) {
return new Date();
}
- throw new ConversionException("You should not enter invalid dates!");
+ throw new Converter.ConversionException(
+ "You should not enter invalid dates!");
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DefaultHandleUnparsableDateField.java b/tests/testbench/com/vaadin/tests/components/datefield/DefaultHandleUnparsableDateField.java
index bcdc8260b0..060c7fcc0a 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DefaultHandleUnparsableDateField.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DefaultHandleUnparsableDateField.java
@@ -17,7 +17,8 @@ public class DefaultHandleUnparsableDateField extends TestBase {
date.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
if (date.isValid()) {
- getMainWindow().showNotification(date.toString());
+ getMainWindow()
+ .showNotification(date.getValue().toString());
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFieldResolutionMsec.html b/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFieldResolutionMsec.html
index 3cdf70d5ab..8b2797167b 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFieldResolutionMsec.html
+++ b/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFieldResolutionMsec.html
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
@@ -53,7 +53,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::Root/VOverlay[2]/VMenuBar[0]#item6</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::Root/VOverlay[2]/VMenuBar[0]#item5</td>
<td>29,2</td>
</tr>
<tr>
@@ -83,12 +83,7 @@
</tr>
<tr>
<td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[6]</td>
- <td>000</td>
-</tr>
-<tr>
- <td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[8]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/VCalendarPanel[0]#ampm</td>
<td>PM</td>
</tr>
<tr>
@@ -108,7 +103,7 @@
</tr>
<tr>
<td>select</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[8]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/VCalendarPanel[0]#ampm</td>
<td>label=AM</td>
</tr>
<tr>
@@ -148,43 +143,38 @@
</tr>
<tr>
<td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/VCalendarPanel[0]#h</td>
<td>03</td>
</tr>
<tr>
<td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[2]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/VCalendarPanel[0]#m</td>
<td>04</td>
</tr>
<tr>
<td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[4]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/VCalendarPanel[0]#s</td>
<td>05</td>
</tr>
<tr>
<td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[6]</td>
- <td>006</td>
-</tr>
-<tr>
- <td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[8]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/VCalendarPanel[0]#ampm</td>
<td>AM</td>
</tr>
<tr>
<td>select</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[6]</td>
- <td>label=002</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/VCalendarPanel[0]#s</td>
+ <td>label=02</td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_SLog/ChildComponentContainer[0]/VLabel[0]</td>
- <td>6. ValueChangeEvent, new value: Jan 2, 2000 03:04:05.002</td>
+ <td>6. ValueChangeEvent, new value: Jan 2, 2000 03:04:02.006</td>
</tr>
<tr>
<td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[6]</td>
- <td>002</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/VCalendarPanel[0]#s</td>
+ <td>02</td>
</tr>
</tbody></table>
</body>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFields.java b/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFields.java
index 56f3641043..de08477dd3 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFields.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFields.java
@@ -8,6 +8,7 @@ import java.util.Locale;
import com.vaadin.tests.components.ComponentTestCase;
import com.vaadin.ui.Component;
import com.vaadin.ui.DateField;
+import com.vaadin.ui.DateField.Resolution;
import com.vaadin.ui.InlineDateField;
@SuppressWarnings("serial")
@@ -47,7 +48,7 @@ public class InlineDateFields extends ComponentTestCase<InlineDateField> {
pd.setWidth(width);
pd.setValue(new Date(12312312313L));
pd.setLocale(locale);
- pd.setResolution(DateField.RESOLUTION_YEAR);
+ pd.setResolution(DateField.Resolution.YEAR);
return pd;
}
@@ -66,18 +67,17 @@ public class InlineDateFields extends ComponentTestCase<InlineDateField> {
}
private Component createResolutionSelectAction() {
- LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();
- options.put("Year", DateField.RESOLUTION_YEAR);
- options.put("Month", DateField.RESOLUTION_MONTH);
- options.put("Day", DateField.RESOLUTION_DAY);
- options.put("Hour", DateField.RESOLUTION_HOUR);
- options.put("Min", DateField.RESOLUTION_MIN);
- options.put("Sec", DateField.RESOLUTION_SEC);
- options.put("Msec", DateField.RESOLUTION_MSEC);
+ LinkedHashMap<String, Resolution> options = new LinkedHashMap<String, Resolution>();
+ options.put("Year", DateField.Resolution.YEAR);
+ options.put("Month", DateField.Resolution.MONTH);
+ options.put("Day", DateField.Resolution.DAY);
+ options.put("Hour", DateField.Resolution.HOUR);
+ options.put("Min", DateField.Resolution.MINUTE);
+ options.put("Sec", DateField.Resolution.SECOND);
return createSelectAction("Resolution", options, "Year",
- new Command<InlineDateField, Integer>() {
+ new Command<InlineDateField, Resolution>() {
- public void execute(InlineDateField c, Integer value,
+ public void execute(InlineDateField c, Resolution value,
Object data) {
c.setResolution(value);
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldResolutions.html b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldResolutions.html
index 6dae483332..730cc895a4 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldResolutions.html
+++ b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldResolutions.html
@@ -272,67 +272,6 @@
<td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::PID_SLocale-en_US-undefined-wide#field</td>
<td>10,12</td>
</tr>
-<!--Resolution: msec-->
-<tr>
- <td>select</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::PID_Sselectaction-Resolution/domChild[0]</td>
- <td>label=Msec</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>enabled-msec</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::PID_SLocale-en_US-undefined-wide#popupButton</td>
- <td>10,12</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::Root/VOverlay[0]/VCalendarPanel[0]#header</td>
- <td>May 1970</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::Root/VOverlay[0]/VCalendarPanel[0]#day23</td>
- <td>23</td>
-</tr>
-<tr>
- <td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::Root/VOverlay[0]/VCalendarPanel[0]#h</td>
- <td>02</td>
-</tr>
-<tr>
- <td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::Root/VOverlay[0]/VCalendarPanel[0]#m</td>
- <td>05</td>
-</tr>
-<tr>
- <td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::Root/VOverlay[0]/VCalendarPanel[0]#s</td>
- <td>12</td>
-</tr>
-<tr>
- <td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::Root/VOverlay[0]/VCalendarPanel[0]#ms</td>
- <td>313</td>
-</tr>
-<tr>
- <td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::Root/VOverlay[0]/VCalendarPanel[0]#ampm</td>
- <td>PM</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>msec-popup-us</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::PID_SLocale-en_US-undefined-wide#field</td>
- <td>10,12</td>
-</tr>
<!--Check resolution year functionality-->
<tr>
<td>select</td>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFields.java b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFields.java
index 7e8b19b2a1..ad961ee7a6 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFields.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFields.java
@@ -8,6 +8,7 @@ import java.util.Locale;
import com.vaadin.tests.components.ComponentTestCase;
import com.vaadin.ui.Component;
import com.vaadin.ui.DateField;
+import com.vaadin.ui.DateField.Resolution;
import com.vaadin.ui.PopupDateField;
@SuppressWarnings("serial")
@@ -47,7 +48,7 @@ public class PopupDateFields extends ComponentTestCase<PopupDateField> {
pd.setWidth(width);
pd.setValue(new Date(12312312313L));
pd.setLocale(locale);
- pd.setResolution(DateField.RESOLUTION_YEAR);
+ pd.setResolution(DateField.Resolution.YEAR);
return pd;
}
@@ -66,18 +67,17 @@ public class PopupDateFields extends ComponentTestCase<PopupDateField> {
}
private Component createResolutionSelectAction() {
- LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();
- options.put("Year", DateField.RESOLUTION_YEAR);
- options.put("Month", DateField.RESOLUTION_MONTH);
- options.put("Day", DateField.RESOLUTION_DAY);
- options.put("Hour", DateField.RESOLUTION_HOUR);
- options.put("Min", DateField.RESOLUTION_MIN);
- options.put("Sec", DateField.RESOLUTION_SEC);
- options.put("Msec", DateField.RESOLUTION_MSEC);
+ LinkedHashMap<String, Resolution> options = new LinkedHashMap<String, Resolution>();
+ options.put("Year", DateField.Resolution.YEAR);
+ options.put("Month", DateField.Resolution.MONTH);
+ options.put("Day", DateField.Resolution.DAY);
+ options.put("Hour", DateField.Resolution.HOUR);
+ options.put("Min", DateField.Resolution.MINUTE);
+ options.put("Sec", DateField.Resolution.SECOND);
return createSelectAction("Resolution", options, "Year",
- new Command<PopupDateField, Integer>() {
+ new Command<PopupDateField, Resolution>() {
- public void execute(PopupDateField c, Integer value,
+ public void execute(PopupDateField c, Resolution value,
Object data) {
c.setResolution(value);
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/RequiredInvalidDateField.java b/tests/testbench/com/vaadin/tests/components/datefield/RequiredInvalidDateField.java
index 7176dae48b..a89459d37a 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/RequiredInvalidDateField.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/RequiredInvalidDateField.java
@@ -12,6 +12,7 @@ import com.vaadin.ui.DateField;
public class RequiredInvalidDateField extends TestBase {
+ @SuppressWarnings("deprecation")
@Override
protected void setup() {
// StringLengthValidator textValidator = new StringLengthValidator(
@@ -34,20 +35,26 @@ public class RequiredInvalidDateField extends TestBase {
Date date = new Date(2011 - 1900, 9 - 1, 1);
- Validator dateValidator = new AbstractValidator(
+ Validator dateValidator = new AbstractValidator<Date>(
"Day of month must be an even number") {
- public boolean isValid(Object value) {
- if (!(value instanceof Date)) {
- return false;
+ @Override
+ protected boolean isValidValue(Date value) {
+ if (value == null) {
+ return true;
}
- Date date = (Date) value;
- return (date.getDate() % 2 == 0);
+
+ return (value.getDate() % 2 == 0);
+ }
+
+ @Override
+ public Class getType() {
+ return Date.class;
}
};
// not required
- Property dateProperty1 = new ObjectProperty<Date>(date);
+ Property<Date> dateProperty1 = new ObjectProperty<Date>(date);
DateField dateField1 = new DateField("Not required", dateProperty1);
dateField1.setLocale(new Locale("fi", "FI"));
dateField1.setResolution(DateField.RESOLUTION_DAY);
@@ -57,7 +64,7 @@ public class RequiredInvalidDateField extends TestBase {
addComponent(dateField1);
// required
- Property dateProperty2 = new ObjectProperty<Date>(date);
+ Property<Date> dateProperty2 = new ObjectProperty<Date>(date);
DateField dateField2 = new DateField("Required", dateProperty2);
dateField2.setLocale(new Locale("fi", "FI"));
dateField2.setResolution(DateField.RESOLUTION_DAY);
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullInlineDateField.html b/tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullInlineDateField.html
index 40d50f0328..7f4cd92be2 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullInlineDateField.html
+++ b/tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullInlineDateField.html
@@ -16,16 +16,7 @@
<td>/run/com.vaadin.tests.components.datefield.InlineDateFieldTest?restartApplication</td>
<td></td>
</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_Smenu#item0</td>
- <td>42,20</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_Smenu#item0</td>
- <td>42,20</td>
-</tr>
+<!--locale -> en_us-->
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_Smenu#item0</td>
@@ -46,6 +37,7 @@
<td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::Root/VOverlay[2]/VMenuBar[0]#item2</td>
<td>34,4</td>
</tr>
+<!--resolution seconds-->
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_Smenu#item0</td>
@@ -63,19 +55,10 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::Root/VOverlay[2]/VMenuBar[0]#item6</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::Root/VOverlay[2]/VMenuBar[0]#item5</td>
<td>27,5</td>
</tr>
-<tr>
- <td>scroll</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[6]</td>
- <td>7539</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>300</td>
- <td></td>
-</tr>
+<!--set value to null-->
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_Smenu#item0</td>
@@ -96,16 +79,7 @@
<td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::Root/VOverlay[2]/VMenuBar[0]#item0</td>
<td>12,8</td>
</tr>
-<tr>
- <td>scroll</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[6]</td>
- <td>3542</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>300</td>
- <td></td>
-</tr>
+<!--add a value change listener-->
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_Smenu#item0</td>
@@ -139,19 +113,14 @@
<tr>
<td>select</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[6]</td>
- <td>index=0</td>
-</tr>
-<tr>
- <td>select</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[8]</td>
<td>index=1</td>
</tr>
+<!--As we start from current date - might be 0-4 value changes and the day may be any day-->
<tr>
- <td>verifyTextPresent</td>
- <td>12:00:00.000</td>
- <td></td>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_SLog_row_0</td>
+ <td>*. ValueChangeEvent, new value: * DATE(D), DATE(YYYY) 12:00:00.000</td>
</tr>
-
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullPopupDateField.html b/tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullPopupDateField.html
index b7f63591f9..9fabd8b1e7 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullPopupDateField.html
+++ b/tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullPopupDateField.html
@@ -78,7 +78,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[2]/VMenuBar[0]#item6</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[2]/VMenuBar[0]#item5</td>
<td>30,12</td>
</tr>
<tr>
@@ -88,22 +88,17 @@
</tr>
<tr>
<td>select</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[0]/VCalendarPanel[0]#m</td>
- <td>index=0</td>
-</tr>
-<tr>
- <td>select</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[0]/VCalendarPanel[0]#s</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[0]/VCalendarPanel[0]#h</td>
<td>index=0</td>
</tr>
<tr>
<td>select</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[0]/VCalendarPanel[0]#ms</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[0]/VCalendarPanel[0]#m</td>
<td>index=0</td>
</tr>
<tr>
<td>select</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[0]/VCalendarPanel[0]#h</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[0]/VCalendarPanel[0]#s</td>
<td>index=0</td>
</tr>
<tr>
@@ -112,11 +107,10 @@
<td>index=1</td>
</tr>
<tr>
- <td>verifyTextPresent</td>
- <td>12:00:00.000</td>
- <td></td>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::PID_SLog_row_0</td>
+ <td>*. ValueChangeEvent, new value: * DATE(D), DATE(YYYY) 12:00:00.000</td>
</tr>
-
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.java b/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.java
index 1f9735b543..12c9608d28 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.java
@@ -12,10 +12,11 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.DateField;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.PopupDateField;
public class ValueThroughProperty extends TestBase {
- private final Property dateProperty = new ObjectProperty<Date>(null,
+ private final Property<Date> dateProperty = new ObjectProperty<Date>(null,
Date.class);
@Override
@@ -25,7 +26,7 @@ public class ValueThroughProperty extends TestBase {
+ "Then try to set DateField's value using the first button. It sets the value "
+ "correctly (as we can see from the Label) but the client-side is not updated.<br/>"
+ "Using second button updates value correctly on the client-side too.",
- Label.CONTENT_XML));
+ ContentMode.XML));
final PopupDateField df = new PopupDateField(dateProperty);
df.setLocale(new Locale("en", "US"));
diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java
index 0fb8b27b75..e551e153db 100644
--- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java
+++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java
@@ -26,7 +26,7 @@ public class EmbeddedPdf extends TestBase {
player.setSource(new ClassResource(getClass(), "test.pdf", this));
addComponent(player);
- player.getWindow().addWindow(new Window("Testwindow"));
+ player.getRoot().addWindow(new Window("Testwindow"));
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/form/FormCommitWithInvalidValues.java b/tests/testbench/com/vaadin/tests/components/form/FormCommitWithInvalidValues.java
index 0a3054b0e4..6bc7cb5cca 100644
--- a/tests/testbench/com/vaadin/tests/components/form/FormCommitWithInvalidValues.java
+++ b/tests/testbench/com/vaadin/tests/components/form/FormCommitWithInvalidValues.java
@@ -6,8 +6,8 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Form;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window.Notification;
public class FormCommitWithInvalidValues extends TestBase {
diff --git a/tests/testbench/com/vaadin/tests/components/form/FormTest.java b/tests/testbench/com/vaadin/tests/components/form/FormTest.java
index e3e873c1bb..451a1b7fa3 100644
--- a/tests/testbench/com/vaadin/tests/components/form/FormTest.java
+++ b/tests/testbench/com/vaadin/tests/components/form/FormTest.java
@@ -118,26 +118,40 @@ public class FormTest extends AbstractFieldTest<Form> {
private void createDataSourceSelect(String category) {
LinkedHashMap<String, Item> options = new LinkedHashMap<String, Item>();
- options.put("Person", new BeanItem<Person>(new Person("First", "Last",
- "foo@vaadin.com", "02-111 2222", "Ruukinkatu 2-4", 20540,
- "Turku")));
- options.put("Product", new BeanItem<Product>(new Product(
- "Computer Monitor", 399.99f,
- "A monitor that can display both color and black and white.")));
+
+ options.put("Person", createPersonItem());
+ options.put("Product", createProductItem());
+
createSelectAction("Form data source", category, options, "Person",
formItemDataSourceCommand);
}
+ private BeanItem<Product> createProductItem() {
+ return new BeanItem<Product>(new Product("Computer Monitor", 399.99f,
+ "A monitor that can display both color and black and white."));
+ }
+
+ private BeanItem<Person> createPersonItem() {
+ Person person = new Person("First", "Last", "foo@vaadin.com",
+ "02-111 2222", "Ruukinkatu 2-4", 20540, "Turku");
+
+ BeanItem<Person> personItem = new BeanItem<Person>(person);
+ // add nested properties from address
+ personItem.expandProperty("address");
+
+ return personItem;
+ }
+
private void createFormFactorySelect(String category) {
LinkedHashMap<String, FormFieldFactory> options = new LinkedHashMap<String, FormFieldFactory>();
options.put("Default", DefaultFieldFactory.get());
options.put("Custom FieldFactory", new FormFieldFactory() {
- public Field createField(Item item, Object propertyId,
+ public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
Class<?> type = item.getItemProperty(propertyId).getType();
- Field c = null;
+ Field<?> c = null;
if (Number.class.isAssignableFrom(type)) {
TextField tf = new TextField();
tf.setCaption(DefaultFieldFactory
diff --git a/tests/testbench/com/vaadin/tests/components/form/FormWithEnterShortCut.java b/tests/testbench/com/vaadin/tests/components/form/FormWithEnterShortCut.java
index a3baab921f..689ba7ea83 100644
--- a/tests/testbench/com/vaadin/tests/components/form/FormWithEnterShortCut.java
+++ b/tests/testbench/com/vaadin/tests/components/form/FormWithEnterShortCut.java
@@ -5,7 +5,6 @@ import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Log;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Field;
import com.vaadin.ui.Form;
import com.vaadin.ui.TextField;
@@ -16,7 +15,7 @@ public class FormWithEnterShortCut extends TestBase {
protected void setup() {
final Form form = new Form();
- final Field tf = new TextField("Search");
+ final TextField tf = new TextField("Search");
form.addField("searchfield", tf);
Button button = new Button("Go");
diff --git a/tests/testbench/com/vaadin/tests/components/form/UndefinedWideFormWithRelativeWideFooter.java b/tests/testbench/com/vaadin/tests/components/form/UndefinedWideFormWithRelativeWideFooter.java
index cb616d4548..21430d8936 100644
--- a/tests/testbench/com/vaadin/tests/components/form/UndefinedWideFormWithRelativeWideFooter.java
+++ b/tests/testbench/com/vaadin/tests/components/form/UndefinedWideFormWithRelativeWideFooter.java
@@ -5,16 +5,17 @@ import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.Form;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
@SuppressWarnings("serial")
-public class UndefinedWideFormWithRelativeWideFooter extends Application {
+public class UndefinedWideFormWithRelativeWideFooter extends
+ Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window("Test");
+ LegacyWindow w = new LegacyWindow("Test");
setMainWindow(w);
final Form f = new Form();
diff --git a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.html b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.html
deleted file mode 100644
index ecac497a1b..0000000000
--- a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link rel="selenium.base" href="http://localhost:8888/" />
-<title>New Test</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">New Test</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/run/com.vaadin.tests.components.formlayout.FormLayoutReplaceComponent?restartApplication</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsformlayoutFormLayoutReplaceComponent::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCheckBox[0]/domChild[0]</td>
- <td>6,6</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>textarea-visible</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsformlayoutFormLayoutReplaceComponent::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCheckBox[0]/domChild[0]</td>
- <td>5,8</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>textarea-hidden</td>
-</tr>
-
-</tbody></table>
-</body>
-</html>
diff --git a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.java b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.java
deleted file mode 100644
index 9427318a10..0000000000
--- a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package com.vaadin.tests.components.formlayout;
-import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickListener;
-import com.vaadin.ui.CheckBox;
-import com.vaadin.ui.FormLayout;
-import com.vaadin.ui.TextField;
-
-public class FormLayoutReplaceComponent extends TestBase {
-
- @Override
- protected void setup() {
- addComponent(new FL());
-
- }
-
- public class FL extends FormLayout implements ClickListener {
-
- private TextField messages;
- private CheckBox control;
-
- @SuppressWarnings("deprecation")
- public FL() {
- setCaption("Test");
- control = new CheckBox("Messages On/Off");
- control.addListener(this);
- control.setImmediate(true);
- addComponent(control);
-
- // The bug is in replaceComponent, triggered when VTextField is
- // replaced by VTextArea so cannot replace this with TextArea.
- messages = new TextField("Messages");
- messages.setRows(10);
- messages.setColumns(40);
- messages.setVisible(false);
- messages.setEnabled(false);
- addComponent(messages);
- }
-
- public final void buttonClick(Button.ClickEvent e) {
- if (e.getButton() == control) {
- messages.setVisible(control.booleanValue());
- }
- }
- }
-
- @Override
- protected String getDescription() {
- return "Check or uncheck the CheckBox to show/hide the messages field inside the FormLayout.";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return 6308;
- }
-
-} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java b/tests/testbench/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java
index c8eb1483b4..bbe88b1770 100644
--- a/tests/testbench/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java
+++ b/tests/testbench/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java
@@ -2,16 +2,16 @@ package com.vaadin.tests.components.formlayout;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.FormLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
public class TableInFormLayoutCausesScrolling extends AbstractTestCase {
@Override
public void init() {
// Window Initialization.
- final Window window = new Window("Main Window");
+ final LegacyWindow window = new LegacyWindow("Main Window");
setMainWindow(window);
// FormLayout creation
diff --git a/tests/testbench/com/vaadin/tests/components/label/LabelModes.java b/tests/testbench/com/vaadin/tests/components/label/LabelModes.java
index 4b58794a87..00553ddf96 100644
--- a/tests/testbench/com/vaadin/tests/components/label/LabelModes.java
+++ b/tests/testbench/com/vaadin/tests/components/label/LabelModes.java
@@ -2,6 +2,7 @@ package com.vaadin.tests.components.label;
import com.vaadin.tests.components.ComponentTestCase;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
public class LabelModes extends ComponentTestCase<Label> {
@@ -23,17 +24,17 @@ public class LabelModes extends ComponentTestCase<Label> {
addTestComponent(l);
l = createLabel("This label contains\nnewlines and spaces\nand is in\npreformatted mode");
- l.setContentMode(Label.CONTENT_PREFORMATTED);
+ l.setContentMode(ContentMode.PREFORMATTED);
l.setWidth(null);
addTestComponent(l);
l = createLabel("This label contains\nnewlines and spaces\nand is in\nhtml mode");
- l.setContentMode(Label.CONTENT_XHTML);
+ l.setContentMode(ContentMode.XHTML);
l.setWidth(null);
addTestComponent(l);
l = createLabel("This label contains\nnewlines and spaces\nand is in\nraw mode");
- l.setContentMode(Label.CONTENT_RAW);
+ l.setContentMode(ContentMode.RAW);
l.setWidth(null);
addTestComponent(l);
diff --git a/tests/testbench/com/vaadin/tests/components/label/LabelTest.java b/tests/testbench/com/vaadin/tests/components/label/LabelTest.java
index 5c71046404..130aaeca78 100644
--- a/tests/testbench/com/vaadin/tests/components/label/LabelTest.java
+++ b/tests/testbench/com/vaadin/tests/components/label/LabelTest.java
@@ -7,6 +7,7 @@ import java.util.List;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.tests.components.AbstractComponentTest;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
public class LabelTest extends AbstractComponentTest<Label> implements
ValueChangeListener {
@@ -29,8 +30,8 @@ public class LabelTest extends AbstractComponentTest<Label> implements
}
};
- private Command<Label, Integer> contentModeCommand = new Command<Label, Integer>() {
- public void execute(Label c, Integer value, Object data) {
+ private Command<Label, ContentMode> contentModeCommand = new Command<Label, ContentMode>() {
+ public void execute(Label c, ContentMode value, Object data) {
c.setContentMode(value);
}
};
@@ -68,13 +69,14 @@ public class LabelTest extends AbstractComponentTest<Label> implements
@SuppressWarnings("deprecation")
private void createContentModeSelect(String category) {
- LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();
- options.put("Text", Label.CONTENT_TEXT);
- options.put("Preformatted", Label.CONTENT_PREFORMATTED);
- options.put("Raw", Label.CONTENT_RAW);
- options.put("UIDL", Label.CONTENT_UIDL);
- options.put("XHTML", Label.CONTENT_XHTML);
- options.put("XML", Label.CONTENT_XML);
+ LinkedHashMap<String, ContentMode> options = new LinkedHashMap<String, ContentMode>();
+ options.put("Text", ContentMode.TEXT);
+ options.put("Preformatted", ContentMode.PREFORMATTED);
+ options.put("Raw", ContentMode.RAW);
+ options.put("UIDL", ContentMode.XML); // Deprecated UIDL mode still used
+ // to avoid breaking old tests
+ options.put("XHTML", ContentMode.XHTML);
+ options.put("XML", ContentMode.XML);
createSelectAction("Content mode", category, options, "Text",
contentModeCommand);
diff --git a/tests/testbench/com/vaadin/tests/components/label/Labels.java b/tests/testbench/com/vaadin/tests/components/label/Labels.java
index ad648e7404..bbd64375ef 100644
--- a/tests/testbench/com/vaadin/tests/components/label/Labels.java
+++ b/tests/testbench/com/vaadin/tests/components/label/Labels.java
@@ -3,6 +3,7 @@ package com.vaadin.tests.components.label;
import com.vaadin.tests.components.ComponentTestCase;
import com.vaadin.tests.util.LoremIpsum;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
public class Labels extends ComponentTestCase<Label> {
@@ -37,13 +38,13 @@ public class Labels extends ComponentTestCase<Label> {
l = createLabel(
"<div style='border: 1px solid red'><h1>Hello\n\n\n</h1><p/><h2>I am a rich Label</h3></div>",
"This is an XHTML label with rich content");
- l.setContentMode(Label.CONTENT_XHTML);
+ l.setContentMode(ContentMode.XHTML);
addTestComponent(l);
l = createLabel(
"<div style='border: 1px solid blue'><h1>Hello</h1><p/><h2>I am a rich Label</h3></div>",
"This is an XHTML label with fixed 200px width and rich content");
- l.setContentMode(Label.CONTENT_XHTML);
+ l.setContentMode(ContentMode.XHTML);
l.setWidth("200px");
addTestComponent(l);
diff --git a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java
index 341caecc9f..1295cadf95 100644
--- a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java
+++ b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java
@@ -1,37 +1,22 @@
package com.vaadin.tests.components.loginform;
import com.vaadin.Application;
+import com.vaadin.terminal.WrappedRequest;
import com.vaadin.ui.LoginForm;
import com.vaadin.ui.LoginForm.LoginEvent;
import com.vaadin.ui.LoginForm.LoginListener;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.Root.LegacyWindow;
@SuppressWarnings("serial")
public class LoginFormWithMultipleWindows extends Application {
- /**
- * =======================================================================
- * Comment out this to make the LoginForm work as expected
- * =======================================================================
- */
@Override
- public Window getWindow(String name) {
- Window w = super.getWindow(name);
- if (w == null) {
- w = new LoginFormWindow();
- w.setName(name);
- addWindow(w);
- }
- return w;
-
- }
-
- @Override
- public void init() {
- setMainWindow(new LoginFormWindow());
+ protected Root getRoot(WrappedRequest request) {
+ return new LoginFormWindow();
}
- public class LoginFormWindow extends Window {
+ public class LoginFormWindow extends LegacyWindow {
public LoginFormWindow() {
super();
diff --git a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarInSplitPanel.java b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarInSplitPanel.java
index 4a41f8d8dc..e73d31bf04 100644
--- a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarInSplitPanel.java
+++ b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarInSplitPanel.java
@@ -4,9 +4,9 @@ import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Label;
import com.vaadin.ui.MenuBar;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class MenuBarInSplitPanel extends AbstractTestCase {
@@ -22,8 +22,8 @@ public class MenuBarInSplitPanel extends AbstractTestCase {
@Override
public void init() {
- Window mainWindow = new Window("MenuBar in SplitPanel",
- new HorizontalSplitPanel());
+ LegacyWindow mainWindow = new LegacyWindow(
+ "MenuBar in SplitPanel", new HorizontalSplitPanel());
VerticalLayout left = new VerticalLayout();
mainWindow.addComponent(left);
left.setSizeFull();
diff --git a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRunsOutOfBrowser.java b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRunsOutOfBrowser.java
index b05dbbd074..33e6c0b4a9 100644
--- a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRunsOutOfBrowser.java
+++ b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRunsOutOfBrowser.java
@@ -4,15 +4,15 @@ import com.vaadin.terminal.ThemeResource;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.MenuBar;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class MenuBarRunsOutOfBrowser extends AbstractTestCase {
@Override
public void init() {
setTheme("runo");
- Window main = new Window("Test");
+ LegacyWindow main = new LegacyWindow("Test");
main.setSizeFull();
setMainWindow(main);
main.getContent().setSizeFull();
diff --git a/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonDisableOnClick.html b/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonDisableOnClick.html
index 75eab71892..5f80004c7c 100644
--- a/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonDisableOnClick.html
+++ b/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonDisableOnClick.html
@@ -16,7 +16,7 @@
<td>/run/com.vaadin.tests.components.nativebutton.NativeButtonTest?restartApplication</td>
<td></td>
</tr>
-<!--value change listener-->
+<!-- click listener-->
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::PID_Smenu#item0</td>
@@ -29,7 +29,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::Root/VOverlay[1]/VMenuBar[0]#item4</td>
+ <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::Root/VOverlay[1]/VMenuBar[0]#item2</td>
<td>35,8</td>
</tr>
<!--disable on click-->
@@ -45,7 +45,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::Root/VOverlay[1]/VMenuBar[0]#item1</td>
+ <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::Root/VOverlay[1]/VMenuBar[0]#item0</td>
<td>22,4</td>
</tr>
<tr>
@@ -133,7 +133,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::Root/VOverlay[1]/VMenuBar[0]#item1</td>
+ <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::Root/VOverlay[1]/VMenuBar[0]#item0</td>
<td>36,3</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/notification/Notifications.java b/tests/testbench/com/vaadin/tests/components/notification/Notifications.java
index 0e054eba3b..27aef918d1 100644
--- a/tests/testbench/com/vaadin/tests/components/notification/Notifications.java
+++ b/tests/testbench/com/vaadin/tests/components/notification/Notifications.java
@@ -5,19 +5,20 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.NativeSelect;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window.Notification;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.TextArea;
public class Notifications extends TestBase implements ClickListener {
private static final String CAPTION = "CAPTION";
- private TextField tf;
+ private TextArea tf;
private NativeSelect type;
@SuppressWarnings("deprecation")
@Override
protected void setup() {
- tf = new TextField("Text", "Hello world");
+ tf = new TextArea("Text", "Hello world");
tf.setRows(10);
addComponent(tf);
type = new NativeSelect();
@@ -50,9 +51,9 @@ public class Notifications extends TestBase implements ClickListener {
}
public void buttonClick(ClickEvent event) {
- Notification n = new Notification((String) tf.getValue(),
+ Notification n = new Notification(tf.getValue(),
(Integer) type.getValue());
- event.getButton().getWindow().showNotification(n);
+ Root.getCurrentRoot().showNotification(n);
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.html b/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.html
index b4d76edae9..455952fb71 100644
--- a/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.html
+++ b/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.html
@@ -18,7 +18,7 @@
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
@@ -28,17 +28,17 @@
</tr>
<tr>
<td>closeNotification</td>
- <td>//body/div[4]</td>
+ <td>//body/div[2]</td>
<td>0,0</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VCheckBox[0]/domChild[0]</td>
- <td>60,0</td>
+ <td>63,3</td>
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
@@ -46,51 +46,6 @@
<td></td>
<td>view-plain</td>
</tr>
-<tr>
- <td>closeNotification</td>
- <td>//body/div[4]</td>
- <td>0,0</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VCheckBox[0]/domChild[0]</td>
- <td>51,7</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>window-plain</td>
-</tr>
-<tr>
- <td>closeNotification</td>
- <td>//body/div[4]</td>
- <td>0,0</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VCheckBox[0]/domChild[0]</td>
- <td>80,2</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>window-html</td>
-</tr>
-<tr>
- <td>closeNotification</td>
- <td>//body/div[4]</td>
- <td>0,0</td>
-</tr>
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java b/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java
index 60db11f1df..152688d109 100644
--- a/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java
+++ b/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java
@@ -5,18 +5,16 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Root;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
public class NotificationsHtmlAllowed extends TestBase implements ClickListener {
private TextArea messageField;
private CheckBox htmlAllowedBox;
private TextField captionField;
- private Window subwindow;
- private CheckBox showInSubwindow;
@Override
protected void setup() {
@@ -32,16 +30,8 @@ public class NotificationsHtmlAllowed extends TestBase implements ClickListener
htmlAllowedBox = new CheckBox("Html content allowed", true);
addComponent(htmlAllowedBox);
- showInSubwindow = new CheckBox("Show in subwindow", false);
- addComponent(showInSubwindow);
-
Button showNotification = new Button("Show notification", this);
addComponent(showNotification);
-
- subwindow = new Window("Sub window");
- subwindow.setPositionX(400);
- subwindow.setPositionY(0);
- getMainWindow().addWindow(subwindow);
}
@Override
@@ -56,13 +46,7 @@ public class NotificationsHtmlAllowed extends TestBase implements ClickListener
public void buttonClick(ClickEvent event) {
Notification n = makeNotification();
- Window window;
- if (showInSubwindow.booleanValue()) {
- window = subwindow;
- } else {
- window = event.getButton().getWindow();
- }
- window.showNotification(n);
+ Root.getCurrentRoot().showNotification(n);
}
@@ -70,7 +54,7 @@ public class NotificationsHtmlAllowed extends TestBase implements ClickListener
Notification n = new Notification((String) captionField.getValue(),
(String) messageField.getValue(),
Notification.TYPE_HUMANIZED_MESSAGE,
- htmlAllowedBox.booleanValue());
+ (Boolean) htmlAllowedBox.getValue());
return n;
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java b/tests/testbench/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java
index 29a81720c7..9a4bb15272 100644
--- a/tests/testbench/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java
+++ b/tests/testbench/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java
@@ -4,6 +4,7 @@ import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.OptionGroup;
public class OptionGroupMultipleValueChange extends TestBase {
@@ -26,7 +27,7 @@ public class OptionGroupMultipleValueChange extends TestBase {
og.setImmediate(true);
addComponent(og);
- final Label events = new Label("", Label.CONTENT_PREFORMATTED);
+ final Label events = new Label("", ContentMode.PREFORMATTED);
events.setWidth(null);
addComponent(events);
diff --git a/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java b/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java
index d50952f070..2f30b623fd 100644
--- a/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java
+++ b/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java
@@ -7,7 +7,8 @@ import java.util.List;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
-import com.vaadin.tests.components.TestBase;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
import com.vaadin.tests.util.TestUtils;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Alignment;
@@ -19,7 +20,7 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.VerticalLayout;
-public class OrderedLayoutCases extends TestBase {
+public class OrderedLayoutCases extends AbstractTestRoot {
private static final String[] dimensionValues = { "-1px", "5px", "350px",
"800px", "100%", "50%" };
@@ -108,10 +109,10 @@ public class OrderedLayoutCases extends TestBase {
private HorizontalLayout sizeBar;
@Override
- protected void setup() {
+ protected void setup(WrappedRequest request) {
TestUtils
.injectCSS(
- getMainWindow(),
+ getRoot(),
".sampleChild, .theLayout {border: 1px solid black;}"
+ ".theLayout > div > div:first-child {background: aqua;}"
+ ".theLayout > div > div:first-child + div {background: yellow;}"
@@ -295,7 +296,7 @@ public class OrderedLayoutCases extends TestBase {
addComponent(currentLayout);
getLayout().setSpacing(true);
- getLayout().getParent().setSizeFull();
+ getContent().setSizeFull();
getLayout().setSizeFull();
getLayout().setExpandRatio(currentLayout, 1);
}
@@ -351,7 +352,7 @@ public class OrderedLayoutCases extends TestBase {
}
@Override
- protected String getDescription() {
+ protected String getTestDescription() {
return "Tester application for exploring how Horizontal/VerticalLayout reacts to various settings ";
}
diff --git a/tests/testbench/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java b/tests/testbench/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java
index f59b940353..f20f26153f 100644
--- a/tests/testbench/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java
+++ b/tests/testbench/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java
@@ -4,6 +4,7 @@ import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
@@ -11,7 +12,8 @@ import com.vaadin.ui.Window;
public class VerticalLayoutWidthCalculation extends AbstractTestCase {
@Override
public void init() {
- final Window mainWindow = new Window("Vaadintest Application");
+ final LegacyWindow mainWindow = new LegacyWindow(
+ "Vaadintest Application");
mainWindow.addWindow(createSubWindow());
setMainWindow(mainWindow);
diff --git a/tests/testbench/com/vaadin/tests/components/panel/PanelShouldNotScroll.java b/tests/testbench/com/vaadin/tests/components/panel/PanelShouldNotScroll.java
index 7c537fe710..b7047392e8 100644
--- a/tests/testbench/com/vaadin/tests/components/panel/PanelShouldNotScroll.java
+++ b/tests/testbench/com/vaadin/tests/components/panel/PanelShouldNotScroll.java
@@ -7,6 +7,7 @@ import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Component;
import com.vaadin.ui.CssLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;
@@ -39,7 +40,7 @@ public class PanelShouldNotScroll extends TestBase {
panel.addComponent(new Label(
"fooooooooo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>"
+ "foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
return panel;
}
diff --git a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewNullValues.java b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewNullValues.java
index ff71f2f381..481c134ee6 100644
--- a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewNullValues.java
+++ b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewNullValues.java
@@ -4,9 +4,9 @@ import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.PopupView;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window.Notification;
public class PopupViewNullValues extends TestBase {
diff --git a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewOffScreen.java b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewOffScreen.java
index 7067281fa2..5cb0f073d6 100644
--- a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewOffScreen.java
+++ b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewOffScreen.java
@@ -11,6 +11,7 @@ import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Component;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Panel;
import com.vaadin.ui.PopupView;
import com.vaadin.ui.VerticalLayout;
@@ -69,7 +70,7 @@ public class PopupViewOffScreen extends TestBase {
Label l = new Label(
"<div style='width: 100%; height: 100%; background: " + bg
+ "'>" + LoremIpsum.get(2000) + "</div>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
l.setSizeFull();
p.addComponent(l);
PopupView pv = new PopupView("Click here to popup", p);
diff --git a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewWithRTE.java b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewWithRTE.java
index 1123f217b7..5ed0a375fe 100644
--- a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewWithRTE.java
+++ b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewWithRTE.java
@@ -28,7 +28,7 @@ public class PopupViewWithRTE extends TestBase {
VerticalLayout vl = new VerticalLayout();
public String getMinimizedValueAsHTML() {
- Object value = rte.getValue();
+ String value = rte.getValue();
if (value == null || "".equals(value)) {
value = "Initial <b>content</b> for <h3>rte</h3>.";
rte.setValue(value);
diff --git a/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java b/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java
index 2e26d3e2c4..95691ef9d7 100644
--- a/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java
+++ b/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java
@@ -23,14 +23,14 @@ public class RichTextAreaWithKeyboardShortcuts extends TestBase {
msg += " From : " + sender.getClass().getSimpleName() + " '"
+ ((Component) sender).getCaption() + "'";
- AbstractField f = (AbstractField) target;
+ AbstractField<String> f = (AbstractField<String>) target;
msg += " Target:" + target.getClass().getSimpleName() + " '"
+ f.getCaption() + "'";
String string = f.getValue().toString();
msg += " Value: " + string;
- f.getWindow().showNotification(msg);
+ f.getRoot().showNotification(msg);
}
@@ -42,7 +42,7 @@ public class RichTextAreaWithKeyboardShortcuts extends TestBase {
@Override
protected void setup() {
- getLayout().getWindow().addActionHandler(actionHandler);
+ getLayout().getRoot().addActionHandler(actionHandler);
getLayout().addComponent(createRichTextArea("InMainLayout"));
Panel panel = new Panel("RTA Panel");
@@ -55,7 +55,7 @@ public class RichTextAreaWithKeyboardShortcuts extends TestBase {
w.addComponent(createRichTextArea("InSubWindow"));
w.getContent().setSizeUndefined();
- getLayout().getWindow().addWindow(w);
+ getLayout().getRoot().addWindow(w);
}
diff --git a/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.html b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.html
new file mode 100644
index 0000000000..5448a24816
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.html
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.root.LazyInitRoots/normalPath?restartApplication#normalFragment</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootLazyInitRoots::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>NormalRoot<br />pathInfo: /normalPath<br />parameters: [restartApplication]<br />uri fragment: normalFragment</td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.root.LazyInitRoots/lazyCreatePath?lazyCreate#lazyCreateFragment</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootLazyInitRoots::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>LazyCreateRoot<br />pathInfo: /lazyCreatePath<br />parameters: [lazyCreate]<br />uri fragment: lazyCreateFragment</td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.root.LazyInitRoots/eagerPath/?eagerInit#eagerFragment</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootLazyInitRoots::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>EagerInitRoot<br />pathInfo: /eagerPath/<br />parameters: [eagerInit]<br />uri fragment: null</td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java
new file mode 100644
index 0000000000..97f6701fdb
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java
@@ -0,0 +1,89 @@
+package com.vaadin.tests.components.root;
+
+import com.vaadin.RootRequiresMoreInformationException;
+import com.vaadin.annotations.EagerInit;
+import com.vaadin.terminal.ExternalResource;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.terminal.WrappedRequest.BrowserDetails;
+import com.vaadin.tests.components.AbstractTestApplication;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Link;
+import com.vaadin.ui.Root;
+
+public class LazyInitRoots extends AbstractTestApplication {
+
+ @EagerInit
+ private static class EagerInitRoot extends Root {
+ @Override
+ public void init(WrappedRequest request) {
+ addComponent(getRequestInfo("EagerInitRoot", request));
+ }
+ }
+
+ @Override
+ public Root getRoot(WrappedRequest request)
+ throws RootRequiresMoreInformationException {
+ if (request.getParameter("lazyCreate") != null) {
+ // Root created on second request
+ BrowserDetails browserDetails = request.getBrowserDetails();
+ if (browserDetails == null
+ || browserDetails.getUriFragment() == null) {
+ throw new RootRequiresMoreInformationException();
+ } else {
+ Root root = new Root() {
+ @Override
+ protected void init(WrappedRequest request) {
+ addComponent(getRequestInfo("LazyCreateRoot", request));
+ }
+ };
+ return root;
+ }
+ } else if (request.getParameter("eagerInit") != null) {
+ // Root inited on first request
+ return new EagerInitRoot();
+ } else {
+ // The standard root
+ Root root = new Root() {
+ @Override
+ protected void init(WrappedRequest request) {
+ addComponent(getRequestInfo("NormalRoot", request));
+
+ Link lazyCreateLink = new Link("Open lazyCreate root",
+ new ExternalResource(getURL()
+ + "?lazyCreate#lazyCreate"));
+ lazyCreateLink.setTargetName("_blank");
+ addComponent(lazyCreateLink);
+
+ Link lazyInitLink = new Link("Open eagerInit root",
+ new ExternalResource(getURL()
+ + "?eagerInit#eagerInit"));
+ lazyInitLink.setTargetName("_blank");
+ addComponent(lazyInitLink);
+ }
+ };
+
+ return root;
+ }
+ }
+
+ public static Label getRequestInfo(String name, WrappedRequest request) {
+ String info = name;
+ info += "<br />pathInfo: " + request.getRequestPathInfo();
+ info += "<br />parameters: " + request.getParameterMap().keySet();
+ info += "<br />uri fragment: "
+ + request.getBrowserDetails().getUriFragment();
+ return new Label(info, ContentMode.XHTML);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "BrowserDetails should be available in Application.getRoot if RootRequiresMoreInformation has been thrown and in Root.init if the root has the @RootInitRequiresBrowserDetals annotation";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(7883); // + #7882 + #7884
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/root/RootInitTest.java b/tests/testbench/com/vaadin/tests/components/root/RootInitTest.java
new file mode 100644
index 0000000000..16fecc62d2
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/RootInitTest.java
@@ -0,0 +1,27 @@
+/*
+@ITMillApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.components.root;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Label;
+
+public class RootInitTest extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ addComponent(new Label("Hello root"));
+ }
+
+ @Override
+ public String getTestDescription() {
+ return "Testing basic root creation";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(3067);
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.html b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.html
new file mode 100644
index 0000000000..c9b83fdc4e
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.html
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.root.RootsInMultipleTabs?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootRootsInMultipleTabs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>This is root number 1</td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.root.RootsInMultipleTabs</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootRootsInMultipleTabs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>This is root number 2</td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.root.RootsInMultipleTabs?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootRootsInMultipleTabs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>This is root number 1</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java
new file mode 100644
index 0000000000..c3b20c5e7c
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java
@@ -0,0 +1,36 @@
+package com.vaadin.tests.components.root;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestApplication;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Root;
+
+public class RootsInMultipleTabs extends AbstractTestApplication {
+ private int numberOfRootsOpened;
+
+ public static class TabRoot extends Root {
+ @Override
+ protected void init(WrappedRequest request) {
+ RootsInMultipleTabs application = (RootsInMultipleTabs) getApplication();
+ String message = "This is root number "
+ + ++application.numberOfRootsOpened;
+
+ addComponent(new Label(message));
+ }
+ }
+
+ @Override
+ protected String getRootClassName(WrappedRequest request) {
+ return TabRoot.class.getName();
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Opening the same application again (e.g. in a new tab) should create a new Root.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(7894);
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.html b/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.html
new file mode 100644
index 0000000000..7d0f638325
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.html
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.root.TestRootTheme?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>themeLoaded</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.java b/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.java
new file mode 100644
index 0000000000..77c0bdb150
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.java
@@ -0,0 +1,28 @@
+package com.vaadin.tests.components.root;
+
+import com.vaadin.annotations.Theme;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Label;
+
+@Theme("tests-tickets")
+public class TestRootTheme extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ Label label = new Label("A red label");
+ label.setStyleName("red");
+ addComponent(label);
+ }
+
+ @Override
+ public String getTestDescription() {
+ return "Root with @RootTheme(\"tests-tickets\")";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(7885);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.java b/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.java
new file mode 100644
index 0000000000..c9c001deb6
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.java
@@ -0,0 +1,25 @@
+package com.vaadin.tests.components.root;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+
+@Widgetset("invalid")
+public class TestRootWidgetset extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ // Nothing here
+ }
+
+ @Override
+ public String getTestDescription() {
+ return "This root should never load, as the widgetset can not be loaded";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(7885);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.html b/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.html
new file mode 100644
index 0000000000..d4704fea65
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.html
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.root.UriFragmentTest?restartApplication#urifragment</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>Current URI fragment: urifragment</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>Current URI fragment: test</td>
+</tr>
+<tr>
+ <td>runScript</td>
+ <td>history.back()</td>
+ <td></td>
+</tr>
+<tr>
+ <td>pause</td>
+ <td></td>
+ <td>1000</td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>Current URI fragment: urifragment</td>
+</tr>
+<tr>
+ <td>runScript</td>
+ <td>history.forward()</td>
+ <td></td>
+</tr>
+<tr>
+ <td>pause</td>
+ <td></td>
+ <td>1000</td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>Current URI fragment: test</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.java b/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.java
new file mode 100644
index 0000000000..6078161996
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.java
@@ -0,0 +1,49 @@
+package com.vaadin.tests.components.root;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+
+public class UriFragmentTest extends AbstractTestRoot {
+
+ private final Label fragmentLabel = new Label();
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ addComponent(fragmentLabel);
+ updateLabel();
+ addListener(new FragmentChangedListener() {
+ public void fragmentChanged(FragmentChangedEvent event) {
+ updateLabel();
+ }
+ });
+ addComponent(new Button("Navigate to #test",
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ setFragment("test");
+ }
+ }));
+ }
+
+ private void updateLabel() {
+ String fragment = getFragment();
+ if (fragment == null) {
+ fragmentLabel.setValue("No URI fragment set");
+ } else {
+ fragmentLabel.setValue("Current URI fragment: " + fragment);
+ }
+ }
+
+ @Override
+ public String getTestDescription() {
+ return "URI fragment status should be known when the page is loaded and retained while navigating to different fragments or using the back and forward buttons.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(8048);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/AbstractSplitPanelTest.java b/tests/testbench/com/vaadin/tests/components/splitpanel/AbstractSplitPanelTest.java
index d633618ef4..861bdc1aab 100644
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/AbstractSplitPanelTest.java
+++ b/tests/testbench/com/vaadin/tests/components/splitpanel/AbstractSplitPanelTest.java
@@ -1,6 +1,7 @@
package com.vaadin.tests.components.splitpanel;
import com.vaadin.terminal.Sizeable;
+import com.vaadin.terminal.Sizeable.Unit;
import com.vaadin.tests.components.AbstractLayoutTest;
import com.vaadin.ui.AbstractSplitPanel;
import com.vaadin.ui.AbstractSplitPanel.SplitterClickEvent;
@@ -55,7 +56,7 @@ public abstract class AbstractSplitPanelTest<T extends AbstractSplitPanel>
private boolean reverse = false;
private int position;
- private int unit;
+ private Unit unit;
private String posString;
public SplitPosition(String pos) {
@@ -67,10 +68,10 @@ public abstract class AbstractSplitPanelTest<T extends AbstractSplitPanel>
if (pos.endsWith("px")) {
position = Integer.parseInt(pos.substring(0, pos.length() - 2));
- unit = Sizeable.UNITS_PIXELS;
+ unit = Sizeable.Unit.PIXELS;
} else if (pos.endsWith("%")) {
position = Integer.parseInt(pos.substring(0, pos.length() - 1));
- unit = Sizeable.UNITS_PERCENTAGE;
+ unit = Sizeable.Unit.PERCENTAGE;
} else {
throw new RuntimeException("Could not parse " + pos);
}
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/HorizontalSplitPanelBasicStates.html b/tests/testbench/com/vaadin/tests/components/splitpanel/HorizontalSplitPanelBasicStates.html
index 8e829b2d7a..82229773d0 100644
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/HorizontalSplitPanelBasicStates.html
+++ b/tests/testbench/com/vaadin/tests/components/splitpanel/HorizontalSplitPanelBasicStates.html
@@ -86,7 +86,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentssplitpanelHorizontalSplitPanels::Root/VOverlay[2]/VMenuBar[0]#item2</td>
+ <td>vaadin=runcomvaadintestscomponentssplitpanelHorizontalSplitPanels::Root/VOverlay[2]/VMenuBar[0]#item3</td>
<td>38,9</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java
index a7cb1a857a..d4716433b7 100644
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java
+++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java
@@ -8,7 +8,7 @@ import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.NativeButton;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
public class SplitPanelExtraScrollbars extends AbstractTestCase implements
ClickListener {
@@ -32,7 +32,7 @@ public class SplitPanelExtraScrollbars extends AbstractTestCase implements
sp.setSecondComponent(hl);
hl.addComponent(b);
- Window w = new Window("Test", sp);
+ LegacyWindow w = new LegacyWindow("Test", sp);
setMainWindow(w);
}
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java
index 107635e989..ef17a3c668 100644
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java
+++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java
@@ -8,7 +8,7 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.HorizontalSplitPanel;
-import com.vaadin.ui.TextField;
+import com.vaadin.ui.TextArea;
import com.vaadin.ui.VerticalSplitPanel;
public class SplitPanelReversePosition extends TestBase {
@@ -31,9 +31,9 @@ public class SplitPanelReversePosition extends TestBase {
}
});
- TextField field = new TextField("");
- field.setSizeFull();
- hsplit.addComponent(field);
+ TextArea area = new TextArea("");
+ area.setSizeFull();
+ hsplit.addComponent(area);
final VerticalSplitPanel vsplit = new VerticalSplitPanel();
vsplit.setSizeFull();
@@ -48,13 +48,13 @@ public class SplitPanelReversePosition extends TestBase {
addComponent(hsplit);
- field = new TextField("");
- field.setSizeFull();
- vsplit.addComponent(field);
+ area = new TextArea("");
+ area.setSizeFull();
+ vsplit.addComponent(area);
- field = new TextField("");
- field.setSizeFull();
- vsplit.addComponent(field);
+ area = new TextArea("");
+ area.setSizeFull();
+ vsplit.addComponent(area);
HorizontalLayout buttons = new HorizontalLayout();
buttons.setSpacing(true);
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelSplitterWidth.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelSplitterWidth.java
index 49a5915999..5fad68fef5 100644
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelSplitterWidth.java
+++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelSplitterWidth.java
@@ -4,9 +4,9 @@ import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.HorizontalSplitPanel;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalSplitPanel;
-import com.vaadin.ui.Window.Notification;
public class SplitPanelSplitterWidth extends TestBase {
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java
index 4e6a7730e7..e80ad29426 100644
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java
+++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java
@@ -5,9 +5,9 @@ import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.NativeButton;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class SplitPanelWidthOnResize extends AbstractTestCase {
@@ -15,7 +15,7 @@ public class SplitPanelWidthOnResize extends AbstractTestCase {
public void init() {
VerticalLayout layout = new VerticalLayout();
layout.setSizeFull();
- Window w = new Window("", layout);
+ LegacyWindow w = new LegacyWindow("", layout);
setMainWindow(w);
HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
Button button = new NativeButton("A huge button");
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanels.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanels.java
deleted file mode 100644
index e0a4c19836..0000000000
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanels.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.vaadin.tests.components.splitpanel;
-
-import java.util.LinkedHashMap;
-
-import com.vaadin.ui.SplitPanel;
-
-@SuppressWarnings("deprecation")
-public class SplitPanels extends AbstractSplitPanelTest<SplitPanel> {
-
- private Command<SplitPanel, Integer> orientationCommand = new Command<SplitPanel, Integer>() {
-
- public void execute(SplitPanel c, Integer value, Object data) {
- c.setOrientation(value);
- }
- };
-
- @Override
- protected Class<SplitPanel> getTestClass() {
- return SplitPanel.class;
- }
-
- @Override
- protected void createActions() {
- super.createActions();
- createOrientationSelect(CATEGORY_FEATURES);
-
- }
-
- private void createOrientationSelect(String category) {
- LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();
- options.put("Horizontal", SplitPanel.ORIENTATION_HORIZONTAL);
- options.put("Vertical", SplitPanel.ORIENTATION_VERTICAL);
- createSelectAction("Orientation", category, options, "Horizontal",
- orientationCommand);
-
- }
-}
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/VerticalSplitPanelBasicStates.html b/tests/testbench/com/vaadin/tests/components/splitpanel/VerticalSplitPanelBasicStates.html
index 6e651adcda..cf67caccb7 100644
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/VerticalSplitPanelBasicStates.html
+++ b/tests/testbench/com/vaadin/tests/components/splitpanel/VerticalSplitPanelBasicStates.html
@@ -86,7 +86,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentssplitpanelVerticalSplitPanels::Root/VOverlay[2]/VMenuBar[0]#item2</td>
+ <td>vaadin=runcomvaadintestscomponentssplitpanelVerticalSplitPanels::Root/VOverlay[2]/VMenuBar[0]#item3</td>
<td>38,9</td>
</tr>
<tr>
@@ -208,7 +208,6 @@
<td></td>
<td>enabled</td>
</tr>
-
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/table/ColumnHeaderAlignments.java b/tests/testbench/com/vaadin/tests/components/table/ColumnHeaderAlignments.java
index 0c625f1c5d..fdcb458a6a 100644
--- a/tests/testbench/com/vaadin/tests/components/table/ColumnHeaderAlignments.java
+++ b/tests/testbench/com/vaadin/tests/components/table/ColumnHeaderAlignments.java
@@ -4,8 +4,6 @@ import com.vaadin.data.Item;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Select;
@@ -37,14 +35,14 @@ public class ColumnHeaderAlignments extends TestBase {
}
});
addComponent(theme);
- CheckBox footers = new CheckBox("Show footers", new ClickListener() {
- public void buttonClick(ClickEvent event) {
- fooTable.setFooterVisible((Boolean) event.getButton()
- .getValue());
- barTable.setFooterVisible((Boolean) event.getButton()
- .getValue());
- bazTable.setFooterVisible((Boolean) event.getButton()
- .getValue());
+ CheckBox footers = new CheckBox("Show footers");
+ footers.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ boolean visible = (Boolean) event.getProperty().getValue();
+ fooTable.setFooterVisible(visible);
+ barTable.setFooterVisible(visible);
+ bazTable.setFooterVisible(visible);
}
});
footers.setImmediate(true);
diff --git a/tests/testbench/com/vaadin/tests/components/table/DoublesInTable.java b/tests/testbench/com/vaadin/tests/components/table/DoublesInTable.java
new file mode 100644
index 0000000000..c048c770fa
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/table/DoublesInTable.java
@@ -0,0 +1,277 @@
+package com.vaadin.tests.components.table;
+
+import java.math.BigDecimal;
+import java.text.NumberFormat;
+import java.util.Date;
+import java.util.Locale;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.data.util.BeanItemContainer;
+import com.vaadin.data.util.converter.Converter;
+import com.vaadin.data.util.converter.StringToNumberConverter;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.data.bean.Address;
+import com.vaadin.tests.data.bean.Country;
+import com.vaadin.tests.data.bean.Person;
+import com.vaadin.tests.data.bean.Sex;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.Table;
+
+public class DoublesInTable extends TestBase {
+ BeanItemContainer<Person> personBeanItemContainer = new BeanItemContainer<Person>(
+ Person.class);
+
+ private Table table;
+
+ private Log log = new Log(5);
+
+ private ComboBox localeSelect;
+
+ private CheckBox useCustomConverters;
+
+ private CheckBox editMode;
+
+ @Override
+ protected void setup() {
+ editMode = new CheckBox("Edit mode");
+ editMode.setImmediate(true);
+ editMode.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ table.setEditable(editMode.getValue());
+
+ }
+ });
+
+ useCustomConverters = new CheckBox("Use custom converters");
+ useCustomConverters.setImmediate(true);
+ useCustomConverters.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ recreateTable();
+ }
+ });
+
+ localeSelect = createLocaleSelect();
+ personBeanItemContainer = createContainer(100);
+ addComponent(log);
+ addComponent(localeSelect);
+ addComponent(useCustomConverters);
+ addComponent(editMode);
+ recreateTable();
+
+ }
+
+ private ComboBox createLocaleSelect() {
+ ComboBox cb = new ComboBox();
+ cb.setNullSelectionAllowed(false);
+ for (Locale l : Locale.getAvailableLocales()) {
+ cb.addItem(l);
+ }
+ cb.setImmediate(true);
+ cb.setValue(Locale.US);
+ cb.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ recreateTable();
+ }
+ });
+ return cb;
+ }
+
+ protected void recreateTable() {
+ Table newTable = createTable(useCustomConverters.getValue(),
+ (Locale) localeSelect.getValue());
+ newTable.setEditable(editMode.getValue());
+ if (table == null) {
+ addComponent(newTable);
+ } else {
+ replaceComponent(table, newTable);
+ }
+ table = newTable;
+ }
+
+ private static BeanItemContainer<Person> createContainer(int nr) {
+ BeanItemContainer<Person> bic = new BeanItemContainer<Person>(
+ Person.class);
+ for (int i = 1; i <= nr; i++) {
+ Person p = new Person();
+ p.setFirstName("First " + i);
+ p.setLastName("Last " + i);
+ p.setAge(i);
+ p.setDeceased((i % 5 - 2) == 0);
+ p.setEmail("person" + i + "@mail.com");
+ p.setRent(new BigDecimal(i * 1250.25));
+ p.setSalary(3000 + i);
+ p.setSex((i % 4) == 0 ? Sex.MALE : Sex.FEMALE);
+ p.setBirthDate(new Date(2011 - 1900 - p.getAge(), 11 - 1, 24));
+ if (i % 42 == 0) {
+ p.setSex(Sex.UNKNOWN);
+ }
+ String city = "City " + (i / 10);
+ Country country = Country.FINLAND;
+ Address address = new Address("Street " + i, 12345 + i * 2, city,
+ country);
+ p.setAddress(address);
+ bic.addBean(p);
+ }
+
+ return bic;
+ }
+
+ protected Table createTable(boolean useCustomConverters, Locale locale) {
+ Table t = new Table("Persons");
+ t.setLocale(locale);
+ t.setContainerDataSource(personBeanItemContainer);
+ t.setSortDisabled(false);
+ if (useCustomConverters) {
+ addConverters(t);
+ }
+ t.setSelectable(true);
+ t.setImmediate(true);
+ t.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ log.log("Value is now: " + event.getProperty().getValue());
+
+ }
+ });
+ return t;
+ }
+
+ private void addConverters(Table t) {
+ t.setConverter("sex", new Converter<String, Sex>() {
+
+ public Sex convertToModel(String value, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ // not used in this test - Table only converts to presentation
+ return null;
+ }
+
+ public String convertToPresentation(Sex value, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ if (value == null) {
+ value = Sex.UNKNOWN;
+ }
+ return value.getStringRepresentation();
+ }
+
+ public Class<Sex> getModelType() {
+ return Sex.class;
+ }
+
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+ });
+ t.setConverter("deceased", new Converter<String, Boolean>() {
+
+ public Boolean convertToModel(String value, Locale locale) {
+ // not used in this test - Table only converts from source to
+ // target
+ return null;
+ }
+
+ public String convertToPresentation(Boolean value, Locale locale) {
+ if (value == null || value) {
+ return "YES, DEAD!";
+ } else {
+ return "-";
+ }
+ }
+
+ public Class<Boolean> getModelType() {
+ return Boolean.class;
+ }
+
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+ });
+ t.setConverter("age", new Converter<String, Integer>() {
+
+ public Integer convertToModel(String value, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ // not used in this test - Table only converts from source to
+ // target
+ return null;
+ }
+
+ public String convertToPresentation(Integer value, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ if (value == null) {
+ return null;
+ }
+ if (value < 3) {
+ return value + " (baby)";
+ } else if (value < 7) {
+ return value + " (kid)";
+ } else if (value < 18) {
+ return value + " (young)";
+ } else {
+ return value + "";
+ }
+ }
+
+ public Class<Integer> getModelType() {
+ return Integer.class;
+ }
+
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+ });
+ t.setConverter("address", new Converter<String, Address>() {
+
+ public Address convertToModel(String value, Locale locale)
+ throws ConversionException {
+ // not used in this test - Table only converts to presentation
+ return null;
+ }
+
+ public String convertToPresentation(Address value, Locale locale)
+ throws ConversionException {
+ return value.getStreetAddress() + ", " + value.getCity() + " ("
+ + value.getCountry() + ")";
+ }
+
+ public Class<Address> getModelType() {
+ return Address.class;
+ }
+
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+
+ });
+
+ t.setConverter("rent", new StringToNumberConverter() {
+ @Override
+ protected NumberFormat getFormat(Locale locale) {
+ return NumberFormat.getCurrencyInstance(locale);
+ // DecimalFormat df = new DecimalFormat();
+ // df.setDecimalSeparatorAlwaysShown(true);
+ // df.setGroupingUsed(true);
+ // df.setMinimumFractionDigits(2);
+ // df.setMaximumFractionDigits(2);
+ // return df;
+ }
+ });
+ }
+
+ @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/table/EditableModeChange.java b/tests/testbench/com/vaadin/tests/components/table/EditableModeChange.java
index 5f64dec443..acb866a1da 100644
--- a/tests/testbench/com/vaadin/tests/components/table/EditableModeChange.java
+++ b/tests/testbench/com/vaadin/tests/components/table/EditableModeChange.java
@@ -74,7 +74,7 @@ public class EditableModeChange extends TestBase {
private class ItemFieldFactory extends DefaultFieldFactory {
@Override
- public Field createField(Container container, Object itemId,
+ public Field<?> createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
if (selectionEvent != null) {
if ((selectionEvent.getItemId().equals(itemId))
diff --git a/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java b/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java
index 6561ff0076..08938c079a 100644
--- a/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java
+++ b/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java
@@ -7,6 +7,8 @@ import java.io.Serializable;
import java.util.HashMap;
import com.vaadin.data.Container;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.TestUtils;
import com.vaadin.ui.Button;
@@ -17,13 +19,14 @@ import com.vaadin.ui.Component;
import com.vaadin.ui.DefaultFieldFactory;
import com.vaadin.ui.Field;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Table;
public class EditableTableLeak extends TestBase {
private final Table table = new Table("ISO-3166 Country Codes and flags");
private final CheckBox useFieldFactory = new CheckBox(
"Use a caching TableFieldFactory");
- private final Label sizeLabel = new Label("", Label.CONTENT_XHTML);
+ private final Label sizeLabel = new Label("", ContentMode.XHTML);
private long size = 0;
@@ -57,10 +60,10 @@ public class EditableTableLeak extends TestBase {
}
private static class CachingFieldFactory extends DefaultFieldFactory {
- private final HashMap<Object, HashMap<Object, Field>> cache = new HashMap<Object, HashMap<Object, Field>>();
+ private final HashMap<Object, HashMap<Object, Field<?>>> cache = new HashMap<Object, HashMap<Object, Field<?>>>();
@Override
- public Field createField(Container container, Object itemId,
+ public Field<?> createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
if (cache.containsKey(itemId)) {
if (cache.get(itemId) != null
@@ -68,10 +71,10 @@ public class EditableTableLeak extends TestBase {
return cache.get(itemId).get(propertyId);
}
}
- Field f = super.createField(container, itemId, propertyId,
+ Field<?> f = super.createField(container, itemId, propertyId,
uiContext);
if (!cache.containsKey(itemId)) {
- cache.put(itemId, new HashMap<Object, Field>());
+ cache.put(itemId, new HashMap<Object, Field<?>>());
}
cache.get(itemId).put(propertyId, f);
return f;
@@ -83,10 +86,10 @@ public class EditableTableLeak extends TestBase {
protected void setup() {
addComponent(useFieldFactory);
useFieldFactory.setImmediate(true);
- useFieldFactory.addListener(new Button.ClickListener() {
+ useFieldFactory.addListener(new ValueChangeListener() {
- public void buttonClick(ClickEvent event) {
- if ((Boolean) useFieldFactory.getValue()) {
+ public void valueChange(ValueChangeEvent event) {
+ if (useFieldFactory.getValue()) {
table.setTableFieldFactory(new CachingFieldFactory());
} else {
table.setTableFieldFactory(DefaultFieldFactory.get());
diff --git a/tests/testbench/com/vaadin/tests/components/table/Footer.java b/tests/testbench/com/vaadin/tests/components/table/Footer.java
index d6a9853fff..c962ce8468 100644
--- a/tests/testbench/com/vaadin/tests/components/table/Footer.java
+++ b/tests/testbench/com/vaadin/tests/components/table/Footer.java
@@ -51,7 +51,7 @@ public class Footer extends TestBase {
visible.setImmediate(true);
visible.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- table.setFooterVisible(visible.booleanValue());
+ table.setFooterVisible((Boolean) visible.getValue());
}
});
diff --git a/tests/testbench/com/vaadin/tests/components/table/FooterClick.java b/tests/testbench/com/vaadin/tests/components/table/FooterClick.java
index b92d6ef362..2ae663986b 100644
--- a/tests/testbench/com/vaadin/tests/components/table/FooterClick.java
+++ b/tests/testbench/com/vaadin/tests/components/table/FooterClick.java
@@ -2,11 +2,11 @@ package com.vaadin.tests.components.table;
import com.vaadin.data.Container;
import com.vaadin.data.Item;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Log;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.FooterClickEvent;
@@ -43,7 +43,7 @@ public class FooterClick extends TestBase {
// Add a footer click listener
table.addListener(new Table.FooterClickListener() {
public void footerClick(FooterClickEvent event) {
- columnField.setValue(event.getPropertyId());
+ columnField.setValue(String.valueOf(event.getPropertyId()));
log.log("Clicked on footer: " + event.getPropertyId());
}
});
@@ -51,10 +51,10 @@ public class FooterClick extends TestBase {
CheckBox immediateCheckbox = new CheckBox("Immediate");
immediateCheckbox.setImmediate(true);
immediateCheckbox.setValue(table.isImmediate());
- immediateCheckbox.addListener(new ClickListener() {
+ immediateCheckbox.addListener(new Property.ValueChangeListener() {
- public void buttonClick(ClickEvent event) {
- table.setImmediate(event.getButton().booleanValue());
+ public void valueChange(ValueChangeEvent event) {
+ table.setImmediate((Boolean) event.getProperty().getValue());
}
});
@@ -62,13 +62,14 @@ public class FooterClick extends TestBase {
"Column reordering allowed");
columnReorderingCheckbox.setImmediate(true);
columnReorderingCheckbox.setValue(table.isColumnReorderingAllowed());
- columnReorderingCheckbox.addListener(new ClickListener() {
-
- public void buttonClick(ClickEvent event) {
- table.setColumnReorderingAllowed(event.getButton()
- .booleanValue());
- }
- });
+ columnReorderingCheckbox
+ .addListener(new Property.ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ table.setColumnReorderingAllowed((Boolean) event
+ .getProperty().getValue());
+ }
+ });
addComponent(immediateCheckbox);
addComponent(columnReorderingCheckbox);
diff --git a/tests/testbench/com/vaadin/tests/components/table/HeaderClick.java b/tests/testbench/com/vaadin/tests/components/table/HeaderClick.java
index 3cb11781b1..970618374e 100644
--- a/tests/testbench/com/vaadin/tests/components/table/HeaderClick.java
+++ b/tests/testbench/com/vaadin/tests/components/table/HeaderClick.java
@@ -2,10 +2,10 @@ package com.vaadin.tests.components.table;
import com.vaadin.data.Container;
import com.vaadin.data.Item;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.HeaderClickEvent;
@@ -29,27 +29,27 @@ public class HeaderClick extends TestBase {
// Add a header click listener
table.addListener(new Table.HeaderClickListener() {
public void headerClick(HeaderClickEvent event) {
- columnField.setValue(event.getPropertyId());
+ columnField.setValue(String.valueOf(event.getPropertyId()));
}
});
CheckBox immediateCheckbox = new CheckBox("Immediate");
immediateCheckbox.setImmediate(true);
immediateCheckbox.setValue(table.isImmediate());
- immediateCheckbox.addListener(new ClickListener() {
+ immediateCheckbox.addListener(new Property.ValueChangeListener() {
- public void buttonClick(ClickEvent event) {
- table.setImmediate(event.getButton().booleanValue());
+ public void valueChange(ValueChangeEvent event) {
+ table.setImmediate((Boolean) event.getProperty().getValue());
}
});
CheckBox sortEnabledCheckbox = new CheckBox("Sortable");
sortEnabledCheckbox.setImmediate(true);
sortEnabledCheckbox.setValue(!table.isSortDisabled());
- sortEnabledCheckbox.addListener(new ClickListener() {
+ sortEnabledCheckbox.addListener(new Property.ValueChangeListener() {
- public void buttonClick(ClickEvent event) {
- table.setSortDisabled(!event.getButton().booleanValue());
+ public void valueChange(ValueChangeEvent event) {
+ table.setSortDisabled(!(Boolean) event.getProperty().getValue());
}
});
@@ -57,13 +57,14 @@ public class HeaderClick extends TestBase {
"Column reordering allowed");
columnReorderingCheckbox.setImmediate(true);
columnReorderingCheckbox.setValue(table.isColumnReorderingAllowed());
- columnReorderingCheckbox.addListener(new ClickListener() {
-
- public void buttonClick(ClickEvent event) {
- table.setColumnReorderingAllowed(event.getButton()
- .booleanValue());
- }
- });
+ columnReorderingCheckbox
+ .addListener(new Property.ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ table.setColumnReorderingAllowed((Boolean) event
+ .getProperty().getValue());
+ }
+ });
addComponent(immediateCheckbox);
addComponent(sortEnabledCheckbox);
diff --git a/tests/testbench/com/vaadin/tests/components/table/HeaderUpdateWhenNoRows.java b/tests/testbench/com/vaadin/tests/components/table/HeaderUpdateWhenNoRows.java
index bf1f9ca883..f1e4e09d57 100644
--- a/tests/testbench/com/vaadin/tests/components/table/HeaderUpdateWhenNoRows.java
+++ b/tests/testbench/com/vaadin/tests/components/table/HeaderUpdateWhenNoRows.java
@@ -1,7 +1,8 @@
package com.vaadin.tests.components.table;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Table;
@@ -16,16 +17,17 @@ public class HeaderUpdateWhenNoRows extends TestBase {
table.setHeight("100px");
table.setImmediate(true);
- CheckBox showHeaders = new CheckBox("Show headers",
- new CheckBox.ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (event.getButton().booleanValue()) {
- table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID);
- } else {
- table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
- }
- }
- });
+ final CheckBox showHeaders = new CheckBox("Show headers");
+ showHeaders.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ if (showHeaders.getValue()) {
+ table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID);
+ } else {
+ table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
+ }
+ }
+ });
showHeaders.setImmediate(true);
showHeaders.setValue(true);
diff --git a/tests/testbench/com/vaadin/tests/components/table/HugeRowCount.java b/tests/testbench/com/vaadin/tests/components/table/HugeRowCount.java
index 5cd9f964a3..3478750622 100644
--- a/tests/testbench/com/vaadin/tests/components/table/HugeRowCount.java
+++ b/tests/testbench/com/vaadin/tests/components/table/HugeRowCount.java
@@ -20,7 +20,7 @@ public class HugeRowCount extends TestBase {
container.setSize(100000);
final TextField tf = new TextField("Rows");
- tf.setValue(100000);
+ tf.setValue(String.valueOf(100000));
tf.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
container.setSize(Integer.parseInt(tf.getValue().toString()));
diff --git a/tests/testbench/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java b/tests/testbench/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java
index a54c3ce447..1cfb1ee5e5 100644
--- a/tests/testbench/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java
+++ b/tests/testbench/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java
@@ -8,6 +8,7 @@ import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Component;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Table;
public class LabelEmbeddedClickThroughForTable extends TestBase {
@@ -36,7 +37,7 @@ public class LabelEmbeddedClickThroughForTable extends TestBase {
item.getItemProperty("Column 1").setValue("String A");
item.getItemProperty("Column 2").setValue(new Label("Label A"));
item.getItemProperty("Column 3").setValue(
- new Label("<b>Label A</b>", Label.CONTENT_XHTML));
+ new Label("<b>Label A</b>", ContentMode.XHTML));
item.getItemProperty("Column 4").setValue(
new Embedded("An embedded image", new ThemeResource(
"../runo/icons/32/ok.png")));
@@ -48,7 +49,7 @@ public class LabelEmbeddedClickThroughForTable extends TestBase {
.setValue(
new Label(
"<a style=\"color: blue\" href=\"javascript:false\">Label A</a>",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
item.getItemProperty("Column 4").setValue(
new Embedded("", new ThemeResource(
"../runo/icons/32/cancel.png")));
diff --git a/tests/testbench/com/vaadin/tests/components/table/ModifyContainerProperty.html b/tests/testbench/com/vaadin/tests/components/table/ModifyContainerProperty.html
index 93d97cd698..33318c9a95 100644
--- a/tests/testbench/com/vaadin/tests/components/table/ModifyContainerProperty.html
+++ b/tests/testbench/com/vaadin/tests/components/table/ModifyContainerProperty.html
@@ -22,9 +22,9 @@
<td></td>
</tr>
<tr>
- <td>assertTextNotPresent</td>
- <td>bar</td>
+ <td>screenCapture</td>
<td></td>
+ <td>bar-hidden</td>
</tr>
<tr>
<td>click</td>
diff --git a/tests/testbench/com/vaadin/tests/components/table/MultiSelectWithNotIdentityEqualIds.java b/tests/testbench/com/vaadin/tests/components/table/MultiSelectWithNotIdentityEqualIds.java
index 62fd53d769..9178b284f3 100644
--- a/tests/testbench/com/vaadin/tests/components/table/MultiSelectWithNotIdentityEqualIds.java
+++ b/tests/testbench/com/vaadin/tests/components/table/MultiSelectWithNotIdentityEqualIds.java
@@ -20,8 +20,8 @@ public class MultiSelectWithNotIdentityEqualIds extends TestBase {
t.setImmediate(true);
t.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- t.getWindow().showNotification(
- "Selected: " + event.getProperty());
+ t.getRoot()
+ .showNotification("Selected: " + event.getProperty());
}
});
diff --git a/tests/testbench/com/vaadin/tests/components/table/PropertyValueChange.java b/tests/testbench/com/vaadin/tests/components/table/PropertyValueChange.java
index 5975137976..311c3cf3c1 100644
--- a/tests/testbench/com/vaadin/tests/components/table/PropertyValueChange.java
+++ b/tests/testbench/com/vaadin/tests/components/table/PropertyValueChange.java
@@ -39,17 +39,18 @@ public class PropertyValueChange extends TestBase {
// Also use column generator in test, to ensure it is possible to build
// columns that update automatically.
ColumnGenerator multiplier = new ColumnGenerator() {
- private int getMultipliedValue(Property p) {
- int i = ((Integer) p.getValue()).intValue();
+ private int getMultipliedValue(Property<Integer> p) {
+ int i = p.getValue().intValue();
return i * 3;
}
public Component generateCell(Table source, Object itemId,
Object columnId) {
final Label l = new Label();
- final Property integer = source.getContainerProperty(itemId,
- "integer");
- l.setValue(getMultipliedValue(integer));
+ @SuppressWarnings("unchecked")
+ final Property<Integer> integer = (Property<Integer>) source
+ .getContainerProperty(itemId, "integer");
+ l.setValue(String.valueOf(getMultipliedValue(integer)));
// we must hook value change listener to ensure updates in all use
// cases (eg. edit mode)
@@ -57,7 +58,7 @@ public class PropertyValueChange extends TestBase {
Property.ValueChangeNotifier notifier = (Property.ValueChangeNotifier) integer;
notifier.addListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- l.setValue(getMultipliedValue(integer));
+ l.setValue(String.valueOf(getMultipliedValue(integer)));
}
});
}
@@ -134,7 +135,7 @@ class MyFieldFactory extends DefaultFieldFactory {
}
@Override
- public Field createField(Container container, Object itemId,
+ public Field<?> createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
if (propertyId.equals("text")) {
// replace text fields with comboboxes
diff --git a/tests/testbench/com/vaadin/tests/components/table/ScrollCausesRequestLoop.java b/tests/testbench/com/vaadin/tests/components/table/ScrollCausesRequestLoop.java
index 1916dcd0d7..c140e7e412 100644
--- a/tests/testbench/com/vaadin/tests/components/table/ScrollCausesRequestLoop.java
+++ b/tests/testbench/com/vaadin/tests/components/table/ScrollCausesRequestLoop.java
@@ -7,14 +7,14 @@ import com.vaadin.data.util.BeanItemContainer;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Person;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
public class ScrollCausesRequestLoop extends TestBase {
@Override
protected void setup() {
- setMainWindow(new Window("", new TestView()));
+ setMainWindow(new LegacyWindow("", new TestView()));
}
@Override
diff --git a/tests/testbench/com/vaadin/tests/components/table/ScrollDetachSynchronization.java b/tests/testbench/com/vaadin/tests/components/table/ScrollDetachSynchronization.java
index fe99cfaf2a..3b0234d805 100644
--- a/tests/testbench/com/vaadin/tests/components/table/ScrollDetachSynchronization.java
+++ b/tests/testbench/com/vaadin/tests/components/table/ScrollDetachSynchronization.java
@@ -7,15 +7,12 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class ScrollDetachSynchronization extends TestBase {
@Override
public void setup() {
- Window mainWindow = new Window("Synctest Application");
- mainWindow.setContent(buildLayout());
- setMainWindow(mainWindow);
+ getMainWindow().setContent(buildLayout());
}
@Override
diff --git a/tests/testbench/com/vaadin/tests/components/table/SortLongTable.java b/tests/testbench/com/vaadin/tests/components/table/SortLongTable.java
index cc9dec0965..15872aa849 100644
--- a/tests/testbench/com/vaadin/tests/components/table/SortLongTable.java
+++ b/tests/testbench/com/vaadin/tests/components/table/SortLongTable.java
@@ -1,9 +1,9 @@
package com.vaadin.tests.components.table;
import com.vaadin.tests.components.AbstractTestCase;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class SortLongTable extends AbstractTestCase {
@@ -11,7 +11,7 @@ public class SortLongTable extends AbstractTestCase {
public void init() {
final int NUMBER_OF_ROWS = 100; // Works with 10
- Window mainWindow = new Window("Table Sort Test");
+ LegacyWindow mainWindow = new LegacyWindow("Table Sort Test");
mainWindow.setSizeFull();
setMainWindow(mainWindow);
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableCacheBuildEfficiency.java b/tests/testbench/com/vaadin/tests/components/table/TableCacheBuildEfficiency.java
index 220d5e8192..3c6445349a 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableCacheBuildEfficiency.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableCacheBuildEfficiency.java
@@ -28,7 +28,7 @@ public class TableCacheBuildEfficiency extends TestBase {
final Table table = new Table() {
@Override
- public Property getContainerProperty(Object itemId,
+ public Property<?> getContainerProperty(Object itemId,
Object propertyId) {
log("Fetched container property \"" + propertyId
+ "\" for item \"" + itemId + "\"");
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.html b/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.html
index 83a02ec44b..5b50eeba23 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.html
+++ b/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.html
@@ -18,82 +18,82 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>38,11</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>35,14</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>24,11</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>39,11</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>37,14</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>51,16</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[6]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[6]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>19,10</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>43,14</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[8]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[8]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>36,7</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[9]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[9]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>27,14</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>13,7</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[11]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[11]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>43,8</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[12]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[12]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>27,9</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>53,16</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[14]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[14]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>40,9</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[15]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[15]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>45,10</td>
</tr>
<tr>
@@ -103,82 +103,82 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>39,7</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>37,6</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>33,11</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>17,9</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>49,14</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>53,9</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[6]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[6]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>21,12</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>32,13</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[8]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[8]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>45,11</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[9]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[9]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>22,10</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>28,8</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[11]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[11]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>15,8</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[12]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[12]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>35,5</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>26,8</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[14]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[14]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>55,13</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[15]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[15]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>22,7</td>
</tr>
<tr>
@@ -188,82 +188,82 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>41,12</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>28,9</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>16,8</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>38,12</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>47,6</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>30,7</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[6]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[6]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>16,8</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>68,8</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[8]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[8]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>36,10</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[9]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[9]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>48,8</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>27,12</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[11]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[11]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>19,14</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[12]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[12]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>22,10</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>39,13</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[14]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[14]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>35,15</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[15]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[15]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>19,15</td>
</tr>
<tr>
@@ -273,82 +273,82 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>30,8</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>20,13</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>19,15</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>43,15</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>44,15</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>62,12</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[6]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[6]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>29,14</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>25,13</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[8]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[8]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>22,9</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[9]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[9]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>30,11</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>21,6</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[11]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[11]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>32,11</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[12]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[12]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>34,14</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>45,11</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[14]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[14]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>31,6</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[15]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[15]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>45,10</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java b/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java
index 47216033e9..ff5aa89d84 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java
@@ -11,24 +11,21 @@ import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class TableClickValueChangeInteraction extends TestBase {
- final Window mainWindow = new Window();
-
@Override
public void setup() {
- setMainWindow(mainWindow);
+ GridLayout grid = new GridLayout(4, 4);
+ grid.setSpacing(true);
+ grid.setMargin(true);
- GridLayout layout = new GridLayout(4, 4);
- layout.setSpacing(true);
- layout.setMargin(true);
- mainWindow.setContent(layout);
+ getLayout().removeAllComponents();
+ getLayout().addComponent(grid);
for (int i = 0; i < 16; ++i) {
- mainWindow.addComponent(makeTable((i & 8) > 0, (i & 4) > 0,
- (i & 2) > 0, (i & 1) > 0));
+ grid.addComponent(makeTable((i & 8) > 0, (i & 4) > 0, (i & 2) > 0,
+ (i & 1) > 0));
}
}
@@ -72,7 +69,8 @@ public class TableClickValueChangeInteraction extends TestBase {
if (listenValueChanges) {
table.addListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- valueChangeLabel.setValue("Value " + event.getProperty());
+ valueChangeLabel.setValue("Value "
+ + event.getProperty().getValue());
}
});
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableExtraScrollbars.java b/tests/testbench/com/vaadin/tests/components/table/TableExtraScrollbars.java
index 8fde820749..010093bf8f 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableExtraScrollbars.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableExtraScrollbars.java
@@ -4,9 +4,9 @@ import com.vaadin.data.Container;
import com.vaadin.data.Item;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.tests.components.AbstractTestCase;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class TableExtraScrollbars extends AbstractTestCase {
@@ -16,7 +16,7 @@ public class TableExtraScrollbars extends AbstractTestCase {
@Override
public void init() {
setTheme("runo");
- Window w = new Window("Table scrollbars bug example");
+ LegacyWindow w = new LegacyWindow("Table scrollbars bug example");
setMainWindow(w);
VerticalLayout vl = new VerticalLayout();
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableHeaderZoom.java b/tests/testbench/com/vaadin/tests/components/table/TableHeaderZoom.java
index f7d85f1a3c..bce96ebced 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableHeaderZoom.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableHeaderZoom.java
@@ -2,8 +2,8 @@ package com.vaadin.tests.components.table;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.CssLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
public class TableHeaderZoom extends TestBase {
@@ -19,7 +19,7 @@ public class TableHeaderZoom extends TestBase {
table.addItem(new Object[] { "" + i, "foo" }, i);
}
- Window main = getMainWindow();
+ LegacyWindow main = getMainWindow();
main.setContent(new CssLayout());
main.addComponent(table);
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableHeightWhenHidingHeaders.java b/tests/testbench/com/vaadin/tests/components/table/TableHeightWhenHidingHeaders.java
index d0b7631f10..27b962cddd 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableHeightWhenHidingHeaders.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableHeightWhenHidingHeaders.java
@@ -1,10 +1,11 @@
package com.vaadin.tests.components.table;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.tests.components.AbstractTestCase;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
/**
* Setting table height and setting column header mode as hidden leaves the body
@@ -17,7 +18,7 @@ public class TableHeightWhenHidingHeaders extends AbstractTestCase {
@Override
public void init() {
- Window mainWindow = new Window();
+ LegacyWindow mainWindow = new LegacyWindow();
setMainWindow(mainWindow);
final Table table = new Table("Test table");
@@ -30,24 +31,25 @@ public class TableHeightWhenHidingHeaders extends AbstractTestCase {
table.addItem("1").getItemProperty("Name").setValue("Item 1");
table.addItem("2").getItemProperty("Name").setValue("Item 2");
- CheckBox showHeaders = new CheckBox("Show headers",
- new CheckBox.ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (event.getButton().booleanValue()) {
- // table body height is now 77px, which together
- // with header makes 100px
- table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID);
- } else {
- table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
- // header disappears, but table body height stays at
- // 77px
- // and below the body is an empty area (same height
- // as header would
- // have)
+ CheckBox showHeaders = new CheckBox("Show headers");
+ showHeaders.addListener(new ValueChangeListener() {
- }
- }
- });
+ public void valueChange(ValueChangeEvent event) {
+ if ((Boolean) event.getProperty().getValue()) {
+ // table body height is now 77px, which together
+ // with header makes 100px
+ table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID);
+ } else {
+ table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
+ // header disappears, but table body height stays at
+ // 77px
+ // and below the body is an empty area (same height
+ // as header would
+ // have)
+
+ }
+ }
+ });
showHeaders.setValue(true);
showHeaders.setImmediate(true);
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.java b/tests/testbench/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.java
index 2f53b91107..1f15b224dc 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.java
@@ -4,69 +4,70 @@ import com.vaadin.data.Container;
import com.vaadin.data.Item;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Button;
+import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator;
import com.vaadin.ui.Component;
-import com.vaadin.ui.Label;
import com.vaadin.ui.Table;
-import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator;
import com.vaadin.ui.TextField;
public class TableItemDescriptionGeneratorTest extends TestBase {
- private final String COLUMN1_PROPERTY_ID = "Text - Cell description";
- private final String COLUMN2_PROPERTY_ID = "Text - Row description";
- private final String COLUMN3_PROPERTY_ID = "Widget";
-
- @Override
- protected void setup() {
- final Table table = new Table();
- table.setDebugId("table");
- table.setContainerDataSource(createContainer());
- addComponent(table);
-
- table.setItemDescriptionGenerator(new ItemDescriptionGenerator() {
- public String generateDescription(Component source, Object itemId,
- Object propertyId) {
- if(propertyId == null){
- return "Row description "+ itemId;
- } else if(propertyId == COLUMN1_PROPERTY_ID) {
- return "Cell description " + itemId +","+propertyId;
- }
- return null;
- }
- });
-
- table.addGeneratedColumn(COLUMN3_PROPERTY_ID, new Table.ColumnGenerator() {
-
- public Component generateCell(Table source, Object itemId, Object columnId) {
- TextField lbl = new TextField();
- lbl.setDescription("Textfields own description");
- return lbl;
- }
- });
- }
+ private final String COLUMN1_PROPERTY_ID = "Text - Cell description";
+ private final String COLUMN2_PROPERTY_ID = "Text - Row description";
+ private final String COLUMN3_PROPERTY_ID = "Widget";
+
+ @Override
+ protected void setup() {
+ final Table table = new Table();
+ table.setDebugId("table");
+ table.setContainerDataSource(createContainer());
+ addComponent(table);
+
+ table.setItemDescriptionGenerator(new ItemDescriptionGenerator() {
+ public String generateDescription(Component source, Object itemId,
+ Object propertyId) {
+ if (propertyId == null) {
+ return "Row description " + itemId;
+ } else if (propertyId == COLUMN1_PROPERTY_ID) {
+ return "Cell description " + itemId + "," + propertyId;
+ }
+ return null;
+ }
+ });
+
+ table.addGeneratedColumn(COLUMN3_PROPERTY_ID,
+ new Table.ColumnGenerator() {
- @Override
- protected String getDescription() {
- return "Cells and rows should have tooltips";
- }
+ public Component generateCell(Table source, Object itemId,
+ Object columnId) {
+ TextField lbl = new TextField();
+ lbl.setDescription("Textfields own description");
+ return lbl;
+ }
+ });
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Cells and rows should have tooltips";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 5414;
+ }
- @Override
- protected Integer getTicketNumber() {
- return 5414;
- }
-
- private Container createContainer() {
+ private Container createContainer() {
IndexedContainer container = new IndexedContainer();
container.addContainerProperty(COLUMN1_PROPERTY_ID, String.class, "");
container.addContainerProperty(COLUMN2_PROPERTY_ID, String.class, "");
- // container.addContainerProperty(COLUMN3_PROPERTY_ID, String.class, "");
+ // container.addContainerProperty(COLUMN3_PROPERTY_ID, String.class,
+ // "");
for (int i = 0; i < 5; i++) {
Item item = container.addItem("item " + i);
item.getItemProperty(COLUMN1_PROPERTY_ID).setValue("first" + i);
item.getItemProperty(COLUMN2_PROPERTY_ID).setValue("middle" + i);
- // item.getItemProperty(COLUMN3_PROPERTY_ID).setValue("last" + i);
+ // item.getItemProperty(COLUMN3_PROPERTY_ID).setValue("last" + i);
}
return container;
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableMultiSelectSimple.java b/tests/testbench/com/vaadin/tests/components/table/TableMultiSelectSimple.java
index 76415844be..c33ba30193 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableMultiSelectSimple.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableMultiSelectSimple.java
@@ -29,8 +29,8 @@ public class TableMultiSelectSimple extends TestBase {
t.addListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- TreeSet sorted = new TreeSet((Set) event.getProperty()
- .getValue());
+ TreeSet<?> sorted = new TreeSet<Object>((Set<?>) event
+ .getProperty().getValue());
log.log("Selected value: " + sorted);
}
});
@@ -40,7 +40,7 @@ public class TableMultiSelectSimple extends TestBase {
for (int i = 0; i < 10; i++) {
t.addItem(i);
- t.getContainerProperty(i, "string").setValue(i);
+ t.getContainerProperty(i, "string").setValue(String.valueOf(i));
t.getContainerProperty(i, "button")
.setValue(new Button("Click me"));
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/TablePageLengthUpdate.java b/tests/testbench/com/vaadin/tests/components/table/TablePageLengthUpdate.java
index 71dc987e56..2ba1475cc8 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TablePageLengthUpdate.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TablePageLengthUpdate.java
@@ -1,7 +1,6 @@
package com.vaadin.tests.components.table;
import com.vaadin.data.util.MethodProperty;
-import com.vaadin.terminal.Sizeable;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
@@ -61,8 +60,7 @@ public class TablePageLengthUpdate extends TestBase {
}
public String getTableHeight() {
- return "" + (int) table.getHeight()
- + Sizeable.UNIT_SYMBOLS[table.getHeightUnits()];
+ return "" + (int) table.getHeight() + table.getHeightUnits().getSymbol();
}
public void setTableHeight(String height) {
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableScrollOnFocus.java b/tests/testbench/com/vaadin/tests/components/table/TableScrollOnFocus.java
index 2c7193956a..4053665898 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableScrollOnFocus.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableScrollOnFocus.java
@@ -15,7 +15,7 @@ public class TableScrollOnFocus extends TestBase {
chkSelectable.setImmediate(true);
chkSelectable.addListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- table.setSelectable(chkSelectable.booleanValue());
+ table.setSelectable((Boolean) chkSelectable.getValue());
}
});
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.java b/tests/testbench/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.java
index 21e26b64b8..a1686dee3f 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.java
@@ -3,10 +3,10 @@ package com.vaadin.tests.components.table;
import com.vaadin.event.ItemClickEvent;
import com.vaadin.event.ItemClickEvent.ItemClickListener;
import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.TableDragMode;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window.Notification;
public class TableShouldNotEatValueChanges extends TestBase {
@@ -27,7 +27,7 @@ public class TableShouldNotEatValueChanges extends TestBase {
ItemClickListener l = new ItemClickListener() {
public void itemClick(ItemClickEvent event) {
- tf.getWindow().showNotification(
+ tf.getRoot().showNotification(
"TF Value on the server:" + tf.getValue(),
Notification.TYPE_WARNING_MESSAGE);
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableSingleSelect.java b/tests/testbench/com/vaadin/tests/components/table/TableSingleSelect.java
index 911c59b5c5..62d0cce9df 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableSingleSelect.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableSingleSelect.java
@@ -32,7 +32,7 @@ public class TableSingleSelect extends TestBase {
for (int i = 0; i < 10; i++) {
t.addItem(i);
- t.getContainerProperty(i, "string").setValue(i);
+ t.getContainerProperty(i, "string").setValue(String.valueOf(i));
t.getContainerProperty(i, "button")
.setValue(new Button("Click me"));
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableToggleVisibility.java b/tests/testbench/com/vaadin/tests/components/table/TableToggleVisibility.java
index f5f87599d9..0cc125acaa 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableToggleVisibility.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableToggleVisibility.java
@@ -7,9 +7,9 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class TableToggleVisibility extends AbstractTestCase {
@@ -112,7 +112,8 @@ public class TableToggleVisibility extends AbstractTestCase {
mainLayout.addComponent(split);
mainLayout.setExpandRatio(split, 1.0f);
- Window mainWindow = new Window("Visibilitybug Application", mainLayout);
+ LegacyWindow mainWindow = new LegacyWindow("Visibilitybug Application",
+ mainLayout);
mainWindow.setSizeFull();
setMainWindow(mainWindow);
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.html b/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.html
index fbb6f4c7f9..8874cc91af 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.html
+++ b/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.html
@@ -27,9 +27,9 @@
<td></td>
</tr>
<tr>
- <td>verifyTextPresent</td>
- <td>exact:1: Size 200x200 pixels</td>
- <td></td>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::PID_SLog_row_0</td>
+ <td>1. Size 200x200 pixels</td>
</tr>
<tr>
<td>screenCapture</td>
@@ -42,9 +42,9 @@
<td></td>
</tr>
<tr>
- <td>verifyTextPresent</td>
- <td>exact:2: Size 600x200 pixels<br />1: Size 200x200 pixels</td>
- <td></td>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::PID_SLog_row_0</td>
+ <td>2. Size 600x200 pixels</td>
</tr>
<tr>
<td>screenCapture</td>
@@ -57,9 +57,9 @@
<td></td>
</tr>
<tr>
- <td>verifyTextPresent</td>
- <td>exact:3: Size undefined<br />2: Size 600x200 pixels<br />1: Size 200x200 pixels</td>
- <td></td>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::PID_SLog_row_0</td>
+ <td>3. Size undefined</td>
</tr>
<tr>
<td>select</td>
@@ -67,9 +67,9 @@
<td>label=4</td>
</tr>
<tr>
- <td>verifyTextPresent</td>
- <td>exact:4: Page length: 4<br />3: Size undefined<br />2: Size 600x200 pixels<br />1: Size 200x200 pixels</td>
- <td></td>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::PID_SLog_row_0</td>
+ <td>4. Page length: 4</td>
</tr>
<tr>
<td>screenCapture</td>
@@ -97,14 +97,14 @@
<td>3,6</td>
</tr>
<tr>
- <td>verifyTextPresent</td>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]</td>
<td>Column 2</td>
- <td></td>
</tr>
<tr>
- <td>verifyTextPresent</td>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[2]</td>
<td>Column 3</td>
- <td></td>
</tr>
<tr>
<td>screenCapture</td>
@@ -121,7 +121,6 @@
<td></td>
<td>AllColumnsShown</td>
</tr>
-
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.java b/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.java
index 2b3204953b..73b80f62f4 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.java
@@ -5,22 +5,20 @@ import java.util.Arrays;
import com.vaadin.data.Container;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.util.IndexedContainer;
-import com.vaadin.data.util.ObjectProperty;
import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Log;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Label;
import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.Table;
public class TableUndefinedSize extends TestBase {
- private ObjectProperty<String> output = new ObjectProperty<String>("");
-
- private int counter = 1;
+ private Log log;
@Override
protected void setup() {
@@ -37,17 +35,14 @@ public class TableUndefinedSize extends TestBase {
tbl.setImmediate(true);
tbl.setColumnCollapsingAllowed(true);
- Label output = new Label(this.output);
- output.setWidth("400px");
- output.setHeight("100px");
- output.setContentMode(Label.CONTENT_XHTML);
+ log = new Log(5);
controls.addComponent(new Button("Fixed size (200x200)",
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
tbl.setWidth("200px");
tbl.setHeight("200px");
- print("Size 200x200 pixels");
+ log.log("Size 200x200 pixels");
}
}));
@@ -56,7 +51,7 @@ public class TableUndefinedSize extends TestBase {
public void buttonClick(ClickEvent event) {
tbl.setWidth("600px");
tbl.setHeight("200px");
- print("Size 600x200 pixels");
+ log.log("Size 600x200 pixels");
}
}));
@@ -64,7 +59,7 @@ public class TableUndefinedSize extends TestBase {
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
tbl.setSizeUndefined();
- print("Size undefined");
+ log.log("Size undefined");
}
}));
@@ -77,68 +72,70 @@ public class TableUndefinedSize extends TestBase {
int pageLength = Integer.valueOf(event.getProperty().getValue()
.toString());
tbl.setPageLength(pageLength);
- print("Page length: " + pageLength);
+ log.log("Page length: " + pageLength);
}
});
controls.addComponent(pageLength);
- CheckBox cb = new CheckBox("Column 1", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- tbl.setColumnCollapsed("Column 1", !event.getButton()
- .booleanValue());
- if (event.getButton().booleanValue()) {
- print("Column 1 visible");
+ CheckBox cb = new CheckBox("Column 1");
+ cb.setValue(true);
+ cb.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ Boolean value = (Boolean) event.getProperty().getValue();
+ tbl.setColumnCollapsed("Column 1", !value);
+ if (value) {
+ log.log("Column 1 visible");
} else {
- print("Column 1 hidden");
+ log.log("Column 1 hidden");
}
- }
+ }
});
cb.setImmediate(true);
- cb.setValue(true);
visibilities.addComponent(cb);
- cb = new CheckBox("Column 2", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- tbl.setColumnCollapsed("Column 2", !event.getButton()
- .booleanValue());
+ cb = new CheckBox("Column 2");
+ cb.setValue(true);
+ cb.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ Boolean value = (Boolean) event.getProperty().getValue();
+ tbl.setColumnCollapsed("Column 2", !value);
- if (event.getButton().booleanValue()) {
- print("Column 2 visible");
+ if (value) {
+ log.log("Column 2 visible");
} else {
- print("Column 2 hidden");
+ log.log("Column 2 hidden");
}
}
});
cb.setImmediate(true);
- cb.setValue(true);
visibilities.addComponent(cb);
- cb = new CheckBox("Column 3", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- tbl.setColumnCollapsed("Column 3", !event.getButton()
- .booleanValue());
+ cb = new CheckBox("Column 3");
+ cb.setValue(true);
+ cb.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ Boolean value = (Boolean) event.getProperty().getValue();
- if (event.getButton().booleanValue()) {
- print("Column 3 visible");
+ tbl.setColumnCollapsed("Column 3", !value);
+
+ if (value) {
+ log.log("Column 3 visible");
} else {
- print("Column 3 hidden");
+ log.log("Column 3 hidden");
}
}
});
cb.setImmediate(true);
- cb.setValue(true);
visibilities.addComponent(cb);
- addComponent(output);
+ addComponent(log);
addComponent(tbl);
}
- protected void print(String message) {
- output.setValue(counter + ": " + message + "<br/>" + output.getValue());
- counter++;
- }
-
protected Container createDataSource() {
IndexedContainer c = new IndexedContainer();
c.addContainerProperty("Column 1", String.class, "Column 1");
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableUnregisterComponent.java b/tests/testbench/com/vaadin/tests/components/table/TableUnregisterComponent.java
index 91f5aec1ca..6fd4a9db52 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableUnregisterComponent.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableUnregisterComponent.java
@@ -49,10 +49,10 @@ public class TableUnregisterComponent extends TestBase {
table.setColumnCollapsingAllowed(true);
table.setTableFieldFactory(new DefaultFieldFactory() {
@Override
- public Field createField(Container container, Object itemId,
+ public Field<?> createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
if (COL_B.equals(propertyId)) {
- Field field = new TextField() {
+ Field<String> field = new TextField() {
@Override
public void setPropertyDataSource(Property newDataSource) {
super.setPropertyDataSource(newDataSource);
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableWithManyColumns.java b/tests/testbench/com/vaadin/tests/components/table/TableWithManyColumns.java
index 7040391721..e0ae38a8b9 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableWithManyColumns.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableWithManyColumns.java
@@ -20,7 +20,7 @@ public class TableWithManyColumns extends TestBase {
for (int row = 0; row < ROWS; row++) {
Item i = t.addItem(String.valueOf(row));
for (int col = 0; col < COLS; col++) {
- Property p = i.getItemProperty("COLUMN_" + col);
+ Property<?> p = i.getItemProperty("COLUMN_" + col);
p.setValue("item " + row + "/" + col);
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/Tables.java b/tests/testbench/com/vaadin/tests/components/table/Tables.java
index 3f37a178b6..4c773c9678 100644
--- a/tests/testbench/com/vaadin/tests/components/table/Tables.java
+++ b/tests/testbench/com/vaadin/tests/components/table/Tables.java
@@ -13,9 +13,12 @@ import com.vaadin.tests.components.select.AbstractSelectTestCase;
import com.vaadin.ui.AbstractSelect.MultiSelectMode;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Table;
+import com.vaadin.ui.Table.Align;
import com.vaadin.ui.Table.CellStyleGenerator;
import com.vaadin.ui.Table.ColumnGenerator;
+import com.vaadin.ui.Table.ColumnHeaderMode;
import com.vaadin.ui.Table.ColumnResizeEvent;
import com.vaadin.ui.Table.ColumnResizeListener;
import com.vaadin.ui.Table.FooterClickEvent;
@@ -24,6 +27,7 @@ import com.vaadin.ui.Table.GeneratedRow;
import com.vaadin.ui.Table.HeaderClickEvent;
import com.vaadin.ui.Table.HeaderClickListener;
import com.vaadin.ui.Table.RowGenerator;
+import com.vaadin.ui.Table.RowHeaderMode;
public class Tables<T extends Table> extends AbstractSelectTestCase<T>
implements ItemClickListener, HeaderClickListener, FooterClickListener,
@@ -34,15 +38,16 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
private static final String CATEGORY_FOOTER = "Footer";
private static final String CATEGORY_COLUMNS = "Columns";
+ @SuppressWarnings("unchecked")
@Override
protected Class<T> getTestClass() {
- return (Class) Table.class;
+ return (Class<T>) Table.class;
}
/* COMMANDS */
- private Command<T, String> columnAlignmentCommand = new Command<T, String>() {
+ private Command<T, Align> columnAlignmentCommand = new Command<T, Align>() {
- public void execute(T c, String alignment, Object propertyId) {
+ public void execute(T c, Align alignment, Object propertyId) {
c.setColumnAlignment(propertyId, alignment);
}
@@ -106,10 +111,10 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
}
};
- protected Command<T, Integer> rowHeaderModeCommand = new Command<T, Integer>() {
+ protected Command<T, RowHeaderMode> rowHeaderModeCommand = new Command<T, RowHeaderMode>() {
- public void execute(Table c, Integer value, Object data) {
- if (value == Table.ROW_HEADER_MODE_PROPERTY) {
+ public void execute(Table c, RowHeaderMode value, Object data) {
+ if (value == RowHeaderMode.PROPERTY) {
c.setItemCaptionPropertyId("Property 3");
}
c.setRowHeaderMode(value);
@@ -133,7 +138,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
protected Command<T, Object> alignColumnLeftCommand = new Command<T, Object>() {
public void execute(T c, Object propertyId, Object data) {
- c.setColumnAlignment(propertyId, (String) data);
+ c.setColumnAlignment(propertyId, (Align) data);
}
};
@@ -172,9 +177,9 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
}
};
- private Command<T, Integer> columnHeaderModeCommand = new Command<T, Integer>() {
+ private Command<T, ColumnHeaderMode> columnHeaderModeCommand = new Command<T, ColumnHeaderMode>() {
- public void execute(T c, Integer columnHeaderMode, Object data) {
+ public void execute(T c, ColumnHeaderMode columnHeaderMode, Object data) {
c.setColumnHeaderMode(columnHeaderMode);
}
@@ -239,7 +244,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
l.setWidth(col.width);
if (col.html) {
l.setValue(value);
- l.setContentMode(Label.CONTENT_XHTML);
+ l.setContentMode(ContentMode.XHTML);
} else {
l.setValue(value);
}
@@ -475,13 +480,12 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
}
private void createColumnHeaderMode(String category) {
- LinkedHashMap<String, Integer> columnHeaderModeOptions = new LinkedHashMap<String, Integer>();
- columnHeaderModeOptions.put("Hidden", Table.COLUMN_HEADER_MODE_HIDDEN);
- columnHeaderModeOptions.put("Id", Table.COLUMN_HEADER_MODE_ID);
- columnHeaderModeOptions.put("Explicit",
- Table.COLUMN_HEADER_MODE_EXPLICIT);
+ LinkedHashMap<String, ColumnHeaderMode> columnHeaderModeOptions = new LinkedHashMap<String, ColumnHeaderMode>();
+ columnHeaderModeOptions.put("Hidden", ColumnHeaderMode.HIDDEN);
+ columnHeaderModeOptions.put("Id", ColumnHeaderMode.ID);
+ columnHeaderModeOptions.put("Explicit", ColumnHeaderMode.EXPLICIT);
columnHeaderModeOptions.put("Explicit defaults id",
- Table.COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID);
+ ColumnHeaderMode.EXPLICIT_DEFAULTS_ID);
createSelectAction("Column header mode", category,
columnHeaderModeOptions, "Explicit defaults id",
@@ -601,10 +605,10 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
createBooleanAction("Collapsed", category, false, columnCollapsed,
propertyId);
t.log("Collapsed");
- LinkedHashMap<String, String> options = new LinkedHashMap<String, String>();
- options.put("Left", Table.ALIGN_LEFT);
- options.put("Center", Table.ALIGN_CENTER);
- options.put("Right", Table.ALIGN_RIGHT);
+ LinkedHashMap<String, Align> options = new LinkedHashMap<String, Align>();
+ options.put("Left", Align.LEFT);
+ options.put("Center", Align.CENTER);
+ options.put("Right", Align.RIGHT);
createSelectAction("Alignment", category, options, "Left",
columnAlignmentCommand, propertyId);
@@ -650,16 +654,15 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
}
private void createRowHeaderModeSelect(String category) {
- LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();
- options.put("Explicit", Table.ROW_HEADER_MODE_EXPLICIT);
- options.put("Explicit defaults id",
- Table.ROW_HEADER_MODE_EXPLICIT_DEFAULTS_ID);
- options.put("Hidden", Table.ROW_HEADER_MODE_HIDDEN);
- options.put("Icon only", Table.ROW_HEADER_MODE_ICON_ONLY);
- options.put("Id", Table.ROW_HEADER_MODE_ID);
- options.put("Index", Table.ROW_HEADER_MODE_INDEX);
- options.put("Item", Table.ROW_HEADER_MODE_ITEM);
- options.put("'Property 3' property", Table.ROW_HEADER_MODE_PROPERTY);
+ LinkedHashMap<String, RowHeaderMode> options = new LinkedHashMap<String, RowHeaderMode>();
+ options.put("Explicit", RowHeaderMode.EXPLICIT);
+ options.put("Explicit defaults id", RowHeaderMode.EXPLICIT_DEFAULTS_ID);
+ options.put("Hidden", RowHeaderMode.HIDDEN);
+ options.put("Icon only", RowHeaderMode.ICON_ONLY);
+ options.put("Id", RowHeaderMode.ID);
+ options.put("Index", RowHeaderMode.INDEX);
+ options.put("Item", RowHeaderMode.ITEM);
+ options.put("'Property 3' property", RowHeaderMode.PROPERTY);
createSelectAction("Row header mode", category, options, "Hidden",
rowHeaderModeCommand);
@@ -739,17 +742,17 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
}
protected void createHeaderVisibilitySelect(String category) {
- LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();
- options.put("Explicit", Table.COLUMN_HEADER_MODE_EXPLICIT);
+ LinkedHashMap<String, ColumnHeaderMode> options = new LinkedHashMap<String, ColumnHeaderMode>();
+ options.put("Explicit", ColumnHeaderMode.EXPLICIT);
options.put("Explicit defaults id",
- Table.COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID);
- options.put("Id", Table.COLUMN_HEADER_MODE_ID);
- options.put("Hidden", Table.COLUMN_HEADER_MODE_HIDDEN);
+ ColumnHeaderMode.EXPLICIT_DEFAULTS_ID);
+ options.put("Id", ColumnHeaderMode.ID);
+ options.put("Hidden", ColumnHeaderMode.HIDDEN);
createSelectAction("Header mode", category, options,
- "Explicit defaults id", new Command<T, Integer>() {
+ "Explicit defaults id", new Command<T, ColumnHeaderMode>() {
- public void execute(T c, Integer value, Object data) {
+ public void execute(T c, ColumnHeaderMode value, Object data) {
c.setColumnHeaderMode(value);
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/TestCurrentPageFirstItem.java b/tests/testbench/com/vaadin/tests/components/table/TestCurrentPageFirstItem.java
index 1733b15e80..1748c27426 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TestCurrentPageFirstItem.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TestCurrentPageFirstItem.java
@@ -7,12 +7,12 @@ import com.vaadin.data.util.IndexedContainer;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class TestCurrentPageFirstItem extends Application implements
- ClickListener {
+public class TestCurrentPageFirstItem extends Application.LegacyApplication
+ implements ClickListener {
private Button buttonIndex;
private Button buttonItem;
@@ -23,7 +23,7 @@ public class TestCurrentPageFirstItem extends Application implements
@Override
public void init() {
try {
- Window main = new Window("Table header Test");
+ LegacyWindow main = new LegacyWindow("Table header Test");
setMainWindow(main);
main.setSizeFull();
// setTheme("testtheme");
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTest.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTest.java
index 1c5c63dcd4..3077c1a97b 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTest.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTest.java
@@ -80,6 +80,7 @@ public class TabSheetTest<T extends TabSheet> extends
}
};
+ @SuppressWarnings("unchecked")
@Override
protected Class<T> getTestClass() {
return (Class<T>) TabSheet.class;
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetNPE.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetNPE.java
index 2b1669bff0..24077b972c 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetNPE.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetNPE.java
@@ -5,10 +5,10 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TabSheet.Tab;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class TabsheetNPE extends AbstractTestCase implements ClickListener {
@@ -29,7 +29,7 @@ public class TabsheetNPE extends AbstractTestCase implements ClickListener {
@Override
public void init() {
- setMainWindow(new Window("TabSheet Demo", createMainLayout()));
+ setMainWindow(new LegacyWindow("TabSheet Demo", createMainLayout()));
}
private VerticalLayout createMainLayout() {
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.java b/tests/testbench/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.java
index 66d19f6935..110f26d478 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.java
@@ -3,7 +3,6 @@ package com.vaadin.tests.components.tabsheet;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TextArea;
-import com.vaadin.ui.TextField;
public class VerticalScrollbarPosition extends TestBase {
@@ -28,9 +27,9 @@ public class VerticalScrollbarPosition extends TestBase {
tf.setWidth("200px");
tabsheet.addTab(
tf,
- "A text field that is 200px wide, the tab bar for the tabsheet is wider",
+ "A text area that is 200px wide, the tab bar for the tabsheet is wider",
null);
- TextField tf2 = new TextField("Another tab", "b");
+ TextArea tf2 = new TextArea("Another tab", "b");
tf2.setWidth("1000px");
tf2.setHeight("50px");
tabsheet.addTab(tf2);
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/SelectionAndCursorPosition.java b/tests/testbench/com/vaadin/tests/components/textfield/SelectionAndCursorPosition.java
index d362a3050d..962a85ffcb 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/SelectionAndCursorPosition.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/SelectionAndCursorPosition.java
@@ -3,6 +3,7 @@ package com.vaadin.tests.components.textfield;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.AbstractTextField;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
@@ -10,34 +11,31 @@ import com.vaadin.ui.CheckBox;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
public class SelectionAndCursorPosition extends TestBase {
- TextField tf = new TextField();
+ TextField textField = createTextField();
+ TextArea textArea = createTextArea();
+ AbstractTextField activeComponent = textField;
@Override
protected void setup() {
-
- tf.setCaption("Text field");
- tf.setValue("So we have some text to select");
- tf.setWidth("400px");
-
FormLayout fl = new FormLayout();
Panel panel = new Panel(fl);
panel.setCaption("Hackers panel");
CheckBox ml = new CheckBox("Multiline");
ml.setImmediate(true);
ml.addListener(new Property.ValueChangeListener() {
- @SuppressWarnings("deprecation")
public void valueChange(ValueChangeEvent event) {
- if (tf.getHeight() < 0) {
- tf.setHeight("50px");
+ if (textField.getApplication() == null) {
+ replaceComponent(textArea, textField);
+ activeComponent = textField;
} else {
- tf.setSizeUndefined();
- tf.setRows(0);
+ replaceComponent(textField, textArea);
+ activeComponent = textArea;
}
- tf.setWidth("400px");
}
});
fl.addComponent(ml);
@@ -45,7 +43,7 @@ public class SelectionAndCursorPosition extends TestBase {
Button b = new Button("Select all ( selectAll() )");
b.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
- tf.selectAll();
+ activeComponent.selectAll();
}
});
fl.addComponent(b);
@@ -58,9 +56,10 @@ public class SelectionAndCursorPosition extends TestBase {
b = new Button("select");
b.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
- int startPos = Integer.parseInt((String) start.getValue());
- int lenght = Integer.parseInt((String) length.getValue());
- tf.setSelectionRange(startPos, lenght);
+ int startPos = Integer.parseInt(start.getValue());
+ int lenght = Integer.parseInt(length.getValue());
+
+ activeComponent.setSelectionRange(startPos, lenght);
}
});
@@ -74,8 +73,8 @@ public class SelectionAndCursorPosition extends TestBase {
b = new Button("set");
b.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
- int startPos = Integer.parseInt((String) pos.getValue());
- tf.setCursorPosition(startPos);
+ int startPos = Integer.parseInt(pos.getValue());
+ activeComponent.setCursorPosition(startPos);
}
});
@@ -85,11 +84,30 @@ public class SelectionAndCursorPosition extends TestBase {
.setCaption("Set cursor position ( setCursorPosition(int pos) )");
fl.addComponent(setCursorPosition);
- getLayout().addComponent(tf);
+ getLayout().addComponent(textField);
getLayout().addComponent(panel);
}
+ private static TextField createTextField() {
+ TextField tf = new TextField();
+ tf.setCaption("Text field");
+ tf.setValue("So we have some text to select");
+ tf.setWidth("400px");
+
+ return tf;
+ }
+
+ private static TextArea createTextArea() {
+ TextArea ta = new TextArea();
+ ta.setCaption("Text area");
+ ta.setValue("So we have some text to select");
+ ta.setWidth("400px");
+ ta.setHeight("50px");
+
+ return ta;
+ }
+
@Override
protected String getDescription() {
return "For usability reasons it is often essential that developer "
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/SizedTextFields.java b/tests/testbench/com/vaadin/tests/components/textfield/SizedTextFields.java
index 93ab80b88a..7d993682fd 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/SizedTextFields.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/SizedTextFields.java
@@ -3,6 +3,7 @@ package com.vaadin.tests.components.textfield;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Component;
import com.vaadin.ui.CssLayout;
+import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
@@ -37,10 +38,10 @@ public class SizedTextFields extends TestBase {
vl.setHeight("40px");
vl.setWidth("200px");
- tf = new TextField();
- tf.setRows(2); // make it text area, instead of oneliner
- tf.setSizeFull();
- vl.addComponent(tf);
+ TextArea ta = new TextArea();
+ ta.setRows(2); // make it text area, instead of oneliner
+ ta.setSizeFull();
+ vl.addComponent(ta);
vl.setCaption("Fullsize textarea in 100px height 200px width box");
cssLayout.addComponent(vl);
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEvents.java b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEvents.java
index f0f0a52237..b3ea5b8186 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEvents.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEvents.java
@@ -87,7 +87,7 @@ public class TextChangeEvents extends TestBase {
@Override
public void attach() {
super.attach();
- TestUtils.injectCSS(getWindow(), ".match { background:green ;} "
+ TestUtils.injectCSS(getRoot(), ".match { background:green ;} "
+ ".nomatch {background:red;}");
}
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEventsWithNonImmediateValueChange.java b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEventsWithNonImmediateValueChange.java
index df5b275a8e..ab3fd49cd6 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEventsWithNonImmediateValueChange.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEventsWithNonImmediateValueChange.java
@@ -32,7 +32,7 @@ public class TextChangeEventsWithNonImmediateValueChange extends TestBase {
tf.addListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- l.log("Value change: '" + event.getProperty().toString() + "'");
+ l.log("Value change: '" + event.getProperty().getValue() + "'");
}
});
@@ -52,4 +52,4 @@ public class TextChangeEventsWithNonImmediateValueChange extends TestBase {
return 6866;
}
-} \ No newline at end of file
+}
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeListenerChangingNonTextProperties.java b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeListenerChangingNonTextProperties.java
index e0fcb1dde8..af380275e3 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeListenerChangingNonTextProperties.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeListenerChangingNonTextProperties.java
@@ -22,8 +22,11 @@ public class TextChangeListenerChangingNonTextProperties extends TestBase {
@Override
public void attach() {
super.attach();
- TestUtils.injectCSS(getWindow(), ".red { background:red;} "
- + ".green { background:green;} .blue { background:blue;} .cyan { background:cyan;} .magenta { background:magenta;}");
+ TestUtils
+ .injectCSS(
+ getRoot(),
+ ".red { background:red;} "
+ + ".green { background:green;} .blue { background:blue;} .cyan { background:cyan;} .magenta { background:magenta;}");
}
};
tf2.setTextChangeEventMode(TextChangeEventMode.EAGER);
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInLayoutInTable.java b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInLayoutInTable.java
index 4fb91db973..3e1a709243 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInLayoutInTable.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInLayoutInTable.java
@@ -3,18 +3,18 @@ package com.vaadin.tests.components.textfield;
import com.vaadin.Application;
import com.vaadin.ui.Component;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-@SuppressWarnings("serial")
-public class TextFieldInLayoutInTable extends Application {
+public class TextFieldInLayoutInTable extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWindow = new Window(this.getClass().getName());
+ final LegacyWindow mainWindow = new LegacyWindow(this.getClass()
+ .getName());
setMainWindow(mainWindow);
final Table table = new Table();
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInputPromptAndClickShortcut.java b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInputPromptAndClickShortcut.java
index 6aac7caddd..c04c9d6c13 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInputPromptAndClickShortcut.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInputPromptAndClickShortcut.java
@@ -1,5 +1,7 @@
package com.vaadin.tests.components.textfield;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.event.ShortcutAction.KeyCode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Log;
@@ -23,18 +25,18 @@ public class TextFieldInputPromptAndClickShortcut extends TestBase {
});
button.setClickShortcut(KeyCode.ESCAPE);
- final CheckBox inputPromptSelection = new CheckBox("Input prompt",
- new ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (event.getButton().getValue() == Boolean.TRUE) {
- textField.setInputPrompt("Input prompt");
- } else {
- textField.setInputPrompt(null);
- }
- log.log("Set input prompt: "
- + textField.getInputPrompt());
- }
- });
+ final CheckBox inputPromptSelection = new CheckBox("Input prompt");
+ inputPromptSelection.setImmediate(true);
+ inputPromptSelection.addListener(new ValueChangeListener() {
+ public void valueChange(ValueChangeEvent event) {
+ if (event.getProperty().getValue() == Boolean.TRUE) {
+ textField.setInputPrompt("Input prompt");
+ } else {
+ textField.setInputPrompt(null);
+ }
+ log.log("Set input prompt: " + textField.getInputPrompt());
+ }
+ });
inputPromptSelection.setImmediate(true);
addComponent(textField);
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldSecret.html b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldSecret.html
deleted file mode 100644
index 6a51103fe5..0000000000
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldSecret.html
+++ /dev/null
@@ -1,196 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link rel="selenium.base" href="" />
-<title>New Test</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">New Test</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/run/com.vaadin.tests.components.textfield.TextFieldTest?restartApplication</td>
- <td></td>
-</tr>
-<!--Disable event log-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_Smenu#item1</td>
- <td>19,8</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[0]/VMenuBar[0]#item0</td>
- <td>24,1</td>
-</tr>
-<!--Enter "s3cr3t" in the TextField-->
-<tr>
- <td>enterCharacter</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_StestComponent</td>
- <td>s3cr3t</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>normal</td>
-</tr>
-<!--Change to secret-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_Smenu#item0</td>
- <td>38,11</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[0]/VMenuBar[0]#item5</td>
- <td>51,10</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[1]/VMenuBar[0]#item6</td>
- <td>25,12</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>secret</td>
-</tr>
-<!--Change to normal-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_Smenu#item0</td>
- <td>38,11</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[0]/VMenuBar[0]#item5</td>
- <td>51,10</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[1]/VMenuBar[0]#item6</td>
- <td>25,12</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>normal</td>
-</tr>
-<!--Change to secret-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_Smenu#item0</td>
- <td>38,11</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[0]/VMenuBar[0]#item5</td>
- <td>51,10</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[1]/VMenuBar[0]#item6</td>
- <td>25,12</td>
-</tr>
-<!--ValueChangeListener-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_Smenu#item0</td>
- <td>38,13</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[0]/VMenuBar[0]#item3</td>
- <td>30,5</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[1]/VMenuBar[0]#item2</td>
- <td>62,12</td>
-</tr>
-<!--Enable and clear event log-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_Smenu#item1</td>
- <td>19,8</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[0]/VMenuBar[0]#item0</td>
- <td>24,1</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_Smenu#item1</td>
- <td>19,8</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[0]/VMenuBar[0]#item1</td>
- <td>24,1</td>
-</tr>
-<!--Value -> Test-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_Smenu#item0</td>
- <td>21,2</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[0]/VMenuBar[0]#item4</td>
- <td>24,7</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[1]/VMenuBar[0]#item0</td>
- <td>37,8</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[2]/VMenuBar[0]#item2</td>
- <td>37,4</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>100</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_SLog/ChildComponentContainer[0]/VLabel[0]</td>
- <td>1. ValueChangeEvent, new value: 'Test'</td>
-</tr>
-<tr>
- <td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_StestComponent</td>
- <td>Test</td>
-</tr>
-<!--Change to normal-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_Smenu#item0</td>
- <td>38,11</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[0]/VMenuBar[0]#item5</td>
- <td>51,10</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[1]/VMenuBar[0]#item6</td>
- <td>25,12</td>
-</tr>
-<tr>
- <td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_StestComponent</td>
- <td>Test</td>
-</tr>
-<!---->
-</tbody></table>
-</body>
-</html>
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldTest.java b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldTest.java
index bc7a6fcf76..10793a8bad 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldTest.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldTest.java
@@ -1,7 +1,5 @@
package com.vaadin.tests.components.textfield;
-import java.util.LinkedHashMap;
-
import com.vaadin.event.FieldEvents.TextChangeListener;
import com.vaadin.tests.components.abstractfield.AbstractTextFieldTest;
import com.vaadin.ui.TextField;
@@ -9,27 +7,6 @@ import com.vaadin.ui.TextField;
public class TextFieldTest extends AbstractTextFieldTest<TextField> implements
TextChangeListener {
- private Command<TextField, Boolean> secretCommand = new Command<TextField, Boolean>() {
- @SuppressWarnings("deprecation")
- public void execute(TextField c, Boolean value, Object data) {
- c.setSecret(value);
- }
- };
-
- private Command<TextField, Boolean> wordwrapCommand = new Command<TextField, Boolean>() {
- @SuppressWarnings("deprecation")
- public void execute(TextField c, Boolean value, Object data) {
- c.setWordwrap(value);
- }
- };
-
- private Command<TextField, Integer> rowsCommand = new Command<TextField, Integer>() {
- @SuppressWarnings("deprecation")
- public void execute(TextField c, Integer value, Object data) {
- c.setRows(value);
- }
- };
-
@Override
protected Class<TextField> getTestClass() {
return TextField.class;
@@ -38,22 +15,6 @@ public class TextFieldTest extends AbstractTextFieldTest<TextField> implements
@Override
protected void createActions() {
super.createActions();
- createSecretAction(CATEGORY_FEATURES);
- createWordwrapAction(CATEGORY_FEATURES);
- createRowsAction(CATEGORY_FEATURES);
- }
-
- private void createRowsAction(String category) {
- LinkedHashMap<String, Integer> options = createIntegerOptions(20);
- createSelectAction("Rows", category, options, "0", rowsCommand);
- }
-
- private void createSecretAction(String category) {
- createBooleanAction("Secret", category, false, secretCommand);
- }
-
- private void createWordwrapAction(String category) {
- createBooleanAction("Wordwrap", category, false, wordwrapCommand);
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldWithPropertyFormatter.java b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldWithPropertyFormatter.java
index 1fbe6ffc55..ea4b572604 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldWithPropertyFormatter.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldWithPropertyFormatter.java
@@ -13,11 +13,10 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.TextField;
-@SuppressWarnings("unchecked")
public class TextFieldWithPropertyFormatter extends TestBase {
- private PropertyFormatter formatter;
- private Property property;
+ private PropertyFormatter<BigDecimal> formatter;
+ private Property<BigDecimal> property;
@Override
protected void setup() {
@@ -26,25 +25,25 @@ public class TextFieldWithPropertyFormatter extends TestBase {
* digits - rounds half up
*/
// Property containing BigDecimal
- property = new Property() {
+ property = new Property<BigDecimal>() {
private BigDecimal value;
- public Object getValue() {
+ public BigDecimal getValue() {
return value;
}
- public void setValue(Object newValue) throws ReadOnlyException,
- ConversionException {
+ public void setValue(Object newValue) throws ReadOnlyException {
if (newValue == null) {
value = null;
} else if (newValue instanceof BigDecimal) {
value = (BigDecimal) newValue;
} else {
- throw new ConversionException();
+ throw new IllegalArgumentException(
+ "Value must be of type BigDecimal");
}
}
- public Class<?> getType() {
+ public Class<BigDecimal> getType() {
return BigDecimal.class;
}
@@ -57,7 +56,7 @@ public class TextFieldWithPropertyFormatter extends TestBase {
}
};
- formatter = new PropertyFormatter(property) {
+ formatter = new PropertyFormatter<BigDecimal>(property) {
private final DecimalFormat df = new DecimalFormat("#,##0.00",
new DecimalFormatSymbols(new Locale("en", "UK")));
@@ -67,7 +66,7 @@ public class TextFieldWithPropertyFormatter extends TestBase {
}
@Override
- public String format(Object value) {
+ public String format(BigDecimal value) {
final String retVal;
if (value == null) {
@@ -79,7 +78,7 @@ public class TextFieldWithPropertyFormatter extends TestBase {
}
@Override
- public Object parse(String formattedValue) throws Exception {
+ public BigDecimal parse(String formattedValue) throws Exception {
if (formattedValue != null
&& formattedValue.trim().length() != 0) {
BigDecimal value = (BigDecimal) df.parse(formattedValue);
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeFiltering.java b/tests/testbench/com/vaadin/tests/components/tree/TreeFiltering.java
index e69e5f50f9..20d1eacb97 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreeFiltering.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreeFiltering.java
@@ -48,8 +48,8 @@ public class TreeFiltering extends TestBase {
filterType.addListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- cont.setIncludeParentsWhenFiltering(((CheckBox) event
- .getProperty()).booleanValue());
+ cont.setIncludeParentsWhenFiltering((Boolean) ((CheckBox) event
+ .getProperty()).getValue());
ccTree.requestRepaint();
}
});
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeFocusGaining.java b/tests/testbench/com/vaadin/tests/components/tree/TreeFocusGaining.java
index e784009bce..87170214ca 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreeFocusGaining.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreeFocusGaining.java
@@ -21,7 +21,7 @@ public class TreeFocusGaining extends TestBase {
textField.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- log.log("TF value now:" + event.getProperty());
+ log.log("TF value now:" + event.getProperty().getValue());
}
});
@@ -31,7 +31,7 @@ public class TreeFocusGaining extends TestBase {
tree.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- log.log("Tree value now:" + event.getProperty());
+ log.log("Tree value now:" + event.getProperty().getValue());
}
});
tree.setImmediate(true);
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java b/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java
index 86d419c2b3..bad6359889 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java
@@ -5,8 +5,8 @@ package com.vaadin.tests.components.tree;
import com.vaadin.data.Container;
import com.vaadin.data.util.HierarchicalContainer;
-import com.vaadin.data.validator.AbstractValidator;
import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.AlwaysFailValidator;
import com.vaadin.ui.Tree;
public class TreeKeyboardNavigationScrolls extends TestBase {
@@ -16,12 +16,7 @@ public class TreeKeyboardNavigationScrolls extends TestBase {
Tree tree = new Tree();
tree.setContainerDataSource(generateHierarchicalContainer());
tree.setImmediate(true);
- tree.addValidator(new AbstractValidator("failed") {
- public boolean isValid(Object value) {
- return false;
- }
-
- });
+ tree.addValidator(new AlwaysFailValidator("failed"));
addComponent(tree);
}
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators.java b/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators.java
index 2a545065c4..9204f0495b 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators.java
@@ -2,8 +2,8 @@ package com.vaadin.tests.components.tree;
import com.vaadin.data.Container;
import com.vaadin.data.util.HierarchicalContainer;
-import com.vaadin.data.validator.AbstractValidator;
import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.AlwaysFailValidator;
import com.vaadin.ui.Tree;
public class TreeKeyboardNavigationValidators extends TestBase {
@@ -18,12 +18,7 @@ public class TreeKeyboardNavigationValidators extends TestBase {
tree.setSizeFull();
tree.setContainerDataSource(generateHierarchicalContainer());
tree.setImmediate(true);
- tree.addValidator(new AbstractValidator("failed") {
- public boolean isValid(Object value) {
- return false;
- }
-
- });
+ tree.addValidator(new AlwaysFailValidator("failed"));
return tree;
}
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreePerformanceTest.java b/tests/testbench/com/vaadin/tests/components/tree/TreePerformanceTest.java
index de72a6efeb..9d58762f60 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreePerformanceTest.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreePerformanceTest.java
@@ -2,9 +2,9 @@ package com.vaadin.tests.components.tree;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class TreePerformanceTest extends AbstractTestCase {
@@ -20,7 +20,7 @@ public class TreePerformanceTest extends AbstractTestCase {
@Override
public void init() {
- Window w = new Window();
+ LegacyWindow w = new LegacyWindow();
setMainWindow(w);
Layout layout = null;
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeScrolling.java b/tests/testbench/com/vaadin/tests/components/tree/TreeScrolling.java
index c17855996e..abc9a5385d 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreeScrolling.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreeScrolling.java
@@ -2,10 +2,10 @@ package com.vaadin.tests.components.tree;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.RichTextArea;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class TreeScrolling extends AbstractTestCase {
@@ -13,7 +13,7 @@ public class TreeScrolling extends AbstractTestCase {
public void init() {
VerticalLayout layout = new VerticalLayout();
layout.setSizeUndefined();
- Window w = new Window("", layout);
+ LegacyWindow w = new LegacyWindow("", layout);
setMainWindow(w);
TextField filler1 = new TextField();
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/DisappearingComponents.java b/tests/testbench/com/vaadin/tests/components/treetable/DisappearingComponents.java
index becae955ab..329e5d291d 100644
--- a/tests/testbench/com/vaadin/tests/components/treetable/DisappearingComponents.java
+++ b/tests/testbench/com/vaadin/tests/components/treetable/DisappearingComponents.java
@@ -3,14 +3,14 @@ package com.vaadin.tests.components.treetable;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Link;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TreeTable;
-import com.vaadin.ui.Window;
public class DisappearingComponents extends AbstractTestCase {
@Override
public void init() {
- Window mainWindow = new Window("Application");
+ LegacyWindow mainWindow = new LegacyWindow("Application");
final TreeTable tt = new TreeTable();
tt.setSizeUndefined();
tt.setWidth("100%");
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.java b/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.java
index 6f2e507ce3..2f84c8a68d 100644
--- a/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.java
+++ b/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.java
@@ -31,7 +31,7 @@ public class ProgrammaticCollapse extends TestBase {
new ClickListener() {
public void buttonClick(ClickEvent event) {
boolean collapsed = !table.isCollapsed(1);
- table.getWindow().showNotification(
+ table.getRoot().showNotification(
"set collapsed: " + collapsed);
table.setCollapsed(1, collapsed);
}
@@ -40,7 +40,7 @@ public class ProgrammaticCollapse extends TestBase {
new ClickListener() {
public void buttonClick(ClickEvent event) {
boolean collapsed = !table.isCollapsed(100);
- table.getWindow().showNotification(
+ table.getRoot().showNotification(
"set collapsed: " + collapsed);
table.setCollapsed(100, collapsed);
}
@@ -51,7 +51,7 @@ public class ProgrammaticCollapse extends TestBase {
public void buttonClick(ClickEvent event) {
collapsed = !collapsed;
- table.getWindow().showNotification(
+ table.getRoot().showNotification(
"set collapsed: " + collapsed);
for (int i = 0; i < 50; ++i) {
table.setCollapsed(i * 2, collapsed);
diff --git a/tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java b/tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java
index ea04c3ad30..ae3d4bc053 100644
--- a/tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java
+++ b/tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java
@@ -12,6 +12,7 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root;
import com.vaadin.ui.Window;
public class AttachShouldBeCalledForSubWindows extends AbstractTestCase
@@ -25,7 +26,7 @@ public class AttachShouldBeCalledForSubWindows extends AbstractTestCase
@Override
public void init() {
- Window mainWindow = new Window() {
+ Root.LegacyWindow mainWindow = new Root.LegacyWindow() {
@Override
public void attach() {
log(this);
diff --git a/tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.html b/tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.html
index 36e9134566..a6a633ba2c 100644
--- a/tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.html
+++ b/tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.html
@@ -23,9 +23,10 @@
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::PID_Sopennative</td>
+ <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::PID_Sopensub/domChild[0]/domChild[0]</td>
<td></td>
</tr>
+<!--Close from click handler-->
<tr>
<td>click</td>
<td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
@@ -38,53 +39,23 @@
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::PID_Sopennative</td>
+ <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::PID_Sopensub/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>Click close in title bar</td>
<td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::PID_SLog/ChildComponentContainer[0]/VLabel[0]</td>
- <td>2. Window 'Sub-window' closed</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForPopUp</td>
- <td>nativewindow</td>
- <td>30000</td>
-</tr>
-<tr>
- <td>selectWindow</td>
- <td>name=nativewindow</td>
- <td></td>
-</tr>
-<tr>
- <td>close</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>selectWindow</td>
- <td>title=com.vaadin.tests.components.window.CloseSubWindow</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::PID_Spoll/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::/VWindow[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::PID_SLog/ChildComponentContainer[0]/VLabel[0]</td>
- <td>3. Browser window closed</td>
+ <td>2. Window 'Sub-window' closed</td>
</tr>
</tbody></table>
</body>
diff --git a/tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.java b/tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.java
index c1104836a8..4cd3854d6f 100644
--- a/tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.java
+++ b/tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.java
@@ -1,8 +1,5 @@
package com.vaadin.tests.components.window;
-import java.net.URL;
-
-import com.vaadin.terminal.ExternalResource;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Log;
import com.vaadin.ui.Button;
@@ -14,7 +11,6 @@ import com.vaadin.ui.Window.CloseListener;
public class CloseSubWindow extends TestBase {
- private Window browserWindow;
private Log log = new Log(5);
@Override
@@ -30,54 +26,6 @@ public class CloseSubWindow extends TestBase {
addComponent(log);
addComponent(openWindowButton);
-
- Button openBrowserWindowButton = new Button("Open browser window");
- openWindowButton.setDebugId("opennative");
- openBrowserWindowButton.addListener(new ClickListener() {
- public void buttonClick(ClickEvent event) {
- browserWindow = new Window("Window");
- Button closeButton = new Button("Close this window",
- new ClickListener() {
-
- public void buttonClick(ClickEvent event) {
- event.getButton().getWindow()
- .executeJavaScript("window.close();");
-
- }
- });
- browserWindow.addComponent(closeButton);
-
- browserWindow.addListener(new CloseListener() {
- public void windowClose(CloseEvent e) {
- logBrowserWindowClosed();
- // there is no push, so the user needs to click a button
- // to see the notification
-
- // Opera does not send a notification about the window
- // having been closed
- }
-
- });
-
- addWindow(browserWindow);
- URL windowUrl = browserWindow.getURL();
- // named for easier access by test tools
- getMainWindow().open(new ExternalResource(windowUrl),
- "nativewindow");
- if (getBrowser().isOpera()) {
- // Immediately log a close event in Opera so this test can
- // be run for all browsers. Vaadin ticket #5687.
- logBrowserWindowClosed();
- }
- }
- });
-
- addComponent(openBrowserWindowButton);
-
- Button pollButton = new Button("Poll server");
- pollButton.setDebugId("poll");
- addComponent(pollButton);
-
}
private Window createClosableSubWindow(final String title) {
@@ -89,7 +37,7 @@ public class CloseSubWindow extends TestBase {
Button closeButton = new Button("Close");
closeButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
- window.getParent().removeWindow(window);
+ window.close();
}
});
window.addComponent(closeButton);
@@ -97,7 +45,7 @@ public class CloseSubWindow extends TestBase {
Button removeButton = new Button("Remove from parent");
removeButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
- window.getParent().removeWindow(window);
+ window.close();
}
});
window.addComponent(closeButton);
@@ -120,10 +68,4 @@ public class CloseSubWindow extends TestBase {
protected Integer getTicketNumber() {
return 3865;
}
-
- private void logBrowserWindowClosed() {
- log.log("Browser window closed");
-
- }
-
}
diff --git a/tests/testbench/com/vaadin/tests/components/window/ExecuteJavaScript.java b/tests/testbench/com/vaadin/tests/components/window/ExecuteJavaScript.java
index dfa0e80368..bf979b1aa3 100644
--- a/tests/testbench/com/vaadin/tests/components/window/ExecuteJavaScript.java
+++ b/tests/testbench/com/vaadin/tests/components/window/ExecuteJavaScript.java
@@ -4,13 +4,13 @@ import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
public class ExecuteJavaScript extends AbstractTestCase {
@Override
public void init() {
- final Window mainWindow = new Window("Test");
+ final LegacyWindow mainWindow = new LegacyWindow("Test");
setMainWindow(mainWindow);
for (final String script : new String[] { "alert('foo');",
diff --git a/tests/testbench/com/vaadin/tests/components/window/ExtraWindowShown.java b/tests/testbench/com/vaadin/tests/components/window/ExtraWindowShown.java
index 284a63543a..e81e02b22b 100644
--- a/tests/testbench/com/vaadin/tests/components/window/ExtraWindowShown.java
+++ b/tests/testbench/com/vaadin/tests/components/window/ExtraWindowShown.java
@@ -20,16 +20,14 @@ public class ExtraWindowShown extends TestBase {
w.addComponent(new Button("Close", new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- Window main = w.getParent();
- // main = w.getWindow();
- main.removeWindow(w);
+ w.close();
}
}));
Button iconButton = new Button("A button with icon");
iconButton
.setIcon(new ThemeResource("../runo/icons/16/ok.png"));
w.addComponent(iconButton);
- event.getButton().getWindow().addWindow(w);
+ event.getButton().getRoot().addWindow(w);
}
});
diff --git a/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java b/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java
index 6c051f4b1e..2e6a386667 100644
--- a/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java
+++ b/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java
@@ -1,37 +1,42 @@
package com.vaadin.tests.components.window;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.tests.util.Log;
import com.vaadin.tests.util.LoremIpsum;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Root.BrowserWindowResizeEvent;
+import com.vaadin.ui.Root.BrowserWindowResizeListener;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Window;
import com.vaadin.ui.Window.ResizeEvent;
import com.vaadin.ui.Window.ResizeListener;
public class LazyWindowResize extends AbstractTestCase {
- private Window mainWindow;
+ private LegacyWindow mainWindow;
private Window subWindow;
- private Button lazyMode;
+ private CheckBox lazyMode;
private Log log = new Log(5);
private CheckBox resizeListenerCheckBox;
protected ResizeListener resizeListener = new ResizeListener() {
public void windowResized(ResizeEvent e) {
- if (e.getWindow() == mainWindow) {
- log.log("Main window resized");
- } else {
- log.log("Sub window resized");
- }
+ log.log("Sub window resized");
+ }
+ };
+ protected BrowserWindowResizeListener browserWindowResizeListener = new BrowserWindowResizeListener() {
+ public void browserWindowResized(BrowserWindowResizeEvent event) {
+ log.log("Main window resized");
}
};
- private CheckBox immediateCheckBox;;;
+
+ private CheckBox immediateCheckBox;
@Override
protected String getDescription() {
@@ -45,7 +50,7 @@ public class LazyWindowResize extends AbstractTestCase {
@Override
public void init() {
- mainWindow = new Window("Resize test");
+ mainWindow = new LegacyWindow("Resize test");
setMainWindow(mainWindow);
subWindow = new Window("Sub window");
subWindow.setHeight("50%");
@@ -56,24 +61,24 @@ public class LazyWindowResize extends AbstractTestCase {
lazyMode = new CheckBox("Lazy resize");
lazyMode.setImmediate(true);
- lazyMode.addListener(new ClickListener() {
+ lazyMode.addListener(new ValueChangeListener() {
- public void buttonClick(ClickEvent event) {
- setLazy(lazyMode.booleanValue());
+ public void valueChange(ValueChangeEvent event) {
+ setLazy(lazyMode.getValue());
}
});
resizeListenerCheckBox = new CheckBox("Resize listener");
resizeListenerCheckBox.setImmediate(true);
- resizeListenerCheckBox.addListener(new ClickListener() {
+ resizeListenerCheckBox.addListener(new ValueChangeListener() {
- public void buttonClick(ClickEvent event) {
- if (resizeListenerCheckBox.booleanValue()) {
+ public void valueChange(ValueChangeEvent event) {
+ if (resizeListenerCheckBox.getValue()) {
subWindow.addListener(resizeListener);
- mainWindow.addListener(resizeListener);
+ mainWindow.addListener(browserWindowResizeListener);
} else {
subWindow.removeListener(resizeListener);
- mainWindow.removeListener(resizeListener);
+ mainWindow.removeListener(browserWindowResizeListener);
}
}
@@ -81,12 +86,11 @@ public class LazyWindowResize extends AbstractTestCase {
});
immediateCheckBox = new CheckBox("Windows immediate");
immediateCheckBox.setImmediate(true);
- immediateCheckBox.addListener(new ClickListener() {
-
- public void buttonClick(ClickEvent event) {
- mainWindow.setImmediate(immediateCheckBox.booleanValue());
- subWindow.setImmediate(immediateCheckBox.booleanValue());
+ immediateCheckBox.addListener(new ValueChangeListener() {
+ public void valueChange(ValueChangeEvent event) {
+ mainWindow.setImmediate(immediateCheckBox.getValue());
+ subWindow.setImmediate(immediateCheckBox.getValue());
}
});
@@ -94,7 +98,7 @@ public class LazyWindowResize extends AbstractTestCase {
mainWindow.addComponent(resizeListenerCheckBox);
mainWindow.addComponent(immediateCheckBox);
mainWindow.addComponent(log);
- mainWindow.addComponent(new Label("<br/><br/>", Label.CONTENT_XHTML));
+ mainWindow.addComponent(new Label("<br/><br/>", ContentMode.XHTML));
mainWindow.addComponent(new Label(LoremIpsum.get(10000)));
setLazy(false);
diff --git a/tests/testbench/com/vaadin/tests/components/window/LongNotifications.java b/tests/testbench/com/vaadin/tests/components/window/LongNotifications.java
index c70c14e08e..c916973713 100644
--- a/tests/testbench/com/vaadin/tests/components/window/LongNotifications.java
+++ b/tests/testbench/com/vaadin/tests/components/window/LongNotifications.java
@@ -3,7 +3,7 @@ package com.vaadin.tests.components.window;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Window.Notification;
+import com.vaadin.ui.Notification;
public class LongNotifications extends TestBase {
private final String text = "This is a veeeery large notification in the main window which should definitly not exist at all, in any app. But they finally do in real world applications, no matter what you do. People have small screens and desperatly try to run web apps in their iphones.";
diff --git a/tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.html b/tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.html
deleted file mode 100644
index 1b2e91617d..0000000000
--- a/tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link rel="selenium.base" href="http://localhost:8888/" />
-<title>ReplacingComponentsInHandleParameters</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">ReplacingComponentsInHandleParameters</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/run/com.vaadin.tests.components.window.ReplacingComponentsInHandleParameters?restartApplication</td>
- <td></td>
-</tr>
-<tr>
- <td>open</td>
- <td>/run/com.vaadin.tests.components.window.ReplacingComponentsInHandleParameters</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowReplacingComponentsInHandleParameters::PID_STestId/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowReplacingComponentsInHandleParameters::PID_STestId/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td></td>
-</tr>
-
-</tbody></table>
-</body>
-</html>
diff --git a/tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.java b/tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.java
deleted file mode 100644
index d6fe10601f..0000000000
--- a/tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.vaadin.tests.components.window;
-
-import java.util.Map;
-
-import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
-
-public class ReplacingComponentsInHandleParameters extends TestBase {
-
- @Override
- protected String getDescription() {
- return "Reusing debug IDs when replacing components in handleParameters() causes out of sync";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return 8090;
- }
-
- @Override
- protected void setup() {
- final ClickListener clickListener = new ClickListener() {
- public void buttonClick(ClickEvent event) {
- event.getButton().setCaption("Clicked!");
- }
- };
- final Window main = new Window() {
- @Override
- public void handleParameters(Map<String, String[]> parameters) {
- super.handleParameters(parameters);
- removeAllComponents();
- addComponent(new Label(
- "Reload window (without ?restartApplication), then click the button twice."));
-
- Button btn = new Button("Click me", clickListener);
- btn.setDebugId("TestId");
- addComponent(btn);
- }
- };
- setMainWindow(main);
- }
-}
diff --git a/tests/testbench/com/vaadin/tests/components/window/SubWindowFocusAndBlurListeners.java b/tests/testbench/com/vaadin/tests/components/window/SubWindowFocusAndBlurListeners.java
index 2d9d7bd5b2..988d47e29f 100644
--- a/tests/testbench/com/vaadin/tests/components/window/SubWindowFocusAndBlurListeners.java
+++ b/tests/testbench/com/vaadin/tests/components/window/SubWindowFocusAndBlurListeners.java
@@ -10,6 +10,7 @@ import com.vaadin.event.ShortcutAction;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Window;
@@ -35,14 +36,14 @@ public class SubWindowFocusAndBlurListeners extends TestBase {
window.addComponent(new TextField());
window.addListener(new FocusListener() {
public void focus(FocusEvent event) {
- event.getComponent().getWindow()
+ event.getComponent().getRoot()
.showNotification("Focused window");
}
});
window.addListener(new BlurListener() {
public void blur(BlurEvent event) {
- event.getComponent().getWindow()
+ event.getComponent().getRoot()
.showNotification("Blurred window");
}
});
@@ -56,11 +57,11 @@ public class SubWindowFocusAndBlurListeners extends TestBase {
}
public void handleAction(Action action, Object sender, Object target) {
- window.showNotification("Action!");
+ window.getRoot().showNotification("Action!");
}
});
- Window main = getLayout().getWindow();
+ Root main = getLayout().getRoot();
main.addWindow(window);
diff --git a/tests/testbench/com/vaadin/tests/components/window/SubWindowOrder.java b/tests/testbench/com/vaadin/tests/components/window/SubWindowOrder.java
index c34f32f275..9b4fcea22b 100644
--- a/tests/testbench/com/vaadin/tests/components/window/SubWindowOrder.java
+++ b/tests/testbench/com/vaadin/tests/components/window/SubWindowOrder.java
@@ -10,6 +10,7 @@ import com.vaadin.ui.ComboBox;
import com.vaadin.ui.CssLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root;
import com.vaadin.ui.Window;
public class SubWindowOrder extends TestBase {
@@ -19,7 +20,7 @@ public class SubWindowOrder extends TestBase {
@Override
protected void setup() {
- Window mainWindow = getMainWindow();
+ Root mainWindow = getMainWindow();
HorizontalLayout controlpanels = new HorizontalLayout();
for (int i = 1; i <= 5; i++) {
Window dialog = new Window("Dialog " + i);
diff --git a/tests/testbench/com/vaadin/tests/components/window/WindowClickEvents.html b/tests/testbench/com/vaadin/tests/components/window/WindowClickEvents.html
index a7dc524d6d..d7990994a1 100644
--- a/tests/testbench/com/vaadin/tests/components/window/WindowClickEvents.html
+++ b/tests/testbench/com/vaadin/tests/components/window/WindowClickEvents.html
@@ -28,12 +28,12 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::PID_SLog_row_1</td>
<td>1. Click using left on Main window layout</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::PID_SLog_row_0</td>
<td>2. Click using left on Main window</td>
</tr>
<tr>
@@ -43,12 +43,12 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::PID_SLog_row_1</td>
<td>3. Click using left on Sub window layout</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::PID_SLog_row_0</td>
<td>4. Click using left on Sub window</td>
</tr>
<!--Clicking on the button should not produce a window click event-->
@@ -72,6 +72,7 @@
<td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::PID_SLog_row_1</td>
<td>4. Click using left on Sub window</td>
</tr>
+
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/window/WindowResizeListener.java b/tests/testbench/com/vaadin/tests/components/window/WindowResizeListener.java
index 62f998e20e..c6563f200f 100644
--- a/tests/testbench/com/vaadin/tests/components/window/WindowResizeListener.java
+++ b/tests/testbench/com/vaadin/tests/components/window/WindowResizeListener.java
@@ -1,15 +1,15 @@
package com.vaadin.tests.components.window;
-import com.vaadin.terminal.Sizeable;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.Root.BrowserWindowResizeEvent;
import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.ResizeEvent;
-import com.vaadin.ui.Window.ResizeListener;
public class WindowResizeListener extends TestBase {
@@ -33,19 +33,20 @@ public class WindowResizeListener extends TestBase {
final Label l = new Label();
getLayout().addComponent(l);
- getMainWindow().addListener(new ResizeListener() {
- public void windowResized(ResizeEvent e) {
- l.setValue("Current main window size: "
- + getMainWindow().getWidth() + " x "
- + getMainWindow().getHeight());
+ getMainWindow().addListener(new Root.BrowserWindowResizeListener() {
+ public void browserWindowResized(BrowserWindowResizeEvent event) {
+ l.setValue("Current browser window size: "
+ + getMainWindow().getBrowserWindowWidth() + " x "
+ + getMainWindow().getBrowserWindowHeight());
}
});
CheckBox subwindow = new CheckBox("show subwindow");
subwindow.setImmediate(true);
- subwindow.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (event.getButton().booleanValue()) {
+ subwindow.addListener(new Property.ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ if ((Boolean) event.getProperty().getValue()) {
getMainWindow().addWindow(subwin);
} else {
getMainWindow().removeWindow(subwin);
@@ -55,9 +56,10 @@ public class WindowResizeListener extends TestBase {
getLayout().addComponent(subwindow);
CheckBox immediate = new CheckBox("immediate");
- immediate.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- boolean booleanValue = event.getButton().booleanValue();
+ immediate.addListener(new Property.ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ boolean booleanValue = (Boolean) event.getProperty().getValue();
getMainWindow().setImmediate(booleanValue);
subwin.setImmediate(booleanValue);
}
@@ -94,9 +96,7 @@ class ResizeListenerWindow extends Window {
}
public void updateLabel() {
- sizeLabel
- .setValue(getWidth() + Sizeable.UNIT_SYMBOLS[getWidthUnits()]
- + " x " + getHeight()
- + Sizeable.UNIT_SYMBOLS[getHeightUnits()]);
+ sizeLabel.setValue(getWidth() + getWidthUnits().getSymbol() + " x "
+ + getHeight() + getHeightUnits().getSymbol());
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/window/WindowScrollingComponentIntoView.java b/tests/testbench/com/vaadin/tests/components/window/WindowScrollingComponentIntoView.java
index 200d52a389..c46f125192 100644
--- a/tests/testbench/com/vaadin/tests/components/window/WindowScrollingComponentIntoView.java
+++ b/tests/testbench/com/vaadin/tests/components/window/WindowScrollingComponentIntoView.java
@@ -8,6 +8,7 @@ import com.vaadin.ui.Component;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
@@ -29,15 +30,7 @@ public class WindowScrollingComponentIntoView extends AbstractTestCase {
Table table = new Table();
table.setPageLength(50);
- final Button up = new Button("up");
- up.addListener(new Button.ClickListener() {
-
- public void buttonClick(ClickEvent event) {
- up.getWindow().setScrollTop(0);
- }
- });
-
- setMainWindow(new Window(""));
+ setMainWindow(new LegacyWindow(""));
getMainWindow().getContent().setSizeUndefined();
Component l2 = null;
@@ -109,13 +102,15 @@ public class WindowScrollingComponentIntoView extends AbstractTestCase {
((VerticalLayout) getMainWindow().getContent()).addComponent(
new Button("Scroll win to X9", new ClickListener() {
public void buttonClick(ClickEvent event) {
- window.scrollIntoView(x29);
+ throw new RuntimeException("Currently not implemented");
+ // window.scrollIntoView(x29);
}
}), 0);
((VerticalLayout) getMainWindow().getContent()).addComponent(
new Button("Scroll win to Y9", new ClickListener() {
public void buttonClick(ClickEvent event) {
- window.scrollIntoView(y29);
+ throw new RuntimeException("Currently not implemented");
+ // window.scrollIntoView(y29);
}
}), 0);
diff --git a/tests/testbench/com/vaadin/tests/components/window/WindowScrollingUp.java b/tests/testbench/com/vaadin/tests/components/window/WindowScrollingUp.java
index 44e5bf0d35..2054b751ef 100644
--- a/tests/testbench/com/vaadin/tests/components/window/WindowScrollingUp.java
+++ b/tests/testbench/com/vaadin/tests/components/window/WindowScrollingUp.java
@@ -3,8 +3,8 @@ package com.vaadin.tests.components.window;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
public class WindowScrollingUp extends AbstractTestCase {
@@ -27,11 +27,11 @@ public class WindowScrollingUp extends AbstractTestCase {
up.addListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- up.getWindow().setScrollTop(0);
+ up.getRoot().setScrollTop(0);
}
});
- setMainWindow(new Window(""));
+ setMainWindow(new LegacyWindow(""));
getMainWindow().addComponent(table);
getMainWindow().addComponent(up);
diff --git a/tests/testbench/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java b/tests/testbench/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java
index 24ff586b7b..77a3efa6ad 100644
--- a/tests/testbench/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java
+++ b/tests/testbench/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java
@@ -1,6 +1,8 @@
package com.vaadin.tests.containers;
import com.vaadin.data.Item;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.util.BeanItemContainer;
import com.vaadin.terminal.Sizeable;
import com.vaadin.tests.components.TestBase;
@@ -84,17 +86,17 @@ public class BeanItemContainerFilteringTest extends TestBase {
filterString = new TextField("Filter string:", "1");
vl.addComponent(filterString);
- final CheckBox cb = new CheckBox("Filter on value",
- new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- container.removeAllContainerFilters();
- if (((CheckBox) event.getSource()).booleanValue()) {
- container.addContainerFilter("value",
- filterString.getValue().toString(),
- false, false);
- }
- }
- });
+ final CheckBox cb = new CheckBox("Filter on value");
+ cb.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ container.removeAllContainerFilters();
+ if (((CheckBox) event.getProperty()).getValue()) {
+ container.addContainerFilter("value", filterString
+ .getValue().toString(), false, false);
+ }
+ }
+ });
cb.setImmediate(true);
vl.addComponent(cb);
diff --git a/tests/testbench/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java b/tests/testbench/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java
index fb5fe8c27a..f60e0c74e7 100644
--- a/tests/testbench/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java
+++ b/tests/testbench/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java
@@ -98,7 +98,8 @@ public class HierarchicalWrapperOrdering extends TestBase {
// Get first item
Object itemId = indexedContainer.getIdByIndex(0);
Item item = indexedContainer.getItem(itemId);
- Property property = item.getItemProperty("name");
+ Property<String> property = (Property<String>) item
+ .getItemProperty("name");
// Prepend with Z so item should get sorted later
property.setValue("Z " + property.getValue());
// this does not work alone, requires extraneous
diff --git a/tests/testbench/com/vaadin/tests/containers/IndexedContainerFilteringTest.java b/tests/testbench/com/vaadin/tests/containers/IndexedContainerFilteringTest.java
index bfa9ed5512..2ed5de3bfa 100644
--- a/tests/testbench/com/vaadin/tests/containers/IndexedContainerFilteringTest.java
+++ b/tests/testbench/com/vaadin/tests/containers/IndexedContainerFilteringTest.java
@@ -1,6 +1,8 @@
package com.vaadin.tests.containers;
import com.vaadin.data.Item;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.terminal.Sizeable;
import com.vaadin.tests.components.TestBase;
@@ -51,10 +53,12 @@ public class IndexedContainerFilteringTest extends TestBase {
filterString = new TextField("Filter string:", "1");
vl.addComponent(filterString);
- final CheckBox cb = new CheckBox("Filter", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ final CheckBox cb = new CheckBox("Filter");
+ cb.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
container.removeAllContainerFilters();
- if (((CheckBox) event.getSource()).booleanValue()) {
+ if (((CheckBox) event.getProperty()).getValue()) {
container.addContainerFilter("column1", filterString
.getValue().toString(), false, false);
}
diff --git a/tests/testbench/com/vaadin/tests/containers/TableWithFileSystemContainer.java b/tests/testbench/com/vaadin/tests/containers/TableWithFileSystemContainer.java
index 20567e70af..459c234c24 100644
--- a/tests/testbench/com/vaadin/tests/containers/TableWithFileSystemContainer.java
+++ b/tests/testbench/com/vaadin/tests/containers/TableWithFileSystemContainer.java
@@ -4,8 +4,8 @@ import java.io.File;
import com.vaadin.data.util.FilesystemContainer;
import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
public class TableWithFileSystemContainer extends TestBase {
@@ -13,7 +13,7 @@ public class TableWithFileSystemContainer extends TestBase {
@Override
public void setup() {
- setMainWindow(new Window(""));
+ setMainWindow(new LegacyWindow(""));
Table table = new Table("Documents", new FilesystemContainer(new File(
testPath)));
table.setWidth("100%");
diff --git a/tests/testbench/com/vaadin/tests/containers/TestItemSorter.java b/tests/testbench/com/vaadin/tests/containers/TestItemSorter.java
index bf7ce6175a..0a1c592876 100644
--- a/tests/testbench/com/vaadin/tests/containers/TestItemSorter.java
+++ b/tests/testbench/com/vaadin/tests/containers/TestItemSorter.java
@@ -29,8 +29,8 @@ public class TestItemSorter extends TestBase {
public int compare(Object o1, Object o2) {
if (o1 instanceof CheckBox && o2 instanceof CheckBox) {
- Boolean b1 = ((CheckBox) o1).booleanValue();
- return b1.compareTo(((CheckBox) o2).booleanValue());
+ Boolean b1 = (Boolean) ((CheckBox) o1).getValue();
+ return b1.compareTo((Boolean) ((CheckBox) o2).getValue());
} else if (o1 instanceof Button && o2 instanceof Button) {
String caption1 = ((Button) o1).getCaption().toLowerCase();
String caption2 = ((Button) o2).getCaption().toLowerCase();
diff --git a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java
index 86aee2d5ab..674f610ed7 100644
--- a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java
+++ b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java
@@ -17,14 +17,13 @@ import com.vaadin.data.util.sqlcontainer.connection.SimpleJDBCConnectionPool;
import com.vaadin.data.util.sqlcontainer.query.TableQuery;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Form;
import com.vaadin.ui.HorizontalSplitPanel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
-public class CheckboxUpdateProblem extends Application implements
- Property.ValueChangeListener {
+public class CheckboxUpdateProblem extends Application.LegacyApplication
+ implements Property.ValueChangeListener {
private final DatabaseHelper databaseHelper = new DatabaseHelper();
private Table testList;
private final HorizontalSplitPanel horizontalSplit = new HorizontalSplitPanel();
@@ -33,7 +32,7 @@ public class CheckboxUpdateProblem extends Application implements
@Override
public void init() {
- setMainWindow(new Window("Test window"));
+ setMainWindow(new LegacyWindow("Test window"));
horizontalSplit.setSizeFull();
testList = new Table();
@@ -65,7 +64,7 @@ public class CheckboxUpdateProblem extends Application implements
public void valueChange(ValueChangeEvent event) {
- Property property = event.getProperty();
+ Property<?> property = event.getProperty();
if (property == testList) {
Item item = testList.getItem(testList.getValue());
@@ -85,7 +84,7 @@ public class CheckboxUpdateProblem extends Application implements
setWriteThrough(false);
setInvalidCommitted(false);
- save = new Button("Save", (ClickListener) this);
+ save = new Button("Save", this);
getFooter().addComponent(save);
getFooter().setVisible(false);
}
@@ -187,4 +186,4 @@ public class CheckboxUpdateProblem extends Application implements
}
}
-} \ No newline at end of file
+}
diff --git a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java
index 419e606bfc..2b76612c35 100644
--- a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java
+++ b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java
@@ -12,8 +12,8 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.ProgressIndicator;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
// author table in testdb (MySQL) is set out as follows
// +-------------+-------------+------+-----+---------+----------------+
@@ -25,14 +25,14 @@ import com.vaadin.ui.Window;
// +-------------+-------------+------+-----+---------+----------------+
@SuppressWarnings("serial")
-public class MassInsertMemoryLeakTestApp extends Application {
+public class MassInsertMemoryLeakTestApp extends Application.LegacyApplication {
ProgressIndicator proggress = new ProgressIndicator();
Button process = new Button("Mass insert");
@Override
public void init() {
- setMainWindow(new Window("SQLContainer Test", buildLayout()));
+ setMainWindow(new LegacyWindow("SQLContainer Test", buildLayout()));
process.addListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
diff --git a/tests/testbench/com/vaadin/tests/converter/ConverterThatEnforcesAFormat.java b/tests/testbench/com/vaadin/tests/converter/ConverterThatEnforcesAFormat.java
new file mode 100644
index 0000000000..8b17cb3f48
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/converter/ConverterThatEnforcesAFormat.java
@@ -0,0 +1,46 @@
+package com.vaadin.tests.converter;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.TextField;
+
+public class ConverterThatEnforcesAFormat extends TestBase {
+
+ private Log log = new Log(5);
+
+ @Override
+ protected void setup() {
+ final TextField tf = new TextField(
+ "This field should always be formatted with 3 digits");
+ tf.setConverter(new StringToDoubleConverterWithThreeFractionDigits());
+ tf.addListener(new ValueChangeListener() {
+ public void valueChange(ValueChangeEvent event) {
+ log.log("Value changed to "
+ + event.getProperty().getValue()
+ + "(converted value is "
+ + tf.getConvertedValue()
+ + "). Two-way conversion gives: "
+ + tf.getConverter().convertToPresentation(
+ tf.getConverter().convertToModel(tf.getValue(),
+ tf.getLocale()), tf.getLocale()) + ")");
+ }
+ });
+ tf.setImmediate(true);
+ addComponent(log);
+ addComponent(tf);
+ tf.setConvertedValue(50.0);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Entering a valid double in the field should always cause the field contents to be formatted to contain 3 digits after the decimal point";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 8191;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/converter/StringToDoubleConverterWithThreeFractionDigits.java b/tests/testbench/com/vaadin/tests/converter/StringToDoubleConverterWithThreeFractionDigits.java
new file mode 100644
index 0000000000..dc5abcb9f6
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/converter/StringToDoubleConverterWithThreeFractionDigits.java
@@ -0,0 +1,18 @@
+package com.vaadin.tests.converter;
+
+import java.text.NumberFormat;
+import java.util.Locale;
+
+import com.vaadin.data.util.converter.StringToDoubleConverter;
+
+public class StringToDoubleConverterWithThreeFractionDigits extends StringToDoubleConverter {
+
+ @Override
+ protected NumberFormat getFormat(Locale locale) {
+ NumberFormat format = super.getFormat(locale);
+ format.setGroupingUsed(false);
+ format.setMaximumFractionDigits(3);
+ format.setMinimumFractionDigits(3);
+ return format;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/dd/CustomDDImplementation.java b/tests/testbench/com/vaadin/tests/dd/CustomDDImplementation.java
index c789ead113..de3312d1a8 100644
--- a/tests/testbench/com/vaadin/tests/dd/CustomDDImplementation.java
+++ b/tests/testbench/com/vaadin/tests/dd/CustomDDImplementation.java
@@ -38,7 +38,7 @@ public class CustomDDImplementation extends CustomComponent {
* Check the @ClientWidget
*
*/
- @ClientWidget(VMyDropTarget.class)
+ @ClientWidget(VMyDropTargetPaintable.class)
class MyDropTarget extends AbstractComponent implements DropTarget {
public DropHandler getDropHandler() {
return new DropHandler() {
@@ -76,7 +76,7 @@ public class CustomDDImplementation extends CustomComponent {
* operations that are controlled via server side api.
*
*/
- @ClientWidget(VMyDragSource.class)
+ @ClientWidget(VMyDragSourcePaintable.class)
public class MyDragSource extends AbstractComponent implements Component {
}
diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest2.java b/tests/testbench/com/vaadin/tests/dd/DDTest2.java
index 69af2d3f1d..0dda0d693c 100644
--- a/tests/testbench/com/vaadin/tests/dd/DDTest2.java
+++ b/tests/testbench/com/vaadin/tests/dd/DDTest2.java
@@ -24,6 +24,7 @@ import com.vaadin.ui.AbstractSelect;
import com.vaadin.ui.AbstractSelect.AbstractSelectTargetDetails;
import com.vaadin.ui.AbstractSelect.AcceptItem;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.TableTransferable;
import com.vaadin.ui.Tree;
@@ -44,7 +45,7 @@ public class DDTest2 extends TestBase {
@Override
protected void setup() {
- Window w = getLayout().getWindow();
+ Root w = getLayout().getRoot();
/* darn reindeer has no icons */
/* Make all trees (their nodes actually) draggable */
@@ -94,12 +95,13 @@ public class DDTest2 extends TestBase {
if (transferable instanceof TableTransferable) {
TableTransferable tr = (TableTransferable) transferable;
System.out.println("From table row" + tr.getPropertyId());
- data = tr.getSourceContainer().getItem(tr.getItemId())
- .getItemProperty(tr.getPropertyId()).toString();
-
+ Object value = tr.getSourceContainer()
+ .getItem(tr.getItemId())
+ .getItemProperty(tr.getPropertyId()).getValue();
+ data = (null != value) ? value.toString() : null;
}
if (data == null) {
- data = "-no Text data flawor-";
+ data = "-no Text data flavor-";
}
tree3.addItem(data);
AbstractSelect.AbstractSelectTargetDetails dropTargetData = (AbstractSelect.AbstractSelectTargetDetails) dropEvent
@@ -137,7 +139,7 @@ public class DDTest2 extends TestBase {
public void drop(DragAndDropEvent event) {
/*
* We know transferrable is from table, so it is of type
- * DataBindedTransferrable
+ * DataBoundTransferrable
*/
DataBoundTransferable tr = (DataBoundTransferable) event
.getTransferable();
@@ -147,8 +149,10 @@ public class DDTest2 extends TestBase {
// if the source is from table (not from tree1 itself),
// transfer Name property and use it as an identifier in
// tree1
- String name = sourceContainer.getItem(itemId)
- .getItemProperty("Name").toString();
+ Object nameValue = sourceContainer.getItem(itemId)
+ .getItemProperty("Name").getValue();
+ String name = (null != nameValue) ? nameValue.toString()
+ : null;
tree1.addItem(name);
tree1.setChildrenAllowed(name, false);
diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest4.java b/tests/testbench/com/vaadin/tests/dd/DDTest4.java
index b4da141ce2..654a30486a 100644
--- a/tests/testbench/com/vaadin/tests/dd/DDTest4.java
+++ b/tests/testbench/com/vaadin/tests/dd/DDTest4.java
@@ -16,8 +16,8 @@ import com.vaadin.tests.util.PersonContainer;
import com.vaadin.tests.util.TestUtils;
import com.vaadin.ui.AbstractSelect.AbstractSelectTargetDetails;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
public class DDTest4 extends TestBase {
@@ -28,7 +28,7 @@ public class DDTest4 extends TestBase {
@Override
protected void setup() {
- Window w = getLayout().getWindow();
+ Root w = getLayout().getRoot();
TestUtils
.injectCSS(
diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest5.java b/tests/testbench/com/vaadin/tests/dd/DDTest5.java
index e4f3d5335d..a5d97f4473 100644
--- a/tests/testbench/com/vaadin/tests/dd/DDTest5.java
+++ b/tests/testbench/com/vaadin/tests/dd/DDTest5.java
@@ -15,7 +15,7 @@ import com.vaadin.ui.DragAndDropWrapper.DragStartMode;
import com.vaadin.ui.DragAndDropWrapper.WrapperTransferable;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root;
public class DDTest5 extends TestBase {
@@ -47,7 +47,7 @@ public class DDTest5 extends TestBase {
@Override
protected void setup() {
- Window w = getLayout().getWindow();
+ Root w = getLayout().getRoot();
HorizontalSortableCssLayoutWithWrappers verticalSortableCssLayoutWithWrappers = new HorizontalSortableCssLayoutWithWrappers();
w.addWindow(verticalSortableCssLayoutWithWrappers);
diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest6.java b/tests/testbench/com/vaadin/tests/dd/DDTest6.java
index 4299b321c3..c6c6689bcb 100644
--- a/tests/testbench/com/vaadin/tests/dd/DDTest6.java
+++ b/tests/testbench/com/vaadin/tests/dd/DDTest6.java
@@ -159,7 +159,7 @@ public class DDTest6 extends TestBase {
getLayout().addComponent(sp);
TestUtils
.injectCSS(
- getLayout().getWindow(),
+ getLayout().getRoot(),
""
+ ".v-tree .v-icon {height:16px;} "
+ ".v-tree-node-caption-drag-top {/*border-top: none;*/} "
diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest7.java b/tests/testbench/com/vaadin/tests/dd/DDTest7.java
index 6027b3e499..26521f5a57 100644
--- a/tests/testbench/com/vaadin/tests/dd/DDTest7.java
+++ b/tests/testbench/com/vaadin/tests/dd/DDTest7.java
@@ -16,8 +16,8 @@ import com.vaadin.tests.util.PersonContainer;
import com.vaadin.tests.util.TestUtils;
import com.vaadin.ui.AbstractSelect.AbstractSelectTargetDetails;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
public class DDTest7 extends TestBase {
@@ -29,7 +29,7 @@ public class DDTest7 extends TestBase {
@Override
protected void setup() {
- Window w = getLayout().getWindow();
+ Root w = getLayout().getRoot();
TestUtils
.injectCSS(
diff --git a/tests/testbench/com/vaadin/tests/dd/TreeDragStart.java b/tests/testbench/com/vaadin/tests/dd/TreeDragStart.java
index 4a719bfa7f..4ef7023aa6 100644
--- a/tests/testbench/com/vaadin/tests/dd/TreeDragStart.java
+++ b/tests/testbench/com/vaadin/tests/dd/TreeDragStart.java
@@ -48,7 +48,7 @@ public class TreeDragStart extends TestBase {
checkBox.setValue(true);
checkBox.addListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- if (((CheckBox) event.getProperty()).booleanValue()) {
+ if ((Boolean) ((CheckBox) event.getProperty()).getValue()) {
tree.setDragMode(TreeDragMode.NODE);
} else {
tree.setDragMode(TreeDragMode.NONE);
diff --git a/tests/testbench/com/vaadin/tests/dd/VMyDragSource.java b/tests/testbench/com/vaadin/tests/dd/VMyDragSource.java
index 350ee064f3..7e91d2b9aa 100644
--- a/tests/testbench/com/vaadin/tests/dd/VMyDragSource.java
+++ b/tests/testbench/com/vaadin/tests/dd/VMyDragSource.java
@@ -10,23 +10,20 @@ import com.google.gwt.event.dom.client.MouseOutHandler;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
-import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.Paintable;
-import com.vaadin.terminal.gwt.client.UIDL;
+import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ui.dd.VDragAndDropManager;
import com.vaadin.terminal.gwt.client.ui.dd.VTransferable;
/**
* Example code to implement Component that has something to drag.
*/
-public class VMyDragSource extends Composite implements Paintable,
- MouseDownHandler, MouseMoveHandler, MouseOutHandler {
+public class VMyDragSource extends Composite implements MouseDownHandler,
+ MouseMoveHandler, MouseOutHandler {
private boolean mouseDown;
private MouseDownEvent mDownEvent;
- @SuppressWarnings("unused")
- private ApplicationConnection client;
+ @SuppressWarnings("unused")
public VMyDragSource() {
FlowPanel fp = new FlowPanel();
initWidget(fp);
@@ -41,13 +38,6 @@ public class VMyDragSource extends Composite implements Paintable,
}
- public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
- if (client.updateComponent(this, uidl, true)) {
- return;
- }
- this.client = client;
- }
-
/*
* Below a sophisticated drag start implementation. Drag event is started if
* mouse is moved 5 pixels with left mouse key down.
@@ -89,4 +79,8 @@ public class VMyDragSource extends Composite implements Paintable,
mDownEvent = null;
}
+ public Widget getWidgetForPaintable() {
+ return this;
+ }
+
}
diff --git a/tests/testbench/com/vaadin/tests/dd/VMyDragSourcePaintable.java b/tests/testbench/com/vaadin/tests/dd/VMyDragSourcePaintable.java
new file mode 100644
index 0000000000..c0076592cc
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/dd/VMyDragSourcePaintable.java
@@ -0,0 +1,25 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.dd;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.Widget;
+import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.terminal.gwt.client.ui.VAbstractPaintableWidget;
+
+public class VMyDragSourcePaintable extends VAbstractPaintableWidget {
+
+ public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
+ if (client.updateComponent(this, uidl, true)) {
+ return;
+ }
+ }
+
+ @Override
+ protected Widget createWidget() {
+ return GWT.create(VMyDragSource.class);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/dd/VMyDropTarget.java b/tests/testbench/com/vaadin/tests/dd/VMyDropTarget.java
index 743cce3095..81bbb09a5c 100644
--- a/tests/testbench/com/vaadin/tests/dd/VMyDropTarget.java
+++ b/tests/testbench/com/vaadin/tests/dd/VMyDropTarget.java
@@ -2,16 +2,15 @@ package com.vaadin.tests.dd;
import com.google.gwt.user.client.ui.Composite;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.Paintable;
-import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.terminal.gwt.client.VPaintableWidget;
import com.vaadin.terminal.gwt.client.ui.dd.VDragEvent;
import com.vaadin.terminal.gwt.client.ui.dd.VDropHandler;
import com.vaadin.terminal.gwt.client.ui.dd.VHasDropHandler;
public class VMyDropTarget extends Composite implements VHasDropHandler,
- VDropHandler, Paintable {
+ VDropHandler {
- private ApplicationConnection client;
+ ApplicationConnection client;
public void dragEnter(VDragEvent drag) {
}
@@ -30,23 +29,18 @@ public class VMyDropTarget extends Composite implements VHasDropHandler,
return false;
}
- public Paintable getPaintable() {
- // Drophandler implemented by Paintable itself
+ public VDropHandler getDropHandler() {
+ // Drophandler implemented by widget itself
return this;
}
- public VDropHandler getDropHandler() {
- // Drophandler implemented by Paintable itself
- return this;
+ public VPaintableWidget getPaintable() {
+ // TODO Auto-generated method stub
+ return null;
}
public ApplicationConnection getApplicationConnection() {
return client;
}
- public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
- this.client = client;
-
- }
-
}
diff --git a/tests/testbench/com/vaadin/tests/dd/VMyDropTargetPaintable.java b/tests/testbench/com/vaadin/tests/dd/VMyDropTargetPaintable.java
new file mode 100644
index 0000000000..5529c55383
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/dd/VMyDropTargetPaintable.java
@@ -0,0 +1,31 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.dd;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.Widget;
+import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.terminal.gwt.client.ui.VAbstractPaintableWidget;
+
+public class VMyDropTargetPaintable extends VAbstractPaintableWidget {
+
+ public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
+ if (client.updateComponent(this, uidl, true)) {
+ return;
+ }
+ getWidgetForPaintable().client = client;
+ }
+
+ @Override
+ public VMyDropTarget getWidgetForPaintable() {
+ return (VMyDropTarget) super.getWidgetForPaintable();
+ }
+
+ @Override
+ protected Widget createWidget() {
+ return GWT.create(VMyDropTarget.class);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/AbstractBeanFieldGroupTest.java b/tests/testbench/com/vaadin/tests/fieldgroup/AbstractBeanFieldGroupTest.java
new file mode 100644
index 0000000000..584ce0ec36
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/AbstractBeanFieldGroupTest.java
@@ -0,0 +1,96 @@
+package com.vaadin.tests.fieldgroup;
+
+import com.vaadin.data.fieldgroup.BeanFieldGroup;
+import com.vaadin.data.fieldgroup.FieldGroup.CommitException;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Root;
+
+public abstract class AbstractBeanFieldGroupTest extends TestBase {
+
+ private Button commitButton;
+ protected Log log = new Log(5);
+
+ private Button discardButton;
+ private Button showBeanButton;
+ private BeanFieldGroup fieldBinder;
+
+ @Override
+ protected void setup() {
+ addComponent(log);
+ }
+
+ protected Button getDiscardButton() {
+ if (discardButton == null) {
+ discardButton = new Button("Discard", new Button.ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ getFieldBinder().discard();
+ log.log("Discarded changes");
+
+ }
+ });
+ }
+ return discardButton;
+ }
+
+ protected Button getShowBeanButton() {
+ if (showBeanButton == null) {
+ showBeanButton = new Button("Show bean values",
+ new Button.ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ log.log(getFieldBinder().getItemDataSource()
+ .getBean().toString());
+
+ }
+ });
+ }
+ return showBeanButton;
+ }
+
+ protected Button getCommitButton() {
+ if (commitButton == null) {
+ commitButton = new Button("Commit");
+ commitButton.addListener(new ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ String msg = "Commit succesful";
+ try {
+ getFieldBinder().commit();
+ } catch (CommitException e) {
+ msg = "Commit failed: " + e.getMessage();
+ }
+ Root.getCurrentRoot().showNotification(msg);
+ log.log(msg);
+
+ }
+ });
+ }
+ return commitButton;
+ }
+
+ protected BeanFieldGroup getFieldBinder() {
+ return fieldBinder;
+ }
+
+ protected void setFieldBinder(BeanFieldGroup beanFieldBinder) {
+ fieldBinder = beanFieldBinder;
+ }
+
+ @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/fieldgroup/BasicPersonForm.java b/tests/testbench/com/vaadin/tests/fieldgroup/BasicPersonForm.java
new file mode 100644
index 0000000000..f95c172348
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/BasicPersonForm.java
@@ -0,0 +1,192 @@
+package com.vaadin.tests.fieldgroup;
+
+import com.vaadin.data.fieldgroup.BeanFieldGroup;
+import com.vaadin.data.fieldgroup.FieldGroup;
+import com.vaadin.data.fieldgroup.FieldGroup.CommitEvent;
+import com.vaadin.data.fieldgroup.FieldGroup.CommitException;
+import com.vaadin.data.fieldgroup.FieldGroup.CommitHandler;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.data.util.converter.StringToBooleanConverter;
+import com.vaadin.data.validator.EmailValidator;
+import com.vaadin.data.validator.IntegerRangeValidator;
+import com.vaadin.data.validator.StringLengthValidator;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.data.bean.Address;
+import com.vaadin.tests.data.bean.Country;
+import com.vaadin.tests.data.bean.Person;
+import com.vaadin.tests.data.bean.Sex;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.TextArea;
+import com.vaadin.ui.TextField;
+
+public class BasicPersonForm extends TestBase {
+
+ private Log log = new Log(5);
+ private TextField firstName;
+ private TextArea lastName;
+ private TextField email;
+ private TextField age;
+ private Table sex;
+ private TextField deceased;
+
+ public class Configuration {
+ public boolean preCommitFails = false;
+ public boolean postCommitFails = false;
+
+ public boolean isPreCommitFails() {
+ return preCommitFails;
+ }
+
+ public void setPreCommitFails(boolean preCommitFails) {
+ this.preCommitFails = preCommitFails;
+ }
+
+ public boolean isPostCommitFails() {
+ return postCommitFails;
+ }
+
+ public void setPostCommitFails(boolean postCommitFails) {
+ this.postCommitFails = postCommitFails;
+ }
+
+ }
+
+ private Configuration configuration = new Configuration();
+
+ private class ConfigurationPanel extends Panel {
+
+ public ConfigurationPanel() {
+ super("Configuration");
+ BeanItem<Configuration> bi = new BeanItem<BasicPersonForm.Configuration>(
+ configuration);
+ FieldGroup confFieldGroup = new FieldGroup(bi);
+ confFieldGroup.setItemDataSource(bi);
+ confFieldGroup.setBuffered(false);
+
+ for (Object propertyId : bi.getItemPropertyIds()) {
+ addComponent(confFieldGroup.buildAndBind(propertyId));
+ }
+
+ }
+ }
+
+ @Override
+ protected void setup() {
+ addComponent(log);
+ Panel confPanel = new ConfigurationPanel();
+ addComponent(confPanel);
+
+ final FieldGroup fieldGroup = new BeanFieldGroup<Person>(Person.class);
+ fieldGroup.addCommitHandler(new CommitHandler() {
+
+ public void preCommit(CommitEvent commitEvent)
+ throws CommitException {
+ if (configuration.preCommitFails) {
+ throw new CommitException(
+ "Error in preCommit because first name is "
+ + getPerson(commitEvent.getFieldBinder())
+ .getFirstName());
+ }
+
+ }
+
+ public void postCommit(CommitEvent commitEvent)
+ throws CommitException {
+ if (configuration.postCommitFails) {
+ throw new CommitException(
+ "Error in postCommit because first name is "
+ + getPerson(commitEvent.getFieldBinder())
+ .getFirstName());
+ }
+ }
+ });
+
+ fieldGroup.setBuffered(true);
+
+ fieldGroup.buildAndBindMemberFields(this);
+ addComponent(firstName);
+ addComponent(lastName);
+ addComponent(email);
+ addComponent(age);
+ addComponent(sex);
+ addComponent(deceased);
+
+ Button commitButton = new Button("Commit", new Button.ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ String msg = "Commit succesful";
+ try {
+ fieldGroup.commit();
+ } catch (CommitException e) {
+ msg = "Commit failed: " + e.getMessage();
+ }
+ Root.getCurrentRoot().showNotification(msg);
+ log.log(msg);
+
+ }
+ });
+ Button discardButton = new Button("Discard",
+ new Button.ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ fieldGroup.discard();
+ log.log("Discarded changes");
+
+ }
+ });
+ Button showBean = new Button("Show bean values",
+ new Button.ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ log.log(getPerson(fieldGroup).toString());
+
+ }
+ });
+ addComponent(commitButton);
+ addComponent(discardButton);
+ addComponent(showBean);
+ email.addValidator(new EmailValidator("Must be a valid address"));
+ lastName.addValidator(new StringLengthValidator("Must be min 5 chars",
+ 5, null, true));
+
+ age.addValidator(new IntegerRangeValidator(
+ "Must be between 0 and 150, {0} is not", 0, 150));
+ sex.setPageLength(0);
+ deceased.setConverter(new StringToBooleanConverter() {
+ @Override
+ protected String getTrueString() {
+ return "YAY!";
+ }
+
+ @Override
+ protected String getFalseString() {
+ return "NAAAAAH";
+ }
+ });
+ Person p = new Person("John", "Doe", "john@doe.com", 64, Sex.MALE,
+ new Address("John street", 11223, "John's town", Country.USA));
+ fieldGroup.setItemDataSource(new BeanItem<Person>(p));
+ }
+
+ public static Person getPerson(FieldGroup binder) {
+ return ((BeanItem<Person>) binder.getItemDataSource()).getBean();
+ }
+
+ @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/fieldgroup/BooleanTextField.html b/tests/testbench/com/vaadin/tests/fieldgroup/BooleanTextField.html
new file mode 100644
index 0000000000..62b1458a2f
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/BooleanTextField.html
@@ -0,0 +1,147 @@
+package com.vaadin.tests.fieldgroup;
+
+public class BooleanTextField_html {
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head profile="http://selenium-ide.openqa.org/profiles/test-case">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <link rel="selenium.base" href="" />
+ <title>New Test</title>
+ </head>
+ <body>
+ <table cellpadding="1" cellspacing="1" border="1">
+ <thead>
+ <tr><td rowspan="1" colspan="3">New Test</td></tr>
+ </thead><tbody>
+ <tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.fieldgroup.BasicPersonForm?restartApplication</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>initial</td>
+ </tr>
+ <tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>90,38</td>
+ </tr>
+ <tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>Dover</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>1. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+ </tr>
+ <tr>
+ <td>drag</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>108,9</td>
+ </tr>
+ <tr>
+ <td>drop</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]</td>
+ <td>0,587</td>
+ </tr>
+ <tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>-18,9</td>
+ </tr>
+ <tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[8]</td>
+ <td>239,14</td>
+ </tr>
+ <!--error indicator-->
+ <tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[7]/domChild[0]/domChild[1]</td>
+ <td>v-errorindicator</td>
+ </tr>
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>false</td>
+ </tr>
+ <!--show bean values-->
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>2. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+ </tr>
+ <!--error message in tooltip-->
+ <tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>0,0</td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]</td>
+ <td>Could not convert value to Boolean</td>
+ </tr>
+ <tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>66,6</td>
+ </tr>
+ <tr>
+ <td>type</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>YAY!</td>
+ </tr>
+ <!--no error indicator-->
+ <tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[7]/domChild[0]/domChild[1]</td>
+ <td>v-errorindicator</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[8]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>closeNotification</td>
+ <td>//body/div[2]</td>
+ <td>0,0</td>
+ </tr>
+ <!--commit last name and new deceased status-->
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>4. Person [firstName=John, lastName=Dover, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=true, salary=null, salaryDouble=null, rent=null]</td>
+ </tr>
+ </tbody></table>
+ </body>
+ </html>
+
+}
+
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/CommitHandlerFailures.html b/tests/testbench/com/vaadin/tests/fieldgroup/CommitHandlerFailures.html
new file mode 100644
index 0000000000..355b9ac426
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/CommitHandlerFailures.html
@@ -0,0 +1,220 @@
+package com.vaadin.tests.fieldgroup;
+
+public class CommitHandlerFailures_html {
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head profile="http://selenium-ide.openqa.org/profiles/test-case">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <link rel="selenium.base" href="" />
+ <title>New Test</title>
+ </head>
+ <body>
+ <table cellpadding="1" cellspacing="1" border="1">
+ <thead>
+ <tr><td rowspan="1" colspan="3">New Test</td></tr>
+ </thead><tbody>
+ <tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.fieldgroup.BasicPersonForm?restartApplication</td>
+ <td></td>
+ </tr>
+ <!--assert we are starting with what we think we are starting with-->
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextField[0]</td>
+ <td>John</td>
+ </tr>
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>Doe</td>
+ </tr>
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
+ <td>john@doe.com</td>
+ </tr>
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>64</td>
+ </tr>
+ <tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>v-selected</td>
+ </tr>
+ <tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]</td>
+ <td>v-selected</td>
+ </tr>
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>NAAAAAH</td>
+ </tr>
+ <!--Make changes to fields-->
+ <tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>Doeve</td>
+ </tr>
+ <tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextField[0]</td>
+ <td>Mike</td>
+ </tr>
+ <tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
+ <td>me@me.com</td>
+ </tr>
+ <tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>12</td>
+ </tr>
+ <tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>31,10</td>
+ </tr>
+ <!--show bean values-->
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>1. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+ </tr>
+ <!--pre commit fails-->
+ <tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VCheckBox[0]/domChild[0]</td>
+ <td>35,6</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[8]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>closeNotification</td>
+ <td>//body/div[2]</td>
+ <td>0,0</td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>2. Commit failed: Commit failed</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>3. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+ </tr>
+ <!--post commit fails-->
+ <tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VCheckBox[0]/domChild[0]</td>
+ <td>10,7</td>
+ </tr>
+ <tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VCheckBox[0]/domChild[0]</td>
+ <td>9,7</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[8]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>closeNotification</td>
+ <td>//body/div[2]</td>
+ <td>0,0</td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>4. Commit failed: Commit failed</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>5. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+ </tr>
+ <!--discard and ensure old values are returned as all commits have failed-->
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[9]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextField[0]</td>
+ <td>John</td>
+ </tr>
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>Doe</td>
+ </tr>
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
+ <td>john@doe.com</td>
+ </tr>
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>64</td>
+ </tr>
+ <tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>v-selected</td>
+ </tr>
+ <tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]</td>
+ <td>v-selected</td>
+ </tr>
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>NAAAAAH</td>
+ </tr>
+ <!--show bean values-->
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>7. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+ </tr>
+
+ </tbody></table>
+ </body>
+ </html>
+
+}
+
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/CommitWithValidationOrConversionError.html b/tests/testbench/com/vaadin/tests/fieldgroup/CommitWithValidationOrConversionError.html
new file mode 100644
index 0000000000..667618963b
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/CommitWithValidationOrConversionError.html
@@ -0,0 +1,150 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head profile="http://selenium-ide.openqa.org/profiles/test-case">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <link rel="selenium.base" href="" />
+ <title>New Test</title>
+ </head>
+ <body>
+ <table cellpadding="1" cellspacing="1" border="1">
+ <thead>
+ <tr><td rowspan="1" colspan="3">New Test</td></tr>
+ </thead><tbody>
+ <tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.fieldgroup.BasicPersonForm?restartApplication</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>Doev</td>
+ </tr>
+ <!--commit with invalid field must fail-->
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[8]/VButton[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>closeNotification</td>
+ <td>//body/div[2]</td>
+ <td>0,0</td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>1. Commit failed: Commit failed</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>2. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+ </tr>
+ <tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>64,2</td>
+ </tr>
+ <!--commit with 2 fails-->
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[8]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>closeNotification</td>
+ <td>//body/div[2]</td>
+ <td>0,0</td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>3. Commit failed: Commit failed</td>
+ </tr>
+ <tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>Doever</td>
+ </tr>
+ <!--1 error fixed, still 1 conversion error-->
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[8]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>closeNotification</td>
+ <td>//body/div[2]</td>
+ <td>0,0</td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>4. Commit failed: Commit failed</td>
+ </tr>
+ <tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>123</td>
+ </tr>
+ <!--all fields ok, commit should be ok-->
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[8]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>closeNotification</td>
+ <td>//body/div[2]</td>
+ <td>0,0</td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>5. Commit succesful</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>6. Person [firstName=John, lastName=Doever, email=john@doe.com, age=123, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+ </tr>
+ <!--discard should now have no effect-->
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[9]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>7. Discarded changes</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>8. Person [firstName=John, lastName=Doever, email=john@doe.com, age=123, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+ </tr>
+
+ </tbody></table>
+ </body>
+ </html>
+
+}
+
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java b/tests/testbench/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java
new file mode 100644
index 0000000000..9ff553ce61
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java
@@ -0,0 +1,106 @@
+package com.vaadin.tests.fieldgroup;
+
+import com.vaadin.data.fieldgroup.BeanFieldGroup;
+import com.vaadin.data.fieldgroup.FieldGroup;
+import com.vaadin.data.fieldgroup.FieldGroup.CommitException;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.data.bean.Address;
+import com.vaadin.tests.data.bean.Country;
+import com.vaadin.tests.data.bean.Person;
+import com.vaadin.tests.data.bean.PersonWithBeanValidationAnnotations;
+import com.vaadin.tests.data.bean.Sex;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.TextArea;
+import com.vaadin.ui.TextField;
+
+public class FieldBinderWithBeanValidation extends TestBase {
+
+ private Log log = new Log(5);
+ private TextField firstName;
+ private TextArea lastName;
+ private TextField email;
+ private TextField age;
+ private Table sex;
+ private TextField deceased;
+
+ @Override
+ protected void setup() {
+ addComponent(log);
+
+ final BeanFieldGroup<PersonWithBeanValidationAnnotations> fieldGroup = new BeanFieldGroup<PersonWithBeanValidationAnnotations>(
+ PersonWithBeanValidationAnnotations.class);
+
+ fieldGroup.buildAndBindMemberFields(this);
+ addComponent(firstName);
+ addComponent(lastName);
+ addComponent(email);
+ addComponent(age);
+ addComponent(sex);
+ addComponent(deceased);
+
+ Button commitButton = new Button("Commit", new Button.ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ String msg = "Commit succesful";
+ try {
+ fieldGroup.commit();
+ } catch (CommitException e) {
+ msg = "Commit failed: " + e.getMessage();
+ }
+ Root.getCurrentRoot().showNotification(msg);
+ log.log(msg);
+
+ }
+ });
+ Button discardButton = new Button("Discard",
+ new Button.ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ fieldGroup.discard();
+ log.log("Discarded changes");
+
+ }
+ });
+ Button showBean = new Button("Show bean values",
+ new Button.ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ log.log(getPerson(fieldGroup).toString());
+
+ }
+ });
+ addComponent(commitButton);
+ addComponent(discardButton);
+ addComponent(showBean);
+ sex.setPageLength(0);
+
+ PersonWithBeanValidationAnnotations p = new PersonWithBeanValidationAnnotations(
+ "John", "Doe", "john@doe.com", 64, Sex.MALE, new Address(
+ "John street", 11223, "John's town", Country.USA));
+ fieldGroup
+ .setItemDataSource(new BeanItem<PersonWithBeanValidationAnnotations>(
+ p));
+ }
+
+ public static Person getPerson(FieldGroup binder) {
+ return ((BeanItem<Person>) binder.getItemDataSource()).getBean();
+ }
+
+ @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/fieldgroup/FieldGroupDiscard.html b/tests/testbench/com/vaadin/tests/fieldgroup/FieldGroupDiscard.html
new file mode 100644
index 0000000000..b4460df233
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/FieldGroupDiscard.html
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.fieldgroup.BasicPersonForm?restartApplication</td>
+ <td></td>
+</tr>
+<!--assert we are starting with what we think we are starting with-->
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextField[0]</td>
+ <td>John</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>Doe</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
+ <td>john@doe.com</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>64</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>v-selected</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]</td>
+ <td>v-selected</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>NAAAAAH</td>
+</tr>
+<!--make some changes-->
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextField[0]</td>
+ <td>John123</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>Doe123</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
+ <td>john@doe.com123</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>64123</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>33,8</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>72,10</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>-18,15</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>YAY!</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>1. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[9]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>2. Discarded changes</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>3. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+</tr>
+<!--we should still be at the state we started from-->
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextField[0]</td>
+ <td>John</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>Doe</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
+ <td>john@doe.com</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>64</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>v-selected</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]</td>
+ <td>v-selected</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>NAAAAAH</td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/FormBuilderWithNestedProperties.java b/tests/testbench/com/vaadin/tests/fieldgroup/FormBuilderWithNestedProperties.java
new file mode 100644
index 0000000000..5f25070f2e
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/FormBuilderWithNestedProperties.java
@@ -0,0 +1,47 @@
+package com.vaadin.tests.fieldgroup;
+
+import com.vaadin.data.fieldgroup.BeanFieldGroup;
+import com.vaadin.data.fieldgroup.FieldGroup;
+import com.vaadin.data.fieldgroup.PropertyId;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.data.bean.Address;
+import com.vaadin.tests.data.bean.Country;
+import com.vaadin.tests.data.bean.Person;
+import com.vaadin.tests.data.bean.Sex;
+import com.vaadin.ui.TextField;
+
+public class FormBuilderWithNestedProperties extends TestBase {
+
+ private TextField firstName;
+ private TextField lastName;
+ @PropertyId("address.streetAddress")
+ private TextField streetAddress;
+
+ @Override
+ protected void setup() {
+ FieldGroup fieldGroup = new BeanFieldGroup<Person>(Person.class);
+ fieldGroup.buildAndBindMemberFields(this);
+
+ addComponent(firstName);
+ addComponent(lastName);
+ addComponent(streetAddress);
+
+ fieldGroup.setItemDataSource(new BeanItem<Person>(new Person("Who",
+ "me?", "email", 1, Sex.MALE, new Address("street name", 202020,
+ "City", Country.FINLAND))));
+ }
+
+ @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/fieldgroup/FormManyToMany.java b/tests/testbench/com/vaadin/tests/fieldgroup/FormManyToMany.java
new file mode 100644
index 0000000000..f4f612503c
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/FormManyToMany.java
@@ -0,0 +1,28 @@
+package com.vaadin.tests.fieldgroup;
+
+import com.vaadin.tests.components.TestBase;
+
+public class FormManyToMany extends TestBase {
+
+ @Override
+ protected void setup() {
+ // TODO implement
+
+ // TODO note that in one direction, a setter is used and automatically
+ // updates the other direction (setting the Roles of a User updates
+ // Roles), whereas in the other direction (updating the list of Users
+ // for a Role), manual updates are needed at commit time to keep the
+ // Users consistent with Roles
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Forms which allow editing of a many-to-many mapping between users and roles";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/FormOneToMany.java b/tests/testbench/com/vaadin/tests/fieldgroup/FormOneToMany.java
new file mode 100644
index 0000000000..e269a39441
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/FormOneToMany.java
@@ -0,0 +1,43 @@
+package com.vaadin.tests.fieldgroup;
+
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Millionaire;
+import com.vaadin.ui.Form;
+
+public class FormOneToMany extends TestBase {
+
+ @Override
+ protected void setup() {
+ final Form form = new Form();
+ addComponent(form);
+ form.setItemDataSource(createMillionaireItem());
+
+ // TODO support adding, editing and removing secondary addresses
+ }
+
+ protected BeanItem<Millionaire> createMillionaireItem() {
+ Millionaire person = new Millionaire("First", "Last", "foo@vaadin.com",
+ "02-111 2222", "Ruukinkatu 2-4", 20540, "Turku");
+
+ BeanItem<Millionaire> item = new BeanItem<Millionaire>(person);
+ // add nested properties from address
+ item.expandProperty("address");
+
+ // TODO for now, hide secondary residences
+ item.removeItemProperty("secondaryResidences");
+
+ return item;
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Form with an editable list of sub-objects.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/FormOneToOne.java b/tests/testbench/com/vaadin/tests/fieldgroup/FormOneToOne.java
new file mode 100644
index 0000000000..b16cb29a8a
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/FormOneToOne.java
@@ -0,0 +1,38 @@
+package com.vaadin.tests.fieldgroup;
+
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Person;
+import com.vaadin.ui.Form;
+
+public class FormOneToOne extends TestBase {
+
+ @Override
+ protected void setup() {
+ final Form form = new Form();
+ addComponent(form);
+ form.setItemDataSource(createPersonItem());
+ }
+
+ protected BeanItem<Person> createPersonItem() {
+ Person person = new Person("First", "Last", "foo@vaadin.com",
+ "02-111 2222", "Ruukinkatu 2-4", 20540, "Turku");
+
+ BeanItem<Person> item = new BeanItem<Person>(person);
+ // add nested properties from address
+ item.expandProperty("address");
+
+ return item;
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Form where some properties come from a sub-object of the bean.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/FormWithNestedProperties.java b/tests/testbench/com/vaadin/tests/fieldgroup/FormWithNestedProperties.java
new file mode 100644
index 0000000000..f66d822495
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/FormWithNestedProperties.java
@@ -0,0 +1,67 @@
+package com.vaadin.tests.fieldgroup;
+
+import com.vaadin.data.fieldgroup.BeanFieldGroup;
+import com.vaadin.data.fieldgroup.PropertyId;
+import com.vaadin.tests.data.bean.Address;
+import com.vaadin.tests.data.bean.Country;
+import com.vaadin.tests.data.bean.Person;
+import com.vaadin.tests.data.bean.Sex;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.NativeSelect;
+import com.vaadin.ui.TextField;
+
+public class FormWithNestedProperties extends AbstractBeanFieldGroupTest {
+
+ private Log log = new Log(5);
+
+ private TextField firstName = new TextField("First name");
+ private TextField lastName = new TextField("Last name");
+ private TextField email = new TextField("Email");
+ private TextField age = new TextField("Age");
+
+ @PropertyId("address.streetAddress")
+ private TextField streetAddress = new TextField("Street address");
+ private NativeSelect country;
+
+ private CheckBox deceased = new CheckBox("Deceased");
+
+ @Override
+ protected void setup() {
+ super.setup();
+
+ setFieldBinder(new BeanFieldGroup<Person>(Person.class));
+ country = getFieldBinder().buildAndBind("country", "address.country",
+ NativeSelect.class);
+ getFieldBinder().bindMemberFields(this);
+ addComponent(firstName);
+ addComponent(lastName);
+ addComponent(streetAddress);
+ addComponent(country);
+ addComponent(email);
+ addComponent(age);
+ addComponent(deceased);
+ addComponent(getCommitButton());
+ addComponent(getDiscardButton());
+ addComponent(getShowBeanButton());
+
+ getFieldBinder().setItemDataSource(
+ new Person("First", "Last", "Email", 52, Sex.FEMALE,
+ new Address("street address", 01234, "City",
+ Country.FINLAND)));
+
+ }
+
+ @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/fieldgroup/IntegerRangeValidator.html b/tests/testbench/com/vaadin/tests/fieldgroup/IntegerRangeValidator.html
new file mode 100644
index 0000000000..e2d6256f24
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/IntegerRangeValidator.html
@@ -0,0 +1,95 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head profile="http://selenium-ide.openqa.org/profiles/test-case">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <link rel="selenium.base" href="" />
+ <title>New Test</title>
+ </head>
+ <body>
+ <table cellpadding="1" cellspacing="1" border="1">
+ <thead>
+ <tr><td rowspan="1" colspan="3">New Test</td></tr>
+ </thead><tbody>
+ <tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.fieldgroup.BasicPersonForm?restartApplication</td>
+ <td></td>
+</tr>
+<!--64123 -> age-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>64,20</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>64123</td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::Root/VTooltip[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]</td>
+ <td>Must be between 0 and 150, 64123 is not</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[5]/domChild[0]/domChild[1]</td>
+ <td>v-errorindicator</td>
+</tr>
+<!--10 -> age-->
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>10</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[5]/domChild[0]/domChild[1]</td>
+ <td>v-errorindicator</td>
+</tr>
+<!---1-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>69,11</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>-1</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[5]/domChild[0]/domChild[1]</td>
+ <td>v-errorindicator</td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::Root/VTooltip[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]</td>
+ <td>Must be between 0 and 150, -1 is not</td>
+</tr>
+</tbody></table>
+ </body>
+ </html>
+
diff --git a/tests/testbench/com/vaadin/tests/fields/FormManyToMany.java b/tests/testbench/com/vaadin/tests/fields/FormManyToMany.java
new file mode 100644
index 0000000000..43fba20f33
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fields/FormManyToMany.java
@@ -0,0 +1,28 @@
+package com.vaadin.tests.fields;
+
+import com.vaadin.tests.components.TestBase;
+
+public class FormManyToMany extends TestBase {
+
+ @Override
+ protected void setup() {
+ // TODO implement
+
+ // TODO note that in one direction, a setter is used and automatically
+ // updates the other direction (setting the Roles of a User updates
+ // Roles), whereas in the other direction (updating the list of Users
+ // for a Role), manual updates are needed at commit time to keep the
+ // Users consistent with Roles
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Forms which allow editing of a many-to-many mapping between users and roles";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/fields/FormOneToMany.java b/tests/testbench/com/vaadin/tests/fields/FormOneToMany.java
new file mode 100644
index 0000000000..a010e935ab
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fields/FormOneToMany.java
@@ -0,0 +1,43 @@
+package com.vaadin.tests.fields;
+
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Millionaire;
+import com.vaadin.ui.Form;
+
+public class FormOneToMany extends TestBase {
+
+ @Override
+ protected void setup() {
+ final Form form = new Form();
+ addComponent(form);
+ form.setItemDataSource(createMillionaireItem());
+
+ // TODO support adding, editing and removing secondary addresses
+ }
+
+ protected BeanItem<Millionaire> createMillionaireItem() {
+ Millionaire person = new Millionaire("First", "Last", "foo@vaadin.com",
+ "02-111 2222", "Ruukinkatu 2-4", 20540, "Turku");
+
+ BeanItem<Millionaire> item = new BeanItem<Millionaire>(person);
+ // add nested properties from address
+ item.expandProperty("address");
+
+ // TODO for now, hide secondary residences
+ item.removeItemProperty("secondaryResidences");
+
+ return item;
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Form with an editable list of sub-objects.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/fields/FormOneToOne.java b/tests/testbench/com/vaadin/tests/fields/FormOneToOne.java
new file mode 100644
index 0000000000..36f4dfe0ea
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fields/FormOneToOne.java
@@ -0,0 +1,38 @@
+package com.vaadin.tests.fields;
+
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Person;
+import com.vaadin.ui.Form;
+
+public class FormOneToOne extends TestBase {
+
+ @Override
+ protected void setup() {
+ final Form form = new Form();
+ addComponent(form);
+ form.setItemDataSource(createPersonItem());
+ }
+
+ protected BeanItem<Person> createPersonItem() {
+ Person person = new Person("First", "Last", "foo@vaadin.com",
+ "02-111 2222", "Ruukinkatu 2-4", 20540, "Turku");
+
+ BeanItem<Person> item = new BeanItem<Person>(person);
+ // add nested properties from address
+ item.expandProperty("address");
+
+ return item;
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Form where some properties come from a sub-object of the bean.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java b/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java
index 479af4aa87..eb26faacc0 100644
--- a/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java
+++ b/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java
@@ -1,12 +1,12 @@
package com.vaadin.tests.integration;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Log;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.ResizeEvent;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.Root.BrowserWindowResizeEvent;
public class EmbedSizeTest extends TestBase {
@@ -14,30 +14,31 @@ public class EmbedSizeTest extends TestBase {
@Override
protected void setup() {
- Window mainWindow = getMainWindow();
+ Root mainWindow = getMainWindow();
mainWindow.setSizeUndefined();
mainWindow.getContent().setSizeUndefined();
mainWindow.setImmediate(true);
- CheckBox lazyCheckBox = new CheckBox("Lazy resize",
- new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- boolean resizeLazy = Boolean.TRUE == event.getButton()
- .getValue();
- getMainWindow().setResizeLazy(resizeLazy);
- log.log("Resize lazy: " + resizeLazy);
- }
- });
+ CheckBox lazyCheckBox = new CheckBox("Lazy resize");
+ lazyCheckBox.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ CheckBox cb = (CheckBox) event.getProperty();
+ Boolean resizeLazy = cb.getValue();
+ getMainWindow().setResizeLazy(resizeLazy);
+ log.log("Resize lazy: " + resizeLazy);
+ }
+ });
lazyCheckBox.setValue(Boolean.FALSE);
lazyCheckBox.setImmediate(true);
addComponent(lazyCheckBox);
addComponent(log);
- mainWindow.addListener(new Window.ResizeListener() {
- public void windowResized(ResizeEvent e) {
- Window window = e.getWindow();
- log.log("Resize event: " + window.getWidth() + " x "
- + window.getHeight());
+ mainWindow.addListener(new Root.BrowserWindowResizeListener() {
+ public void browserWindowResized(BrowserWindowResizeEvent event) {
+ log.log("Resize event: " + event.getWidth() + " x "
+ + event.getHeight());
+
}
});
}
diff --git a/tests/testbench/com/vaadin/tests/integration/IntegrationTestApplication.java b/tests/testbench/com/vaadin/tests/integration/IntegrationTestApplication.java
index 6bff7aca1d..b2001bdd7e 100644
--- a/tests/testbench/com/vaadin/tests/integration/IntegrationTestApplication.java
+++ b/tests/testbench/com/vaadin/tests/integration/IntegrationTestApplication.java
@@ -7,14 +7,14 @@ import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.terminal.ClassResource;
import com.vaadin.terminal.Resource;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
-public class IntegrationTestApplication extends Application {
+public class IntegrationTestApplication extends Application.LegacyApplication {
@Override
public void init() {
- Window window = new Window("Vaadin Application");
+ LegacyWindow window = new LegacyWindow("Vaadin Application");
setMainWindow(window);
final Table table = new Table();
diff --git a/tests/testbench/com/vaadin/tests/integration/JSR286PortletApplication.java b/tests/testbench/com/vaadin/tests/integration/JSR286PortletApplication.java
index 41d02d35ae..ecc7ea9647 100644
--- a/tests/testbench/com/vaadin/tests/integration/JSR286PortletApplication.java
+++ b/tests/testbench/com/vaadin/tests/integration/JSR286PortletApplication.java
@@ -22,17 +22,19 @@ import com.vaadin.terminal.gwt.server.PortletApplicationContext2;
import com.vaadin.terminal.gwt.server.PortletApplicationContext2.PortletListener;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Link;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
/**
* Adapted from old PortletDemo to support integration testing.
*/
-public class JSR286PortletApplication extends Application {
+public class JSR286PortletApplication extends Application.LegacyApplication {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
TextField tf = new TextField("Some value");
Label userInfo = new Label();
Link portletEdit = new Link();
@@ -41,7 +43,6 @@ public class JSR286PortletApplication extends Application {
@Override
public void init() {
- main = new Window();
setMainWindow(main);
Embedded appResourceTest = new Embedded(
@@ -54,7 +55,7 @@ public class JSR286PortletApplication extends Application {
main.addComponent(specialNameResourceTest);
userInfo.setCaption("User info");
- userInfo.setContentMode(Label.CONTENT_PREFORMATTED);
+ userInfo.setContentMode(ContentMode.PREFORMATTED);
main.addComponent(userInfo);
tf.setEnabled(false);
@@ -79,12 +80,12 @@ public class JSR286PortletApplication extends Application {
private class DemoPortletListener implements PortletListener {
public void handleActionRequest(ActionRequest request,
- ActionResponse response, Window window) {
+ ActionResponse response, Root window) {
main.addComponent(new Label("Action received"));
}
public void handleRenderRequest(RenderRequest request,
- RenderResponse response, Window window) {
+ RenderResponse response, Root window) {
// Portlet up-and-running, enable stuff
portletEdit.setEnabled(true);
portletMax.setEnabled(true);
@@ -157,12 +158,12 @@ public class JSR286PortletApplication extends Application {
}
public void handleEventRequest(EventRequest request,
- EventResponse response, Window window) {
+ EventResponse response, Root window) {
// events not used by this test
}
public void handleResourceRequest(ResourceRequest request,
- ResourceResponse response, Window window) {
+ ResourceResponse response, Root window) {
// nothing special to do here
}
}
diff --git a/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java b/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java
index 4267a7ea91..91e9a4620c 100644
--- a/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java
+++ b/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java
@@ -5,15 +5,17 @@ import java.util.Iterator;
import java.util.Locale;
import com.vaadin.Application;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.event.Action;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.terminal.Resource;
import com.vaadin.terminal.ThemeResource;
+import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.AbstractSelect;
import com.vaadin.ui.Accordion;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Component;
@@ -24,6 +26,7 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.InlineDateField;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Layout;
import com.vaadin.ui.ListSelect;
import com.vaadin.ui.MenuBar;
@@ -31,25 +34,27 @@ import com.vaadin.ui.MenuBar.Command;
import com.vaadin.ui.MenuBar.MenuItem;
import com.vaadin.ui.NativeButton;
import com.vaadin.ui.NativeSelect;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.Panel;
import com.vaadin.ui.PopupView;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Slider;
import com.vaadin.ui.Slider.ValueOutOfBoundsException;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
import com.vaadin.ui.TabSheet.Tab;
import com.vaadin.ui.Table;
+import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Tree;
import com.vaadin.ui.TwinColSelect;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
import com.vaadin.ui.themes.LiferayTheme;
@SuppressWarnings("serial")
-public class LiferayThemeDemo extends Application {
+public class LiferayThemeDemo extends Application.LegacyApplication {
@SuppressWarnings("deprecation")
private static final Date DATE = new Date(2009 - 1900, 6 - 1, 2);
@@ -59,7 +64,7 @@ public class LiferayThemeDemo extends Application {
private static final Resource ICON_OK = new ThemeResource(
"../runo/icons/16/ok.png");
- private Window main;
+ private LegacyWindow main;
private VerticalLayout mainLayout;
private TabSheet tabs;
@@ -79,7 +84,7 @@ public class LiferayThemeDemo extends Application {
@Override
public void init() {
- main = new Window("Vaadin Liferay Theme");
+ main = new LegacyWindow("Vaadin Liferay Theme");
mainLayout = (VerticalLayout) main.getContent();
mainLayout.setMargin(false);
setMainWindow(main);
@@ -127,7 +132,7 @@ public class LiferayThemeDemo extends Application {
l.setMargin(true);
l.setCaption("Labels");
- l.addComponent(new Label("Normal Label", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Normal Label", ContentMode.XHTML));
l.addComponent(new Label(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit."));
return l;
@@ -139,7 +144,7 @@ public class LiferayThemeDemo extends Application {
l.setMargin(true);
l.setSpacing(true);
- Button b = new Button("Normal Button");
+ AbstractComponent b = new Button("Normal Button");
b.setDescription("This is a tooltip!");
l.addComponent(b);
@@ -208,17 +213,17 @@ public class LiferayThemeDemo extends Application {
l.setWidth("400px");
l.setColumnExpandRatio(0, 1);
- l.addComponent(new Label("Normal TextField", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Normal TextField", ContentMode.XHTML));
TextField tf = new TextField();
tf.setInputPrompt("Enter text");
l.addComponent(tf);
- l.addComponent(new Label("Normal TextArea", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Normal TextArea", ContentMode.XHTML));
- tf = new TextField();
- tf.setHeight("5em");
- tf.setInputPrompt("Enter text");
- l.addComponent(tf);
+ TextArea ta = new TextArea();
+ ta.setHeight("5em");
+ ta.setInputPrompt("Enter text");
+ l.addComponent(ta);
return l;
}
@@ -310,12 +315,14 @@ public class LiferayThemeDemo extends Application {
}
}
- closable.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ closable.addListener(new Property.ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
Iterator<Component> it = ts.getComponentIterator();
for (; it.hasNext();) {
Component c = it.next();
- ts.getTab(c).setClosable(event.getButton().booleanValue());
+ ts.getTab(c).setClosable(
+ (Boolean) event.getProperty().getValue());
}
}
});
@@ -332,7 +339,7 @@ public class LiferayThemeDemo extends Application {
l.setColumnExpandRatio(0, 2);
l.setColumnExpandRatio(1, 5);
- l.addComponent(new Label("Normal Panel", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Normal Panel", ContentMode.XHTML));
Panel p = new Panel("Normal Panel");
p.setHeight("100px");
@@ -341,7 +348,7 @@ public class LiferayThemeDemo extends Application {
l.addComponent(new Label(
"Light Style (<code>LiferayTheme.PANEL_LIGHT</code>)",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
Panel p2 = new Panel("Light Style Panel");
p2.setStyleName(LiferayTheme.PANEL_LIGHT);
@@ -374,7 +381,7 @@ public class LiferayThemeDemo extends Application {
int sum = 0;
for (int j = 0; j < 100; j++) {
- t.addItem(new Object[] { j, "Bar value " + j,
+ t.addItem(new Object[] { "" + j, "Bar value " + j,
"Last column value " + j, new TextField() }, j);
sum += j;
}
@@ -404,7 +411,7 @@ public class LiferayThemeDemo extends Application {
w2.setPositionX(350);
w2.setPositionY(160);
w2.addComponent(new Label("<code>Window.setResizable(false)</code>",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
tabs.addListener(new TabSheet.SelectedTabChangeListener() {
public void selectedTabChange(SelectedTabChangeEvent event) {
@@ -435,7 +442,7 @@ public class LiferayThemeDemo extends Application {
l.addComponent(lockCheckBox, 1, 0);
l.newLine();
- Label label = new Label("Normal SplitPanel", Label.CONTENT_XHTML);
+ Label label = new Label("Normal SplitPanel", ContentMode.XHTML);
label.setWidth(null);
l.addComponent(label);
final HorizontalSplitPanel sp = new HorizontalSplitPanel();
@@ -448,7 +455,7 @@ public class LiferayThemeDemo extends Application {
label = new Label(
"Small Style<br />(<code>LiferayTheme.SPLITPANEL_SMALL</code>)",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
label.setWidth(null);
l.addComponent(label);
@@ -462,12 +469,13 @@ public class LiferayThemeDemo extends Application {
sp3.setSecondComponent(sp4);
l.addComponent(sp3);
- lockCheckBox.addListener(new ClickListener() {
- public void buttonClick(ClickEvent event) {
- sp.setLocked(event.getButton().booleanValue());
- sp2.setLocked(event.getButton().booleanValue());
- sp3.setLocked(event.getButton().booleanValue());
- sp4.setLocked(event.getButton().booleanValue());
+ lockCheckBox.addListener(new Property.ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ sp.setLocked((Boolean) event.getProperty().getValue());
+ sp2.setLocked((Boolean) event.getProperty().getValue());
+ sp3.setLocked((Boolean) event.getProperty().getValue());
+ sp4.setLocked((Boolean) event.getProperty().getValue());
}
});
@@ -507,7 +515,7 @@ public class LiferayThemeDemo extends Application {
l.setWidth("400px");
l.setColumnExpandRatio(0, 1);
- l.addComponent(new Label("Horizontal Slider", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Horizontal Slider", ContentMode.XHTML));
Slider s = new Slider();
s.setWidth("200px");
try {
@@ -518,7 +526,7 @@ public class LiferayThemeDemo extends Application {
}
l.addComponent(s);
- l.addComponent(new Label("Vertical Slider", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Vertical Slider", ContentMode.XHTML));
s = new Slider();
s.setOrientation(Slider.ORIENTATION_VERTICAL);
s.setHeight("200px");
@@ -580,55 +588,52 @@ public class LiferayThemeDemo extends Application {
message.setValue("Jumped over the lazy dog.");
message.setWidth("15em");
- l.addComponent(new Label("<h3>Type</h3>", Label.CONTENT_XHTML));
- l.addComponent(new Label("<h3>Preview</h3>", Label.CONTENT_XHTML));
+ l.addComponent(new Label("<h3>Type</h3>", ContentMode.XHTML));
+ l.addComponent(new Label("<h3>Preview</h3>", ContentMode.XHTML));
- l.addComponent(new Label("Humanized", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Humanized", ContentMode.XHTML));
Button show = new Button("Humanized Notification",
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
event.getButton()
- .getWindow()
- .showNotification((String) title.getValue(),
- (String) message.getValue());
+ .getRoot()
+ .showNotification(title.getValue(),
+ message.getValue());
}
});
l.addComponent(show);
- l.addComponent(new Label("Warning", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Warning", ContentMode.XHTML));
show = new Button("Warning Notification", new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
event.getButton()
- .getWindow()
- .showNotification((String) title.getValue(),
- (String) message.getValue(),
+ .getRoot()
+ .showNotification(title.getValue(), message.getValue(),
Notification.TYPE_WARNING_MESSAGE);
}
});
l.addComponent(show);
- l.addComponent(new Label("Error", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Error", ContentMode.XHTML));
show = new Button("Error Notification", new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
event.getButton()
- .getWindow()
- .showNotification((String) title.getValue(),
- (String) message.getValue(),
+ .getRoot()
+ .showNotification(title.getValue(), message.getValue(),
Notification.TYPE_ERROR_MESSAGE);
}
});
l.addComponent(show);
- l.addComponent(new Label("Tray", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Tray", ContentMode.XHTML));
show = new Button("Tray Notification", new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
event.getButton()
- .getWindow()
- .showNotification((String) title.getValue(),
- (String) message.getValue(),
+ .getRoot()
+ .showNotification(title.getValue(), message.getValue(),
Notification.TYPE_TRAY_NOTIFICATION);
}
diff --git a/tests/testbench/com/vaadin/tests/layouts/CaptionsInLayouts.java b/tests/testbench/com/vaadin/tests/layouts/CaptionsInLayouts.java
index 7ad433e5c9..4388639893 100644
--- a/tests/testbench/com/vaadin/tests/layouts/CaptionsInLayouts.java
+++ b/tests/testbench/com/vaadin/tests/layouts/CaptionsInLayouts.java
@@ -37,7 +37,7 @@ public class CaptionsInLayouts extends TestBase {
private HorizontalLayout horizontalLayout;
private GridLayout gridLayout;
private FormLayout formLayout;
- private List<AbstractField> components = new ArrayList<AbstractField>();
+ private List<AbstractField<?>> components = new ArrayList<AbstractField<?>>();
private CssLayout cssLayout;
private HorizontalLayout layoutParent = new HorizontalLayout();
@@ -69,7 +69,7 @@ public class CaptionsInLayouts extends TestBase {
}
protected void prependCaptions(String prepend) {
- for (AbstractField c : components) {
+ for (AbstractField<?> c : components) {
c.setCaption(prepend + c.getCaption());
}
@@ -102,14 +102,14 @@ public class CaptionsInLayouts extends TestBase {
}
protected void setRequired(boolean value) {
- for (AbstractField c : components) {
+ for (AbstractField<?> c : components) {
c.setRequired(value);
}
}
protected void setIcon(boolean value) {
- for (AbstractField c : components) {
+ for (AbstractField<?> c : components) {
if (!value) {
c.setIcon(null);
} else {
@@ -133,7 +133,7 @@ public class CaptionsInLayouts extends TestBase {
}
protected void setError(boolean value) {
- for (AbstractField c : components) {
+ for (AbstractField<?> c : components) {
if (value) {
c.setComponentError(new UserError("error"));
} else {
diff --git a/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java b/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java
index 87b04ffcb0..f1e05b6fee 100644
--- a/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java
+++ b/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java
@@ -4,9 +4,9 @@ import com.vaadin.terminal.Sizeable;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class ComplexGLColumnExpansionWithColSpan extends AbstractTestCase {
private int cols;
@@ -29,7 +29,7 @@ public class ComplexGLColumnExpansionWithColSpan extends AbstractTestCase {
mainLayout.setMargin(true);
mainLayout.setHeight(100, Sizeable.UNITS_PERCENTAGE);
mainLayout.setWidth(100, Sizeable.UNITS_PERCENTAGE);
- setMainWindow(new Window("Vaadin Test", mainLayout));
+ setMainWindow(new LegacyWindow("Vaadin Test", mainLayout));
cols = 1;
final GridLayout gl = new GridLayout(cols, 3);
@@ -71,7 +71,7 @@ public class ComplexGLColumnExpansionWithColSpan extends AbstractTestCase {
mainLayout.addComponent(restart);
restart.addListener(new Button.ClickListener() {
public void buttonClick(Button.ClickEvent event) {
- mainLayout.getWindow().getApplication().close();
+ mainLayout.getRoot().getApplication().close();
}
});
diff --git a/tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponent.html b/tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponent.html
index 0c4c3ad12c..0932be5d81 100644
--- a/tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponent.html
+++ b/tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponent.html
@@ -22,14 +22,9 @@
<td></td>
</tr>
<tr>
- <td>verifyTextPresent</td>
- <td>Caption2</td>
- <td></td>
-</tr>
-<tr>
- <td>verifyTextNotPresent</td>
- <td>Caption1</td>
+ <td>screenCapture</td>
<td></td>
+ <td>caption1-hidden</td>
</tr>
</tbody></table>
diff --git a/tests/testbench/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java b/tests/testbench/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java
index e29c7559b3..7fc33edfc7 100644
--- a/tests/testbench/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java
+++ b/tests/testbench/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java
@@ -1,15 +1,15 @@
package com.vaadin.tests.layouts;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.FormLayout;
-import com.vaadin.ui.TextField;
+import com.vaadin.ui.TextArea;
public class FormLayoutWithInvisibleComponent extends TestBase {
- private TextField messages;
+ private TextArea messages;
@Override
protected String getDescription() {
@@ -24,19 +24,20 @@ public class FormLayoutWithInvisibleComponent extends TestBase {
@Override
protected void setup() {
FormLayout formLayout = new FormLayout();
- CheckBox control = new CheckBox("Messages On/Off",
- new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- messages.setVisible(event.getButton().booleanValue());
- messages.setRequired(true);
- messages.setCaption("Messages visible");
- }
-
- });
+ CheckBox control = new CheckBox("Messages On/Off");
+ control.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ messages.setVisible((Boolean) event.getProperty().getValue());
+ messages.setRequired(true);
+ messages.setCaption("Messages visible");
+ }
+
+ });
control.setImmediate(true);
formLayout.addComponent(control);
- messages = new TextField("Messages hidden");
+ messages = new TextArea("Messages hidden");
messages.setRows(10);
messages.setColumns(40);
messages.setVisible(false);
diff --git a/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java b/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java
index 08df953e66..987152f529 100644
--- a/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java
+++ b/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java
@@ -14,9 +14,9 @@ import com.vaadin.ui.Form;
import com.vaadin.ui.FormFieldFactory;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class GridLayoutCaptions extends TestBase {
@@ -27,31 +27,31 @@ public class GridLayoutCaptions extends TestBase {
private CssLayout wrapper2 = new CssLayout();
private FormFieldFactory fff = new FormFieldFactory() {
- public Field createField(Item item, Object propertyId,
+ public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
if (propertyId.equals(DataPOJO.Fields.name.name())) {
- Field f = DefaultFieldFactory.get().createField(item,
+ Field<?> f = DefaultFieldFactory.get().createField(item,
propertyId, uiContext);
f.setCaption("This is a long caption for the name field");
return f;
} else if (propertyId.equals(DataPOJO.Fields.hp.name())) {
- Field f = DefaultFieldFactory.get().createField(item,
+ Field<?> f = DefaultFieldFactory.get().createField(item,
propertyId, uiContext);
f.setCaption("This is a long caption for the HP field, but it has a VL as a wrapper");
return f;
} else if (propertyId.equals(DataPOJO.Fields.place.name())) {
- Field f = DefaultFieldFactory.get().createField(item,
+ Field<?> f = DefaultFieldFactory.get().createField(item,
propertyId, uiContext);
f.setCaption("This is a long caption for the Place field, but it has a CSSLo as a wrapper");
return f;
} else if (propertyId.equals(DataPOJO.Fields.price.name())) {
- Field f = DefaultFieldFactory.get().createField(item,
+ Field<?> f = DefaultFieldFactory.get().createField(item,
propertyId, uiContext);
f.setCaption("With size undefined the caption behaves like this...");
f.setSizeFull();
@@ -174,7 +174,8 @@ public class GridLayoutCaptions extends TestBase {
@Override
protected void setup() {
- Window mainWindow = new Window("Formlayoutcaptionboom Application");
+ LegacyWindow mainWindow = new LegacyWindow(
+ "Formlayoutcaptionboom Application");
Label label = new Label("Hello Vaadin user");
mainWindow.addComponent(label);
setMainWindow(mainWindow);
diff --git a/tests/testbench/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java b/tests/testbench/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java
index e9d206009a..f7f4ac2d4c 100644
--- a/tests/testbench/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java
+++ b/tests/testbench/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java
@@ -6,9 +6,9 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class GridLayoutExpandRatioModification extends TestBase implements
ClickListener {
@@ -21,7 +21,7 @@ public class GridLayoutExpandRatioModification extends TestBase implements
@Override
public void setup() {
- Window main = new Window("The Main Window");
+ LegacyWindow main = new LegacyWindow("The Main Window");
mainLayout = new GridLayout(3, 3);
main.setContent(mainLayout);
setMainWindow(main);
diff --git a/tests/testbench/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java b/tests/testbench/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java
index 8fb42948fc..d6ea84e44e 100644
--- a/tests/testbench/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java
+++ b/tests/testbench/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java
@@ -4,15 +4,15 @@ import com.vaadin.Application;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class GridLayoutInsidePanel2 extends Application {
+public class GridLayoutInsidePanel2 extends Application.LegacyApplication {
private Layout layout;
@Override
public void init() {
- Window w = new Window("Main");
+ LegacyWindow w = new LegacyWindow("Main");
setMainWindow(w);
layout = (Layout) w.getContent();
GridLayout gl = new GridLayout(1, 1);
diff --git a/tests/testbench/com/vaadin/tests/layouts/HiddenHorizontalLayout.java b/tests/testbench/com/vaadin/tests/layouts/HiddenHorizontalLayout.java
index 8de59ccf00..a8f44a5771 100644
--- a/tests/testbench/com/vaadin/tests/layouts/HiddenHorizontalLayout.java
+++ b/tests/testbench/com/vaadin/tests/layouts/HiddenHorizontalLayout.java
@@ -5,6 +5,7 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.VerticalLayout;
public class HiddenHorizontalLayout extends TestBase {
@@ -41,7 +42,7 @@ public class HiddenHorizontalLayout extends TestBase {
+ "3. Click \"toggle layout visibility\"<br>"
+ "4. Resize browser window to full <br/>"
+ "5. Click \"toggle layout visibility\"<br/>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
vl.addComponent(l);
Button b = new Button("toggle layout visibility",
new Button.ClickListener() {
diff --git a/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.html b/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.html
index 22d81ce11f..5a59bfd784 100644
--- a/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.html
+++ b/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.html
@@ -17,6 +17,11 @@
<td></td>
</tr>
<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.AbsoluteLayout</td>
+</tr>
+<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VAbsoluteLayout[0]/VAbsoluteLayout$AbsoluteWrapper[0]/VLabel[0]</td>
<td>Label inside the component container</td>
@@ -53,6 +58,11 @@
<td>199,6</td>
</tr>
<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.Accordion</td>
+</tr>
+<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VAccordion[0]/VAccordion$StackItem[0]/VLabel[0]</td>
<td>Label inside the component container</td>
@@ -89,6 +99,11 @@
<td>186,11</td>
</tr>
<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.CssLayout</td>
+</tr>
+<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VCssLayout[0]/VCssLayout$FlowPane[0]/VLabel[0]</td>
<td>Label inside the component container</td>
@@ -125,40 +140,9 @@
<td>199,10</td>
</tr>
<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VOrderedLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
- <td>Label inside the component container</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VLabel[0]</td>
- <td>Label outside the component container</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VOrderedLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
- <td>Label inside the component container</td>
-</tr>
-<!--Next component container-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[1]</td>
- <td>14,5</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item4</td>
- <td>199,10</td>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.FormLayout</td>
</tr>
<tr>
<td>assertText</td>
@@ -193,10 +177,15 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item5</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item4</td>
<td>199,10</td>
</tr>
<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.GridLayout</td>
+</tr>
+<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VLabel[0]</td>
<td>Label inside the component container</td>
@@ -229,10 +218,15 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item6</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item5</td>
<td>199,10</td>
</tr>
<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.HorizontalLayout</td>
+</tr>
+<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
<td>Label inside the component container</td>
@@ -265,10 +259,15 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item7</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item6</td>
<td>199,10</td>
</tr>
<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.HorizontalSplitPanel</td>
+</tr>
+<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VSplitPanelHorizontal[0]/VLabel[0]</td>
<td>Label inside the component container</td>
@@ -301,44 +300,13 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item8</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item7</td>
<td>199,10</td>
</tr>
<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VOrderedLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
- <td>Label inside the component container</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VLabel[0]</td>
- <td>Label outside the component container</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VOrderedLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
- <td>Label inside the component container</td>
-</tr>
-<!--Next component container-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[1]</td>
- <td>14,5</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item9</td>
- <td>199,10</td>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.Panel</td>
</tr>
<tr>
<td>assertText</td>
@@ -373,44 +341,13 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item10</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item9</td>
<td>199,10</td>
</tr>
<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VSplitPanelVertical[0]/VLabel[0]</td>
- <td>Label inside the component container</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VLabel[0]</td>
- <td>Label outside the component container</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VSplitPanelVertical[0]/VLabel[0]</td>
- <td>Label inside the component container</td>
-</tr>
-<!--Next component container-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[1]</td>
- <td>14,5</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item11</td>
- <td>199,10</td>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.TabSheet</td>
</tr>
<tr>
<td>assertText</td>
@@ -445,10 +382,15 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item12</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item10</td>
<td>199,10</td>
</tr>
<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.VerticalLayout</td>
+</tr>
+<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
<td>Label inside the component container</td>
@@ -481,10 +423,15 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item13</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item11</td>
<td>199,10</td>
</tr>
<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.VerticalSplitPanel</td>
+</tr>
+<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VSplitPanelVertical[0]/VLabel[0]</td>
<td>Label inside the component container</td>
diff --git a/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java b/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java
index d21ecdd575..bf5de2976f 100644
--- a/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java
+++ b/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java
@@ -14,6 +14,7 @@ import com.vaadin.ui.CustomLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.LoginForm;
import com.vaadin.ui.PopupView;
+import com.vaadin.ui.Root;
import com.vaadin.ui.Window;
public class MovingComponentsWhileOldParentInvisible extends TestBase {
@@ -43,7 +44,8 @@ public class MovingComponentsWhileOldParentInvisible extends TestBase {
.getComponentContainers()) {
if (cls == LoginForm.class || cls == CustomLayout.class
|| CustomComponent.class.isAssignableFrom(cls)
- || cls == PopupView.class || cls == Window.class) {
+ || cls == PopupView.class || cls == Window.class
+ || cls == Root.class) {
// Does not support addComponent
continue;
}
diff --git a/tests/testbench/com/vaadin/tests/layouts/TestAbsoluteLayout.java b/tests/testbench/com/vaadin/tests/layouts/TestAbsoluteLayout.java
index 9a98cd17bd..2f0f16b4a5 100644
--- a/tests/testbench/com/vaadin/tests/layouts/TestAbsoluteLayout.java
+++ b/tests/testbench/com/vaadin/tests/layouts/TestAbsoluteLayout.java
@@ -33,7 +33,7 @@ public class TestAbsoluteLayout extends TestBase {
private static class MFieldFactory extends DefaultFieldFactory {
@Override
- public Field createField(Item item, Object propertyId,
+ public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
if (propertyId.equals("CSSString")) {
TextArea f = new TextArea();
@@ -47,10 +47,10 @@ public class TestAbsoluteLayout extends TestBase {
s.addContainerProperty("caption", String.class, "");
s.setItemCaptionPropertyId("caption");
s.setNullSelectionAllowed(false);
- for (int i = 0; i < Layout.UNIT_SYMBOLS.length; i++) {
+ for (int i = 0; i < Layout.Unit.values().length; i++) {
Item unitItem = s.addItem(i);
unitItem.getItemProperty("caption").setValue(
- Layout.UNIT_SYMBOLS[i]);
+ Layout.Unit.values()[i]);
}
return s;
}
@@ -155,7 +155,8 @@ public class TestAbsoluteLayout extends TestBase {
+ getDebugId();
if (next instanceof Property) {
- caption += " value:" + ((Property) next).getValue();
+ caption += " value:"
+ + ((Property<?>) next).getValue();
}
item.getItemProperty("caption").setValue(caption);
diff --git a/tests/testbench/com/vaadin/tests/layouts/TestLayoutClickListeners.java b/tests/testbench/com/vaadin/tests/layouts/TestLayoutClickListeners.java
index 93c51d6b4a..619e4581fa 100644
--- a/tests/testbench/com/vaadin/tests/layouts/TestLayoutClickListeners.java
+++ b/tests/testbench/com/vaadin/tests/layouts/TestLayoutClickListeners.java
@@ -13,9 +13,10 @@ import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class TestLayoutClickListeners extends AbstractTestCase {
@@ -23,7 +24,7 @@ public class TestLayoutClickListeners extends AbstractTestCase {
@Override
public void init() {
- Window w = new Window("main window");
+ LegacyWindow w = new LegacyWindow("main window");
setMainWindow(w);
setTheme("tests-tickets");
@@ -117,7 +118,7 @@ public class TestLayoutClickListeners extends AbstractTestCase {
gl.setStyleName("borders");
gl.setSpacing(true);
addContent(gl, 4);
- TextField largeTextarea = new TextField("Large textarea");
+ TextArea largeTextarea = new TextArea("Large textarea");
largeTextarea.setWidth("100%");
largeTextarea.setHeight("99%");
gl.addComponent(largeTextarea, 0, 3, 3, 3);
diff --git a/tests/testbench/com/vaadin/tests/layouts/TestLayoutPerformance.java b/tests/testbench/com/vaadin/tests/layouts/TestLayoutPerformance.java
index c7cf89e8b6..a5e2048066 100644
--- a/tests/testbench/com/vaadin/tests/layouts/TestLayoutPerformance.java
+++ b/tests/testbench/com/vaadin/tests/layouts/TestLayoutPerformance.java
@@ -9,6 +9,7 @@ import com.vaadin.ui.Component;
import com.vaadin.ui.CssLayout;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Layout;
import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.TextField;
@@ -33,12 +34,12 @@ public class TestLayoutPerformance extends TestBase {
@Override
protected void setup() {
Label label = new Label("<h1>CssLayout performance test.</h1>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
getLayout().addComponent(label);
label = new Label(
"<em>Hint</em>. Use debug dialog to measure rendering times TODO: extend with size settings (to both layout and content).",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
getLayout().addComponent(label);
ns = new NativeSelect("Select component to test");
@@ -65,11 +66,11 @@ public class TestLayoutPerformance extends TestBase {
b.addListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- int components = Integer.parseInt((String) n.getValue());
+ int components = Integer.parseInt(n.getValue());
Layout layout = getCurrentLayout();
for (int i = 0; i < components; i++) {
Component component = newTestComponent();
- if (cb.booleanValue()) {
+ if (cb.getValue()) {
component.setCaption("caption " + i);
}
layout.addComponent(component);
diff --git a/tests/testbench/com/vaadin/tests/layouts/TreeWithBordersInLayout.java b/tests/testbench/com/vaadin/tests/layouts/TreeWithBordersInLayout.java
index bce30f8fea..8d506e0884 100644
--- a/tests/testbench/com/vaadin/tests/layouts/TreeWithBordersInLayout.java
+++ b/tests/testbench/com/vaadin/tests/layouts/TreeWithBordersInLayout.java
@@ -2,9 +2,9 @@ package com.vaadin.tests.layouts;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class TreeWithBordersInLayout extends AbstractTestCase {
@@ -14,7 +14,7 @@ public class TreeWithBordersInLayout extends AbstractTestCase {
public void init() {
Layout mainLayout = new VerticalLayout();
mainLayout.setSizeUndefined();
- setMainWindow(new Window("main window", mainLayout));
+ setMainWindow(new LegacyWindow("main window", mainLayout));
setTheme("tests-tickets");
diff --git a/tests/testbench/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java b/tests/testbench/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java
index e2c02a629b..d41b288e03 100644
--- a/tests/testbench/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java
+++ b/tests/testbench/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java
@@ -5,9 +5,9 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class VerticalLayoutExpandRatioModification extends TestBase implements
ClickListener {
@@ -20,7 +20,7 @@ public class VerticalLayoutExpandRatioModification extends TestBase implements
@Override
public void setup() {
- Window main = new Window("The Main Window");
+ LegacyWindow main = new LegacyWindow("The Main Window");
mainLayout = new VerticalLayout();
main.setContent(mainLayout);
setMainWindow(main);
diff --git a/tests/testbench/com/vaadin/tests/layouts/WidgetImplementationSwap.html b/tests/testbench/com/vaadin/tests/layouts/WidgetImplementationSwap.html
deleted file mode 100644
index c335f5df5a..0000000000
--- a/tests/testbench/com/vaadin/tests/layouts/WidgetImplementationSwap.html
+++ /dev/null
@@ -1,182 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link rel="selenium.base" href="" />
-<title>New Test</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">New Test</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/run/com.vaadin.tests.layouts.WidgetImplementationSwap?restartApplication</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPresent</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VAbsoluteLayout[0]/VAbsoluteLayout$AbsoluteWrapper[0]/VTextArea[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPresent</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VTextArea[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPresent</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VHorizontalLayout[0]/ChildComponentContainer[0]/VTextArea[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VButton[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VButton[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPresent</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VTextArea[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[9]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[9]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPresent</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[8]/VCssLayout[0]/VCssLayout$FlowPane[0]/VTextArea[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-
-</tbody></table>
-</body>
-</html>
diff --git a/tests/testbench/com/vaadin/tests/layouts/WidgetImplementationSwap.java b/tests/testbench/com/vaadin/tests/layouts/WidgetImplementationSwap.java
deleted file mode 100644
index 283e9f7a54..0000000000
--- a/tests/testbench/com/vaadin/tests/layouts/WidgetImplementationSwap.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package com.vaadin.tests.layouts;
-
-import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.AbsoluteLayout;
-import com.vaadin.ui.AbstractLayout;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.CssLayout;
-import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("deprecation")
-public class WidgetImplementationSwap extends TestBase {
-
- @Override
- protected void setup() {
- setTheme("tests-tickets");
-
- {
- final AbstractLayout layout = new AbsoluteLayout();
- layout.setCaption(layout.getClass().getSimpleName());
- layout.setStyleName("borders");
- layout.setWidth("500px");
- layout.setHeight("50px");
- addComponent(layout);
- final TextField tf = new TextField();
- layout.addComponent(tf);
- Button b = new Button("-> TextArea", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (tf.getRows() == 0) {
- tf.setRows(3);
- event.getButton().setCaption("Move");
- } else {
- layout.setCaption(layout.getClass().getSimpleName()
- + " done");
- event.getButton().setCaption("done");
- }
-
- }
- });
- addComponent(b);
- }
- {
- final AbstractLayout layout = new VerticalLayout();
- layout.setCaption(layout.getClass().getSimpleName());
- layout.setStyleName("borders");
- layout.setWidth("500px");
- layout.setHeight("50px");
- addComponent(layout);
- final TextField tf = new TextField();
- layout.addComponent(tf);
- Button b = new Button("-> TextArea", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (tf.getRows() == 0) {
- tf.setRows(3);
- event.getButton().setCaption("Move");
- } else {
- layout.setCaption(layout.getClass().getSimpleName()
- + " done");
- event.getButton().setCaption("done");
- }
-
- }
- });
- addComponent(b);
- }
-
- {
- final AbstractLayout layout = new HorizontalLayout();
- layout.setCaption(layout.getClass().getSimpleName());
- layout.setStyleName("borders");
- layout.setWidth("500px");
- layout.setHeight("50px");
- addComponent(layout);
- final TextField tf = new TextField();
- layout.addComponent(tf);
- Button b = new Button("-> TextArea", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (tf.getRows() == 0) {
- tf.setRows(3);
- event.getButton().setCaption("Move");
- } else {
- layout.setCaption(layout.getClass().getSimpleName()
- + " done");
- event.getButton().setCaption("done");
- }
-
- }
- });
- addComponent(b);
- }
-
- {
- final AbstractLayout layout = new GridLayout();
- layout.setCaption(layout.getClass().getSimpleName());
- layout.setStyleName("borders");
- layout.setWidth("500px");
- layout.setHeight("50px");
- addComponent(layout);
- final TextField tf = new TextField();
- layout.addComponent(tf);
- Button b = new Button("-> TextArea", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (tf.getRows() == 0) {
- tf.setRows(3);
- event.getButton().setCaption("Move");
- } else {
- layout.setCaption(layout.getClass().getSimpleName()
- + " done");
- event.getButton().setCaption("done");
- }
-
- }
- });
- addComponent(b);
- }
-
- {
- final AbstractLayout layout = new CssLayout();
- layout.setCaption(layout.getClass().getSimpleName());
- layout.setStyleName("borders");
- layout.setWidth("500px");
- layout.setHeight("50px");
- addComponent(layout);
- final TextField tf = new TextField();
- layout.addComponent(tf);
- Button b = new Button("-> TextArea", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (tf.getRows() == 0) {
- tf.setRows(3);
- event.getButton().setCaption("Move");
- } else {
- layout.setCaption(layout.getClass().getSimpleName()
- + " done");
- event.getButton().setCaption("done");
- }
-
- }
- });
- addComponent(b);
- }
-
- }
-
- @Override
- protected String getDescription() {
- return "First click turns TextField into a TextArea (on the client); second click modifies the layout - widget should still be a TextArea.";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return 5457;
- }
-
-}
diff --git a/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java b/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java
index 2b006fbfca..73211bb96d 100644
--- a/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java
+++ b/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java
@@ -510,17 +510,17 @@ public class GridLayoutTests extends AbstractLayoutTests {
glo.replaceComponent(row2, row2 = new NativeSelect());
glo.replaceComponent(row3, row3 = getTestTabsheet());
- ((AbstractField) col1).setRequired(true);
- ((AbstractField) col1).setValidationVisible(true);
- ((AbstractField) col1).setRequiredError("required error");
+ ((AbstractField<?>) col1).setRequired(true);
+ ((AbstractField<?>) col1).setValidationVisible(true);
+ ((AbstractField<?>) col1).setRequiredError("required error");
- ((AbstractField) row1).setRequired(true);
- ((AbstractField) row1).setValidationVisible(true);
- ((AbstractField) row1).setRequiredError("required error");
+ ((AbstractField<?>) row1).setRequired(true);
+ ((AbstractField<?>) row1).setValidationVisible(true);
+ ((AbstractField<?>) row1).setRequiredError("required error");
- ((AbstractField) row2).setRequired(true);
- ((AbstractField) row2).setValidationVisible(true);
- ((AbstractField) row2).setRequiredError("required error");
+ ((AbstractField<?>) row2).setRequired(true);
+ ((AbstractField<?>) row2).setValidationVisible(true);
+ ((AbstractField<?>) row2).setRequiredError("required error");
row2.setComponentError(new UserError("component error, user error"));
row3.setComponentError(new UserError("component error, user error"));
diff --git a/tests/testbench/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java b/tests/testbench/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java
index caebbc8532..920c9ec819 100644
--- a/tests/testbench/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java
+++ b/tests/testbench/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java
@@ -14,6 +14,7 @@ import com.vaadin.ui.CheckBox;
import com.vaadin.ui.DateField;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Link;
import com.vaadin.ui.Select;
@@ -114,7 +115,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
final AbstractComponent c1 = new Button("BUTTON");
final AbstractComponent c2 = new Label("<b>LABEL</b>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
final AbstractComponent c3 = new Table("TABLE");
c3.setHeight("100px");
c3.setWidth("100%");
@@ -489,7 +490,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
components[3] = getTestTabsheet();
components[3].setIcon(new ThemeResource(LOCK_16_PNG));
- AbstractField[] fields = new AbstractField[5];
+ AbstractField<?>[] fields = new AbstractField<?>[5];
fields[0] = new TextField();
fields[0].setRequired(true);
fields[0].setValidationVisible(true);
diff --git a/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.html b/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.html
index b0e2444986..4bc409b881 100644
--- a/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.html
+++ b/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.html
@@ -316,12 +316,6 @@
<td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]</td>
<td></td>
</tr>
-<!-- Only for IE6 so it has time to load images and adjust -->
-<tr>
- <td>pause</td>
- <td>2000</td>
- <td></td>
-</tr>
<tr>
<td>screenCapture</td>
<td></td>
diff --git a/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.java b/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.java
index 6f73a42497..6a524cd024 100644
--- a/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.java
+++ b/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.java
@@ -11,8 +11,8 @@ import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Layout;
import com.vaadin.ui.NativeSelect;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
import com.vaadin.ui.themes.Reindeer;
@SuppressWarnings("serial")
@@ -22,12 +22,12 @@ public class LayoutTesterApplication extends AbstractTestCase {
private int layoutCount = 1;
private Method[] layoutGetters;
- private Window mainWindow;
+ private LegacyWindow mainWindow;
private NativeSelect layoutSelector;
@Override
public void init() {
- mainWindow = new Window("LayoutTesterApplication");
+ mainWindow = new LegacyWindow("LayoutTesterApplication");
setMainWindow(mainWindow);
loadLayoutGetters();
nextLaytout();
diff --git a/tests/testbench/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java b/tests/testbench/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java
index 941dfcd877..dd40726ec2 100644
--- a/tests/testbench/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java
+++ b/tests/testbench/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java
@@ -14,6 +14,7 @@ import com.vaadin.ui.CheckBox;
import com.vaadin.ui.DateField;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Link;
import com.vaadin.ui.NativeSelect;
@@ -46,7 +47,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
((TextField) components[i]).setValue("FIELD " + i);
vlo.addComponent(components[i]);
vlo.setComponentAlignment(components[i], alignments[i]);
- vlo.addComponent(new Label("<hr />", Label.CONTENT_XHTML));
+ vlo.addComponent(new Label("<hr />", ContentMode.XHTML));
}
baseLayout.addComponent(vlo);
vlo = getTestLaytout();
@@ -55,7 +56,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
((TextField) components[i]).setValue("FIELD " + i);
vlo.addComponent(components[i]);
vlo.setComponentAlignment(components[i], alignments[i]);
- vlo.addComponent(new Label("<hr />", Label.CONTENT_XHTML));
+ vlo.addComponent(new Label("<hr />", ContentMode.XHTML));
}
baseLayout.addComponent(vlo);
return baseLayout;
@@ -115,7 +116,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
final AbstractComponent c1 = new Button("BUTTON");
final AbstractComponent c2 = new Label("<b>LABEL</b>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
final AbstractComponent c3 = new Table("TABLE");
c3.setHeight("100px");
c3.setWidth("100%");
@@ -268,7 +269,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
button4.setEnabled(false);
vlo2.addComponent(c1);
- vlo2.addComponent(new Label("<hr />", Label.CONTENT_XHTML));
+ vlo2.addComponent(new Label("<hr />", ContentMode.XHTML));
vlo2.addComponent(c2);
vlo2.setExpandRatio(c1, 0.5f);
vlo2.setExpandRatio(c2, 0.5f);
@@ -453,7 +454,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
final VerticalLayout vlo2 = getTestLaytout();
vlo2.addComponent(c1);
- vlo2.addComponent(new Label("<hr />", Label.CONTENT_XHTML));
+ vlo2.addComponent(new Label("<hr />", ContentMode.XHTML));
vlo2.addComponent(c2);
vlo2.setExpandRatio(c1, 0.5f);
vlo2.setExpandRatio(c2, 0.5f);
@@ -510,7 +511,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
components[3] = getTestTabsheet();
components[3].setIcon(new ThemeResource(LOCK_16_PNG));
- AbstractField[] fields = new AbstractField[6];
+ AbstractField<?>[] fields = new AbstractField<?>[6];
fields[0] = new TextField();
fields[0].setRequired(true);
fields[0].setValidationVisible(true);
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/CustomConverterFactoryRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/CustomConverterFactoryRoot.java
new file mode 100644
index 0000000000..de32a817a1
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/CustomConverterFactoryRoot.java
@@ -0,0 +1,33 @@
+package com.vaadin.tests.minitutorials;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.TextField;
+
+public class CustomConverterFactoryRoot extends AbstractTestRoot {
+ @Override
+ public void setup(WrappedRequest request) {
+ getApplication().setConverterFactory(new MyConverterFactory());
+
+ TextField tf = new TextField("This is my double field");
+ tf.setImmediate(true);
+ tf.setConverter(Double.class);
+ addComponent(tf);
+
+ // As we do not set the locale explicitly for the field we set the value
+ // after the field has been attached so it uses the application locale
+ // for conversion
+ tf.setConvertedValue(50.1);
+
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Mini tutorial for https://vaadin.com/wiki/-/wiki/Main/Changing%20the%20default%20converters%20for%20an%20application";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/DynamicImageRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/DynamicImageRoot.java
new file mode 100644
index 0000000000..a0e6a54c41
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/DynamicImageRoot.java
@@ -0,0 +1,79 @@
+package com.vaadin.tests.minitutorials;
+
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.imageio.ImageIO;
+
+import com.vaadin.Application;
+import com.vaadin.terminal.ExternalResource;
+import com.vaadin.terminal.RequestHandler;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.terminal.WrappedResponse;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Embedded;
+
+public class DynamicImageRoot extends AbstractTestRoot {
+
+ @Override
+ public void setup(WrappedRequest request) {
+ // Add the request handler that handles our dynamic image
+ getApplication().addRequestHandler(new DynamicImageRequestHandler());
+
+ // Create a URL that we can handle in DynamicImageRequestHandler
+ URL imageUrl;
+ try {
+ imageUrl = new URL(getApplication().getURL(),
+ DynamicImageRequestHandler.IMAGE_URL + "?text=Hello!");
+ } catch (MalformedURLException e) {
+ // This should never happen
+ throw new RuntimeException(e);
+ }
+
+ // Add an embedded using the created URL
+ Embedded embedded = new Embedded("A dynamically generated image",
+ new ExternalResource(imageUrl));
+ embedded.setType(Embedded.TYPE_IMAGE);
+ getContent().addComponent(embedded);
+
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Mini tutorial for https://vaadin.com/wiki/-/wiki/Main/Generating%20dynamic%20resources%20based%20on%20URI%20or%20parameters";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+}
+
+class DynamicImageRequestHandler implements RequestHandler {
+
+ public static final String IMAGE_URL = "myimage.png";
+
+ public boolean handleRequest(Application application,
+ WrappedRequest request, WrappedResponse response)
+ throws IOException {
+ String pathInfo = request.getRequestPathInfo();
+ if (("/" + IMAGE_URL).equals(pathInfo)) {
+ // Create an image, draw the "text" parameter to it and output it to
+ // the browser.
+ String text = request.getParameter("text");
+ BufferedImage bi = new BufferedImage(100, 30,
+ BufferedImage.TYPE_3BYTE_BGR);
+ bi.getGraphics().drawChars(text.toCharArray(), 0, text.length(),
+ 10, 20);
+ response.setContentType("image/png");
+ ImageIO.write(bi, "png", response.getOutputStream());
+
+ return true;
+ }
+ // If the URL did not match our image URL, let the other request
+ // handlers handle it
+ return false;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/FormUsingExistingLayout.java b/tests/testbench/com/vaadin/tests/minitutorials/FormUsingExistingLayout.java
new file mode 100644
index 0000000000..9d20867d24
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/FormUsingExistingLayout.java
@@ -0,0 +1,98 @@
+package com.vaadin.tests.minitutorials;
+
+import com.vaadin.data.fieldgroup.FieldGroup;
+import com.vaadin.data.fieldgroup.PropertyId;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.TextArea;
+import com.vaadin.ui.TextField;
+
+public class FormUsingExistingLayout extends AbstractTestRoot {
+
+ public static class Notice {
+ String firstName;
+ String lastName;
+ String message;
+
+ public Notice(String firstName, String lastName, String message) {
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.message = message;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ }
+
+ public static class MyFormLayout extends GridLayout {
+ private TextField firstName = new TextField("First name");
+ private TextField lastName = new TextField("Last name");
+
+ // The name of the property is by default the name of the member field,
+ // but it can be redefined with the @PropertyId annotation
+ @PropertyId("message")
+ private TextArea messageField = new TextArea("Your message");
+
+ public MyFormLayout() {
+ // Set up the GridLayout
+ super(2, 3);
+ setSpacing(true);
+
+ // Add the (currently unbound) fields
+ addComponent(firstName);
+ addComponent(lastName);
+
+ addComponent(messageField, 0, 1, 1, 1);
+ messageField.setWidth("100%");
+ }
+
+ }
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ // Create the layout
+ MyFormLayout myFormLayout = new MyFormLayout();
+
+ // Create a field group and use it to bind the fields in the layout
+ FieldGroup fieldGroup = new FieldGroup(new BeanItem<Notice>(new Notice(
+ "John", "Doe", "")));
+ fieldGroup.bindMemberFields(myFormLayout);
+
+ addComponent(myFormLayout);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Mini tutorial for https://vaadin.com/wiki/-/wiki/Main/Creating%20a%20form%20using%20an%20existing%20layout";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/FormatTableValue.java b/tests/testbench/com/vaadin/tests/minitutorials/FormatTableValue.java
new file mode 100644
index 0000000000..aba1447d2c
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/FormatTableValue.java
@@ -0,0 +1,60 @@
+package com.vaadin.tests.minitutorials;
+
+import java.text.NumberFormat;
+import java.util.Locale;
+
+import com.vaadin.data.util.converter.StringToNumberConverter;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Table;
+
+public class FormatTableValue extends AbstractTestRoot {
+
+ private static final String PERCENT_PROPERTY = "percent";
+ private static final String CURRENCY_PROPERTY = "currency";
+ private static final String DEFAULT_PROPERTY = "default";
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ Table table = new Table();
+ table.setLocale(Locale.FRANCE);
+ table.addContainerProperty(PERCENT_PROPERTY, Double.class, 0);
+ table.addContainerProperty(CURRENCY_PROPERTY, Double.class, 0);
+ table.addContainerProperty(DEFAULT_PROPERTY, Double.class, 0);
+
+ Object itemId = table.addItem();
+ table.getItem(itemId).getItemProperty(PERCENT_PROPERTY)
+ .setValue(3.1415);
+ table.getItem(itemId).getItemProperty(CURRENCY_PROPERTY)
+ .setValue(3.1415);
+ table.getItem(itemId).getItemProperty(DEFAULT_PROPERTY)
+ .setValue(3.1415);
+
+ table.setConverter(PERCENT_PROPERTY, new StringToNumberConverter() {
+ @Override
+ protected NumberFormat getFormat(Locale locale) {
+ return NumberFormat.getPercentInstance(locale);
+ }
+ });
+
+ table.setConverter(CURRENCY_PROPERTY, new StringToNumberConverter() {
+ @Override
+ protected NumberFormat getFormat(Locale locale) {
+ return NumberFormat.getCurrencyInstance(locale);
+ }
+ });
+
+ addComponent(table);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Mini tutorial for https://vaadin.com/wiki/-/wiki/Main/Formatting%20data%20in%20Table";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/IntegerTextFieldDataSource.java b/tests/testbench/com/vaadin/tests/minitutorials/IntegerTextFieldDataSource.java
new file mode 100644
index 0000000000..5c0efea3ea
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/IntegerTextFieldDataSource.java
@@ -0,0 +1,69 @@
+package com.vaadin.tests.minitutorials;
+
+import com.vaadin.data.Property;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.TextField;
+
+public class IntegerTextFieldDataSource extends AbstractTestRoot {
+
+ public class MyBean {
+ private int value;
+
+ public int getValue() {
+ return value;
+ }
+
+ public void setValue(int integer) {
+ value = integer;
+ }
+ }
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ final MyBean myBean = new MyBean();
+ BeanItem<MyBean> beanItem = new BeanItem<MyBean>(myBean);
+
+ final Property<Integer> integerProperty = (Property<Integer>) beanItem
+ .getItemProperty("value");
+ final TextField textField = new TextField("Text field", integerProperty);
+
+ Button submitButton = new Button("Submit value", new ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ String uiValue = textField.getValue();
+ Integer propertyValue = integerProperty.getValue();
+ int dataModelValue = myBean.getValue();
+
+ Root.getCurrentRoot().showNotification(
+ "UI value (String): " + uiValue
+ + "<br />Property value (Integer): "
+ + propertyValue
+ + "<br />Data model value (int): "
+ + dataModelValue);
+ }
+ });
+
+ addComponent(new Label("Text field type: " + textField.getType()));
+ addComponent(new Label("Text field type: " + integerProperty.getType()));
+ addComponent(textField);
+ addComponent(submitButton);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Mini tutorial for https://vaadin.com/wiki/-/wiki/Main/Creating%20a%20TextField%20for%20Integer%20only%20input%20using%20a%20data%20source";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/IntegerTextFieldStandalone.java b/tests/testbench/com/vaadin/tests/minitutorials/IntegerTextFieldStandalone.java
new file mode 100644
index 0000000000..45bc49ba72
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/IntegerTextFieldStandalone.java
@@ -0,0 +1,57 @@
+package com.vaadin.tests.minitutorials;
+
+import com.vaadin.data.util.converter.Converter.ConversionException;
+import com.vaadin.data.util.converter.StringToIntegerConverter;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.TextField;
+
+public class IntegerTextFieldStandalone extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ final TextField textField = new TextField("Text field");
+ textField.setConverter(new StringToIntegerConverter());
+
+ Button submitButton = new Button("Submit value", new ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ String uiValue = textField.getValue();
+ try {
+ Integer convertedValue = (Integer) textField
+ .getConvertedValue();
+ Root.getCurrentRoot().showNotification(
+ "UI value (String): " + uiValue
+ + "<br />Converted value (Integer): "
+ + convertedValue);
+ } catch (ConversionException e) {
+ e.printStackTrace();
+ Root.getCurrentRoot().showNotification(
+ "Could not convert value: " + uiValue);
+ }
+ }
+ });
+
+ addComponent(new Label("Text field type: " + textField.getType()));
+ addComponent(new Label("Converterd text field type: "
+ + textField.getConverter().getModelType()));
+ addComponent(textField);
+ addComponent(submitButton);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Mini tutorial for https://vaadin.com/wiki/-/wiki/Main/Creating%20a%20TextField%20for%20Integer%20only%20input%20when%20not%20using%20a%20data%20source";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/MyConverterFactory.java b/tests/testbench/com/vaadin/tests/minitutorials/MyConverterFactory.java
new file mode 100644
index 0000000000..456654e10a
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/MyConverterFactory.java
@@ -0,0 +1,17 @@
+package com.vaadin.tests.minitutorials;
+
+import com.vaadin.data.util.converter.Converter;
+import com.vaadin.data.util.converter.DefaultConverterFactory;
+
+public class MyConverterFactory extends DefaultConverterFactory {
+ @Override
+ protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter(
+ Class<PRESENTATION> presentationType, Class<MODEL> modelType) {
+ // Handle String <-> Double
+ if (presentationType == String.class && modelType == Double.class) {
+ return (Converter<PRESENTATION, MODEL>) new MyStringToDoubleConverter();
+ }
+ // Let default factory handle the rest
+ return super.findConverter(presentationType, modelType);
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/MyStringToDoubleConverter.java b/tests/testbench/com/vaadin/tests/minitutorials/MyStringToDoubleConverter.java
new file mode 100644
index 0000000000..38268bdf68
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/MyStringToDoubleConverter.java
@@ -0,0 +1,18 @@
+package com.vaadin.tests.minitutorials;
+
+import java.text.NumberFormat;
+import java.util.Locale;
+
+import com.vaadin.data.util.converter.StringToDoubleConverter;
+
+public class MyStringToDoubleConverter extends StringToDoubleConverter {
+
+ @Override
+ protected NumberFormat getFormat(Locale locale) {
+ NumberFormat format = super.getFormat(locale);
+ format.setGroupingUsed(false);
+ format.setMaximumFractionDigits(3);
+ format.setMinimumFractionDigits(3);
+ return format;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/StringMyTypeConverter.java b/tests/testbench/com/vaadin/tests/minitutorials/StringMyTypeConverter.java
new file mode 100644
index 0000000000..e28788f743
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/StringMyTypeConverter.java
@@ -0,0 +1,108 @@
+package com.vaadin.tests.minitutorials;
+
+import java.util.Locale;
+
+import com.vaadin.data.util.converter.Converter;
+import com.vaadin.data.util.converter.Converter.ConversionException;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.TextField;
+
+public class StringMyTypeConverter extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ Name name = new Name("Rudolph", "Reindeer");
+
+ final TextField textField = new TextField("Name");
+ textField.setConverter(new StringToNameConverter());
+ textField.setConvertedValue(name);
+
+ addComponent(textField);
+ addComponent(new Button("Submit value", new ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ try {
+ Name name = (Name) textField.getConvertedValue();
+ getRoot().showNotification(
+ "First name: " + name.getFirstName()
+ + "<br />Last name: " + name.getLastName());
+ } catch (ConversionException e) {
+ e.printStackTrace();
+ getRoot().showNotification(e.getCause().getMessage());
+ }
+ }
+ }));
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Mini tutorial for https://vaadin.com/wiki/-/wiki/Main/Creating%20your%20own%20converter%20for%20String%20-%20MyType%20conversion";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
+
+class StringToNameConverter implements Converter<String, Name> {
+ public Name convertToModel(String text, Locale locale)
+ throws ConversionException {
+ if (text == null) {
+ return null;
+ }
+ String[] parts = text.split(" ");
+ if (parts.length != 2) {
+ throw new ConversionException("Can not convert text to a name: "
+ + text);
+ }
+ return new Name(parts[0], parts[1]);
+ }
+
+ public String convertToPresentation(Name name, Locale locale)
+ throws ConversionException {
+ if (name == null) {
+ return null;
+ } else {
+ return name.getFirstName() + " " + name.getLastName();
+ }
+ }
+
+ public Class<Name> getModelType() {
+ return Name.class;
+ }
+
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+}
+
+class Name {
+ private String firstName;
+ private String lastName;
+
+ public Name(String firstName, String lastName) {
+ this.firstName = firstName;
+ this.lastName = lastName;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.html b/tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.html
new file mode 100644
index 0000000000..da050b3aaa
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.html
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="http://localhost:8888/" />
+<title>CloseSubWindow</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">CloseSubWindow</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.requesthandlers.AppResource404?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClickAndWait</td>
+ <td>vaadin=runcomvaadintestsrequesthandlersAppResource404::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLink[0]/domChild[0]/domChild[0]</td>
+ <td>57,3</td>
+</tr>
+<tr>
+ <td>assertTextNotPresent</td>
+ <td>404</td>
+ <td></td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.requesthandlers.AppResource404</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClickAndWait</td>
+ <td>vaadin=runcomvaadintestsrequesthandlersAppResource404::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VLink[0]/domChild[0]/domChild[0]</td>
+ <td>72,9</td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>RequestURI=/run/com.vaadin.tests.requesthandlers.AppResource404/APP/12341234/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.requesthandlers.AppResource404</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsrequesthandlersAppResource404::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClickAndWait</td>
+ <td>vaadin=runcomvaadintestsrequesthandlersAppResource404::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLink[0]/domChild[0]/domChild[0]</td>
+ <td>47,9</td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>RequestURI=/run/com.vaadin.tests.requesthandlers.AppResource404/APP/1//com/vaadin/tests/integration/se.gif</td>
+ <td></td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.java b/tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.java
new file mode 100644
index 0000000000..1d98e35dd5
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.java
@@ -0,0 +1,41 @@
+package com.vaadin.tests.requesthandlers;
+
+import com.vaadin.terminal.ExternalResource;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.integration.FlagSeResource;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Link;
+
+public class AppResource404 extends TestBase {
+
+ @Override
+ protected void setup() {
+ // Add one existing resource
+ final FlagSeResource resource = new FlagSeResource(this);
+ resource.setCacheTime(0);
+ addResource(resource);
+
+ addComponent(new Link("Existing resource", resource));
+ addComponent(new Link("Non-existing resource", new ExternalResource(
+ getURL().toString() + "APP/12341234/")));
+
+ addComponent(new Button("Remove existing resrouce",
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ removeResource(resource);
+ }
+ }));
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Accessing the URL of a resource that has been removed or the URL following the resource URL pattern but not currently mapped to a resource should give a 404 error message";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(6702);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java b/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java
index 9425cd9bd2..cc275c18f4 100644
--- a/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java
+++ b/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java
@@ -1,5 +1,7 @@
package com.vaadin.tests.themes;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.terminal.UserError;
import com.vaadin.ui.Button;
@@ -8,12 +10,13 @@ import com.vaadin.ui.CheckBox;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Layout;
import com.vaadin.ui.NativeButton;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.Root.LegacyWindow;
@SuppressWarnings("serial")
-public class ButtonsTest extends com.vaadin.Application {
+public class ButtonsTest extends com.vaadin.Application.LegacyApplication {
- final Window main = new Window("Button states & themes");
+ final Root.LegacyWindow main = new LegacyWindow("Button states & themes");
CheckBox styleToggle;
CheckBox iconToggle;
@@ -29,8 +32,10 @@ public class ButtonsTest extends com.vaadin.Application {
setMainWindow(main);
setTheme("reindeer");
- themeToggle = new CheckBox("Runo theme", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ themeToggle = new CheckBox("Runo theme");
+ themeToggle.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
if (getTheme() == "reindeer") {
setTheme("runo");
} else {
@@ -41,8 +46,10 @@ public class ButtonsTest extends com.vaadin.Application {
themeToggle.setStyleName("small");
themeToggle.setImmediate(true);
- styleToggle = new CheckBox("Black style", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ styleToggle = new CheckBox("Black style");
+ styleToggle.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
if (!main.getContent().getStyleName().contains("black")) {
main.getContent().setStyleName("black");
} else {
@@ -53,8 +60,10 @@ public class ButtonsTest extends com.vaadin.Application {
styleToggle.setImmediate(true);
styleToggle.setStyleName("small");
- iconToggle = new CheckBox("64x icons", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ iconToggle = new CheckBox("64x icons");
+ iconToggle.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
largeIcons = !largeIcons;
recreateAll();
}
@@ -62,13 +71,14 @@ public class ButtonsTest extends com.vaadin.Application {
iconToggle.setImmediate(true);
iconToggle.setStyleName("small");
- nativeToggle = new CheckBox("Native buttons",
- new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- nativeButtons = !nativeButtons;
- recreateAll();
- }
- });
+ nativeToggle = new CheckBox("Native buttons");
+ nativeToggle.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ nativeButtons = !nativeButtons;
+ recreateAll();
+ }
+ });
nativeToggle.setImmediate(true);
nativeToggle.setStyleName("small");
@@ -155,4 +165,4 @@ public class ButtonsTest extends com.vaadin.Application {
return hl;
}
-} \ No newline at end of file
+}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1225.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1225.java
index 0596fd4d49..92a5e526d1 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1225.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1225.java
@@ -4,23 +4,24 @@ import com.vaadin.Application;
import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
-import com.vaadin.ui.Window;
/**
* With IE7 extra scrollbars appear in content area all though content fits
* properly. Scrollbars will disappear if "shaking" content a bit, like
* selecting tests in area.
*/
-public class Ticket1225 extends Application {
+public class Ticket1225 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window(
+ final LegacyWindow mainWin = new LegacyWindow(
"Test app to break layout fuction in IE7");
setMainWindow(mainWin);
@@ -45,7 +46,7 @@ public class Ticket1225 extends Application {
Label red = new Label(
"<div style='background:red;width:100%;height:100%;'>??</div>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
// red.setCaption("cap");
// red.setSizeFull();
@@ -58,7 +59,7 @@ public class Ticket1225 extends Application {
ts.getTab(red).setCaption("REd tab");
Label l = new Label("<div style='background:blue;'>sdf</div>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
el.addComponent(l);
el.setComponentAlignment(l, Alignment.MIDDLE_RIGHT);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1230.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1230.java
index fd859459c0..7cdbb1300e 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1230.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1230.java
@@ -6,10 +6,10 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Select;
-import com.vaadin.ui.Window;
-public class Ticket1230 extends Application {
+public class Ticket1230 extends Application.LegacyApplication {
private static final Object PROPERTY_ID = new Object();
private static final Object NULL_ITEM_ID = new Object();
@@ -18,7 +18,7 @@ public class Ticket1230 extends Application {
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
GridLayout layout = new GridLayout(5, 5);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket124.java b/tests/testbench/com/vaadin/tests/tickets/Ticket124.java
index efd28d7f41..f1d33dca0b 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket124.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket124.java
@@ -6,17 +6,19 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket124 extends Application {
+public class Ticket124 extends Application.LegacyApplication {
private TextField tf;
private GridLayout gl;
@Override
public void init() {
- Window w = new Window("#124: Insert & remove row for GridLayout");
+ LegacyWindow w = new LegacyWindow(
+ "#124: Insert & remove row for GridLayout");
setMainWindow(w);
setTheme("tests-tickets");
// gl = new GridLayout(4, 4);
@@ -45,7 +47,7 @@ public class Ticket124 extends Application {
gl.addComponent(new Label("0,0-1,0"), 0, 0, 1, 0);
gl.addComponent(new Label("2,0-3,0"), 2, 0, 3, 0);
Label l = new Label("Large cell 0,1-2,2<br/>yadayada<br/>lorem ipsum");
- l.setContentMode(Label.CONTENT_XHTML);
+ l.setContentMode(ContentMode.XHTML);
gl.addComponent(l, 0, 1, 2, 2);
gl.addComponent(new Label("3-1"), 3, 1);
gl.addComponent(new Label("3,2-3,3"), 3, 2, 3, 3);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1245.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1245.java
index 2e8675de7b..a5aa8cd2ac 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1245.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1245.java
@@ -5,20 +5,20 @@ import com.vaadin.data.Property;
import com.vaadin.ui.AbstractSelect;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
import com.vaadin.ui.themes.Reindeer;
-public class Ticket1245 extends com.vaadin.Application {
+public class Ticket1245 extends com.vaadin.Application.LegacyApplication {
TextField f = new TextField();
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
main.addComponent(new TreeExample());
@@ -80,7 +80,9 @@ class TreeExample extends CustomComponent {
// get the created item
final Item item = tree.getItem(id);
// set our "caption" property
- final Property p = item.getItemProperty(CAPTION_PROPERTY);
+ @SuppressWarnings("unchecked")
+ final Property<String> p = (Property<String>) item
+ .getItemProperty(CAPTION_PROPERTY);
p.setValue(caption);
if (parent != null) {
tree.setChildrenAllowed(parent, true);
@@ -90,4 +92,4 @@ class TreeExample extends CustomComponent {
return id;
}
-} \ No newline at end of file
+}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1362Login.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1362Login.java
deleted file mode 100644
index d8fdefbd38..0000000000
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1362Login.java
+++ /dev/null
@@ -1,275 +0,0 @@
-package com.vaadin.tests.tickets;
-
-import java.io.ByteArrayInputStream;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Map;
-
-import com.vaadin.Application;
-import com.vaadin.terminal.ApplicationResource;
-import com.vaadin.terminal.DownloadStream;
-import com.vaadin.terminal.ParameterHandler;
-import com.vaadin.terminal.URIHandler;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.Embedded;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
-
-/**
- * Proof of concept how to create a decent login screen that works with browsers
- * PW managers. (Browsers don't autofill generated login forms)
- *
- * TODO generalize js to work inside iframes (if a Vaadin application is inside
- * iframe)
- *
- * TODO extract login form to a external template.
- *
- * TODO theme
- *
- * TODO refine docs, make LoginBox a standard Vaadin component
- *
- * TODO article
- *
- */
-public class Ticket1362Login extends Application {
-
- public class LoginBox extends CustomComponent {
-
- Embedded iframe = new Embedded();
-
- ApplicationResource loginPage = new ApplicationResource() {
-
- private byte[] loginHTML = (""
- + "<html>"
- + "<head><script type='text/javascript'>"
- + "var setTarget = function() {document.getElementById('loginf').action = top.location;};"
- + "</script></head>"
- + "<body onload='setTarget();'>"
- + "Iframe generated by LoginBox. PW managers can autofill form. Form handled by LoginBox "
- + "that will fire LoginEvents. Will post into another iframe, from where the script "
- + "will find Vaadin client that will be force synced. <form id='loginf' target='logintarget'>"
- + "Username : <input type='text' name='username'>"
- + "Password : <input type='password' name='password'>"
- + "<input type='submit' value='login'>" + "</form>"
- + "<iframe name='logintarget'></iframe>" + "</body>"
- + "</html>").getBytes();
-
- public Application getApplication() {
- return LoginBox.this.getApplication();
- }
-
- public int getBufferSize() {
- return loginHTML.length;
- }
-
- public long getCacheTime() {
- return 0;
- }
-
- public String getFilename() {
- return "login.html";
- }
-
- public DownloadStream getStream() {
- return new DownloadStream(new ByteArrayInputStream(loginHTML),
- getMIMEType(), getFilename());
- }
-
- public String getMIMEType() {
- return "text/html";
- }
- };
-
- private ParameterHandler paramHandler = new ParameterHandler() {
-
- public void handleParameters(Map<String, String[]> parameters) {
- if (parameters.containsKey("username")) {
- getWindow().addURIHandler(uriHandler);
-
- HashMap<String, String> params = new HashMap<String, String>();
- // expecting single params
- for (Iterator<String> it = parameters.keySet().iterator(); it
- .hasNext();) {
- String key = it.next();
- String value = (parameters.get(key))[0];
- params.put(key, value);
- }
- LoginEvent event = new LoginEvent(params);
- for (Iterator<LoginListener> iterator = listeners
- .iterator(); iterator.hasNext();) {
- LoginListener listener = iterator.next();
- listener.onLogin(event);
- }
- }
- }
- };
-
- private URIHandler uriHandler = new URIHandler() {
- public DownloadStream handleURI(URL context, String relativeUri) {
- if (window != null) {
- window.removeURIHandler(this);
- }
- return new DownloadStream(
- new ByteArrayInputStream(
- "<html><body>Login form handeled.<script type='text/javascript'>top.vaadin.forceSync();</script></body></html>"
- .getBytes()), "text/html",
- "loginSuccesfull.html");
- }
- };
-
- private LinkedList<LoginListener> listeners = new LinkedList<LoginListener>();
-
- private Window window;
-
- LoginBox() {
- iframe.setType(Embedded.TYPE_BROWSER);
- iframe.setSizeFull();
- setCompositionRoot(iframe);
- }
-
- @Override
- public void attach() {
- super.attach();
- getApplication().addResource(loginPage);
- getWindow().addParameterHandler(paramHandler);
- iframe.setSource(loginPage);
- }
-
- @Override
- public void detach() {
- getApplication().removeResource(loginPage);
- getWindow().removeParameterHandler(paramHandler);
- // store window temporary to properly remove uri handler once
- // response is handled. (May happen if login handler removes login
- // box
- window = getWindow();
- super.detach();
- }
-
- /**
- * This event is sent when login form is submitted.
- */
- public class LoginEvent {
-
- private Map<String, String> params;
-
- private LoginEvent(Map<String, String> params) {
- this.params = params;
- }
-
- /**
- * Returns form value by field name.
- *
- * @param name
- * @return value in given field
- */
- public String getLoginParameter(String name) {
- if (params.containsKey(name)) {
- return params.get(name);
- } else {
- return null;
- }
- }
- }
-
- /**
- * Adds LoginListener to handle login logic
- *
- * @param listener
- */
- public void addLoginListener(LoginListener listener) {
- listeners.add(listener);
- }
-
- /**
- * Removes LoginListener
- *
- * @param listener
- */
- public void removeLoginListener(LoginListener listener) {
- listeners.remove(listener);
- }
-
- }
-
- /**
- * Login listener is a class capable to listen LoginEvents sent from
- * LoginBox
- */
- public interface LoginListener {
- /**
- * This method is fired on each login form post.
- *
- * @param event
- */
- public void onLogin(LoginBox.LoginEvent event);
- }
-
- final static String GUEST = "guest";
-
- LoginBox loginBox = new LoginBox();
-
- Label currentUser = new Label(GUEST);
-
- private Panel mainPanel;
-
- private VerticalLayout el;
-
- @Override
- public void init() {
-
- final Window mainWin = new Window(
- "Test app with password manager savvy login functionality");
-
- el = new VerticalLayout();
-
- currentUser.setCaption("Currennt user");
- el.addComponent(currentUser);
-
- el.addComponent(loginBox);
- el.setExpandRatio(loginBox, 1);
-
- mainWin.setContent(el);
-
- setMainWindow(mainWin);
-
- mainPanel = new Panel("Test app");
- mainPanel.setSizeFull();
- mainPanel.addComponent(new Label("User is logged in"));
- mainPanel.addComponent(new Button("Logout", new Button.ClickListener() {
-
- public void buttonClick(ClickEvent event) {
- Ticket1362Login.this.close();
- }
- }));
-
- loginBox.addLoginListener(new LoginListener() {
- public void onLogin(LoginBox.LoginEvent event) {
- String pw = event.getLoginParameter("password");
- String username = event.getLoginParameter("username");
- if (pw.equals("1234")) {
- setUser(username);
- currentUser.setValue(username);
- currentUser.getWindow().showNotification(
- "Logged in user: " + username);
- getMainWindow().getContent().replaceComponent(loginBox,
- mainPanel);
- el.setExpandRatio(mainPanel, 1);
- } else {
- getMainWindow().showNotification(
- "Wrong password. Hint, try '1234' ",
- Notification.TYPE_WARNING_MESSAGE);
- }
- }
- });
-
- }
-
-} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1365.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1365.java
index 9916ca634d..b35d185811 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1365.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1365.java
@@ -4,10 +4,11 @@ import com.vaadin.event.Action;
import com.vaadin.event.Action.Handler;
import com.vaadin.event.ShortcutAction;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket1365 extends com.vaadin.Application implements Handler {
+public class Ticket1365 extends com.vaadin.Application.LegacyApplication
+ implements Handler {
TextField f = new TextField();
@@ -15,8 +16,8 @@ public class Ticket1365 extends com.vaadin.Application implements Handler {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
main.addComponent(f);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1368.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1368.java
index 9df316fdcb..a1a5b449d1 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1368.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1368.java
@@ -3,19 +3,19 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
/**
*/
-public class Ticket1368 extends Application {
+public class Ticket1368 extends Application.LegacyApplication {
private Table t;
@Override
public void init() {
- final Window mainWin = new Window("Test app to #1368");
+ final LegacyWindow mainWin = new LegacyWindow("Test app to #1368");
setMainWindow(mainWin);
t = TestForTablesInitialColumnWidthLogicRendering.getTestTable(3, 5);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1397.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1397.java
index 282df33d89..dfccf31956 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1397.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1397.java
@@ -10,18 +10,18 @@ import com.vaadin.ui.InlineDateField;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.PopupView;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket1397 extends Application {
+public class Ticket1397 extends Application.LegacyApplication {
- Window main;
+ LegacyWindow main;
@Override
public void init() {
setTheme("runo");
- main = new Window("PopupView test");
+ main = new LegacyWindow("PopupView test");
setMainWindow(main);
Panel panel = new Panel("PopupTest");
@@ -31,7 +31,7 @@ public class Ticket1397 extends Application {
PopupView.Content content = new PopupView.Content() {
public String getMinimizedValueAsHTML() {
- return prop.toString();
+ return String.valueOf(prop.getValue());
}
public Component getPopupComponent() {
@@ -69,7 +69,7 @@ public class Ticket1397 extends Application {
panel2.addComponent(new myButton());
PopupView.Content content2 = new PopupView.Content() {
public String getMinimizedValueAsHTML() {
- return prop2.toString();
+ return String.valueOf(prop2.getValue());
}
public Component getPopupComponent() {
@@ -90,7 +90,7 @@ public class Ticket1397 extends Application {
PopupView.Content content3 = new PopupView.Content() {
public String getMinimizedValueAsHTML() {
- return op.toString();
+ return String.valueOf(op.getValue());
}
public Component getPopupComponent() {
@@ -114,7 +114,7 @@ public class Ticket1397 extends Application {
final InlineDateField df = new InlineDateField("", new Date());
PopupView pp = new PopupView(new PopupView.Content() {
public String getMinimizedValueAsHTML() {
- return df.toString();
+ return String.valueOf(df.getValue());
}
public Component getPopupComponent() {
@@ -131,7 +131,8 @@ public class Ticket1397 extends Application {
+ " and see how the overview-version changes.");
public String getMinimizedValueAsHTML() {
- return "" + tf.toString().length() + " characters of info";
+ return "" + String.valueOf(tf.getValue()).length()
+ + " characters of info";
}
public Component getPopupComponent() {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1435.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1435.java
index b961c0d6b1..c280be4e4a 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1435.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1435.java
@@ -11,18 +11,19 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1435 extends Application {
+public class Ticket1435 extends Application.LegacyApplication {
private static final boolean useWorkaround = true;
@Override
public void init() {
- final Window mainWin = new Window("ButtonPanel containing a table test");
+ final LegacyWindow mainWin = new LegacyWindow(
+ "ButtonPanel containing a table test");
setMainWindow(mainWin);
((AbstractOrderedLayout) mainWin.getContent()).setSpacing(true);
@@ -54,7 +55,7 @@ public class Ticket1435 extends Application {
// Last known height before the panel was collapsed
private float lastHeight = -1;
- private int lastHeightUnit = -1;
+ private Unit lastHeightUnit = null;
public ButtonPanel(String labelString) {
setCompositionRoot(root);
@@ -162,7 +163,7 @@ public class Ticket1435 extends Application {
root.setExpandRatio(container, 1);
}
- public void setHeight(int height, int unit) {
+ public void setHeight(int height, Unit unit) {
root.setHeight(height, unit);
lastHeight = height;
lastHeightUnit = unit;
@@ -182,7 +183,7 @@ public class Ticket1435 extends Application {
root.setWidth(width);
}
- public void setWidth(int width, int unit) {
+ public void setWidth(int width, Unit unit) {
root.setWidth(width, unit);
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1444.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1444.java
index 003b50240b..5076e79996 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1444.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1444.java
@@ -2,15 +2,16 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1444 extends Application {
+public class Ticket1444 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window(
+ final LegacyWindow mainWin = new LegacyWindow(
"Test app to break layout fuction in IE7");
setMainWindow(mainWin);
@@ -20,7 +21,7 @@ public class Ticket1444 extends Application {
Label red = new Label(
"<div style='background:red;width:100%;height:100%;'>??</div>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
red.setSizeFull();
ol.addComponent(red);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1465ModalNotification.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1465ModalNotification.java
index ff716aefc1..9459c7cc85 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1465ModalNotification.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1465ModalNotification.java
@@ -4,14 +4,18 @@ import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Window;
-public class Ticket1465ModalNotification extends Application {
+public class Ticket1465ModalNotification extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window("ButtonPanel containing a table test");
+ final LegacyWindow mainWin = new LegacyWindow(
+ "ButtonPanel containing a table test");
setMainWindow(mainWin);
final Window modal = new Window("Modal window");
@@ -21,9 +25,9 @@ public class Ticket1465ModalNotification extends Application {
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- modal.showNotification(
+ Root.getCurrentRoot().showNotification(
"Try clicking the button in main window!",
- Window.Notification.TYPE_ERROR_MESSAGE);
+ Notification.TYPE_ERROR_MESSAGE);
}
});
@@ -33,9 +37,9 @@ public class Ticket1465ModalNotification extends Application {
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- modal.showNotification(
+ Root.getCurrentRoot().showNotification(
"Try clicking the button in main window!",
- Window.Notification.TYPE_WARNING_MESSAGE);
+ Notification.TYPE_WARNING_MESSAGE);
}
});
modal.addComponent(b);
@@ -44,9 +48,9 @@ public class Ticket1465ModalNotification extends Application {
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- modal.showNotification(
+ Root.getCurrentRoot().showNotification(
"Try clicking the button in main window!",
- Window.Notification.TYPE_HUMANIZED_MESSAGE);
+ Notification.TYPE_HUMANIZED_MESSAGE);
}
});
modal.addComponent(b);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer.java
index a0f3070988..616e40d917 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer.java
@@ -65,7 +65,7 @@ public class Ticket1506_TestContainer implements Container {
return a;
}
- public Property getContainerProperty(Object itemId, Object propertyId) {
+ public Property<?> getContainerProperty(Object itemId, Object propertyId) {
if (items.isEmpty()) {
loadItems();
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java
index 4b296d2eda..863ce907da 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java
@@ -57,7 +57,7 @@ public class Ticket1506_TestContainer2 implements Container {
return items.keySet();
}
- public Property getContainerProperty(Object itemId, Object propertyId) {
+ public Property<?> getContainerProperty(Object itemId, Object propertyId) {
if (items.isEmpty()) {
loadItems();
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1519.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1519.java
index ff6d340372..1c4156d7ff 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1519.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1519.java
@@ -2,18 +2,18 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.CustomLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.Window;
-public class Ticket1519 extends Application {
+public class Ticket1519 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window("Test app to #1519");
+ final LegacyWindow mainWin = new LegacyWindow("Test app to #1519");
setMainWindow(mainWin);
- mainWin.setTheme("tests-tickets");
+ setTheme("tests-tickets");
TabSheet ts = new TabSheet();
ts.addTab(new CustomLayout("Ticket1519_News"), "News", null);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1572.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1572.java
index 425a3d5ee2..614c471d3e 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1572.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1572.java
@@ -6,9 +6,9 @@ import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1572 extends com.vaadin.Application {
+public class Ticket1572 extends com.vaadin.Application.LegacyApplication {
private Label state;
private GridLayout gl;
@@ -17,8 +17,8 @@ public class Ticket1572 extends com.vaadin.Application {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
Panel p = new Panel("Test wrapper for gridlayout margin/spacing");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1581.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1581.java
index e87ad848ce..1efea99a0e 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1581.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1581.java
@@ -7,9 +7,9 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Label;
import com.vaadin.ui.ProgressIndicator;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1581 extends com.vaadin.Application {
+public class Ticket1581 extends com.vaadin.Application.LegacyApplication {
private Label time;
private ProgressIndicator poller;
@@ -17,8 +17,8 @@ public class Ticket1581 extends com.vaadin.Application {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
main.addComponent(new Label("Test the second issue in ticket #1581"));
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java
index 7074be65e4..7aba886133 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java
@@ -6,7 +6,6 @@ import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.net.URL;
import java.util.Date;
import javax.imageio.ImageIO;
@@ -14,20 +13,22 @@ import javax.imageio.ImageIO;
import com.vaadin.Application;
import com.vaadin.terminal.DownloadStream;
import com.vaadin.terminal.ExternalResource;
-import com.vaadin.terminal.URIHandler;
+import com.vaadin.terminal.RequestHandler;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.terminal.WrappedResponse;
import com.vaadin.ui.Link;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1589 extends Application {
+public class Ticket1589 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
MyDynamicResource res = new MyDynamicResource();
- w.addURIHandler(res);
+ addRequestHandler(res);
w.addComponent(new Link(
"Test (without Content-Disposition, should suggest generatedFile.png when saving, browser default for actual disposition)",
@@ -39,7 +40,7 @@ public class Ticket1589 extends Application {
}
}
-class MyDynamicResource implements URIHandler {
+class MyDynamicResource implements RequestHandler {
String textToDisplay = (new Date()).toString();
/**
@@ -49,11 +50,14 @@ class MyDynamicResource implements URIHandler {
* Returns null if the URI does not match. Otherwise returns a download
* stream that contains the response from the server.
*/
- public DownloadStream handleURI(URL context, String relativeUri) {
+ public boolean handleRequest(Application application,
+ WrappedRequest request, WrappedResponse response)
+ throws IOException {
+ String relativeUri = request.getRequestPathInfo();
// Catch the given URI that identifies the resource, otherwise let other
// URI handlers or the Application to handle the response.
if (!relativeUri.startsWith("myresource")) {
- return null;
+ return false;
}
// Create an image and draw some background on it.
@@ -86,9 +90,10 @@ class MyDynamicResource implements URIHandler {
downloadStream.setParameter("Content-Disposition",
"attachment; filename=\"downloadedPNG.png\"");
}
- return downloadStream;
+ downloadStream.writeTo(response);
+ return true;
} catch (IOException e) {
- return null;
+ return false;
}
}
} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1598.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1598.java
index 20f1d4d985..0faf9b8afb 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1598.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1598.java
@@ -8,11 +8,11 @@ import com.vaadin.terminal.ThemeResource;
import com.vaadin.ui.MenuBar;
import com.vaadin.ui.MenuBar.Command;
import com.vaadin.ui.MenuBar.MenuItem;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1598 extends Application {
+public class Ticket1598 extends Application.LegacyApplication {
- Window main = new Window("MenuBar test");
+ LegacyWindow main = new LegacyWindow("MenuBar test");
final MenuBar menuBar = new MenuBar();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket161.java b/tests/testbench/com/vaadin/tests/tickets/Ticket161.java
index b2998c687d..1819076b32 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket161.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket161.java
@@ -5,19 +5,19 @@ import com.vaadin.data.Container;
import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
/**
*/
-public class Ticket161 extends Application {
+public class Ticket161 extends Application.LegacyApplication {
private Table t;
@Override
public void init() {
- final Window mainWin = new Window("Test app to #1368");
+ final LegacyWindow mainWin = new LegacyWindow("Test app to #1368");
setMainWindow(mainWin);
t = TestForTablesInitialColumnWidthLogicRendering.getTestTable(3, 100);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1632.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1632.java
index e156752450..1774000355 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1632.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1632.java
@@ -4,19 +4,19 @@ import com.vaadin.Application;
import com.vaadin.data.Item;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
/**
*/
-public class Ticket1632 extends Application {
+public class Ticket1632 extends Application.LegacyApplication {
private Table t;
@Override
public void init() {
- final Window mainWin = new Window("Test app");
+ final LegacyWindow mainWin = new LegacyWindow("Test app");
setMainWindow(mainWin);
t = new Table();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1659.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1659.java
index 8bba5a103e..d78a1d78af 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1659.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1659.java
@@ -4,13 +4,13 @@ import com.vaadin.Application;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1659 extends Application {
+public class Ticket1659 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window();
+ final LegacyWindow mainWin = new LegacyWindow();
setMainWindow(mainWin);
mainWin.addComponent(new Button(
"Change URI using Application.getURL()",
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1663.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1663.java
index 79bd22a96d..64d53e33f6 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1663.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1663.java
@@ -1,15 +1,15 @@
package com.vaadin.tests.tickets;
import com.vaadin.terminal.SystemError;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket1663 extends com.vaadin.Application {
+public class Ticket1663 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window("#1663");
+ LegacyWindow main = new LegacyWindow("#1663");
setMainWindow(main);
TextField tf = new TextField("First name");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1673.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1673.java
index 7af141b972..891cdf9f21 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1673.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1673.java
@@ -2,17 +2,22 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Button;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1673 extends com.vaadin.Application {
+public class Ticket1673 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window("#1673");
+ final LegacyWindow main = new LegacyWindow("#1673");
setMainWindow(main);
- main.addComponent(new Button("close", this, "close"));
+ main.addComponent(new Button("close", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ close();
+ }
+ }));
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java
index 176f2efdd2..7c8e545c97 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java
@@ -21,11 +21,11 @@ import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.AlignmentHandler;
import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1710 extends com.vaadin.Application {
+public class Ticket1710 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
@@ -33,7 +33,7 @@ public class Ticket1710 extends com.vaadin.Application {
setTheme("tests-tickets");
VerticalLayout lo = new VerticalLayout();
- setMainWindow(new Window("#1710", lo));
+ setMainWindow(new LegacyWindow("#1710", lo));
lo.setMargin(true);
lo.setSpacing(true);
lo.setWidth("100%");
@@ -139,9 +139,6 @@ public class Ticket1710 extends com.vaadin.Application {
private Form getFormPanelExample() {
Form f = new Form();
f.setCaption("Test form");
- Button fb1 = new Button("Test button");
- fb1.setComponentError(new SystemError("Test error"));
- f.addField("fb1", fb1);
CheckBox fb2 = new CheckBox("Test button", true);
fb2.setComponentError(new SystemError("Test error"));
f.addField("fb2", fb2);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1737.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1737.java
index f45fe88889..ccd649c542 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1737.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1737.java
@@ -7,10 +7,10 @@ import com.vaadin.terminal.Resource;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1737 extends Application {
+public class Ticket1737 extends Application.LegacyApplication {
Resource slowRes = new ClassResource(Ticket1737.class, "m-bullet-blue.gif",
this) {
@@ -28,8 +28,8 @@ public class Ticket1737 extends Application {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
VerticalLayout el = new VerticalLayout();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1767.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1767.java
index 92fbddeeb3..bf57118a8c 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1767.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1767.java
@@ -1,15 +1,15 @@
package com.vaadin.tests.tickets;
import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1767 extends com.vaadin.Application {
+public class Ticket1767 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
ComboBox cb = new ComboBox(" '<' item is not seen in populist?");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1772.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1772.java
index 7cf3483277..7ca90904f8 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1772.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1772.java
@@ -3,16 +3,16 @@ package com.vaadin.tests.tickets;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket1772 extends com.vaadin.Application {
+public class Ticket1772 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
Button b = new Button("Add content");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1775.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1775.java
index de841288e8..aed69056aa 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1775.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1775.java
@@ -4,16 +4,16 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CustomLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1775 extends com.vaadin.Application {
+public class Ticket1775 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window("#1775");
+ final LegacyWindow main = new LegacyWindow("#1775");
setMainWindow(main);
- main.setTheme("tests-tickets");
+ setTheme("tests-tickets");
String layoutName = "Ticket1775";
final CustomLayout layout = new CustomLayout(layoutName);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java
index e22fbe90ee..86eb3c429a 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java
@@ -10,17 +10,19 @@ import com.vaadin.ui.AbstractField;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Select;
import com.vaadin.ui.Window;
-public class Ticket1804 extends com.vaadin.Application {
+public class Ticket1804 extends com.vaadin.Application.LegacyApplication {
LinkedList<Select> listOfAllFields = new LinkedList<Select>();
@Override
public void init() {
- final Window main = new Window("#1804");
+ final LegacyWindow main = new LegacyWindow("#1804");
setMainWindow(main);
com.vaadin.ui.Select s;
@@ -93,7 +95,7 @@ public class Ticket1804 extends com.vaadin.Application {
StringBuffer msg = new StringBuffer();
for (Iterator<Select> i = listOfAllFields.iterator(); i
.hasNext();) {
- AbstractField af = i.next();
+ AbstractField<?> af = i.next();
msg.append("<h1>" + af.getCaption() + "</h1>\n");
msg.append("Value=" + af.getValue() + "<br/>\n");
if (af.isValid()) {
@@ -107,7 +109,7 @@ public class Ticket1804 extends com.vaadin.Application {
w.setModal(true);
w.setScrollable(true);
w.setHeight("80%");
- w.addComponent(new Label(msg.toString(), Label.CONTENT_XHTML));
+ w.addComponent(new Label(msg.toString(), ContentMode.XHTML));
main.addWindow(w);
}
});
@@ -127,7 +129,7 @@ public class Ticket1804 extends com.vaadin.Application {
}
/** Throws an exception when the string is empty or null. */
- class EmptyStringValidator implements Validator {
+ static class EmptyStringValidator implements Validator {
String msg;
@@ -135,12 +137,8 @@ public class Ticket1804 extends com.vaadin.Application {
this.msg = msg;
}
- public boolean isValid(Object value) {
- return !(value == null || value.toString().length() == 0);
- }
-
public void validate(Object value) throws InvalidValueException {
- if (!isValid(value)) {
+ if (value == null || value.toString().length() == 0) {
throw new InvalidValueException(msg);
}
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1805.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1805.java
index d2407aae39..d7eac667f0 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1805.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1805.java
@@ -7,15 +7,15 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket1805 extends com.vaadin.Application {
+public class Ticket1805 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
((Layout) main.getContent()).setMargin(false);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1806.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1806.java
index c403a8242c..c47ea49697 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1806.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1806.java
@@ -3,15 +3,15 @@ package com.vaadin.tests.tickets;
import com.vaadin.data.util.ObjectProperty;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket1806 extends com.vaadin.Application {
+public class Ticket1806 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
final ObjectProperty<String> prop = new ObjectProperty<String>("");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1811.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1811.java
index 6cbf37541c..7df9610e99 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1811.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1811.java
@@ -8,17 +8,19 @@ import com.vaadin.data.validator.StringLengthValidator;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Window;
-public class Ticket1811 extends com.vaadin.Application {
+public class Ticket1811 extends com.vaadin.Application.LegacyApplication {
LinkedList<TextField> listOfAllFields = new LinkedList<TextField>();
@Override
public void init() {
- final Window main = new Window("#1811");
+ final LegacyWindow main = new LegacyWindow("#1811");
setMainWindow(main);
Validator strLenValidator = new StringLengthValidator(
@@ -69,7 +71,7 @@ public class Ticket1811 extends com.vaadin.Application {
}
Window w = new Window("Status of the fields");
w.setModal(true);
- w.addComponent(new Label(msg.toString(), Label.CONTENT_XHTML));
+ w.addComponent(new Label(msg.toString(), ContentMode.XHTML));
main.addWindow(w);
}
});
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1819.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1819.java
index 97357d8d2c..86325f35a9 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1819.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1819.java
@@ -7,17 +7,19 @@ import com.vaadin.ui.AbstractField;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Select;
import com.vaadin.ui.Window;
-public class Ticket1819 extends com.vaadin.Application {
+public class Ticket1819 extends com.vaadin.Application.LegacyApplication {
LinkedList<Select> listOfAllFields = new LinkedList<Select>();
@Override
public void init() {
- final Window main = new Window("#1819");
+ final LegacyWindow main = new LegacyWindow("#1819");
setMainWindow(main);
com.vaadin.ui.Select s;
@@ -49,13 +51,13 @@ public class Ticket1819 extends com.vaadin.Application {
StringBuffer msg = new StringBuffer();
for (Iterator<Select> i = listOfAllFields.iterator(); i
.hasNext();) {
- AbstractField af = i.next();
+ AbstractField<?> af = i.next();
msg.append("<h1>" + af.getCaption() + "</h1>\n");
msg.append("Value=" + af.getValue() + "<br/>\n");
}
Window w = new Window("Status of the fields");
w.setModal(true);
- w.addComponent(new Label(msg.toString(), Label.CONTENT_XHTML));
+ w.addComponent(new Label(msg.toString(), ContentMode.XHTML));
main.addWindow(w);
}
});
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java
index 824447b6a9..afcdd2ed16 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java
@@ -6,9 +6,10 @@ import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1834PanelScrolling extends com.vaadin.Application {
+public class Ticket1834PanelScrolling extends
+ com.vaadin.Application.LegacyApplication {
private static final int ROWS = 50;
@@ -18,8 +19,8 @@ public class Ticket1834PanelScrolling extends com.vaadin.Application {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
HorizontalLayout currentState = new HorizontalLayout();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1857.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1857.java
index f82467b519..2af5bf9c85 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1857.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1857.java
@@ -7,11 +7,12 @@ import com.vaadin.event.Action;
import com.vaadin.event.Action.Handler;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1857 extends Application implements Handler {
+public class Ticket1857 extends Application.LegacyApplication implements
+ Handler {
@Override
public void init() {
@@ -19,7 +20,7 @@ public class Ticket1857 extends Application implements Handler {
setTheme("tests-tickets");
VerticalLayout el = new VerticalLayout();
- Window main = new Window("Testcase for #1857", el);
+ LegacyWindow main = new LegacyWindow("Testcase for #1857", el);
setMainWindow(main);
el.setMargin(true);
el.setSpacing(true);
@@ -41,7 +42,7 @@ public class Ticket1857 extends Application implements Handler {
actionHandlerEnabler.setImmediate(true);
actionHandlerEnabler.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- if (((Boolean) actionHandlerEnabler.getValue()).booleanValue()) {
+ if (actionHandlerEnabler.getValue().booleanValue()) {
t.addActionHandler(Ticket1857.this);
} else {
t.removeActionHandler(Ticket1857.this);
@@ -54,7 +55,7 @@ public class Ticket1857 extends Application implements Handler {
cellStylesEnabler.setImmediate(true);
cellStylesEnabler.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- if (((Boolean) cellStylesEnabler.getValue()).booleanValue()) {
+ if (cellStylesEnabler.getValue().booleanValue()) {
t.setCellStyleGenerator(new Table.CellStyleGenerator() {
public String getStyle(Object itemId, Object propertyId) {
Object cell = t.getContainerProperty(itemId,
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1868.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1868.java
index fe32dbc775..1af0ed2041 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1868.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1868.java
@@ -1,14 +1,14 @@
package com.vaadin.tests.tickets;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1868 extends com.vaadin.Application {
+public class Ticket1868 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- setMainWindow(new Window("#1868"));
+ setMainWindow(new LegacyWindow("#1868"));
Panel p = new Panel(
"This is a really long caption for the panel, too long in fact!");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1869.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1869.java
index 9c2fdb762d..6745acf583 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1869.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1869.java
@@ -4,16 +4,16 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1869 extends com.vaadin.Application {
+public class Ticket1869 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
GridLayout lo = new GridLayout(2, 1);
- setMainWindow(new Window("#1869", lo));
+ setMainWindow(new LegacyWindow("#1869", lo));
lo.setMargin(true);
lo.setSpacing(true);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java
index 0cacb603fc..6072782dc3 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java
@@ -23,11 +23,11 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.AlignmentHandler;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1878 extends Application {
+public class Ticket1878 extends Application.LegacyApplication {
private Layout orderedLayout;
private Layout gridLayout;
@@ -39,7 +39,7 @@ public class Ticket1878 extends Application {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
@@ -184,7 +184,7 @@ public class Ticket1878 extends Application {
form.setItemDataSource(item);
for (Iterator<?> i = item.getItemPropertyIds().iterator(); i.hasNext();) {
Object property = i.next();
- Field f = form.getField(property);
+ Field<?> f = form.getField(property);
f.setRequired(r.nextBoolean());
if (r.nextBoolean()) {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1900.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1900.java
index 2047b4698c..fdbecf8eae 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1900.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1900.java
@@ -4,13 +4,13 @@ import com.vaadin.Application;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Validator;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket1900 extends Application {
+public class Ticket1900 extends Application.LegacyApplication {
TextField f[] = new TextField[5];
- Window main = new Window("#1900 test");
+ LegacyWindow main = new LegacyWindow("#1900 test");
@Override
public void init() {
@@ -53,19 +53,15 @@ public class Ticket1900 extends Application {
}
- class ContainsValidator implements Validator {
+ static class ContainsValidator implements Validator {
private final String c;
public ContainsValidator(String c) {
this.c = c;
}
- public boolean isValid(Object value) {
- return value != null && value.toString().contains(c);
- }
-
public void validate(Object value) throws InvalidValueException {
- if (!isValid(value)) {
+ if (value == null || !value.toString().contains(c)) {
throw new InvalidValueException("Value does not contain " + c);
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1904.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1904.java
index 1d79158333..2837d71e67 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1904.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1904.java
@@ -5,14 +5,14 @@ import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1904 extends Application {
+public class Ticket1904 extends Application.LegacyApplication {
@Override
public void init() {
- setMainWindow(new Window("#1904"));
+ setMainWindow(new LegacyWindow("#1904"));
setTheme("tests-tickets");
addOL("defaults", null, false);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1916.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1916.java
index d340bf144a..790d3aa931 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1916.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1916.java
@@ -4,10 +4,10 @@ import com.vaadin.Application;
import com.vaadin.terminal.UserError;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket1916 extends Application {
+public class Ticket1916 extends Application.LegacyApplication {
@Override
public void init() {
@@ -21,7 +21,7 @@ public class Ticket1916 extends Application {
test.addComponent(tf);
test.setComponentAlignment(tf, Alignment.MIDDLE_CENTER);
- Window w = new Window("Test #1916", test);
+ LegacyWindow w = new LegacyWindow("Test #1916", test);
setMainWindow(w);
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1919.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1919.java
index 70bc0e1211..68a2eaa2bc 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1919.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1919.java
@@ -1,23 +1,24 @@
package com.vaadin.tests.tickets;
import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1919 extends com.vaadin.Application {
+public class Ticket1919 extends com.vaadin.Application.LegacyApplication {
private GridLayout lo;
private boolean on = true;
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
- main.setTheme("tests-tickets");
+ setTheme("tests-tickets");
lo = new GridLayout(2, 2);
lo.setSizeFull();
@@ -46,8 +47,12 @@ public class Ticket1919 extends com.vaadin.Application {
Panel p = new Panel();
p.setSizeFull();
- Button b = new Button("toggle Values", this, "toggleStyleName");
+ Button b = new Button("toggle Values", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ toggleStyleName();
+ }
+ });
p.addComponent(b);
return p;
}
-} \ No newline at end of file
+}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1921.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1921.java
index 71c45c34ce..c0a1c7d2c9 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1921.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1921.java
@@ -1,15 +1,20 @@
package com.vaadin.tests.tickets;
+import java.io.IOException;
import java.util.Map;
import com.vaadin.Application;
-import com.vaadin.terminal.ParameterHandler;
+import com.vaadin.terminal.RequestHandler;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.terminal.WrappedResponse;
import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1921 extends Application implements ParameterHandler {
+public class Ticket1921 extends Application.LegacyApplication implements
+ RequestHandler {
int state = -1;
int round = 1;
@@ -20,11 +25,15 @@ public class Ticket1921 extends Application implements ParameterHandler {
public void init() {
outer = new VerticalLayout();
- setMainWindow(new Window("#1921", outer));
+ setMainWindow(new LegacyWindow("#1921", outer));
setTheme("tests-tickets");
inner = new VerticalLayout();
outer.addComponent(inner);
- button = new Button("foo", this, "newState");
+ button = new Button("foo", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ newState();
+ }
+ });
inner.addComponent(button);
outer.setStyleName("red");
@@ -32,7 +41,7 @@ public class Ticket1921 extends Application implements ParameterHandler {
newState();
- getMainWindow().addParameterHandler(this);
+ addRequestHandler(this);
}
public void newState() {
@@ -83,14 +92,17 @@ public class Ticket1921 extends Application implements ParameterHandler {
}
}
- public void handleParameters(Map<String, String[]> parameters) {
+ public boolean handleRequest(Application application,
+ WrappedRequest request, WrappedResponse response)
+ throws IOException {
+ Map<String, String[]> parameters = request.getParameterMap();
String[] s = parameters.get("state");
if (s == null || s.length != 1) {
- return;
+ return false;
}
String v[] = s[0].split("\\.");
if (v == null || v.length != 2) {
- return;
+ return false;
}
try {
int rr = Integer.parseInt(v[0]);
@@ -98,12 +110,13 @@ public class Ticket1921 extends Application implements ParameterHandler {
if (rr < round || (rr == round && rs < state)) {
getMainWindow().showNotification(
"Already past requested " + s[0]);
- return;
+ return false;
}
while (round < rr || state < rs) {
newState();
}
} catch (NumberFormatException ignored) {
}
+ return false;
}
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1923.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1923.java
index 9ea952a2b5..7252caf9d1 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1923.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1923.java
@@ -2,10 +2,10 @@ package com.vaadin.tests.tickets;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1923 extends com.vaadin.Application {
+public class Ticket1923 extends com.vaadin.Application.LegacyApplication {
private static final int ROWS = 50;
@@ -13,8 +13,8 @@ public class Ticket1923 extends com.vaadin.Application {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
p = new Panel("TestPanel 250x300");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1924ThemeChanging.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1924ThemeChanging.java
deleted file mode 100644
index 11621c7fa9..0000000000
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1924ThemeChanging.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.vaadin.tests.tickets;
-
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
-
-public class Ticket1924ThemeChanging extends com.vaadin.Application {
-
- private Label l = new Label("Background should be red with test theme");
-
- @SuppressWarnings("unused")
- private Panel p;
-
- @Override
- public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
- setMainWindow(main);
-
- l.setStyleName("red");
- main.addComponent(l);
-
- Button b = new Button("Toggle tests-tickets theme");
- b.addListener(new ClickListener() {
- boolean flag = false;
-
- public void buttonClick(ClickEvent event) {
- if (flag == !flag) {
- main.setTheme("tests-tickets");
- } else {
- main.setTheme(null);
- }
- }
- });
-
- main.addComponent(b);
-
- b = new Button("Modify caption (should not reload page)");
- b.addListener(new ClickListener() {
- public void buttonClick(ClickEvent event) {
- main.setCaption(main.getCaption() + ".");
- }
- });
-
- main.addComponent(b);
-
- }
-} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1925.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1925.java
index bb15f2c80e..91ea8c0c44 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1925.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1925.java
@@ -1,13 +1,13 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1925 extends Application {
+public class Ticket1925 extends Application.LegacyApplication {
@Override
public void init() {
- Window mainWindow = new Window("Test åäö");
+ LegacyWindow mainWindow = new LegacyWindow("Test åäö");
setMainWindow(mainWindow);
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1939.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1939.java
index 2970335d83..d24cace2c9 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1939.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1939.java
@@ -3,15 +3,15 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1939 extends Application {
+public class Ticket1939 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
final VerticalLayout l = new VerticalLayout();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1940.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1940.java
index a3264ecba4..10eebe4cba 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1940.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1940.java
@@ -1,15 +1,15 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1940 extends Application {
+public class Ticket1940 extends Application.LegacyApplication {
@Override
public void init() {
- final Window w = new Window(getClass().getName());
+ final LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
final VerticalLayout l = new VerticalLayout();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1953.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1953.java
index 43e7f10220..a832401cd0 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1953.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1953.java
@@ -4,9 +4,9 @@ import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1953 extends Application {
+public class Ticket1953 extends Application.LegacyApplication {
public static final String cellStyle = "test-cell";
public static final String colHeadStyle = "test-col-head";
public static final String headingStyle = "test-heading";
@@ -16,11 +16,11 @@ public class Ticket1953 extends Application {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
- main.setTheme("tests-tickets");
+ setTheme("tests-tickets");
GridLayout gl = new GridLayout(5, 5);
gl.setStyleName("borders");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1966.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1966.java
index 2245be0057..d461ffe4e3 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1966.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1966.java
@@ -9,14 +9,14 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.AlignmentHandler;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1966 extends Application {
+public class Ticket1966 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
// setTheme("tests-tickets");
w.setContent(new GridLayout(2, 2));
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1966_2.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1966_2.java
index 2d287ecdd4..85b802d46c 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1966_2.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1966_2.java
@@ -9,14 +9,14 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.AlignmentHandler;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1966_2 extends Application {
+public class Ticket1966_2 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
w.setContent(new GridLayout(2, 2));
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1966_3.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1966_3.java
index e6953d4193..cfc9825b58 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1966_3.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1966_3.java
@@ -6,15 +6,15 @@ import com.vaadin.terminal.UserError;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1966_3 extends Application {
+public class Ticket1966_3 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
GridLayout layout = new GridLayout(10, 10);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1969.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1969.java
index ffe099b067..aed322ca4d 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1969.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1969.java
@@ -5,17 +5,17 @@ import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1969 extends com.vaadin.Application {
+public class Ticket1969 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
main.getContent().setSizeFull();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1970.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1970.java
index 1442c9ea5b..beeda85c9f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1970.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1970.java
@@ -6,10 +6,10 @@ import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.CloseEvent;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1970 extends Application {
+public class Ticket1970 extends Application.LegacyApplication {
@Override
public void init() {
@@ -17,10 +17,10 @@ public class Ticket1970 extends Application {
}
@Override
- public Window getWindow(String name) {
+ public LegacyWindow getWindow(String name) {
// If we already have the requested window, use it
- Window w = super.getWindow(name);
+ LegacyWindow w = super.getWindow(name);
if (w == null) {
// If no window found, create it
@@ -29,8 +29,8 @@ public class Ticket1970 extends Application {
return w;
}
- private Window createExtraWindow(String name) {
- final Window w = new Window("Extra window: " + name);
+ private LegacyWindow createExtraWindow(String name) {
+ final LegacyWindow w = new LegacyWindow("Extra window: " + name);
w.setName(name);
addWindow(w);
w.addComponent(new Label(
@@ -40,26 +40,21 @@ public class Ticket1970 extends Application {
public void buttonClick(ClickEvent event) {
String openWindows = "";
- for (Iterator<Window> i = getWindows().iterator(); i
+ for (Iterator<LegacyWindow> i = getWindows().iterator(); i
.hasNext();) {
- Window t = i.next();
+ LegacyWindow t = i.next();
openWindows += (openWindows.length() > 0 ? "," : "")
+ t.getName();
}
w.showNotification(openWindows);
}
}));
- w.addListener(new Window.CloseListener() {
- public void windowClose(CloseEvent e) {
- removeWindow(w);
- }
- });
return w;
}
- private Window createWindow() {
- final Window w = new Window();
+ private LegacyWindow createWindow() {
+ final LegacyWindow w = new LegacyWindow();
w.addComponent(new Button("Show the name of the application",
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
@@ -68,11 +63,11 @@ public class Ticket1970 extends Application {
}
}));
w.addComponent(new Label("<a href='" + getURL().toExternalForm() + "'>"
- + getURL().toExternalForm() + "</a>", Label.CONTENT_XHTML));
+ + getURL().toExternalForm() + "</a>", ContentMode.XHTML));
w.addComponent(new Label(
"<h2>How to reproduce</h2>Open the above link in another browser"
+ " window and then press the Show-button on this window.",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
return w;
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1972.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1972.java
index 62b001bbda..fd77343259 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1972.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1972.java
@@ -3,13 +3,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1972 extends Application {
+public class Ticket1972 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
setTheme("tests-ticket");
GridLayout layout = new GridLayout(3, 3);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1973.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1973.java
index 9629c4507b..d4b1345eb1 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1973.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1973.java
@@ -4,13 +4,13 @@ import com.vaadin.data.Item;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1973 extends com.vaadin.Application {
+public class Ticket1973 extends com.vaadin.Application.LegacyApplication {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
Table table = new Table();
@Override
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1973_2.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1973_2.java
index 5cffdbd5db..d43aac9da0 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1973_2.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1973_2.java
@@ -5,12 +5,12 @@ import com.vaadin.data.Item;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1973_2 extends Application {
- Window main = new Window();
+public class Ticket1973_2 extends Application.LegacyApplication {
+ LegacyWindow main = new LegacyWindow();
Table table = new Table();
@Override
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1975.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1975.java
index 4f4376721a..d908cc567c 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1975.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1975.java
@@ -11,16 +11,16 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CustomLayout;
import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1975 extends Application {
+public class Ticket1975 extends Application.LegacyApplication {
private CustomLayout cl1;
private CustomLayout cl2;
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
setTheme("tests-tickets");
GridLayout layout = new GridLayout(1, 10);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1982.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1982.java
index 53e5630353..431c3a6b99 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1982.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1982.java
@@ -10,15 +10,15 @@ import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1982 extends Application {
+public class Ticket1982 extends Application.LegacyApplication {
private List<TitleBar> components = new ArrayList<TitleBar>();
@Override
public void init() {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
setMainWindow(main);
GridLayout gl = new GridLayout(2, 2);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java
index fbab5c5244..c68ccf08f9 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java
@@ -1,25 +1,26 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.terminal.Sizeable;
import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
/**
* Test class for ticket 1983
*/
-public class Ticket1983 extends Application {
+public class Ticket1983 extends Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window("Test for ticket 1983");
+ LegacyWindow main = new LegacyWindow("Test for ticket 1983");
main.setContent(new TestLayout());
setMainWindow(main);
}
@@ -114,11 +115,11 @@ public class Ticket1983 extends Application {
ol.addComponent(button);
leftSide.setFirstComponent(ol);
- button = new CheckBox("Two col");
- button.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- Button b = event.getButton();
- if (((Boolean) b.getValue()).booleanValue()) {
+ CheckBox checkBox = new CheckBox("Two col");
+ checkBox.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ if ((Boolean) event.getProperty().getValue()) {
table.setVisibleColumns(new Object[] { propId, propId2 });
} else {
table.setVisibleColumns(new Object[] { propId });
@@ -127,7 +128,7 @@ public class Ticket1983 extends Application {
}
});
- ol.addComponent(button);
+ ol.addComponent(checkBox);
return leftSide;
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1986.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1986.java
index 44d4632427..88ebad933f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1986.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1986.java
@@ -8,15 +8,15 @@ import com.vaadin.ui.GridLayout;
import com.vaadin.ui.ListSelect;
import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.OptionGroup;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.TwinColSelect;
-import com.vaadin.ui.Window;
-public class Ticket1986 extends Application {
+public class Ticket1986 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
int index = 1;
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1991.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1991.java
index d2aca84848..72866a3ee8 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1991.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1991.java
@@ -1,15 +1,15 @@
package com.vaadin.tests.tickets;
import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
-public class Ticket1991 extends com.vaadin.Application {
+public class Ticket1991 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
Table t = new Table("Test table");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1995.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1995.java
index 8b66c7f012..23f377e89e 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1995.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1995.java
@@ -7,17 +7,17 @@ import com.vaadin.data.Item;
import com.vaadin.data.util.filter.SimpleStringFilter;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
-public class Ticket1995 extends Application {
+public class Ticket1995 extends Application.LegacyApplication {
private static final Object PROPERTY_1 = "Test";
private Table table;
@Override
public void init() {
- final Window mainWin = new Window(getClass().getName());
+ final LegacyWindow mainWin = new LegacyWindow(getClass().getName());
setMainWindow(mainWin);
table = new Table();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket20.java b/tests/testbench/com/vaadin/tests/tickets/Ticket20.java
index 55fee95de3..5c4779e69e 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket20.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket20.java
@@ -4,43 +4,29 @@ import com.vaadin.Application;
import com.vaadin.data.Validator;
import com.vaadin.data.util.MethodProperty;
import com.vaadin.data.validator.CompositeValidator;
+import com.vaadin.data.validator.CompositeValidator.CombinationMode;
+import com.vaadin.data.validator.IntegerValidator;
import com.vaadin.ui.Button;
import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket20 extends Application {
+public class Ticket20 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window("Test app for #20");
+ final LegacyWindow mainWin = new LegacyWindow("Test app for #20");
setMainWindow(mainWin);
final TextField tx = new TextField("Integer");
mainWin.addComponent(tx);
tx.setImmediate(true);
CompositeValidator v = new CompositeValidator();
+ v.addValidator(new IntegerValidator("{0} is not a number"));
v.addValidator(new Validator() {
- public boolean isValid(Object value) {
- try {
- Integer.parseInt("" + value);
- return true;
- } catch (NumberFormatException e) {
- return false;
- }
- }
-
- public void validate(Object value) throws InvalidValueException {
- if (!isValid(value)) {
- throw new InvalidValueException(value + " is not a number");
- }
- }
- });
- v.addValidator(new Validator() {
-
- public boolean isValid(Object value) {
+ private boolean isValid(Object value) {
try {
int i = Integer.parseInt("" + value);
if (i < 0) {
@@ -59,17 +45,12 @@ public class Ticket20 extends Application {
}
}
});
- CompositeValidator v2 = new CompositeValidator(
- CompositeValidator.MODE_OR, null);
+ CompositeValidator v2 = new CompositeValidator(CombinationMode.OR, null);
v2.addValidator(v);
v2.addValidator(new Validator() {
- public boolean isValid(Object value) {
- return "".equals("" + value);
- }
-
public void validate(Object value) throws InvalidValueException {
- if (!isValid(value)) {
+ if (!"".equals("" + value)) {
throw new InvalidValueException("Value is not empty string");
}
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2001.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2001.java
index 4796451dc0..a14c881b85 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2001.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2001.java
@@ -5,14 +5,14 @@ import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2001 extends Application {
+public class Ticket2001 extends Application.LegacyApplication {
@Override
public void init() {
- final Window w = new Window(getClass().getName());
+ final LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
final VerticalLayout l = new VerticalLayout();
@@ -23,7 +23,7 @@ public class Ticket2001 extends Application {
final CheckBox b = new CheckBox("fixed width: 30px", false);
b.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- if (b.booleanValue()) {
+ if ((Boolean) b.getValue()) {
l.setWidth("30px");
} else {
l.setWidth(null);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2002.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2002.java
index 2776fbc3b4..2c4a948cea 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2002.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2002.java
@@ -3,10 +3,10 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.data.util.MethodProperty;
import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket2002 extends Application {
+public class Ticket2002 extends Application.LegacyApplication {
private Long long1 = new Long(1L);
private Long long2 = new Long(2L);
@@ -28,7 +28,7 @@ public class Ticket2002 extends Application {
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
GridLayout layout = new GridLayout(2, 2);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2007.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2007.java
index 84dafb41f3..6700267a25 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2007.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2007.java
@@ -4,22 +4,22 @@ import com.vaadin.Application;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2007 extends Application {
+public class Ticket2007 extends Application.LegacyApplication {
int childs = 0;
@Override
public void init() {
- final Window main = new Window("Main window for #2007");
+ final LegacyWindow main = new LegacyWindow("Main window for #2007");
setMainWindow(main);
main.addComponent(new Button("Open another (non-main) window",
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- Window c = new Window("Non-main browser window "
- + (++childs));
+ LegacyWindow c = new LegacyWindow(
+ "Non-main browser window " + (++childs));
addWindow(c);
main.open(new ExternalResource(c.getURL()), "_new");
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2009.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2009.java
index b1138acc08..7667d6190b 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2009.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2009.java
@@ -8,20 +8,21 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-public class Ticket2009 extends com.vaadin.Application {
+public class Ticket2009 extends com.vaadin.Application.LegacyApplication {
TextField f = new TextField();
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
HorizontalLayout ol = new HorizontalLayout();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2011.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2011.java
index 0cfa642ff4..e8113b0cea 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2011.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2011.java
@@ -2,14 +2,14 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Select;
-import com.vaadin.ui.Window;
-public class Ticket2011 extends Application {
+public class Ticket2011 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
// setTheme("tests-ticket");
GridLayout layout = new GridLayout(10, 10);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2014.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2014.java
index e4cf36b084..538ebc4ccd 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2014.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2014.java
@@ -9,9 +9,9 @@ import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2014 extends Application {
+public class Ticket2014 extends Application.LegacyApplication {
private HorizontalLayout innerLayout1;
private Button b1;
@@ -19,7 +19,7 @@ public class Ticket2014 extends Application {
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
// setTheme("tests-ticket");
GridLayout layout = new GridLayout(10, 10);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2021.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2021.java
index 9f37ddfef3..cab8fc261c 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2021.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2021.java
@@ -10,11 +10,11 @@ import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2021 extends Application {
+public class Ticket2021 extends Application.LegacyApplication {
private TextArea tf1, tf2, tf3;
@@ -26,7 +26,7 @@ public class Ticket2021 extends Application {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
w.setContent(new GridLayout(2, 2));
setMainWindow(w);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2022.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2022.java
index 501f11e0b4..bc97f906b1 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2022.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2022.java
@@ -2,13 +2,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.CustomLayout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2022 extends Application {
+public class Ticket2022 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
CustomLayout l;
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2023.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2023.java
index ac80ef602b..238561ef47 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2023.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2023.java
@@ -4,16 +4,16 @@ import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2023 extends com.vaadin.Application implements
- Button.ClickListener {
+public class Ticket2023 extends com.vaadin.Application.LegacyApplication
+ implements Button.ClickListener {
AbstractComponent c = new Button();
@Override
public void init() {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
setMainWindow(main);
String[] sizes = { "20", "100", "1", "0", "-1", "", "z" };
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2024.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2024.java
index 41c7fd96f1..e7cabbca95 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2024.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2024.java
@@ -3,15 +3,15 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2024 extends Application {
+public class Ticket2024 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
GridLayout layout = new GridLayout(2, 2);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2026.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2026.java
index aa23572e0a..6d608ad529 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2026.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2026.java
@@ -2,14 +2,14 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket2026 extends Application {
+public class Ticket2026 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
GridLayout layout = new GridLayout(2, 2);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2029.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2029.java
index f13b57d110..1eadd3d7bd 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2029.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2029.java
@@ -11,12 +11,12 @@ import com.vaadin.ui.Component;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2029 extends Application {
+public class Ticket2029 extends Application.LegacyApplication {
int COMPONENTS;
int DIM1, DIM2;
@@ -28,7 +28,7 @@ public class Ticket2029 extends Application {
DIM1 = 504;
DIM2 = 100;
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
Panel p = createPanel();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2037.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2037.java
index 782cbd06c2..86d9cf6d40 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2037.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2037.java
@@ -4,14 +4,14 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2037 extends com.vaadin.Application {
+public class Ticket2037 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
setMainWindow(main);
main.addComponent(new Label(
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2038.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2038.java
index 85a5a4b701..a5c102b988 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2038.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2038.java
@@ -4,15 +4,15 @@ import com.vaadin.Application;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
-public class Ticket2038 extends Application {
+public class Ticket2038 extends Application.LegacyApplication {
@Override
public void init() {
- final Window w = new Window("Testing for #2038");
+ final LegacyWindow w = new LegacyWindow("Testing for #2038");
setMainWindow(w);
final TextField tf = new TextField(
@@ -36,7 +36,7 @@ public class Ticket2038 extends Application {
b.setImmediate(true);
b.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- tf.setRequiredError(b.booleanValue() ? "Field must not be empty"
+ tf.setRequiredError((Boolean) b.getValue() ? "Field must not be empty"
: null);
}
});
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2040.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2040.java
index 35210ebaa4..ac8928d110 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2040.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2040.java
@@ -3,17 +3,17 @@ package com.vaadin.tests.tickets;
import com.vaadin.ui.Accordion;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket2040 extends com.vaadin.Application {
+public class Ticket2040 extends com.vaadin.Application.LegacyApplication {
TextField f = new TextField();
@Override
public void init() {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
setMainWindow(main);
main.getContent().setSizeFull();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2042.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2042.java
index 1714a93f82..c4eded63d7 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2042.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2042.java
@@ -6,14 +6,14 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2042 extends Application {
+public class Ticket2042 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
GridLayout layout = new GridLayout(1, 2);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2043.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2043.java
index ce42699094..7238462397 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2043.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2043.java
@@ -4,13 +4,13 @@ import com.vaadin.Application;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Link;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2043 extends Application {
+public class Ticket2043 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
GridLayout layout = new GridLayout(10, 10);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2048.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2048.java
index 92a08eced9..84978a42e1 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2048.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2048.java
@@ -10,10 +10,10 @@ import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2048 extends Application {
+public class Ticket2048 extends Application.LegacyApplication {
private Embedded embedded;
private Panel p;
@@ -21,7 +21,7 @@ public class Ticket2048 extends Application {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
// splitPanel = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2051.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2051.java
index 29aeef21b1..bd098443f2 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2051.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2051.java
@@ -7,18 +7,18 @@ import com.vaadin.ui.Component;
import com.vaadin.ui.DateField;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket2051 extends Application {
+public class Ticket2051 extends Application.LegacyApplication {
private static final Object P1 = new Object();
private static final Object P2 = new Object();
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
GridLayout layout = new GridLayout(10, 10);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2053.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2053.java
index f784b40aed..751dbbae01 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2053.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2053.java
@@ -7,18 +7,17 @@ import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.CloseEvent;
-public class Ticket2053 extends Application {
+public class Ticket2053 extends Application.LegacyApplication {
int childs = 0;
@Override
public void init() {
- final Window main = new Window("#2053");
+ final LegacyWindow main = new LegacyWindow("#2053");
setMainWindow(main);
Button nothing = new Button("Do nothing");
main.addComponent(nothing);
@@ -28,12 +27,8 @@ public class Ticket2053 extends Application {
Button add = new Button("Add a window", new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
final String name = "Child " + (++childs);
- Window c = new Window(name);
- c.addListener(new Window.CloseListener() {
- public void windowClose(CloseEvent e) {
- main.addComponent(new Label(name + " closed"));
- }
- });
+ LegacyWindow c = new LegacyWindow(name);
+
addWindow(c);
main.open(new ExternalResource(c.getURL()), "_new");
main.addComponent(new Label(name + " opened"));
@@ -42,7 +37,7 @@ public class Ticket2053 extends Application {
tf.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
main.addComponent(new Label(name + " send text:"
- + tf.toString()));
+ + tf.getValue()));
}
});
for (int i = 0; i < 3; i++) {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2060.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2060.java
index 061c71a509..b47fbc8818 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2060.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2060.java
@@ -6,9 +6,9 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2060 extends Application {
+public class Ticket2060 extends Application.LegacyApplication {
private Button button1;
private Button button2;
@@ -16,7 +16,7 @@ public class Ticket2060 extends Application {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
GridLayout layout = new GridLayout(10, 10);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2061.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2061.java
index c9cc3ce328..0881d141cb 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2061.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2061.java
@@ -8,18 +8,18 @@ import com.vaadin.data.util.HierarchicalContainer;
import com.vaadin.ui.Accordion;
import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2061 extends Application {
+public class Ticket2061 extends Application.LegacyApplication {
- private Window mainWindow;
+ private LegacyWindow mainWindow;
@Override
public void init() {
- mainWindow = new Window("Ticket 2061");
+ mainWindow = new LegacyWindow("Ticket 2061");
mainWindow.setSizeFull();
mainWindow.getContent().setSizeFull();
setMainWindow(mainWindow);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2061b.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2061b.java
index 5dc6dde768..98badf36e8 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2061b.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2061b.java
@@ -12,6 +12,7 @@ import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
import com.vaadin.ui.TabSheet.SelectedTabChangeListener;
@@ -19,17 +20,16 @@ import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
-import com.vaadin.ui.Window;
-public class Ticket2061b extends Application implements
+public class Ticket2061b extends Application.LegacyApplication implements
SelectedTabChangeListener {
- private Window mainWindow;
+ private LegacyWindow mainWindow;
private Panel p;
@Override
public void init() {
- mainWindow = new Window("Ticket 2061b");
+ mainWindow = new LegacyWindow("Ticket 2061b");
mainWindow.setSizeFull();
AbstractOrderedLayout mainLayout = (AbstractOrderedLayout) mainWindow
.getContent();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2061c.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2061c.java
index 4cca979268..a8188a4913 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2061c.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2061c.java
@@ -10,22 +10,22 @@ import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
import com.vaadin.ui.TabSheet.SelectedTabChangeListener;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2061c extends Application implements
+public class Ticket2061c extends Application.LegacyApplication implements
SelectedTabChangeListener {
- private Window mainWindow;
+ private LegacyWindow mainWindow;
private Panel p;
@Override
public void init() {
- mainWindow = new Window("Vaadin");
+ mainWindow = new LegacyWindow("Vaadin");
mainWindow.setSizeFull();
mainWindow.getContent().setSizeFull();
setMainWindow(mainWindow);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2062.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2062.java
index 5b6bbe71de..5d91240c6a 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2062.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2062.java
@@ -2,17 +2,17 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.HorizontalSplitPanel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket2062 extends Application {
+public class Ticket2062 extends Application.LegacyApplication {
private static final Object P1 = new Object();
@Override
public void init() {
- setMainWindow(new Window("Ticket2062"));
+ setMainWindow(new LegacyWindow("Ticket2062"));
getMainWindow().setSizeFull();
HorizontalSplitPanel p = new HorizontalSplitPanel();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2083.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2083.java
index 25ecfabbec..ea77b6f2e6 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2083.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2083.java
@@ -4,13 +4,13 @@ import com.vaadin.Application;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2083 extends Application {
+public class Ticket2083 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
GridLayout layout = new GridLayout(10, 10);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2090.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2090.java
index 5bc69e0a64..b4171b9bac 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2090.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2090.java
@@ -3,18 +3,17 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.terminal.Sizeable;
import com.vaadin.terminal.UserError;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket2090 extends Application {
+public class Ticket2090 extends Application.LegacyApplication {
Label label = new Label();
Button target = new Button();
- Window w = new Window("#2090");
+ LegacyWindow w = new LegacyWindow("#2090");
@Override
public void init() {
@@ -30,7 +29,7 @@ public class Ticket2090 extends Application {
height.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
try {
- target.setHeight(height.toString());
+ target.setHeight(height.getValue());
height.setComponentError(null);
updateLabel();
} catch (Exception e) {
@@ -41,7 +40,7 @@ public class Ticket2090 extends Application {
width.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
try {
- target.setWidth(width.toString());
+ target.setWidth(width.getValue());
width.setComponentError(null);
updateLabel();
} catch (Exception e) {
@@ -54,9 +53,8 @@ public class Ticket2090 extends Application {
private void updateLabel() {
label.setValue("width: " + target.getWidth()
- + Sizeable.UNIT_SYMBOLS[target.getWidthUnits()] + ", height: "
- + target.getHeight()
- + Sizeable.UNIT_SYMBOLS[target.getHeightUnits()]);
+ + target.getWidthUnits().getSymbol() + ", height: "
+ + target.getHeight() + target.getHeightUnits().getSymbol());
}
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2095.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2095.java
index 42486748d2..a27ae7ac4d 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2095.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2095.java
@@ -3,13 +3,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Embedded;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2095 extends Application {
+public class Ticket2095 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// uncomment to workaround iorderedlayout bug in current trunk
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2098.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2098.java
index 4d02862e4b..5dc741eff6 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2098.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2098.java
@@ -2,23 +2,23 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.Window;
-public class Ticket2098 extends Application {
+public class Ticket2098 extends Application.LegacyApplication {
private static final String info = "First tab hidden, second should initially be selected";
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
w.addComponent(new Label(info));
createUI(w);
}
- private void createUI(Window w) {
+ private void createUI(LegacyWindow w) {
TabSheet ts = new TabSheet();
Label l1 = new Label("111");
Label l2 = new Label("222");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2099.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2099.java
index d0021ae75f..6278f7d4df 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2099.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2099.java
@@ -6,11 +6,12 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-public class Ticket2099 extends Application {
+public class Ticket2099 extends Application.LegacyApplication {
private Label l1, l2, l3;
private VerticalLayout ol1, ol2, ol3;
@@ -18,7 +19,7 @@ public class Ticket2099 extends Application {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
GridLayout layout = new GridLayout(10, 10);
@@ -36,7 +37,7 @@ public class Ticket2099 extends Application {
});
popup = createPopup();
- addWindow(popup);
+ getMainWindow().addWindow(popup);
layout.addComponent(b);
layout.addComponent(new Button("Hide label '222'", new ClickListener() {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2101.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2101.java
index 7d3412bfd8..67c3c9f331 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2101.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2101.java
@@ -2,13 +2,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Button;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2101 extends Application {
+public class Ticket2101 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
Button b = new Button(
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2103.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2103.java
index d65f4c1aec..1fb89eebc4 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2103.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2103.java
@@ -5,16 +5,16 @@ import com.vaadin.data.Item;
import com.vaadin.data.util.HierarchicalContainer;
import com.vaadin.ui.Accordion;
import com.vaadin.ui.Component;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2103 extends Application {
- private Window mainWindow;
+public class Ticket2103 extends Application.LegacyApplication {
+ private LegacyWindow mainWindow;
@Override
public void init() {
- mainWindow = new Window(getClass().getSimpleName());
+ mainWindow = new LegacyWindow(getClass().getSimpleName());
mainWindow.setContent(new VerticalLayout());
mainWindow.setSizeFull();
mainWindow.getContent().setSizeFull();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java
index 8b95fa35a2..4637b71fb4 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java
@@ -1,31 +1,32 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.util.MethodProperty;
import com.vaadin.event.ItemClickEvent;
import com.vaadin.event.ItemClickEvent.ItemClickListener;
import com.vaadin.terminal.ExternalResource;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.Tree;
-import com.vaadin.ui.Window;
-public class Ticket2104 extends Application {
+public class Ticket2104 extends Application.LegacyApplication {
private static final Label info = new Label(
"Click event should _always_ come trough. Switching features on/off should immediatly affect the tree (verify w/ debug window)",
- Label.CONTENT_RAW);
+ ContentMode.RAW);
Tree tree = new Tree();
Table table = new Table();
@Override
public void init() {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
setMainWindow(main);
main.addComponent(info);
@@ -48,8 +49,10 @@ public class Ticket2104 extends Application {
"multiSelect"));
cb.setImmediate(true);
ol.addComponent(cb);
- cb = new CheckBox("icon", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ cb = new CheckBox("icon");
+ cb.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
if (tree.getItemIconPropertyId() == null) {
tree.setItemIconPropertyId("icon");
} else {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2106.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2106.java
index 92908aa66d..0776f6c4a6 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2106.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2106.java
@@ -6,9 +6,9 @@ import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2106 extends Application {
+public class Ticket2106 extends Application.LegacyApplication {
private static CustomizedSystemMessages msgs = new Application.CustomizedSystemMessages();
static {
@@ -24,7 +24,7 @@ public class Ticket2106 extends Application {
@Override
public void init() {
- setMainWindow(new Window("#2106"));
+ setMainWindow(new LegacyWindow("#2106"));
getMainWindow().addComponent(
new Button("Do nothing", new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2107.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2107.java
index 199b278343..57926143eb 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2107.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2107.java
@@ -5,15 +5,15 @@ import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Validator;
import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
-public class Ticket2107 extends Application {
+public class Ticket2107 extends Application.LegacyApplication {
@Override
public void init() {
- final Window w = new Window("Testing for #2107");
+ final LegacyWindow w = new LegacyWindow("Testing for #2107");
setMainWindow(w);
final TextField tf = new TextField(
@@ -31,12 +31,8 @@ public class Ticket2107 extends Application {
});
tf.addValidator(new Validator() {
- public boolean isValid(Object value) {
- return value != null && value.toString().length() > 3;
- }
-
public void validate(Object value) throws InvalidValueException {
- if (!isValid(value)) {
+ if (value == null || value.toString().length() <= 3) {
throw new InvalidValueException(
"Text length must exceed 3 characters");
}
@@ -51,7 +47,7 @@ public class Ticket2107 extends Application {
b.setImmediate(true);
b.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- tf.setRequiredError(b.booleanValue() ? "Field must not be empty"
+ tf.setRequiredError(b.getValue() ? "Field must not be empty"
: null);
}
});
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2117.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2117.java
index 974b3c4572..82241843df 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2117.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2117.java
@@ -6,9 +6,10 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2117 extends Application {
+public class Ticket2117 extends Application.LegacyApplication {
@Override
public void init() {
@@ -16,10 +17,10 @@ public class Ticket2117 extends Application {
}
@Override
- public Window getWindow(String name) {
+ public LegacyWindow getWindow(String name) {
// If we already have the requested window, use it
- Window w = super.getWindow(name);
+ LegacyWindow w = super.getWindow(name);
if (w == null) {
// If no window found, create it
@@ -29,8 +30,8 @@ public class Ticket2117 extends Application {
return w;
}
- private Window createExtraWindow(String name) {
- final Window w = new Window("Extra window: " + name);
+ private LegacyWindow createExtraWindow(String name) {
+ final LegacyWindow w = new LegacyWindow("Extra window: " + name);
w.setName(name);
addWindow(w);
w.addComponent(new Label(
@@ -46,15 +47,15 @@ public class Ticket2117 extends Application {
return w;
}
- private Window createWindow() {
- final Window w = new Window();
+ private LegacyWindow createWindow() {
+ final LegacyWindow w = new LegacyWindow();
w.addComponent(new Label(
"Click this link: <a target=\"_blank\" href='"
+ getURL().toExternalForm()
+ "'>"
+ getURL().toExternalForm()
+ "</a> which opens new windows to this uri. They should end up having a separate Window and URL.",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
return w;
}
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2119.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2119.java
index c1e0d64dde..b7dc84b8ab 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2119.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2119.java
@@ -6,32 +6,33 @@ import com.vaadin.data.util.ObjectProperty;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Select;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
/**
* Test case for Ticket 2119.
*/
-public class Ticket2119 extends Application {
+public class Ticket2119 extends Application.LegacyApplication {
private ObjectProperty<String> globalValue;
@Override
public void init() {
globalValue = new ObjectProperty<String>(null, String.class);
- Window main = createWindow();
+ LegacyWindow main = createWindow();
setMainWindow(main);
}
@Override
- public Window getWindow(String name) {
+ public LegacyWindow getWindow(String name) {
if (!isRunning()) {
return null;
}
// If we already have the requested window, use it
- Window w = super.getWindow(name);
+ LegacyWindow w = super.getWindow(name);
if (w == null) {
// If no window found, create it
w = createWindow();
@@ -41,8 +42,8 @@ public class Ticket2119 extends Application {
return w;
}
- private Window createWindow() {
- Window main = new Window("Test for ticket XXX");
+ private LegacyWindow createWindow() {
+ LegacyWindow main = new LegacyWindow("Test for ticket XXX");
main.setContent(testLayout());
return main;
}
@@ -56,7 +57,7 @@ public class Ticket2119 extends Application {
+ " - Go to the second Window\n"
+ " - Click the arrow in the Select\n"
+ " --> The opened list correctly shows the new value but the old one is shown in the \"input\" part");
- label.setContentMode(Label.CONTENT_PREFORMATTED);
+ label.setContentMode(ContentMode.PREFORMATTED);
layout.addComponent(label);
final Select select = new Select("Test Select");
@@ -74,7 +75,9 @@ public class Ticket2119 extends Application {
globalValue.addListener(new Property.ValueChangeListener() {
public void valueChange(Property.ValueChangeEvent event) {
- valueProperty.setValue(event.getProperty().getValue());
+ Object value = event.getProperty().getValue();
+ valueProperty.setValue((null != value) ? value.toString()
+ : null);
}
});
@@ -89,4 +92,4 @@ public class Ticket2119 extends Application {
return layout;
}
-} \ No newline at end of file
+}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2125.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2125.java
index b296a4ff46..cc81c787b2 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2125.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2125.java
@@ -5,12 +5,12 @@ import com.vaadin.data.util.MethodProperty;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.CellStyleGenerator;
import com.vaadin.ui.Table.ColumnGenerator;
-import com.vaadin.ui.Window;
-public class Ticket2125 extends Application {
+public class Ticket2125 extends Application.LegacyApplication {
@Override
public void init() {
@@ -18,7 +18,7 @@ public class Ticket2125 extends Application {
}
- class MainWindow extends Window {
+ class MainWindow extends LegacyWindow {
MainWindow(String caption) {
super(caption);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2126.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2126.java
index 4de873a7fc..abcca6d59c 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2126.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2126.java
@@ -5,8 +5,8 @@ import com.vaadin.data.util.IndexedContainer;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
/**
*
@@ -14,9 +14,9 @@ import com.vaadin.ui.Window;
* client.
*
*/
-public class Ticket2126 extends com.vaadin.Application {
+public class Ticket2126 extends com.vaadin.Application.LegacyApplication {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
Table table = new Table();
@Override
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2151.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2151.java
index 5a48156367..c2fbe1b4f7 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2151.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2151.java
@@ -2,19 +2,21 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.ui.AbstractComponent;
+import com.vaadin.ui.AbstractField;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2151 extends Application {
+public class Ticket2151 extends Application.LegacyApplication {
private Label status;
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
@@ -38,30 +40,21 @@ public class Ticket2151 extends Application {
layout.addComponent(new Label("b"));
layout.addComponent(new Label("c"));
- check(Button.class);
- check(CheckBox.class);
- checkDataBinding(Button.class);
+ checkButton(Button.class);
+ checkCheckBox(CheckBox.class);
checkDataBinding(CheckBox.class);
}
- private void check(Class<? extends Button> class1) {
+ private void checkButton(Class<? extends Button> class1) {
boolean ok = false;
- Button b;
+ AbstractComponent b;
try {
b = class1.newInstance();
b.setCaption("Button of type " + class1.getSimpleName());
- try {
- // This should throw an exception
- b.setValue("ON");
- } catch (IllegalArgumentException e) {
- ok = true;
- } catch (Exception e) {
- e.printStackTrace();
- }
+ ok = true;
} catch (Exception e1) {
e1.printStackTrace();
- return;
}
if (ok) {
@@ -74,15 +67,30 @@ public class Ticket2151 extends Application {
}
- private void checkDataBinding(Class<? extends Button> class1) {
+ private void checkCheckBox(Class<? extends CheckBox> class1) {
+ boolean ok = false;
+ CheckBox b;
+ try {
+ b = class1.newInstance();
+ } catch (Exception e1) {
+ e1.printStackTrace();
+ return;
+ }
+
+ b.setCaption("Button of type " + class1.getSimpleName());
+ status.setValue(status.getValue() + " "
+ + class1.getClass().getSimpleName() + ": OK");
+
+ }
+
+ private void checkDataBinding(Class<? extends AbstractField> class1) {
boolean ok = false;
- Button b;
+ AbstractField b;
try {
b = class1.newInstance();
b.setCaption("Button of type " + class1.getSimpleName());
try {
- b.setWriteThrough(true);
- b.setReadThrough(true);
+ b.setBuffered(false);
ObjectProperty<String> prop = new ObjectProperty<String>(
"ABC 123");
/*
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2157.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2157.java
index 3d90907e50..23c5b0bcd5 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2157.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2157.java
@@ -4,14 +4,14 @@ import com.vaadin.Application;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2157 extends Application {
+public class Ticket2157 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2178.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2178.java
index a3461dd8b6..6de42003b4 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2178.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2178.java
@@ -4,14 +4,14 @@ import com.vaadin.Application;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2178 extends Application {
+public class Ticket2178 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2179.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2179.java
index 165e770307..ba4dd2ee46 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2179.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2179.java
@@ -4,13 +4,13 @@ import com.vaadin.Application;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Validator;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket2179 extends Application {
+public class Ticket2179 extends Application.LegacyApplication {
TextField f = new TextField("Test fiel ( must contain 1 & 2 )");
- Window main = new Window("Dual validator test");
+ LegacyWindow main = new LegacyWindow("Dual validator test");
@Override
public void init() {
@@ -33,19 +33,15 @@ public class Ticket2179 extends Application {
}
- class ContainsValidator implements Validator {
+ static class ContainsValidator implements Validator {
private final String c;
public ContainsValidator(String c) {
this.c = c;
}
- public boolean isValid(Object value) {
- return value != null && value.toString().contains(c);
- }
-
public void validate(Object value) throws InvalidValueException {
- if (!isValid(value)) {
+ if (value == null || !value.toString().contains(c)) {
throw new InvalidValueException("Value does not contain " + c);
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2180.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2180.java
index 9f5e2a2de1..7b993cdf24 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2180.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2180.java
@@ -3,17 +3,17 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.Window;
-public class Ticket2180 extends Application {
+public class Ticket2180 extends Application.LegacyApplication {
- private Window mainWindow;
+ private LegacyWindow mainWindow;
private TabSheet tabSheet;
@Override
public void init() {
- mainWindow = new Window("Tabsheet should cause scrollbars");
+ mainWindow = new LegacyWindow("Tabsheet should cause scrollbars");
setMainWindow(mainWindow);
// mainWindow.getLayout().setSizeFull();
tabSheet = new TabSheet();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2181.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2181.java
index ea3d996b98..c3219102f6 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2181.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2181.java
@@ -12,17 +12,18 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component;
import com.vaadin.ui.OptionGroup;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2181 extends Application implements Button.ClickListener {
+public class Ticket2181 extends Application.LegacyApplication implements
+ Button.ClickListener {
// private static final Object PROPERTY_VALUE = new Object();
// private static final Object PROPERTY_CAPTION = new Object();
private static final String caption = "This is a caption which is very long and nice and perhaps sometimes should be clipped";
- Window main = new Window("#2181 test");
+ LegacyWindow main = new LegacyWindow("#2181 test");
TextField tf1 = new TextField(caption, "Test field - undefined width");
TextField tf2 = new TextField(caption, "Test field - 150px wide");
Button setButton = new Button("Set", this);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2186.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2186.java
index bc9ff8c27d..b7817d2ed7 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2186.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2186.java
@@ -4,15 +4,15 @@ import com.vaadin.Application;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2186 extends Application {
+public class Ticket2186 extends Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window("Quick test");
+ LegacyWindow main = new LegacyWindow("Quick test");
setMainWindow(main);
HorizontalLayout base = new HorizontalLayout();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2204.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2204.java
index 6a047cb626..eef13ca06c 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2204.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2204.java
@@ -26,12 +26,12 @@ import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Panel;
import com.vaadin.ui.RichTextArea;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
-import com.vaadin.ui.Window;
-public class Ticket2204 extends Application {
+public class Ticket2204 extends Application.LegacyApplication {
private final List<RichTextArea> textAreas = new ArrayList<RichTextArea>();
private TabSheet ts;
@@ -52,7 +52,7 @@ public class Ticket2204 extends Application {
classes.add(HorizontalSplitPanel.class);
classes.add(Form.class);
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
@@ -128,7 +128,7 @@ public class Ticket2204 extends Application {
Form f = (Form) cc;
f.setFormFieldFactory(new FormFieldFactory() {
- public Field createField(Item item, Object propertyId,
+ public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
formTextArea = new RichTextArea();
formTextArea.setVisible(false);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2208.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2208.java
index ff3d9e6ca1..ada9471f18 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2208.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2208.java
@@ -4,18 +4,18 @@ import com.vaadin.Application;
import com.vaadin.data.Item;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.CellStyleGenerator;
import com.vaadin.ui.Table.ColumnGenerator;
-import com.vaadin.ui.Window;
-public class Ticket2208 extends Application {
+public class Ticket2208 extends Application.LegacyApplication {
private Table t;
@Override
public void init() {
- Window mainWindow = new Window();
+ LegacyWindow mainWindow = new LegacyWindow();
setMainWindow(mainWindow);
t = new Table("A table");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2209.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2209.java
index c6b30fa52f..5ba69895b6 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2209.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2209.java
@@ -7,9 +7,9 @@ import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2209 extends Application {
+public class Ticket2209 extends Application.LegacyApplication {
private GridLayout gl;
private ComboBox combo;
@@ -17,7 +17,7 @@ public class Ticket2209 extends Application {
@Override
public void init() {
- setMainWindow(new Window());
+ setMainWindow(new LegacyWindow());
gl = new GridLayout(1, 2);
gl.setStyleName("borders");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL.java
index c7305bd0fb..4a45709ef6 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL.java
@@ -6,10 +6,10 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2209OL extends Application {
+public class Ticket2209OL extends Application.LegacyApplication {
private VerticalLayout gl;
private ComboBox combo;
@@ -17,7 +17,7 @@ public class Ticket2209OL extends Application {
@Override
public void init() {
- setMainWindow(new Window());
+ setMainWindow(new LegacyWindow());
getMainWindow().getContent().setWidth("250px");
gl = new VerticalLayout();
gl.setStyleName("borders");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL2.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL2.java
index d7385562cd..e2e51d8101 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL2.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL2.java
@@ -6,10 +6,10 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2209OL2 extends Application {
+public class Ticket2209OL2 extends Application.LegacyApplication {
private VerticalLayout gl;
private ComboBox combo;
@@ -17,7 +17,7 @@ public class Ticket2209OL2 extends Application {
@Override
public void init() {
- setMainWindow(new Window());
+ setMainWindow(new LegacyWindow());
getMainWindow().getContent().setWidth("250px");
gl = new VerticalLayout();
gl.setSizeUndefined();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2215.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2215.java
index 62ed69e433..5b98fe3af3 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2215.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2215.java
@@ -3,15 +3,15 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
import com.vaadin.ui.themes.Reindeer;
-public class Ticket2215 extends Application {
+public class Ticket2215 extends Application.LegacyApplication {
@Override
public void init() {
- setMainWindow(new Window());
+ setMainWindow(new LegacyWindow());
VerticalLayout ol = new VerticalLayout();
Panel p = new Panel("Test");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2221.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2221.java
index e6489da432..2b7d5ef6d1 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2221.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2221.java
@@ -9,15 +9,15 @@ import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2221 extends Application {
+public class Ticket2221 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2222.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2222.java
index 86dccede69..51ac463a6e 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2222.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2222.java
@@ -5,14 +5,14 @@ import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2222 extends Application {
+public class Ticket2222 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java
index c93b26bec2..e436bab283 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java
@@ -5,15 +5,16 @@ import com.vaadin.data.Item;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2227OrderedlayoutInTable extends Application {
+public class Ticket2227OrderedlayoutInTable extends
+ Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window();
+ LegacyWindow w = new LegacyWindow();
Table t = new Table();
t.setWidth("500px");
t.setHeight("200px");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2231.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2231.java
index ba12dd7abc..ab0cc82628 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2231.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2231.java
@@ -3,13 +3,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2231 extends Application {
+public class Ticket2231 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2232.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2232.java
index ab4e83f0ba..ae8a4b0f51 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2232.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2232.java
@@ -6,14 +6,14 @@ import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.SpacingHandler;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2232 extends Application {
+public class Ticket2232 extends Application.LegacyApplication {
@Override
public void init() {
- setMainWindow(new Window());
+ setMainWindow(new LegacyWindow());
setTheme("tests-tickets");
getMainWindow()
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2234.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2234.java
index 5c6167fbfe..24a6d2ea77 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2234.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2234.java
@@ -4,13 +4,13 @@ import com.vaadin.Application;
import com.vaadin.data.Item;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2234 extends Application {
+public class Ticket2234 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2235.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2235.java
index 72a77e502e..10978cad30 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2235.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2235.java
@@ -2,14 +2,14 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextArea;
-import com.vaadin.ui.Window;
-public class Ticket2235 extends Application {
+public class Ticket2235 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2240.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2240.java
index 6d70d89af8..bf01475809 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2240.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2240.java
@@ -3,10 +3,11 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket2240 extends Application {
+public class Ticket2240 extends Application.LegacyApplication {
public static final String txt = "<p>There are two main types of windows: application-level windows, and "
+ "\"sub windows\".</p><p>A sub window is rendered as a \"inline\" popup window"
@@ -25,7 +26,7 @@ public class Ticket2240 extends Application {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
@@ -36,7 +37,7 @@ public class Ticket2240 extends Application {
layout.setStyleName("borders");
// layout.setSizeFull();
final Label l = new Label(txt);
- l.setContentMode(Label.CONTENT_XHTML);
+ l.setContentMode(ContentMode.XHTML);
// l.setWidth("100%");
TextField tf = new TextField("This is a textField");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2242.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2242.java
index fa25ff55f1..15b2b630a5 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2242.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2242.java
@@ -10,10 +10,11 @@ import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
-public class Ticket2242 extends Application implements ValueChangeListener {
+public class Ticket2242 extends Application.LegacyApplication implements
+ ValueChangeListener {
private Object tableValue = null;
private Table t;
@@ -22,7 +23,7 @@ public class Ticket2242 extends Application implements ValueChangeListener {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2244.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2244.java
index e9ae3ac720..8540960b30 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2244.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2244.java
@@ -8,15 +8,15 @@ import com.vaadin.ui.Form;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2244 extends Application {
+public class Ticket2244 extends Application.LegacyApplication {
Form form;
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
GridLayout gl = new GridLayout(3, 3);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2245.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2245.java
index bac85c95cd..1586a1966b 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2245.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2245.java
@@ -2,13 +2,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.HorizontalSplitPanel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2245 extends Application {
+public class Ticket2245 extends Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window("The Main Window");
+ LegacyWindow main = new LegacyWindow("The Main Window");
main.getContent().setSizeFull();
setMainWindow(main);
HorizontalSplitPanel sp = new HorizontalSplitPanel();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2267.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2267.java
index 020ea5c7c6..cf1d2f64d2 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2267.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2267.java
@@ -6,15 +6,15 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2267 extends Application {
+public class Ticket2267 extends Application.LegacyApplication {
Label l = new Label("0");
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
GridLayout gl = new GridLayout(4, 2);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2271.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2271.java
index 50a99edb7a..fb281f22b2 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2271.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2271.java
@@ -4,14 +4,14 @@ import com.vaadin.Application;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2271 extends Application {
+public class Ticket2271 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2279.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2279.java
index e3b446f242..1e39cd0b8c 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2279.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2279.java
@@ -10,14 +10,15 @@ import com.vaadin.terminal.gwt.client.ui.AlignmentInfo;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.AlignmentHandler;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
// This tests the deprecated setComponentAlignment(Component,String) API
@SuppressWarnings("deprecation")
-public class Ticket2279 extends Application {
+public class Ticket2279 extends Application.LegacyApplication {
private Label label;
@@ -61,7 +62,7 @@ public class Ticket2279 extends Application {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
AbstractOrderedLayout layout = (AbstractOrderedLayout) w.getContent();
@@ -75,7 +76,7 @@ public class Ticket2279 extends Application {
vl.setHeight("500px");
vl.setStyleName("borders");
label = new Label("<b>Error messages follows:</b><br/>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
vl.addComponent(label);
layout.addComponent(vl);
@@ -86,7 +87,7 @@ public class Ticket2279 extends Application {
gl.setHeight("500px");
gl.setStyleName("borders");
label = new Label("<b>Error messages follows:</b><br/>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
gl.addComponent(label);
layout.addComponent(gl);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2282.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2282.java
index c63faf2cef..67fe3f9846 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2282.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2282.java
@@ -5,16 +5,16 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2282 extends Application {
+public class Ticket2282 extends Application.LegacyApplication {
private FormLayout layout1;
private FormLayout layout2;
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
w.getContent().setSizeUndefined();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2283.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2283.java
index 89b90eaa01..8375ca648f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2283.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2283.java
@@ -4,13 +4,13 @@ import com.vaadin.Application;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2283 extends Application {
+public class Ticket2283 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
GridLayout gl = new GridLayout(2, 2);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2287.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2287.java
index 0942877947..66328fa4b9 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2287.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2287.java
@@ -3,27 +3,28 @@ package com.vaadin.tests.tickets;
import java.net.URL;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Root.LegacyWindow;
public class Ticket2287 extends Ticket2292 {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
URL url = getURL();
main.addComponent(new Label(
"Icon is built by servlet with a slow method, so it will show the bug (components not firing requestLayout)."));
Label l = new Label();
- l.setContentMode(Label.CONTENT_XHTML);
+ l.setContentMode(ContentMode.XHTML);
l.setValue("This is a label with as slow image. <img src=\"" + url
+ "/icon.png\" />");
main.addComponent(l);
l = new Label();
- l.setContentMode(Label.CONTENT_XHTML);
+ l.setContentMode(ContentMode.XHTML);
l.setValue("This is a label with as slow image. <img src=\"" + url
+ "/icon.png\" />");
main.addComponent(l);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2289.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2289.java
index 19574b50fb..4cd421e30d 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2289.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2289.java
@@ -7,11 +7,11 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2289 extends Application {
+public class Ticket2289 extends Application.LegacyApplication {
TabSheet ts = null;
Accordion acc = null;
@@ -19,7 +19,7 @@ public class Ticket2289 extends Application {
@Override
public void init() {
- Window w = new Window();
+ LegacyWindow w = new LegacyWindow();
setMainWindow(w);
VerticalLayout ol = new VerticalLayout();
w.setContent(ol);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java
index 8ddc6519f7..a413e87110 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java
@@ -6,24 +6,28 @@ import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.net.URL;
import javax.imageio.ImageIO;
+import com.vaadin.Application;
import com.vaadin.terminal.DownloadStream;
import com.vaadin.terminal.ExternalResource;
+import com.vaadin.terminal.RequestHandler;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.terminal.WrappedResponse;
import com.vaadin.ui.Button;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Label;
import com.vaadin.ui.Link;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2292 extends com.vaadin.Application {
+public class Ticket2292 extends com.vaadin.Application.LegacyApplication
+ implements RequestHandler {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
ExternalResource icon = new ExternalResource("./icon.png");
@@ -40,12 +44,16 @@ public class Ticket2292 extends com.vaadin.Application {
Link l = new Link("l", icon);
main.addComponent(l);
+ addRequestHandler(this);
}
- @Override
- public DownloadStream handleURI(URL context, String relativeUri) {
+ public boolean handleRequest(Application application,
+ WrappedRequest request, WrappedResponse response)
+ throws IOException {
+ String relativeUri = request.getRequestPathInfo();
+
if (!relativeUri.contains("icon.png")) {
- return null;
+ return false;
}
// be slow to show bug
@@ -78,9 +86,10 @@ public class Ticket2292 extends com.vaadin.Application {
// Return a stream from the buffer.
ByteArrayInputStream istream = new ByteArrayInputStream(
imagebuffer.toByteArray());
- return new DownloadStream(istream, null, null);
+ new DownloadStream(istream, null, null).writeTo(response);
+ return true;
} catch (IOException e) {
- return null;
+ return false;
}
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2294.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2294.java
index 37c29ca5e0..30392a245d 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2294.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2294.java
@@ -4,13 +4,13 @@ import com.vaadin.Application;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2294 extends Application {
+public class Ticket2294 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2296.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2296.java
index 1503811341..31ff4a8353 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2296.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2296.java
@@ -3,13 +3,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.CustomLayout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2296 extends Application {
+public class Ticket2296 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
CustomLayout cl = new CustomLayout("Ticket2296");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2297.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2297.java
index 8b425af136..1d1f0f1d74 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2297.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2297.java
@@ -6,14 +6,14 @@ import java.net.URL;
import com.vaadin.ui.CustomLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
public class Ticket2297 extends Ticket2292 {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
URL url = getURL();
main.addComponent(new Label(
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2303.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2303.java
index 3b8864bccc..bc11a7ea49 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2303.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2303.java
@@ -6,14 +6,14 @@ import java.io.IOException;
import com.vaadin.Application;
import com.vaadin.ui.CustomLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2303 extends Application {
+public class Ticket2303 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window("main window");
+ LegacyWindow w = new LegacyWindow("main window");
String customlayout = "<div location=\"test\"></div>";
CustomLayout cl = null;
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2304.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2304.java
index 1b356c73fb..9484b4865f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2304.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2304.java
@@ -2,16 +2,17 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.themes.Reindeer;
-public class Ticket2304 extends Application {
+public class Ticket2304 extends Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
Panel p = new Panel();
@@ -21,7 +22,7 @@ public class Ticket2304 extends Application {
Label l = new Label(
"a\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\n");
- l.setContentMode(Label.CONTENT_PREFORMATTED);
+ l.setContentMode(ContentMode.PREFORMATTED);
p.addComponent(l);
main.addComponent(new Label(
"This text should be right below the panel, w/o spacing"));
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2310.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2310.java
index 6363fddcaf..36bda7095c 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2310.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2310.java
@@ -5,15 +5,15 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.themes.Reindeer;
-public class Ticket2310 extends Application {
+public class Ticket2310 extends Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
main.addComponent(new Label("Instructions: change label when panel is "
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2319.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2319.java
index b8a2ba8db8..ec6d3be801 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2319.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2319.java
@@ -6,15 +6,15 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
-import com.vaadin.ui.Window;
-public class Ticket2319 extends Application {
+public class Ticket2319 extends Application.LegacyApplication {
@Override
public void init() {
- Window mainw = new Window();
+ LegacyWindow mainw = new LegacyWindow();
setMainWindow(mainw);
mainw.addComponent(new Label(
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2323.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2323.java
index 503878ecad..123c154e61 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2323.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2323.java
@@ -2,13 +2,14 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.RichTextArea;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Window;
-public class Ticket2323 extends Application {
+public class Ticket2323 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
Window subWindow = new Window("");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2325.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2325.java
index 1245254fa0..c253eb70e6 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2325.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2325.java
@@ -1,15 +1,16 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-public class Ticket2325 extends Application {
+public class Ticket2325 extends Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window("Testing....");
+ LegacyWindow main = new LegacyWindow("Testing....");
setMainWindow(main);
final VerticalLayout lo = new VerticalLayout();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2329.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2329.java
index 57dbeb4033..f1906d1492 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2329.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2329.java
@@ -3,18 +3,18 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.ColumnGenerator;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2329 extends Application {
+public class Ticket2329 extends Application.LegacyApplication {
private Table table;
private VerticalLayout mainLo;
@Override
public void init() {
- Window mainw = new Window();
+ LegacyWindow mainw = new LegacyWindow();
setMainWindow(mainw);
mainLo = (VerticalLayout) mainw.getContent();
table = new Table();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2337.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2337.java
index 9277a01f96..f71492a96b 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2337.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2337.java
@@ -5,15 +5,15 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2337 extends Application {
+public class Ticket2337 extends Application.LegacyApplication {
GridLayout gl = new GridLayout(3, 1);
@Override
public void init() {
- Window w = new Window();
+ LegacyWindow w = new LegacyWindow();
setMainWindow(w);
Button b = new Button("add", new Button.ClickListener() {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2339.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2339.java
index 6476807ada..81dc3af40f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2339.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2339.java
@@ -6,14 +6,15 @@ import java.io.IOException;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.CustomLayout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2339 extends Application {
+public class Ticket2339 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window(getClass().getSimpleName());
+ final LegacyWindow mainWin = new LegacyWindow(getClass()
+ .getSimpleName());
setMainWindow(mainWin);
try {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2341.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2341.java
index d7fbccfa4e..a35c27962f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2341.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2341.java
@@ -3,13 +3,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.data.Item;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
-public class Ticket2341 extends com.vaadin.Application {
+public class Ticket2341 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
setMainWindow(main);
constructTables((Layout) main.getContent());
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2344.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2344.java
index 26ef216940..d7b1eacd2c 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2344.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2344.java
@@ -4,16 +4,16 @@ import java.util.Random;
import com.vaadin.Application;
import com.vaadin.ui.Button;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
import com.vaadin.ui.themes.BaseTheme;
-public class Ticket2344 extends Application {
+public class Ticket2344 extends Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window("Quick test");
+ LegacyWindow main = new LegacyWindow("Quick test");
setMainWindow(main);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2347.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2347.java
index 76e59146db..207d6ee413 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2347.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2347.java
@@ -5,16 +5,16 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CustomLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2347 extends Application {
+public class Ticket2347 extends Application.LegacyApplication {
private Button b1;
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
createUI((VerticalLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2364.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2364.java
index 7f7290dd80..8039609339 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2364.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2364.java
@@ -2,16 +2,16 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Form;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Select;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2364 extends Application {
+public class Ticket2364 extends Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window("The Main Window!!!");
+ LegacyWindow main = new LegacyWindow("The Main Window!!!");
setMainWindow(main);
Form form = new Form();
VerticalLayout formLayout = new VerticalLayout();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2365.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2365.java
index 0c8a095ec9..19d473f970 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2365.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2365.java
@@ -4,15 +4,16 @@ import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2365 extends Application {
+public class Ticket2365 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window(getClass().getSimpleName());
+ final LegacyWindow mainWin = new LegacyWindow(getClass()
+ .getSimpleName());
setMainWindow(mainWin);
VerticalLayout lo = new VerticalLayout();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2398.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2398.java
index dee0417eff..054cc5f0cc 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2398.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2398.java
@@ -3,15 +3,15 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
-public class Ticket2398 extends Application {
+public class Ticket2398 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window();
+ final LegacyWindow mainWin = new LegacyWindow();
setMainWindow(mainWin);
Table t = new Table();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2404.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2404.java
index 478d8b7786..0da70301d1 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2404.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2404.java
@@ -3,9 +3,9 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2404 extends Application {
+public class Ticket2404 extends Application.LegacyApplication {
@Override
public void init() {
@@ -22,7 +22,7 @@ public class Ticket2404 extends Application {
b.setSizeFull();
}
- setMainWindow(new Window("GridLayout test", gl));
+ setMainWindow(new LegacyWindow("GridLayout test", gl));
}
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java
index 9ab0d851ad..16a552e37a 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java
@@ -9,11 +9,11 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2405 extends Application {
+public class Ticket2405 extends Application.LegacyApplication {
private Label label;
private HorizontalSplitPanel split;
@@ -21,10 +21,9 @@ public class Ticket2405 extends Application {
@Override
public void init() {
- final Window root = new Window("VaadinTunes");
+ final LegacyWindow root = new LegacyWindow("VaadinTunes");
root.setWidth("90%");
root.setHeight("90%");
- root.center();
// We'll attach the window to the browser view already here, so we won't
// forget it later.
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2406.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2406.java
index b7c9f902d2..a121d93099 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2406.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2406.java
@@ -4,16 +4,17 @@ import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-public class Ticket2406 extends Application {
+public class Ticket2406 extends Application.LegacyApplication {
private Window w;
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((VerticalLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2407.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2407.java
index f5ac1dc37f..51ab08188e 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2407.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2407.java
@@ -1,15 +1,15 @@
package com.vaadin.tests.tickets;
import com.vaadin.ui.Form;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2407 extends com.vaadin.Application {
+public class Ticket2407 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window("Ticket2407");
+ final LegacyWindow main = new LegacyWindow("Ticket2407");
setMainWindow(main);
Form form = new Form(new VerticalLayout());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2411.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2411.java
index 01bd4f0651..6801bfa88d 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2411.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2411.java
@@ -3,13 +3,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2411 extends Application {
+public class Ticket2411 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// VerticalLayout l = new VerticalLayout();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2415.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2415.java
index 5c1d0c2a51..0514e9bb39 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2415.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2415.java
@@ -3,14 +3,14 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket2415 extends Application {
+public class Ticket2415 extends Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window("");
+ final LegacyWindow main = new LegacyWindow("");
setMainWindow(main);
final TextField tf = new TextField("Try to change me");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2420.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2420.java
index e40d73877c..adca729c9e 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2420.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2420.java
@@ -2,16 +2,16 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.ProgressIndicator;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2420 extends Application {
+public class Ticket2420 extends Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window("Hello window");
+ final LegacyWindow main = new LegacyWindow("Hello window");
setMainWindow(main);
- main.setTheme("tests-tickets");
+ setTheme("tests-tickets");
ProgressIndicator pi = new ProgressIndicator();
pi.setCaption("Visible");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2425.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2425.java
index 75810137ad..8c9be295a0 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2425.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2425.java
@@ -3,14 +3,14 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.Window;
-public class Ticket2425 extends Application {
+public class Ticket2425 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
w.addComponent(new Label("No scrollbars should be visible anywhere"));
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2426.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2426.java
index 90e2ce438d..a979b6711f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2426.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2426.java
@@ -2,26 +2,26 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2426 extends Application {
+public class Ticket2426 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window();
+ LegacyWindow w = new LegacyWindow();
setMainWindow(w);
final String content = "<select/>";
w.addComponent(new Label("CONTENT_DEFAULT: " + content,
- Label.CONTENT_DEFAULT));
+ ContentMode.DEFAULT));
w.addComponent(new Label("CONTENT_PREFORMATTED: " + content,
- Label.CONTENT_PREFORMATTED));
- w.addComponent(new Label("CONTENT_RAW: " + content, Label.CONTENT_RAW));
- w.addComponent(new Label("CONTENT_TEXT: " + content, Label.CONTENT_TEXT));
- w.addComponent(new Label("CONTENT_XML: " + content, Label.CONTENT_XML));
- w.addComponent(new Label("CONTENT_XHTML: " + content,
- Label.CONTENT_XHTML));
+ ContentMode.PREFORMATTED));
+ w.addComponent(new Label("CONTENT_RAW: " + content, ContentMode.RAW));
+ w.addComponent(new Label("CONTENT_TEXT: " + content, ContentMode.TEXT));
+ w.addComponent(new Label("CONTENT_XML: " + content, ContentMode.XML));
+ w.addComponent(new Label("CONTENT_XHTML: " + content, ContentMode.XHTML));
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2431.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2431.java
index e1eb2531f2..b751488bae 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2431.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2431.java
@@ -7,14 +7,14 @@ import com.vaadin.event.ShortcutAction;
import com.vaadin.event.ShortcutAction.KeyCode;
import com.vaadin.event.ShortcutAction.ModifierKey;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2431 extends Application {
+public class Ticket2431 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window();
+ LegacyWindow w = new LegacyWindow();
setMainWindow(w);
Label help = new Label(
"Use CTRL X to fire action, CTRL C to remove it (fails before fix)");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2432.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2432.java
index 326f27d58a..2716038873 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2432.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2432.java
@@ -8,14 +8,14 @@ import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.AlignmentHandler;
import com.vaadin.ui.Layout.SpacingHandler;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2432 extends Application {
+public class Ticket2432 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window();
+ LegacyWindow w = new LegacyWindow();
setMainWindow(w);
w.getContent().setSizeFull();
((SpacingHandler) w.getContent()).setSpacing(true);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2434.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2434.java
index 5d4a884895..79e383393f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2434.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2434.java
@@ -2,15 +2,15 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
-public class Ticket2434 extends Application {
+public class Ticket2434 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window();
+ LegacyWindow w = new LegacyWindow();
setMainWindow(w);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2436.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2436.java
index 0d8c5ad2dd..fc6445d62f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2436.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2436.java
@@ -4,13 +4,13 @@ import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
import com.vaadin.ui.PopupView;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2436 extends Application {
+public class Ticket2436 extends Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window();
+ final LegacyWindow main = new LegacyWindow();
setMainWindow(main);
final Button remover = new Button("Remove PopupView");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2440.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2440.java
deleted file mode 100644
index cd1e8e682e..0000000000
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2440.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.vaadin.tests.tickets;
-
-import java.net.URL;
-
-import com.vaadin.Application;
-import com.vaadin.terminal.DownloadStream;
-import com.vaadin.terminal.ExternalResource;
-import com.vaadin.terminal.URIHandler;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Link;
-import com.vaadin.ui.Window;
-
-public class Ticket2440 extends Application {
-
- @Override
- public void init() {
- final Window main = new MainWindow();
- setMainWindow(main);
- main.addComponent(new Label(
- "Clicking the link should open a new window that should receive the URI 'msg/hello' and add that a a Label to it's ui. Currently the Label ends up in this (main) window (try reloading). Console intentionally spams during the window finding/uri handling - looks, uhm, interesting."));
- }
-
- @Override
- public Window getWindow(String name) {
- System.err.println("Looking for " + name);
- if ("msg".equals(name)) {
- System.err
- .println(" rest uri, returning new MainWindow with message from uri");
- MainWindow restWindow = new MainWindow();
- addWindow(restWindow);
- return restWindow;
- }
- // If we already have the requested window, use it
- Window w = super.getWindow(name);
- if (w == null) {
- // If no window found, create it
- System.err.println(" new win");
- w = new MainWindow();
- w.setName(name);
- addWindow(w);
- return w;
- } else {
- System.err.println(" found win");
- return w;
- }
-
- }
-
- private class MainWindow extends Window {
- public MainWindow() {
- super("Main window");
-
- addComponent(new Link("new mainwin", new ExternalResource(
- Ticket2440.this.getURL() + "msg/hello"), "_blank", -1, -1,
- Window.BORDER_DEFAULT));
-
- addURIHandler(new URIHandler() {
- public DownloadStream handleURI(URL context, String relativeUri) {
- System.err
- .println((getMainWindow() == getWindow() ? "mainwin: "
- : "subwin: ")
- + context + ", " + relativeUri);
- addComponent(new Label(relativeUri));
- return null;
- }
- });
- }
-
- @Override
- public DownloadStream handleURI(URL context, String relativeUri) {
- System.err.println("MainWindow.handleURI();");
- return super.handleURI(context, relativeUri);
- }
-
- }
-
-}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2526.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2526.java
index 5fc06c27bf..8123fe1182 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2526.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2526.java
@@ -3,13 +3,14 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Window;
-public class Ticket2526 extends Application {
+public class Ticket2526 extends Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window();
+ final LegacyWindow main = new LegacyWindow();
setMainWindow(main);
Button b = new Button("Add windows");
b.addListener(new Button.ClickListener() {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2742.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2742.java
index d656b0205c..1003ea1c66 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2742.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2742.java
@@ -6,13 +6,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.NativeSelect;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
/**
* @author Risto Yrjänä / Vaadin Ltd.
*
*/
-public class Ticket2742 extends Application {
+public class Ticket2742 extends Application.LegacyApplication {
/*
* (non-Javadoc)
@@ -21,7 +21,7 @@ public class Ticket2742 extends Application {
*/
@Override
public void init() {
- Window mainWindow = new Window();
+ LegacyWindow mainWindow = new LegacyWindow();
setMainWindow(mainWindow);
String shortString = "Short";
@@ -39,4 +39,4 @@ public class Ticket2742 extends Application {
mainWindow.addComponent(hl);
}
-} \ No newline at end of file
+}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2901.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2901.java
index 9e28908c22..ab808501f7 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2901.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2901.java
@@ -2,21 +2,22 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
-import com.vaadin.ui.Window;
/**
* With IE7 extra scrollbars appear in content area all though content fits
* properly. Scrollbars will disappear if "shaking" content a bit, like
* selecting tests in area.
*/
-public class Ticket2901 extends Application {
+public class Ticket2901 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window("Test app to break layout in IE6");
+ final LegacyWindow mainWin = new LegacyWindow(
+ "Test app to break layout in IE6");
setMainWindow(mainWin);
VerticalSplitPanel sp = new VerticalSplitPanel();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java
index c37a9362d6..6cf5c8f754 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java
@@ -21,6 +21,7 @@ import com.vaadin.ui.FormLayout;
import com.vaadin.ui.Layout;
import com.vaadin.ui.ListSelect;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
@@ -35,7 +36,7 @@ import com.vaadin.ui.themes.Reindeer;
*
* Other browsers are much faster.
*/
-public class Ticket2998 extends Application {
+public class Ticket2998 extends Application.LegacyApplication {
private Table table;
private VerticalLayout mainLayout;
@@ -129,7 +130,7 @@ public class Ticket2998 extends Application {
close();
} else {
date.setValue(run.getDate());
- kilomiters.setValue(run.getKilometers());
+ kilomiters.setValue(String.valueOf(run.getKilometers()));
title.setValue(run.getTitle());
if (getParent() == null) {
workoutLog.getMainWindow().addWindow(this);
@@ -145,7 +146,7 @@ public class Ticket2998 extends Application {
}
@Override
- public Field createField(Container container, Object itemId,
+ public Field<?> createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
/*
@@ -162,7 +163,7 @@ public class Ticket2998 extends Application {
return getSecondaryTypesList(itemId);
}
- final Field f = super.createField(container, itemId, propertyId,
+ final Field<?> f = super.createField(container, itemId, propertyId,
uiContext);
if (f != null) {
if (f instanceof TextField) {
@@ -172,24 +173,19 @@ public class Ticket2998 extends Application {
if (propertyId.equals("kilometers")) {
f.setWidth("4em");
f.addValidator(new Validator() {
- public boolean isValid(Object value) {
+ public void validate(Object value)
+ throws InvalidValueException {
+ // FIXME this does not follow the standard pattern
+ // for validators and has side effects!
try {
@SuppressWarnings("unused")
float f = Float.parseFloat((String) value);
- return true;
} catch (Exception e) {
- f.getWindow().showNotification(
- "Bad number value");
+ f.getRoot()
+ .showNotification("Bad number value");
f.setValue(0);
- return false;
}
}
-
- public void validate(Object value)
- throws InvalidValueException {
- // TODO Auto-generated method stub
-
- }
});
}
if (propertyId.equals("date")) {
@@ -202,7 +198,7 @@ public class Ticket2998 extends Application {
private Map<Object, ListSelect> workoutIdToList = new HashMap<Object, ListSelect>();
- private Field getSecondaryTypesList(Object itemId) {
+ private Field<?> getSecondaryTypesList(Object itemId) {
ListSelect list = workoutIdToList.get(itemId);
if (list == null) {
list = new ListSelect();
@@ -221,7 +217,7 @@ public class Ticket2998 extends Application {
private Map<Object, ComboBox> workoutIdToCombobox = new HashMap<Object, ComboBox>();
- private Field getTrainingTypeComboboxFor(Object itemId) {
+ private Field<?> getTrainingTypeComboboxFor(Object itemId) {
ComboBox cb = workoutIdToCombobox.get(itemId);
if (cb == null) {
final ComboBox cb2 = new ComboBox();
@@ -250,7 +246,7 @@ public class Ticket2998 extends Application {
*/
private void buildView() {
- final Window w = new Window("Workout Log");
+ final LegacyWindow w = new LegacyWindow("Workout Log");
// set theme and some layout stuff
setMainWindow(w);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket3146.java b/tests/testbench/com/vaadin/tests/tickets/Ticket3146.java
index f4dc1d59e4..924b1318ab 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket3146.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket3146.java
@@ -6,18 +6,18 @@ import java.util.HashSet;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket3146 extends Application {
+public class Ticket3146 extends Application.LegacyApplication {
Table table;
TextField result;
@Override
public void init() {
- Window mainWindow = new Window("Test");
+ LegacyWindow mainWindow = new LegacyWindow("Test");
table = new Table();
table.addContainerProperty("Items", String.class, null);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket34.java b/tests/testbench/com/vaadin/tests/tickets/Ticket34.java
index 7d3baf78fa..1c55bcbe7d 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket34.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket34.java
@@ -9,46 +9,39 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.Root.FragmentChangedEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.UriFragmentUtility;
-import com.vaadin.ui.UriFragmentUtility.FragmentChangedEvent;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket34 extends Application {
+public class Ticket34 extends Application.LegacyApplication {
private Map<String, Component> views = new HashMap<String, Component>();
private VerticalLayout mainLayout;
private Component currentView;
- private UriFragmentUtility reader;
@Override
public void init() {
buildViews(new String[] { "main", "view2", "view3" });
- reader = new UriFragmentUtility();
- reader.addListener(new UriFragmentUtility.FragmentChangedListener() {
+ mainLayout = new VerticalLayout();
+ mainLayout.setSizeFull();
+ final LegacyWindow mainWin = new LegacyWindow(
+ "Test app for URI fragment management/reading", mainLayout);
+ setMainWindow(mainWin);
+
+ mainWin.addListener(new Root.FragmentChangedListener() {
public void fragmentChanged(FragmentChangedEvent event) {
getMainWindow().showNotification(
- "Fragment now: "
- + event.getUriFragmentUtility().getFragment());
+ "Fragment now: " + event.getFragment());
// try to change to view mapped by fragment string
- setView(event.getUriFragmentUtility().getFragment());
+ setView(event.getFragment());
}
});
- mainLayout = new VerticalLayout();
- mainLayout.setSizeFull();
- final Window mainWin = new Window(
- "Test app for URI fragment management/reading", mainLayout);
- setMainWindow(mainWin);
-
- // UriFragmentReader is 0px size by default, so it will not render
- // anything on screen
- mainLayout.addComponent(reader);
-
setView("main");
}
@@ -100,7 +93,7 @@ public class Ticket34 extends Application {
public void buttonClick(ClickEvent event) {
String viewName = tf.getValue().toString();
// fragmentChangedListener will change the view if possible
- reader.setFragment(viewName);
+ event.getButton().getRoot().setFragment(viewName);
}
});
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket5053.java b/tests/testbench/com/vaadin/tests/tickets/Ticket5053.java
index 2f5bade03a..35f244e07f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket5053.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket5053.java
@@ -2,16 +2,16 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
/**
* #5053: Last ComboBox item may not be shown if null selection enabled
*/
-public class Ticket5053 extends Application {
+public class Ticket5053 extends Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
setMainWindow(main);
ComboBox combobox = new ComboBox("My ComboBox");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket5157.java b/tests/testbench/com/vaadin/tests/tickets/Ticket5157.java
index c5049f67c0..5902382d01 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket5157.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket5157.java
@@ -5,8 +5,8 @@ import com.vaadin.event.ShortcutAction.KeyCode;
import com.vaadin.event.ShortcutListener;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
/**
* Key codes were converted to lower case on the server (overlapping special key
@@ -14,11 +14,12 @@ import com.vaadin.ui.Window;
* Therefore, registering e.g. F8 as a key code resulted in "w" being used as
* the trigger and F8 being ignored.
*/
-public class Ticket5157 extends Application {
+public class Ticket5157 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWindow = new Window("Forumtests Application");
+ final LegacyWindow mainWindow = new LegacyWindow(
+ "Forumtests Application");
setMainWindow(mainWindow);
Panel p = new Panel();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket5952.java b/tests/testbench/com/vaadin/tests/tickets/Ticket5952.java
index cd2b3a70e6..3c0c549f1f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket5952.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket5952.java
@@ -2,29 +2,29 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket5952 extends Application {
+public class Ticket5952 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWindow = new Window("Forumtests Application");
+ final LegacyWindow mainWindow = new LegacyWindow(
+ "Forumtests Application");
setMainWindow(mainWindow);
-
- String mathml =
- "<math mode='display' xmlns='http://www.w3.org/1998/Math/MathML'>"+
- "<mrow>"+
- " <msup>"+
- " <mi>x</mi>"+
- " <mn>2</mn>"+
- " </msup>"+
- " <msup>"+
- " <mi>c</mi>"+
- " <mn>2</mn>"+
- " </msup>"+
- " </mrow>"+
- "</math>";
- Label mathLabel = new Label(mathml, Label.CONTENT_XML);
+
+ String mathml = "<math mode='display' xmlns='http://www.w3.org/1998/Math/MathML'>"
+ + "<mrow>"
+ + " <msup>"
+ + " <mi>x</mi>"
+ + " <mn>2</mn>"
+ + " </msup>"
+ + " <msup>"
+ + " <mi>c</mi>"
+ + " <mn>2</mn>"
+ + " </msup>"
+ + " </mrow>" + "</math>";
+ Label mathLabel = new Label(mathml, ContentMode.XML);
mainWindow.addComponent(mathLabel);
}
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket6002.java b/tests/testbench/com/vaadin/tests/tickets/Ticket6002.java
index bd6a8e2b7c..0875e3de48 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket6002.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket6002.java
@@ -5,15 +5,15 @@ import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.util.ObjectProperty;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class Ticket6002 extends TestBase {
@Override
public void setup() {
- Window main = new Window("The Main Window");
+ LegacyWindow main = new LegacyWindow("The Main Window");
setMainWindow(main);
final VerticalLayout mainLayout = new VerticalLayout();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket677.java b/tests/testbench/com/vaadin/tests/tickets/Ticket677.java
index f2a1ae1664..bf7aa7bc36 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket677.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket677.java
@@ -15,12 +15,13 @@ import com.vaadin.ui.Form;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket677 extends Application {
+public class Ticket677 extends Application.LegacyApplication {
private static final Label info = new Label(
"<li> keep debug window open to see variable changes"
@@ -30,7 +31,7 @@ public class Ticket677 extends Application {
+ "<li> focusing should fail (try tabbing as well) [worked previousy]"
+ "<li> no variable changes should be sent from disabled fields [changed sent previously]"
+ "<li> try further toggling and tabbing around",
- Label.CONTENT_RAW);
+ ContentMode.RAW);
Panel root = new Panel("Enabled");
Panel one = new Panel("Enabled");
@@ -40,7 +41,7 @@ public class Ticket677 extends Application {
@Override
public void init() {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
setMainWindow(main);
main.addComponent(info);
@@ -111,9 +112,9 @@ public class Ticket677 extends Application {
form.setFormFieldFactory(new DefaultFieldFactory() {
@Override
- public Field createField(Item item, Object propertyId,
+ public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
- Field f = super.createField(item, propertyId, uiContext);
+ Field<?> f = super.createField(item, propertyId, uiContext);
f.setEnabled(!"disabled".equals(propertyId));
return f;
}
@@ -127,19 +128,19 @@ public class Ticket677 extends Application {
table.addContainerProperty("Text", String.class, null);
for (int i = 0; i < 150; i++) {
Item item = table.addItem("Item" + i);
- Property p = item.getItemProperty("Text");
+ Property<?> p = item.getItemProperty("Text");
p.setValue(i % 5 == 0 ? "enabled" : "disabled");
}
table.setTableFieldFactory(new DefaultFieldFactory() {
@Override
- public Field createField(Container container, Object itemId,
+ public Field<?> createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
- Field f = super.createField(container, itemId, propertyId,
+ Field<?> f = super.createField(container, itemId, propertyId,
uiContext);
Item item = container.getItem(itemId);
- Property p = item.getItemProperty(propertyId);
+ Property<?> p = item.getItemProperty(propertyId);
if ("disabled".equals(p.getValue())) {
f.setEnabled(false);
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket695.java b/tests/testbench/com/vaadin/tests/tickets/Ticket695.java
index f122031b6e..11d643cd52 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket695.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket695.java
@@ -7,14 +7,14 @@ import java.io.ObjectOutputStream;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
@SuppressWarnings("serial")
-public class Ticket695 extends Application {
+public class Ticket695 extends Application.LegacyApplication {
@Override
public void init() {
- final Window w = new Window("Serialization test #695");
+ final LegacyWindow w = new LegacyWindow("Serialization test #695");
setMainWindow(w);
Button b = new Button("Serialize ApplicationContext");
w.addComponent(b);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket736.java b/tests/testbench/com/vaadin/tests/tickets/Ticket736.java
index c530b7ca99..091e0c97af 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket736.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket736.java
@@ -4,28 +4,30 @@ import com.vaadin.Application;
import com.vaadin.data.Validator;
import com.vaadin.data.util.BeanItem;
import com.vaadin.data.util.MethodProperty;
+import com.vaadin.data.validator.IntegerValidator;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Form;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket736 extends Application {
+public class Ticket736 extends Application.LegacyApplication {
Address address = new Address();
@Override
public void init() {
- final Window mainWin = new Window("Test app for #736");
+ final LegacyWindow mainWin = new LegacyWindow("Test app for #736");
setMainWindow(mainWin);
- mainWin.setTheme("runo");
+ setTheme("runo");
// Create form for editing address
final Form f = new Form();
@@ -37,10 +39,20 @@ public class Ticket736 extends Application {
mainWin.addComponent(f);
// Select to use buffered mode for editing to enable commit and discard
- f.setWriteThrough(false);
- f.setReadThrough(false);
- Button commit = new Button("Commit", f, "commit");
- Button discard = new Button("Discard", f, "discard");
+ f.setBuffered(true);
+ Button commit = new Button("Commit", new ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ f.commit();
+ }
+ });
+ Button discard = new Button("Discard", new ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ f.discard();
+ }
+
+ });
HorizontalLayout ol = new HorizontalLayout();
ol.setHeight("3em");
ol.addComponent(commit);
@@ -49,8 +61,9 @@ public class Ticket736 extends Application {
f.setFooter(ol);
// Add some validators for the form
- f.getField("zip").addValidator(new IsInteger());
- f.getField("zip").setDescription("Jepjep");
+ f.getField("zip").addValidator(
+ new IntegerValidator("'{0}' is not a number"));
+ ((AbstractComponent) f.getField("zip")).setDescription("Jepjep");
((AbstractComponent) f.getField("zip")).setIcon(new ThemeResource(
"../runo/icons/16/folder.png"));
f.getField("state").addValidator(new IsValidState());
@@ -84,7 +97,7 @@ public class Ticket736 extends Application {
}
/** Address pojo. */
- public class Address {
+ public static class Address {
String name = "";
String street = "";
String zip = "";
@@ -148,44 +161,18 @@ public class Ticket736 extends Application {
}
- /** Simple validator for checking if the validated value is an integer */
- class IsInteger implements Validator {
-
- public boolean isValid(Object value) {
- try {
- Integer.parseInt("" + value);
- return true;
- } catch (NumberFormatException e) {
- return false;
- }
- }
-
- public void validate(Object value) throws InvalidValueException {
- if (!isValid(value)) {
- throw new InvalidValueException("'" + value
- + "' is not a number");
- }
- }
- }
-
/** Simple state validator */
- class IsValidState implements Validator {
+ static class IsValidState implements Validator {
- public boolean isValid(Object value) {
+ public void validate(Object value) throws InvalidValueException {
// Empty and null are accepted values
if (value == null || "".equals("" + value)) {
- return true;
+ return;
}
// Otherwise state must be two capital letter combo
- if (value.toString().length() != 2) {
- return false;
- }
- return value.toString().equals(("" + value).toUpperCase());
- }
-
- public void validate(Object value) throws InvalidValueException {
- if (!isValid(value)) {
+ if (value.toString().length() != 2
+ || !value.toString().equals(("" + value).toUpperCase())) {
throw new InvalidValueException(
"State must be either two capital letter abreviation or left empty");
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket846.java b/tests/testbench/com/vaadin/tests/tickets/Ticket846.java
index 23f3134308..714b3c21ca 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket846.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket846.java
@@ -1,41 +1,25 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
-import com.vaadin.data.Validator;
import com.vaadin.data.util.MethodProperty;
+import com.vaadin.data.validator.IntegerValidator;
import com.vaadin.ui.Button;
import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket846 extends Application {
+public class Ticket846 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window("Test app for #846");
+ final LegacyWindow mainWin = new LegacyWindow("Test app for #846");
setMainWindow(mainWin);
final TextField tx = new TextField("Integer");
mainWin.addComponent(tx);
tx.setImmediate(true);
- tx.addValidator(new Validator() {
-
- public boolean isValid(Object value) {
- try {
- Integer.parseInt("" + value);
- return true;
- } catch (NumberFormatException e) {
- return false;
- }
- }
-
- public void validate(Object value) throws InvalidValueException {
- if (!isValid(value)) {
- throw new InvalidValueException(value + " is not a number");
- }
- }
- });
+ tx.addValidator(new IntegerValidator("{0} is not a number"));
final String[] visibleProps = { "required", "invalidAllowed",
"readOnly", "readThrough", "invalidCommitted",
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket932.java b/tests/testbench/com/vaadin/tests/tickets/Ticket932.java
index a9333b5e0f..bf6f6d1879 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket932.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket932.java
@@ -4,16 +4,17 @@ import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket932 extends Application {
+public class Ticket932 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window("Test app for max length feature");
+ final LegacyWindow mainWin = new LegacyWindow(
+ "Test app for max length feature");
setMainWindow(mainWin);
final TextField tx = new TextField(
diff --git a/tests/testbench/com/vaadin/tests/util/Address.java b/tests/testbench/com/vaadin/tests/util/Address.java
new file mode 100644
index 0000000000..5ef0669e1b
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/util/Address.java
@@ -0,0 +1,66 @@
+package com.vaadin.tests.util;
+
+import java.io.Serializable;
+
+@SuppressWarnings("serial")
+public class Address implements Serializable {
+
+ private String streetAddress = "";
+ private Integer postalCode = null;
+ private String city = "";
+
+ public Address() {
+ }
+
+ public Address(String streetAddress, int postalCode, String city) {
+ setStreetAddress(streetAddress);
+ setPostalCode(postalCode);
+ setCity(city);
+ }
+
+ /**
+ * @return the streetAddress
+ */
+ public String getStreetAddress() {
+ return streetAddress;
+ }
+
+ /**
+ * @param streetAddress
+ * the streetAddress to set
+ */
+ public void setStreetAddress(String streetAddress) {
+ this.streetAddress = streetAddress;
+ }
+
+ /**
+ * @return the postalCode
+ */
+ public Integer getPostalCode() {
+ return postalCode;
+ }
+
+ /**
+ * @param postalCode
+ * the postalCode to set
+ */
+ public void setPostalCode(Integer postalCode) {
+ this.postalCode = postalCode;
+ }
+
+ /**
+ * @return the city
+ */
+ public String getCity() {
+ return city;
+ }
+
+ /**
+ * @param city
+ * the city to set
+ */
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/util/AlwaysFailValidator.java b/tests/testbench/com/vaadin/tests/util/AlwaysFailValidator.java
new file mode 100644
index 0000000000..ddb58999ee
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/util/AlwaysFailValidator.java
@@ -0,0 +1,23 @@
+package com.vaadin.tests.util;
+
+import com.vaadin.data.validator.AbstractValidator;
+
+public class AlwaysFailValidator extends AbstractValidator<Object> {
+ public AlwaysFailValidator() {
+ super("Validation error");
+ }
+
+ public AlwaysFailValidator(String message) {
+ super(message);
+ }
+
+ @Override
+ protected boolean isValidValue(Object value) {
+ return false;
+ }
+
+ @Override
+ public Class getType() {
+ return Object.class;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/util/Log.java b/tests/testbench/com/vaadin/tests/util/Log.java
index 4eef48a789..fca858cb15 100644
--- a/tests/testbench/com/vaadin/tests/util/Log.java
+++ b/tests/testbench/com/vaadin/tests/util/Log.java
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.VerticalLayout;
public class Log extends VerticalLayout {
@@ -49,7 +50,7 @@ public class Log extends VerticalLayout {
}
private Label createEventLabel() {
- Label l = new Label("&nbsp;", Label.CONTENT_XHTML);
+ Label l = new Label("&nbsp;", ContentMode.XHTML);
l.setWidth(null);
return l;
}
diff --git a/tests/testbench/com/vaadin/tests/util/Millionaire.java b/tests/testbench/com/vaadin/tests/util/Millionaire.java
new file mode 100644
index 0000000000..44d4def416
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/util/Millionaire.java
@@ -0,0 +1,22 @@
+package com.vaadin.tests.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Millionaire extends Person {
+ private List<Address> secondaryResidences = new ArrayList<Address>();
+
+ public Millionaire() {
+ }
+
+ public Millionaire(String firstName, String lastName, String email,
+ String phoneNumber, String streetAddress, int postalCode,
+ String city) {
+ super(firstName, lastName, email, phoneNumber, streetAddress,
+ postalCode, city);
+ }
+
+ public List<Address> getSecondaryResidences() {
+ return secondaryResidences;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/util/Person.java b/tests/testbench/com/vaadin/tests/util/Person.java
index c3e7a69d56..72f6b7d20d 100644
--- a/tests/testbench/com/vaadin/tests/util/Person.java
+++ b/tests/testbench/com/vaadin/tests/util/Person.java
@@ -8,12 +8,10 @@ public class Person implements Serializable {
private String lastName = "";
private String email = "";
private String phoneNumber = "";
- private String streetAddress = "";
- private Integer postalCode = null;
- private String city = "";
+ private Address address = new Address();
public Person() {
-
+ address = new Address();
}
public Person(String firstName, String lastName, String email,
@@ -23,9 +21,7 @@ public class Person implements Serializable {
setLastName(lastName);
setEmail(email);
setPhoneNumber(phoneNumber);
- setStreetAddress(streetAddress);
- setPostalCode(postalCode);
- setCity(city);
+ address = new Address(streetAddress, postalCode, city);
}
/**
@@ -89,48 +85,12 @@ public class Person implements Serializable {
}
/**
- * @return the streetAddress
- */
- public String getStreetAddress() {
- return streetAddress;
- }
-
- /**
- * @param streetAddress
- * the streetAddress to set
- */
- public void setStreetAddress(String streetAddress) {
- this.streetAddress = streetAddress;
- }
-
- /**
- * @return the postalCode
- */
- public Integer getPostalCode() {
- return postalCode;
- }
-
- /**
- * @param postalCode
- * the postalCode to set
- */
- public void setPostalCode(Integer postalCode) {
- this.postalCode = postalCode;
- }
-
- /**
- * @return the city
- */
- public String getCity() {
- return city;
- }
-
- /**
- * @param city
- * the city to set
+ * Returns the address where the person lives.
+ *
+ * @return address (not null)
*/
- public void setCity(String city) {
- this.city = city;
+ public Address getAddress() {
+ return address;
}
} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/util/PersonContainer.java b/tests/testbench/com/vaadin/tests/util/PersonContainer.java
index 8195b4d5f0..a3cf28b083 100644
--- a/tests/testbench/com/vaadin/tests/util/PersonContainer.java
+++ b/tests/testbench/com/vaadin/tests/util/PersonContainer.java
@@ -13,8 +13,8 @@ public class PersonContainer extends BeanItemContainer<Person> implements
* Natural property order for Person bean. Used in tables and forms.
*/
public static final Object[] NATURAL_COL_ORDER = new Object[] {
- "firstName", "lastName", "email", "phoneNumber", "streetAddress",
- "postalCode", "city" };
+ "firstName", "lastName", "email", "phoneNumber",
+ "address.streetAddress", "address.postalCode", "address.city" };
/**
* "Human readable" captions for properties in same order as in
@@ -27,6 +27,9 @@ public class PersonContainer extends BeanItemContainer<Person> implements
public PersonContainer() throws InstantiationException,
IllegalAccessException {
super(Person.class);
+ addNestedContainerProperty("address.streetAddress");
+ addNestedContainerProperty("address.postalCode");
+ addNestedContainerProperty("address.city");
}
public static PersonContainer createWithTestData() {
@@ -67,7 +70,7 @@ public class PersonContainer extends BeanItemContainer<Person> implements
Person p = new Person();
p.setFirstName(fnames[r.nextInt(fnames.length)]);
p.setLastName(lnames[r.nextInt(lnames.length)]);
- p.setCity(cities[r.nextInt(cities.length)]);
+ p.getAddress().setCity(cities[r.nextInt(cities.length)]);
p.setEmail(p.getFirstName().toLowerCase() + "."
+ p.getLastName().toLowerCase() + "@vaadin.com");
p.setPhoneNumber("+358 02 555 " + r.nextInt(10) + r.nextInt(10)
@@ -76,8 +79,9 @@ public class PersonContainer extends BeanItemContainer<Person> implements
if (n < 10000) {
n += 10000;
}
- p.setPostalCode(n);
- p.setStreetAddress(streets[r.nextInt(streets.length)]);
+ p.getAddress().setPostalCode(n);
+ p.getAddress().setStreetAddress(
+ streets[r.nextInt(streets.length)]);
c.addItem(p);
}
} catch (InstantiationException e) {
diff --git a/tests/testbench/com/vaadin/tests/util/Role.java b/tests/testbench/com/vaadin/tests/util/Role.java
new file mode 100644
index 0000000000..83f63db4ab
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/util/Role.java
@@ -0,0 +1,37 @@
+package com.vaadin.tests.util;
+
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Set;
+
+public class Role implements Serializable {
+ private String name = "";
+ private Set<User> users = new HashSet<User>();
+
+ public Role() {
+ }
+
+ public Role(String name) {
+ setName(name);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * In this direction, the users for a role can be queried and the returned
+ * collection modified, but the whole collection of users cannot be set
+ * directly.
+ *
+ * @return set of users having the role (not null)
+ */
+ public Set<User> getUsers() {
+ return users;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/util/SampleDirectory.java b/tests/testbench/com/vaadin/tests/util/SampleDirectory.java
index f97c3c0740..a1f3202cea 100644
--- a/tests/testbench/com/vaadin/tests/util/SampleDirectory.java
+++ b/tests/testbench/com/vaadin/tests/util/SampleDirectory.java
@@ -9,7 +9,9 @@ import java.io.File;
import com.vaadin.Application;
import com.vaadin.terminal.SystemError;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root;
/**
* Provides sample directory based on application directory. If this fails then
@@ -27,7 +29,7 @@ public class SampleDirectory {
* @param application
* @return file pointing to sample directory
*/
- public static File getDirectory(Application application) {
+ public static File getDirectory(Application application, Root root) {
String errorMessage = "Access to application "
+ "context base directory failed, "
+ "possible security constraint with Application "
@@ -63,11 +65,11 @@ public class SampleDirectory {
errorPanel.setStyleName("strong");
errorPanel.setComponentError(new SystemError(
"Cannot provide sample directory"));
- errorPanel.addComponent(new Label(errorMessage, Label.CONTENT_XHTML));
+ errorPanel.addComponent(new Label(errorMessage, ContentMode.XHTML));
// Remove all components from applications main window
- application.getMainWindow().getContent().removeAllComponents();
+ root.getContent().removeAllComponents();
// Add error panel
- application.getMainWindow().getContent().addComponent(errorPanel);
+ root.getContent().addComponent(errorPanel);
return null;
}
}
diff --git a/tests/testbench/com/vaadin/tests/util/TestUtils.java b/tests/testbench/com/vaadin/tests/util/TestUtils.java
index aed69055c7..551e7a7ed8 100644
--- a/tests/testbench/com/vaadin/tests/util/TestUtils.java
+++ b/tests/testbench/com/vaadin/tests/util/TestUtils.java
@@ -2,7 +2,7 @@ package com.vaadin.tests.util;
import com.vaadin.data.Item;
import com.vaadin.data.util.IndexedContainer;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root;
public class TestUtils {
@@ -102,7 +102,7 @@ public class TestUtils {
*
* @param cssString
*/
- public static void injectCSS(Window w, String cssString) {
+ public static void injectCSS(Root w, String cssString) {
String script = "if ('\\v'=='v') /* ie only */ {\n"
+ " document.createStyleSheet().cssText = '"
+ cssString
diff --git a/tests/testbench/com/vaadin/tests/util/User.java b/tests/testbench/com/vaadin/tests/util/User.java
new file mode 100644
index 0000000000..003f485017
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/util/User.java
@@ -0,0 +1,54 @@
+package com.vaadin.tests.util;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+public class User implements Serializable {
+ private String name = "";
+ private Set<Role> roles = new HashSet<Role>();
+
+ public User() {
+ }
+
+ public User(String name) {
+ setName(name);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Returns an unmodifiable set of roles. To modify the roles a user has,
+ * replace the whole set using {@link #setRoles(Set)}.
+ *
+ * @return set of roles (unmodifiable, not null)
+ */
+ public Set<Role> getRoles() {
+ return Collections.unmodifiableSet(roles);
+ }
+
+ /**
+ * Replaces the set of roles with another collection. User references in
+ * roles are automatically updated when setting the roles of a user.
+ *
+ * @param roles
+ * non-null set of roles
+ */
+ public void setRoles(Set<Role> roles) {
+ for (Role role : this.roles) {
+ role.getUsers().remove(this);
+ }
+ this.roles = roles;
+ for (Role role : this.roles) {
+ role.getUsers().add(this);
+ }
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java b/tests/testbench/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java
index af48f92f5c..0efd727a06 100644
--- a/tests/testbench/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java
+++ b/tests/testbench/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java
@@ -3,8 +3,8 @@ package com.vaadin.tests.validation;
import java.util.Date;
import com.vaadin.data.Validator.InvalidValueException;
-import com.vaadin.data.validator.AbstractValidator;
import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.AlwaysFailValidator;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
@@ -77,16 +77,12 @@ public class EmptyFieldErrorIndicators extends TestBase {
// hand-crafted form, not using form field factory
final Form form = new Form() {
@Override
- public void addField(Object propertyId, Field field) {
+ public void addField(Object propertyId, Field<?> field) {
super.addField(propertyId, field);
field.setRequired(required);
field.setRequiredError("Missing required value!");
if (failValidator && !(field instanceof Button)) {
- field.addValidator(new AbstractValidator("Validation error") {
- public boolean isValid(Object value) {
- return false;
- }
- });
+ field.addValidator(new AlwaysFailValidator());
}
}
};
@@ -98,7 +94,8 @@ public class EmptyFieldErrorIndicators extends TestBase {
// same as basic DateField
// form.addField("Popup Date", new PopupDateField("Date"));
Button setDateButton = new Button("Set date");
- form.addField("Set Date", setDateButton);
+ form.getLayout().addComponent(setDateButton);
+ // form.addField("Set Date", setDateButton);
setDateButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
form.getField("Date").setValue(new Date(0));
diff --git a/tests/testbench/com/vaadin/tests/validation/RequiredErrorMessage.java b/tests/testbench/com/vaadin/tests/validation/RequiredErrorMessage.java
index 7f5048bd80..e18b8ffd4e 100644
--- a/tests/testbench/com/vaadin/tests/validation/RequiredErrorMessage.java
+++ b/tests/testbench/com/vaadin/tests/validation/RequiredErrorMessage.java
@@ -2,9 +2,9 @@ package com.vaadin.tests.validation;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Form;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class RequiredErrorMessage extends TestBase {
@@ -21,7 +21,7 @@ public class RequiredErrorMessage extends TestBase {
@Override
public void setup() {
- final Window main = new Window(getClass().getName());
+ final LegacyWindow main = new LegacyWindow(getClass().getName());
setMainWindow(main);
final Form form = new Form(new VerticalLayout());
diff --git a/tests/testbench/com/vaadin/tests/validation/TestValidators.java b/tests/testbench/com/vaadin/tests/validation/TestValidators.java
index 5264d47c9d..a530dee852 100644
--- a/tests/testbench/com/vaadin/tests/validation/TestValidators.java
+++ b/tests/testbench/com/vaadin/tests/validation/TestValidators.java
@@ -3,6 +3,7 @@ package com.vaadin.tests.validation;
import com.vaadin.data.Validator;
import com.vaadin.data.validator.AbstractStringValidator;
import com.vaadin.data.validator.CompositeValidator;
+import com.vaadin.data.validator.CompositeValidator.CombinationMode;
import com.vaadin.data.validator.DoubleValidator;
import com.vaadin.data.validator.EmailValidator;
import com.vaadin.data.validator.IntegerValidator;
@@ -13,9 +14,9 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Form;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window.Notification;
public class TestValidators extends TestBase {
@@ -96,8 +97,7 @@ public class TestValidators extends TestBase {
// TODO CompositeValidator
tf = new TextField(
"A field, must be a floating point number with 4-5 chars");
- CompositeValidator cv = new CompositeValidator(
- CompositeValidator.MODE_AND,
+ CompositeValidator cv = new CompositeValidator(CombinationMode.AND,
"The field must contain a floating point number with 4-5 characters");
cv.addValidator(new StringLengthValidator(
"String length of '{0}' should be 4-5 characters", 4, 5, false));
@@ -109,7 +109,7 @@ public class TestValidators extends TestBase {
tf = new TextField(
"A field, must be a floating point number or 4-5 chars");
- cv = new CompositeValidator(CompositeValidator.MODE_OR,
+ cv = new CompositeValidator(CombinationMode.OR,
"The field must contain a floating point or with 4-5 characters");
cv.addValidator(new StringLengthValidator(
"String length of '{0}' should be 4-5 characters", 4, 5, false));
@@ -127,7 +127,7 @@ public class TestValidators extends TestBase {
Validator postalCodeValidator = new AbstractStringValidator(
"Postal code must be a number 10000-99999.") {
@Override
- protected boolean isValidString(String value) {
+ protected boolean isValidValue(String value) {
return value.matches("[1-9][0-9]{4}");
}
};
diff --git a/tests/vaadin-server.xml b/tests/vaadin-server.xml
new file mode 100644
index 0000000000..d4d23581ec
--- /dev/null
+++ b/tests/vaadin-server.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0"?>
+<project xmlns:antcontrib="antlib:net.sf.antcontrib"
+ xmlns:ivy="antlib:org.apache.ivy.ant"
+ name="vaadin-server"
+ default="deploy-and-start" basedir=".">
+
+ <!-- Import common targets -->
+ <import file="../build/common.xml" />
+
+ <target name="check-params">
+ <fail unless="output-dir" message="The 'output-dir' (usually build/result/vaadin-xxx) should be given to test script." />
+ <fail unless="package.name" message="The 'package.name' property must be defined." />
+ <fail unless="package.filename" message="The 'package.filename' property must be defined." />
+ <fail unless="testing.testarea" message="The 'testing.testarea' property must be defined." />
+ <property name="webroot" value="${testing.testarea}/${package.name}/WebContent" />
+ </target>
+
+ <target name="prepare-testing-area" depends="check-params">
+ <echo> Package name: ${package.name}</echo>
+ <echo> Package filename: ${package.filename}</echo>
+ <echo> Testing area: ${testing.testarea}</echo>
+ <echo> test-output-dir: ${test-output-dir}</echo>
+
+ <delete dir="${testing.testarea}/${package.name}" />
+ <mkdir dir="${testing.testarea}/${package.name}/WebContent" />
+ <echo>Extracting Vaadin package ${package.filename} to testing area ${testing.testarea}</echo>
+ <unzip src="${package.filename}" dest="${testing.testarea}/${package.name}/WebContent" />
+ </target>
+
+ <target name="deploy-and-start" depends="init-deps, prepare-testing-area">
+ <property name="webroot" value="${testing.testarea}/${package.name}/WebContent"></property>
+
+ <ivy:resolve file="ivy.xml"/>
+ <ivy:cachepath pathid="server" conf="server" />
+ <java classname="com.vaadin.launcher.DemoLauncher" fork="yes" dir="${testing.testarea}/${package.name}" resultproperty="server.start.result">
+ <arg value="--nogui=1" />
+ <classpath>
+ <path location="${webroot}/WEB-INF/classes" />
+ <fileset dir="${webroot}/WEB-INF/lib/" includes="*.jar" />
+ <path refid="server" />
+ </classpath>
+ <jvmarg value="-Demma.coverage.out.file=${testing.testarea}/${package.name}/war.ec"/>
+ <jvmarg value="-Djava.awt.headless=true"/>
+ </java>
+ </target>
+
+ <target name="wait-for-startup">
+ <echo>Waiting for Servlet Container to start up.</echo>
+ <waitfor maxwait="60" maxwaitunit="second" checkevery="5" checkeveryunit="second" timeoutproperty="server.start.failed">
+ <http url="http://localhost:8888"/>
+ </waitfor>
+ <fail if="server.start.failed" message="Server startup failed" />
+ </target>
+
+</project>