diff options
Diffstat (limited to 'uitest/src/com/vaadin')
48 files changed, 819 insertions, 288 deletions
diff --git a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java index 1f72495596..e2b93ab7d2 100644 --- a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java +++ b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java @@ -17,6 +17,7 @@ package com.vaadin.launcher; import java.io.File; import java.io.IOException; +import java.io.Serializable; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; @@ -45,10 +46,16 @@ import com.vaadin.server.LegacyVaadinServlet; import com.vaadin.server.ServiceException; import com.vaadin.server.SessionInitEvent; import com.vaadin.server.SessionInitListener; +import com.vaadin.server.SystemMessages; +import com.vaadin.server.SystemMessagesInfo; +import com.vaadin.server.SystemMessagesProvider; import com.vaadin.server.UIClassSelectionEvent; import com.vaadin.server.UIProvider; import com.vaadin.server.VaadinRequest; +import com.vaadin.server.VaadinService; +import com.vaadin.server.VaadinServlet; import com.vaadin.server.VaadinServletRequest; +import com.vaadin.server.VaadinServletService; import com.vaadin.server.VaadinSession; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.UI; @@ -57,6 +64,9 @@ import com.vaadin.util.CurrentInstance; @SuppressWarnings("serial") public class ApplicationRunnerServlet extends LegacyVaadinServlet { + public static String CUSTOM_SYSTEM_MESSAGES_PROPERTY = "custom-" + + SystemMessages.class.getName(); + /** * The name of the application class currently used. Only valid within one * request. @@ -184,6 +194,29 @@ public class ApplicationRunnerServlet extends LegacyVaadinServlet { return getApplicationRunnerURIs(request).applicationClassname; } + private final static class ProxyDeploymentConfiguration implements + InvocationHandler, Serializable { + private final DeploymentConfiguration originalConfiguration; + + private ProxyDeploymentConfiguration( + DeploymentConfiguration originalConfiguration) { + this.originalConfiguration = originalConfiguration; + } + + @Override + public Object invoke(Object proxy, Method method, Object[] args) + throws Throwable { + if (method.getDeclaringClass() == DeploymentConfiguration.class) { + // Find the configuration instance to delegate to + DeploymentConfiguration configuration = findDeploymentConfiguration(originalConfiguration); + + return method.invoke(configuration, args); + } else { + return method.invoke(proxy, args); + } + } + } + private static final class ApplicationRunnerUIProvider extends UIProvider { private final Class<?> classToRun; @@ -309,23 +342,38 @@ public class ApplicationRunnerServlet extends LegacyVaadinServlet { return (DeploymentConfiguration) Proxy.newProxyInstance( DeploymentConfiguration.class.getClassLoader(), new Class[] { DeploymentConfiguration.class }, - new InvocationHandler() { - @Override - public Object invoke(Object proxy, Method method, - Object[] args) throws Throwable { - if (method.getDeclaringClass() == DeploymentConfiguration.class) { - // Find the configuration instance to delegate to - DeploymentConfiguration configuration = findDeploymentConfiguration(originalConfiguration); - - return method.invoke(configuration, args); - } else { - return method.invoke(proxy, args); - } - } - }); + new ProxyDeploymentConfiguration(originalConfiguration)); + } + + @Override + protected VaadinServletService createServletService( + DeploymentConfiguration deploymentConfiguration) + throws ServiceException { + VaadinServletService service = super + .createServletService(deploymentConfiguration); + final SystemMessagesProvider provider = service + .getSystemMessagesProvider(); + service.setSystemMessagesProvider(new SystemMessagesProvider() { + + @Override + public SystemMessages getSystemMessages( + SystemMessagesInfo systemMessagesInfo) { + if (systemMessagesInfo.getRequest() == null) { + return provider.getSystemMessages(systemMessagesInfo); + } + Object messages = systemMessagesInfo.getRequest().getAttribute( + CUSTOM_SYSTEM_MESSAGES_PROPERTY); + if (messages instanceof SystemMessages) { + return (SystemMessages) messages; + } + return provider.getSystemMessages(systemMessagesInfo); + } + + }); + return service; } - private DeploymentConfiguration findDeploymentConfiguration( + private static DeploymentConfiguration findDeploymentConfiguration( DeploymentConfiguration originalConfiguration) throws Exception { // First level of cache DeploymentConfiguration configuration = CurrentInstance @@ -344,16 +392,19 @@ public class ApplicationRunnerServlet extends LegacyVaadinServlet { * request. */ - HttpServletRequest currentRequest = request.get(); + HttpServletRequest currentRequest = VaadinServletService + .getCurrentServletRequest(); if (currentRequest != null) { HttpSession httpSession = currentRequest.getSession(false); if (httpSession != null) { Map<Class<?>, CurrentInstance> oldCurrent = CurrentInstance .setCurrent((VaadinSession) null); try { - session = getService().findVaadinSession( - new VaadinServletRequest(currentRequest, - getService())); + VaadinServletService service = (VaadinServletService) VaadinService + .getCurrent(); + session = service + .findVaadinSession(new VaadinServletRequest( + currentRequest, service)); } finally { /* * Clear some state set by findVaadinSession to @@ -377,9 +428,11 @@ public class ApplicationRunnerServlet extends LegacyVaadinServlet { .getAttribute(name); if (configuration == null) { + ApplicationRunnerServlet servlet = (ApplicationRunnerServlet) VaadinServlet + .getCurrent(); Class<?> classToRun; try { - classToRun = getClassToRun(); + classToRun = servlet.getClassToRun(); } catch (ClassNotFoundException e) { /* * This happens e.g. if the UI class defined in the @@ -402,7 +455,7 @@ public class ApplicationRunnerServlet extends LegacyVaadinServlet { } configuration = new DefaultDeploymentConfiguration( - getClass(), initParameters); + servlet.getClass(), initParameters); } else { configuration = originalConfiguration; } diff --git a/uitest/src/com/vaadin/tests/accessibility/WindowWaiAriaRoles.java b/uitest/src/com/vaadin/tests/accessibility/WindowWaiAriaRoles.java index 2ab6be25ac..c015b65e1f 100644 --- a/uitest/src/com/vaadin/tests/accessibility/WindowWaiAriaRoles.java +++ b/uitest/src/com/vaadin/tests/accessibility/WindowWaiAriaRoles.java @@ -35,7 +35,7 @@ public class WindowWaiAriaRoles extends AbstractTestUI { /* * (non-Javadoc) - * + * * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server. * VaadinRequest) */ @@ -86,7 +86,7 @@ public class WindowWaiAriaRoles extends AbstractTestUI { /* * (non-Javadoc) - * + * * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() */ @Override @@ -96,7 +96,7 @@ public class WindowWaiAriaRoles extends AbstractTestUI { /* * (non-Javadoc) - * + * * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() */ @Override diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.java b/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.java index cee71fdf4e..9e37fef7d9 100644 --- a/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.java +++ b/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.java @@ -1,38 +1,38 @@ -package com.vaadin.tests.components.button;
-
-import com.vaadin.server.ThemeResource;
-import com.vaadin.server.VaadinRequest;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
-import com.vaadin.ui.NativeButton;
-import com.vaadin.ui.UI;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class ButtonToggleIcons extends UI {
-
- @Override
- protected void init(final VaadinRequest request) {
- final VerticalLayout layout = new VerticalLayout();
- setContent(layout);
-
- final ThemeResource iconResource = new ThemeResource(
- "../runo/icons/16/arrow-left.png");
-
- final ClickListener iconToggleListener = new ClickListener() {
- @Override
- public void buttonClick(final ClickEvent event) {
- final Button btn = event.getButton();
- if (btn.getIcon() == null) {
- btn.setIcon(iconResource);
- } else {
- btn.setIcon(null);
- }
- }
- };
-
- layout.addComponent(new Button("Toggle icon", iconToggleListener));
- layout.addComponent(new NativeButton("Toggle icon", iconToggleListener));
- }
-}
+package com.vaadin.tests.components.button; + +import com.vaadin.server.ThemeResource; +import com.vaadin.server.VaadinRequest; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.NativeButton; +import com.vaadin.ui.UI; +import com.vaadin.ui.VerticalLayout; + +@SuppressWarnings("serial") +public class ButtonToggleIcons extends UI { + + @Override + protected void init(final VaadinRequest request) { + final VerticalLayout layout = new VerticalLayout(); + setContent(layout); + + final ThemeResource iconResource = new ThemeResource( + "../runo/icons/16/arrow-left.png"); + + final ClickListener iconToggleListener = new ClickListener() { + @Override + public void buttonClick(final ClickEvent event) { + final Button btn = event.getButton(); + if (btn.getIcon() == null) { + btn.setIcon(iconResource); + } else { + btn.setIcon(null); + } + } + }; + + layout.addComponent(new Button("Toggle icon", iconToggleListener)); + layout.addComponent(new NativeButton("Toggle icon", iconToggleListener)); + } +} diff --git a/uitest/src/com/vaadin/tests/components/calendar/CalendarHtmlInEvents.java b/uitest/src/com/vaadin/tests/components/calendar/CalendarHtmlInEvents.java new file mode 100644 index 0000000000..15cde71838 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/calendar/CalendarHtmlInEvents.java @@ -0,0 +1,101 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.calendar; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.data.util.MethodProperty; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUIWithLog; +import com.vaadin.ui.Alignment; +import com.vaadin.ui.Calendar; +import com.vaadin.ui.CheckBox; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.NativeSelect; +import com.vaadin.ui.components.calendar.event.BasicEvent; +import com.vaadin.ui.components.calendar.event.CalendarEvent; +import com.vaadin.ui.components.calendar.event.CalendarEventProvider; + +public class CalendarHtmlInEvents extends AbstractTestUIWithLog { + + private Calendar calendar = new Calendar(); + + @Override + protected void setup(VaadinRequest request) { + final NativeSelect ns = new NativeSelect("Period"); + ns.addItems("Day", "Week", "Month"); + ns.addValueChangeListener(new ValueChangeListener() { + @Override + public void valueChange(ValueChangeEvent event) { + if ("Day".equals(ns.getValue())) { + calendar.setStartDate(new Date(2014 - 1900, 1 - 1, 1)); + calendar.setEndDate(new Date(2014 - 1900, 1 - 1, 1)); + } else if ("Week".equals(ns.getValue())) { + calendar.setStartDate(new Date(2014 - 1900, 1 - 1, 1)); + calendar.setEndDate(new Date(2014 - 1900, 1 - 1, 7)); + } else if ("Month".equals(ns.getValue())) { + calendar.setStartDate(new Date(2014 - 1900, 1 - 1, 1)); + calendar.setEndDate(new Date(2014 - 1900, 2 - 1, 1)); + } + } + }); + ns.setValue("Month"); + final CheckBox allowHtml = new CheckBox("Allow HTML in event caption", + new MethodProperty<Boolean>(calendar, "eventCaptionAsHtml")); + allowHtml.addValueChangeListener(new ValueChangeListener() { + @Override + public void valueChange(ValueChangeEvent event) { + log("HTML in event caption: " + allowHtml.getValue()); + } + }); + HorizontalLayout hl = new HorizontalLayout(); + hl.setDefaultComponentAlignment(Alignment.BOTTOM_LEFT); + hl.addComponents(ns, allowHtml); + hl.setSpacing(true); + hl.setMargin(true); + calendar.setEventProvider(new CalendarEventProvider() { + + @Override + public List<CalendarEvent> getEvents(Date startDate, Date endDate) { + Date d = startDate; + ArrayList<CalendarEvent> events = new ArrayList<CalendarEvent>(); + while (d.before(endDate)) { + BasicEvent ce = new BasicEvent(); + ce.setAllDay(false); + ce.setCaption("<b>Hello</b> <u>world</u>!"); + ce.setDescription("Nothing really important"); + Date start = new Date(d.getTime()); + start.setHours(d.getDay()); + Date end = new Date(d.getTime()); + end.setHours(d.getDay() + 3); + ce.setStart(start); + ce.setEnd(end); + events.add(ce); + d.setTime(d.getTime() + 1000 * 60 * 60 * 24); + } + + return events; + } + + }); + addComponent(hl); + addComponent(calendar); + } +} diff --git a/uitest/src/com/vaadin/tests/components/calendar/CalendarHtmlInEventsTest.java b/uitest/src/com/vaadin/tests/components/calendar/CalendarHtmlInEventsTest.java new file mode 100644 index 0000000000..31e3f754e3 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/calendar/CalendarHtmlInEventsTest.java @@ -0,0 +1,103 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.calendar; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.elements.CalendarElement; +import com.vaadin.testbench.elements.CheckBoxElement; +import com.vaadin.testbench.elements.NativeSelectElement; +import com.vaadin.tests.tb3.SingleBrowserTest; + +public class CalendarHtmlInEventsTest extends SingleBrowserTest { + + private NativeSelectElement periodSelect; + private CheckBoxElement htmlAllowed; + private CalendarElement calendar; + + @Override + public void setup() throws Exception { + super.setup(); + openTestURL(); + periodSelect = $(NativeSelectElement.class).first(); + htmlAllowed = $(CheckBoxElement.class).first(); + calendar = $(CalendarElement.class).first(); + } + + @Test + public void monthViewEventCaptions() { + Assert.assertEquals(getMonthEvent(0).getText(), + "12:00 AM <b>Hello</b> <u>world</u>!"); + + // Switch to HTML mode + click(htmlAllowed); + Assert.assertEquals("1. HTML in event caption: true", getLogRow(0)); + + Assert.assertEquals(getMonthEvent(0).getText(), "12:00 AM Hello world!"); + } + + @Test + public void weekViewEventCaptions() { + periodSelect.selectByText("Week"); + Assert.assertEquals("4:00 AM\n<b>Hello</b> <u>world</u>!", + getWeekEvent(1).getText()); + + // Switch to HTML mode + click(htmlAllowed); + Assert.assertEquals("1. HTML in event caption: true", getLogRow(0)); + + Assert.assertEquals("4:00 AM\nHello world!", getWeekEvent(1).getText()); + } + + @Test + public void dayViewEventCaptions() { + periodSelect.selectByText("Day"); + Assert.assertEquals("3:00 AM\n<b>Hello</b> <u>world</u>!", + getWeekEvent(0).getText()); + + // Switch to HTML mode + click(htmlAllowed); + Assert.assertEquals("1. HTML in event caption: true", getLogRow(0)); + Assert.assertEquals("3:00 AM\nHello world!", getWeekEvent(0).getText()); + } + + private WebElement getMonthEvent(int dayInCalendar) { + return getMonthDay(dayInCalendar).findElement( + By.className("v-calendar-event")); + } + + private WebElement getWeekEvent(int dayInCalendar) { + return getWeekDay(dayInCalendar).findElement( + By.className("v-calendar-event")); + } + + private void click(CheckBoxElement htmlAllowed2) { + htmlAllowed2.findElement(By.xpath("input")).click(); + } + + private WebElement getMonthDay(int i) { + return calendar.findElements(By.className("v-calendar-month-day")).get( + i); + } + + private WebElement getWeekDay(int i) { + return calendar.findElements(By.className("v-calendar-day-times")).get( + i); + } +} diff --git a/uitest/src/com/vaadin/tests/components/calendar/CalendarNotificationsTestIE.java b/uitest/src/com/vaadin/tests/components/calendar/CalendarNotificationsTestIE.java index 933bca8c7d..62223ccc25 100644 --- a/uitest/src/com/vaadin/tests/components/calendar/CalendarNotificationsTestIE.java +++ b/uitest/src/com/vaadin/tests/components/calendar/CalendarNotificationsTestIE.java @@ -62,7 +62,9 @@ public class CalendarNotificationsTestIE extends MultiBrowserTest { WebElement day = findElements(By.className("v-calendar-day-number")) .get(2); // IE8 requires you to click on the text part to fire the event - new Actions(getDriver()).moveToElement(day, day.getSize().getWidth() - 3, day.getSize().getHeight() / 2).click().perform(); + new Actions(getDriver()) + .moveToElement(day, day.getSize().getWidth() - 3, + day.getSize().getHeight() / 2).click().perform(); // check that a notification was opened, this is done with a log instead // of a screenshot or element presence check due to problems with IE diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxValueInput.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxValueInput.java index 1d2c85c974..a35bc46390 100644 --- a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxValueInput.java +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxValueInput.java @@ -14,18 +14,21 @@ public class ComboBoxValueInput extends AbstractTestUI { ComboBox cb = getComboBox("A combobox", false, "default"); addComponent(cb); - cb = getComboBox("A combobox with input prompt", false, "default-prompt"); + cb = getComboBox("A combobox with input prompt", false, + "default-prompt"); cb.setInputPrompt("Please select"); addComponent(cb); cb = getComboBox("A combobox with null item", true, "null"); addComponent(cb); - cb = getComboBox("A combobox with null item and input prompt", true, "null-prompt"); + cb = getComboBox("A combobox with null item and input prompt", true, + "null-prompt"); cb.setInputPrompt("Please select"); addComponent(cb); - cb = getComboBox("A combobox with filteringMode off", false, "filtering-off"); + cb = getComboBox("A combobox with filteringMode off", false, + "filtering-off"); cb.setFilteringMode(FilteringMode.OFF); addComponent(cb); diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxValueInputTest.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxValueInputTest.java index b2b3c29098..318ffbe549 100644 --- a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxValueInputTest.java +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxValueInputTest.java @@ -131,9 +131,10 @@ public class ComboBoxValueInputTest extends MultiBrowserTest { assertThat(getComboBoxValue(comboBox), is("")); - //selectByText doesn't work when filtering is off. + // selectByText doesn't work when filtering is off. comboBox.openPopup(); - List<WebElement> filteredItems = findElements(By.className("gwt-MenuItem")); + List<WebElement> filteredItems = findElements(By + .className("gwt-MenuItem")); filteredItems.get(1).click(); sendKeysToComboBox(comboBox, "mnop"); diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboSelectedValueBeyondTheFirstDropdownPage.java b/uitest/src/com/vaadin/tests/components/combobox/ComboSelectedValueBeyondTheFirstDropdownPage.java index 41b61c9062..acfb7b165f 100644 --- a/uitest/src/com/vaadin/tests/components/combobox/ComboSelectedValueBeyondTheFirstDropdownPage.java +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboSelectedValueBeyondTheFirstDropdownPage.java @@ -8,7 +8,8 @@ import com.vaadin.ui.ComboBox; import com.vaadin.ui.Label; @SuppressWarnings("serial") -public class ComboSelectedValueBeyondTheFirstDropdownPage extends AbstractTestUI { +public class ComboSelectedValueBeyondTheFirstDropdownPage extends + AbstractTestUI { protected static final int ITEM_COUNT = 21; protected static final String ITEM_NAME_TEMPLATE = "Item %d"; diff --git a/uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentChildVisibilityTest.java b/uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentChildVisibilityTest.java index 4e0204604b..9f1fc6b03e 100644 --- a/uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentChildVisibilityTest.java +++ b/uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentChildVisibilityTest.java @@ -25,5 +25,4 @@ public class CustomComponentChildVisibilityTest extends MultiBrowserTest { return $(LabelElement.class).all().size() > 1; } - }
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/components/datefield/DateFieldDayResolutionOffset.java b/uitest/src/com/vaadin/tests/components/datefield/DateFieldDayResolutionOffset.java index 62db60be76..a6fda534b2 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/DateFieldDayResolutionOffset.java +++ b/uitest/src/com/vaadin/tests/components/datefield/DateFieldDayResolutionOffset.java @@ -29,7 +29,7 @@ public class DateFieldDayResolutionOffset extends AbstractTestUI { addComponent(dateValue); addComponent(dateField); - dateField.addValueChangeListener( new Property.ValueChangeListener(){ + dateField.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { dateValue.setValue(dateformat.format(dateField.getValue())); @@ -37,7 +37,8 @@ public class DateFieldDayResolutionOffset extends AbstractTestUI { }); } - private DateField getDateField(TimeZone timezone, SimpleDateFormat dateformat) { + private DateField getDateField(TimeZone timezone, + SimpleDateFormat dateformat) { final DateField dateField = new DateField(); try { Date initialDate = dateformat.parse(initialDateString); @@ -51,7 +52,8 @@ public class DateFieldDayResolutionOffset extends AbstractTestUI { } private SimpleDateFormat getDateFormat(TimeZone timezone) { - final SimpleDateFormat dateformat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); + final SimpleDateFormat dateformat = new SimpleDateFormat( + "MM/dd/yyyy HH:mm:ss"); dateformat.setTimeZone(timezone); return dateformat; } diff --git a/uitest/src/com/vaadin/tests/components/datefield/DateFieldDayResolutionOffsetTest.java b/uitest/src/com/vaadin/tests/components/datefield/DateFieldDayResolutionOffsetTest.java index c3b3af9aa4..4ee9597f68 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/DateFieldDayResolutionOffsetTest.java +++ b/uitest/src/com/vaadin/tests/components/datefield/DateFieldDayResolutionOffsetTest.java @@ -25,8 +25,9 @@ public class DateFieldDayResolutionOffsetTest extends MultiBrowserTest { } private void select2ndOfSeptember() { - for(WebElement e : findElements(By.className("v-datefield-calendarpanel-day"))) { - if(e.getText().equals("2")) { + for (WebElement e : findElements(By + .className("v-datefield-calendarpanel-day"))) { + if (e.getText().equals("2")) { e.click(); break; } @@ -36,8 +37,7 @@ public class DateFieldDayResolutionOffsetTest extends MultiBrowserTest { private void openDatePicker() { DateFieldElement dateField = $(DateFieldElement.class).first(); - dateField.findElement(By.tagName("button")) - .click(); + dateField.findElement(By.tagName("button")).click(); } }
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrollingTest.java b/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrollingTest.java index 3a0dcafe1f..29476b9ae6 100644 --- a/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrollingTest.java +++ b/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrollingTest.java @@ -13,11 +13,10 @@ public class TableInFormLayoutCausesScrollingTest extends MultiBrowserTest { @Test @Ignore - //This test is actually testing that #7309 is NOT fixed. - //Ignoring the test because it is not stable and it's - //occasionally failing on browsers even when it shouldn't. - - //There's no point fixing this test before #7309 is actually fixed. + // This test is actually testing that #7309 is NOT fixed. + // Ignoring the test because it is not stable and it's + // occasionally failing on browsers even when it shouldn't. + // There's no point fixing this test before #7309 is actually fixed. public void pageIsNotScrolled() throws IOException { openTestURL(); diff --git a/uitest/src/com/vaadin/tests/components/popupview/PopupViewResizeWhileOpenTest.java b/uitest/src/com/vaadin/tests/components/popupview/PopupViewResizeWhileOpenTest.java index 6c23e4e4a5..ce528df373 100644 --- a/uitest/src/com/vaadin/tests/components/popupview/PopupViewResizeWhileOpenTest.java +++ b/uitest/src/com/vaadin/tests/components/popupview/PopupViewResizeWhileOpenTest.java @@ -69,7 +69,7 @@ public class PopupViewResizeWhileOpenTest extends MultiBrowserTest { } private WebElement getPopupShadow() { - //Shadows with index 0: tooltip, index 1: popup + // Shadows with index 0: tooltip, index 1: popup return findElements(By.className("v-shadow")).get(1); } diff --git a/uitest/src/com/vaadin/tests/components/table/LongMultiselectTest.java b/uitest/src/com/vaadin/tests/components/table/LongMultiselectTest.java index ebf2c1dc47..e9f3bbb355 100644 --- a/uitest/src/com/vaadin/tests/components/table/LongMultiselectTest.java +++ b/uitest/src/com/vaadin/tests/components/table/LongMultiselectTest.java @@ -38,7 +38,8 @@ public class LongMultiselectTest extends MultiBrowserTest { TableElement table = getTable(); assertThat(table.getCell(LASTSELECTEDROW, 1).getText(), is("updated")); - assertThat(table.getCell(LASTSELECTEDROW-1, 1).getText(), is("updated")); + assertThat(table.getCell(LASTSELECTEDROW - 1, 1).getText(), + is("updated")); } private void selectRows() { @@ -47,8 +48,9 @@ public class LongMultiselectTest extends MultiBrowserTest { scrollToBottom(); - new Actions(getDriver()).keyDown(Keys.SHIFT).click(getTable().getCell(LASTSELECTEDROW, 0)).keyUp(Keys.SHIFT) - .build().perform(); + new Actions(getDriver()).keyDown(Keys.SHIFT) + .click(getTable().getCell(LASTSELECTEDROW, 0)) + .keyUp(Keys.SHIFT).build().perform(); } private TableElement getTable() { diff --git a/uitest/src/com/vaadin/tests/components/table/SelectAllConstantViewportTest.java b/uitest/src/com/vaadin/tests/components/table/SelectAllConstantViewportTest.java index 0e7a7c08a4..504957e773 100644 --- a/uitest/src/com/vaadin/tests/components/table/SelectAllConstantViewportTest.java +++ b/uitest/src/com/vaadin/tests/components/table/SelectAllConstantViewportTest.java @@ -51,7 +51,8 @@ public class SelectAllConstantViewportTest extends MultiBrowserTest { int rowLocation = row.getLocation().getY(); - // use click x,y with non-zero offset to actually toggle the checkbox. (#13763) + // use click x,y with non-zero offset to actually toggle the checkbox. + // (#13763) checkbox.click(5, 5); int newRowLocation = row.getLocation().getY(); diff --git a/uitest/src/com/vaadin/tests/components/table/TableClickAndDragOnIconAndComponentsTest.java b/uitest/src/com/vaadin/tests/components/table/TableClickAndDragOnIconAndComponentsTest.java index aee8cc96d9..4a9d17c02d 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableClickAndDragOnIconAndComponentsTest.java +++ b/uitest/src/com/vaadin/tests/components/table/TableClickAndDragOnIconAndComponentsTest.java @@ -105,8 +105,8 @@ public class TableClickAndDragOnIconAndComponentsTest extends MultiBrowserTest { } private void assertThatFocusTextFieldHasText(String text) { - List<WebElement> focused = getTable().findElements(By - .className("v-textfield-focus")); + List<WebElement> focused = getTable().findElements( + By.className("v-textfield-focus")); assertThat(focused.get(0).getAttribute("value"), is(text)); } @@ -114,7 +114,7 @@ public class TableClickAndDragOnIconAndComponentsTest extends MultiBrowserTest { private int getSelectedRowTextValue() { WebElement selectedRow = getSelectedRow(); - //i.e. 'red 1foo' + // i.e. 'red 1foo' String text = getText(selectedRow, 2); return Integer.parseInt(text.substring(4, 5)); @@ -127,13 +127,11 @@ public class TableClickAndDragOnIconAndComponentsTest extends MultiBrowserTest { } private List<WebElement> getCellContents(WebElement row) { - return row.findElements( - By.className("v-table-cell-content")); + return row.findElements(By.className("v-table-cell-content")); } private WebElement getSelectedRow() { - return getTable().findElement(By - .className("v-selected")); + return getTable().findElement(By.className("v-selected")); } private void clickOnTextField(int row) { @@ -157,15 +155,13 @@ public class TableClickAndDragOnIconAndComponentsTest extends MultiBrowserTest { } private WebElement getElement(int row, int index, String className) { - return getRows() - .get(row) - .findElements(By.className(className)) + return getRows().get(row).findElements(By.className(className)) .get(index); } private List<WebElement> getRows() { return getTable().findElement(By.className("v-table-body")) - .findElements(By.tagName("tr")); + .findElements(By.tagName("tr")); } private void selectRow(int row) { @@ -178,7 +174,6 @@ public class TableClickAndDragOnIconAndComponentsTest extends MultiBrowserTest { return $(TableElement.class).first(); } - private void clickOnLabel(int row) { WebElement label = getElement(row, "v-label"); label.click(); @@ -200,9 +195,9 @@ public class TableClickAndDragOnIconAndComponentsTest extends MultiBrowserTest { private int getSelectedRowIndex() { List<WebElement> rows = getRows(); - //Unfortunately rows.getIndexOf(getSelectedRow()) doesn't work. - for(WebElement r : rows) { - if(r.getAttribute("class").contains("v-selected")) { + // Unfortunately rows.getIndexOf(getSelectedRow()) doesn't work. + for (WebElement r : rows) { + if (r.getAttribute("class").contains("v-selected")) { return rows.indexOf(r); } } diff --git a/uitest/src/com/vaadin/tests/components/table/TableColumnResizeContentsWidthTest.java b/uitest/src/com/vaadin/tests/components/table/TableColumnResizeContentsWidthTest.java index 3ae66de684..5faee3cc59 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableColumnResizeContentsWidthTest.java +++ b/uitest/src/com/vaadin/tests/components/table/TableColumnResizeContentsWidthTest.java @@ -42,7 +42,8 @@ public class TableColumnResizeContentsWidthTest extends MultiBrowserTest { public List<DesiredCapabilities> getBrowsersToTest() { List<DesiredCapabilities> browsersToTest = super.getBrowsersToTest(); - //Can't get IE8 to hit the resizer, extracted IE8 to it's own test class. + // Can't get IE8 to hit the resizer, extracted IE8 to it's own test + // class. browsersToTest.remove(Browser.IE8.getDesiredCapabilities()); return browsersToTest; @@ -54,7 +55,8 @@ public class TableColumnResizeContentsWidthTest extends MultiBrowserTest { List<ButtonElement> buttons = $(ButtonElement.class).all(); - WebElement resizer = getTable().findElement(By.className("v-table-resizer")); + WebElement resizer = getTable().findElement( + By.className("v-table-resizer")); assertEquals(100, getTextFieldWidth()); @@ -84,7 +86,8 @@ public class TableColumnResizeContentsWidthTest extends MultiBrowserTest { private int getTextFieldWidth() { TableElement table = getTable(); - final WebElement textField = table.findElement(By.className("v-textfield")); + final WebElement textField = table.findElement(By + .className("v-textfield")); return textField.getSize().width; } @@ -94,8 +97,7 @@ public class TableColumnResizeContentsWidthTest extends MultiBrowserTest { } private void moveResizer(WebElement resizer, int offset) { - new Actions(driver).clickAndHold(resizer).moveByOffset(offset, 0).release().perform(); + new Actions(driver).clickAndHold(resizer).moveByOffset(offset, 0) + .release().perform(); } } - - diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/ExtraScrollbarsInTabSheet.java b/uitest/src/com/vaadin/tests/components/tabsheet/ExtraScrollbarsInTabSheet.java index fffc766e7c..63d50e0464 100755 --- a/uitest/src/com/vaadin/tests/components/tabsheet/ExtraScrollbarsInTabSheet.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/ExtraScrollbarsInTabSheet.java @@ -1,42 +1,42 @@ -package com.vaadin.tests.components.tabsheet;
-
-import com.vaadin.annotations.Theme;
-import com.vaadin.server.VaadinRequest;
-import com.vaadin.ui.HorizontalSplitPanel;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.UI;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.themes.Runo;
-
-@Theme("runo")
-public class ExtraScrollbarsInTabSheet extends UI {
-
- @Override
- public void init(VaadinRequest request) {
-
- VerticalLayout vl = new VerticalLayout();
- vl.setSizeFull();
-
- HorizontalSplitPanel horizontalSplit = new HorizontalSplitPanel();
-
- TabSheet ts = new TabSheet();
-
- VerticalLayout tabContent = new VerticalLayout();
- tabContent.setSizeFull();
-
- Panel p = new Panel();
- p.addStyleName(Runo.PANEL_LIGHT);
- p.setHeight("400px");
- tabContent.addComponent(p);
-
- ts.addTab(tabContent);
- horizontalSplit.setSecondComponent(ts);
-
- vl.addComponent(horizontalSplit);
-
- setContent(vl);
-
- }
-
-}
+package com.vaadin.tests.components.tabsheet; + +import com.vaadin.annotations.Theme; +import com.vaadin.server.VaadinRequest; +import com.vaadin.ui.HorizontalSplitPanel; +import com.vaadin.ui.Panel; +import com.vaadin.ui.TabSheet; +import com.vaadin.ui.UI; +import com.vaadin.ui.VerticalLayout; +import com.vaadin.ui.themes.Runo; + +@Theme("runo") +public class ExtraScrollbarsInTabSheet extends UI { + + @Override + public void init(VaadinRequest request) { + + VerticalLayout vl = new VerticalLayout(); + vl.setSizeFull(); + + HorizontalSplitPanel horizontalSplit = new HorizontalSplitPanel(); + + TabSheet ts = new TabSheet(); + + VerticalLayout tabContent = new VerticalLayout(); + tabContent.setSizeFull(); + + Panel p = new Panel(); + p.addStyleName(Runo.PANEL_LIGHT); + p.setHeight("400px"); + tabContent.addComponent(p); + + ts.addTab(tabContent); + horizontalSplit.setSecondComponent(ts); + + vl.addComponent(horizontalSplit); + + setContent(vl); + + } + +} diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheet.java b/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheet.java index c21c702bd0..3e132c583b 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheet.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheet.java @@ -18,18 +18,20 @@ public class FirstTabNotVisibleInTabsheet extends AbstractTestUI { TabSheet tabSheet = new TabSheet(); tabSheet.setWidth("600px"); - firstTab = tabSheet.addTab(new Label("first visible tab"), "first visible tab"); + firstTab = tabSheet.addTab(new Label("first visible tab"), + "first visible tab"); for (int i = 2; i < 10; i++) { tabSheet.addTab(new Label("visible tab " + i), "visible tab " + i); } - addComponent(new VerticalLayout(tabSheet, new Button("Toggle first tab", new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent event) { - firstTab.setVisible(!firstTab.isVisible()); - } - }))); + addComponent(new VerticalLayout(tabSheet, new Button( + "Toggle first tab", new Button.ClickListener() { + @Override + public void buttonClick(Button.ClickEvent event) { + firstTab.setVisible(!firstTab.isVisible()); + } + }))); } @Override diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheetTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheetTest.java index e57651ba03..99c47b1703 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheetTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleInTabsheetTest.java @@ -1,6 +1,5 @@ package com.vaadin.tests.components.tabsheet; - import com.vaadin.testbench.elements.ButtonElement; import com.vaadin.testbench.elements.TabSheetElement; import com.vaadin.tests.tb3.MultiBrowserTest; @@ -17,8 +16,8 @@ public class FirstTabNotVisibleInTabsheetTest extends MultiBrowserTest { TabSheetElement tabSheet = $(TabSheetElement.class).first(); - Assert.assertTrue("TabSheet should have first tab visible", - tabSheet.getTabCaptions().contains("first visible tab")); + Assert.assertTrue("TabSheet should have first tab visible", tabSheet + .getTabCaptions().contains("first visible tab")); } private void toggleFirstTabVisibility() { diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/MoveComponentBetweenTabsheets.java b/uitest/src/com/vaadin/tests/components/tabsheet/MoveComponentBetweenTabsheets.java index 3323d6a8d7..624fac6e75 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/MoveComponentBetweenTabsheets.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/MoveComponentBetweenTabsheets.java @@ -1,69 +1,69 @@ -package com.vaadin.tests.components.tabsheet;
-
-import com.vaadin.server.VaadinRequest;
-import com.vaadin.tests.components.AbstractTestUI;
-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.TabSheet;
-
-/**
- * Main UI class
- */
-@SuppressWarnings("serial")
-public class MoveComponentBetweenTabsheets extends AbstractTestUI {
-
- TabSheet left, right;
- private Label l1;
- private Label l2;
- private Label r1;
- private Label r2;
-
- void doTestOperation() {
- right.addTab(l1, "L1");
- right.setSelectedTab(l1);
- }
-
- @Override
- protected void setup(VaadinRequest request) {
-
- // TODO Auto-generated method stub
- Button button = new Button("Move L1 to the right tabsheet");
- button.addClickListener(new Button.ClickListener() {
- @Override
- public void buttonClick(ClickEvent event) {
- doTestOperation();
- }
- });
-
- getLayout().addComponent(button);
-
- left = new TabSheet();
- l1 = new Label("Left 1");
- left.addTab(l1, "L1");
- l2 = new Label("Left 2");
- left.addTab(l2, "L2");
- left.setWidth("400px");
-
- right = new TabSheet();
- r1 = new Label("Right 1");
- right.addTab(r1, "R1");
- r2 = new Label("Right 2");
- right.addTab(r2, "R2");
- right.setWidth("400px");
-
- getLayout().addComponent(new HorizontalLayout(left, right));
- }
-
- @Override
- protected String getTestDescription() {
- return "Moving a component from a tabsheet to another sometimes causes a client-side error";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return 10839;
- }
-
-}
+package com.vaadin.tests.components.tabsheet; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +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.TabSheet; + +/** + * Main UI class + */ +@SuppressWarnings("serial") +public class MoveComponentBetweenTabsheets extends AbstractTestUI { + + TabSheet left, right; + private Label l1; + private Label l2; + private Label r1; + private Label r2; + + void doTestOperation() { + right.addTab(l1, "L1"); + right.setSelectedTab(l1); + } + + @Override + protected void setup(VaadinRequest request) { + + // TODO Auto-generated method stub + Button button = new Button("Move L1 to the right tabsheet"); + button.addClickListener(new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + doTestOperation(); + } + }); + + getLayout().addComponent(button); + + left = new TabSheet(); + l1 = new Label("Left 1"); + left.addTab(l1, "L1"); + l2 = new Label("Left 2"); + left.addTab(l2, "L2"); + left.setWidth("400px"); + + right = new TabSheet(); + r1 = new Label("Right 1"); + right.addTab(r1, "R1"); + r2 = new Label("Right 2"); + right.addTab(r2, "R2"); + right.setWidth("400px"); + + getLayout().addComponent(new HorizontalLayout(left, right)); + } + + @Override + protected String getTestDescription() { + return "Moving a component from a tabsheet to another sometimes causes a client-side error"; + } + + @Override + protected Integer getTicketNumber() { + return 10839; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/textfield/LocaleChangeOnReadOnlyField.java b/uitest/src/com/vaadin/tests/components/textfield/LocaleChangeOnReadOnlyField.java index a1cabe914e..06469550c9 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/LocaleChangeOnReadOnlyField.java +++ b/uitest/src/com/vaadin/tests/components/textfield/LocaleChangeOnReadOnlyField.java @@ -1,6 +1,5 @@ package com.vaadin.tests.components.textfield; - import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; diff --git a/uitest/src/com/vaadin/tests/components/ui/UIAccessTest.java b/uitest/src/com/vaadin/tests/components/ui/UIAccessTest.java index 9ecaa05315..0e37aa36fb 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UIAccessTest.java +++ b/uitest/src/com/vaadin/tests/components/ui/UIAccessTest.java @@ -43,7 +43,7 @@ public class UIAccessTest extends MultiBrowserTest { waitForLogToContainText("0. Current UI matches in beforeResponse? true"); waitForLogToContainText("1. Current session matches in beforeResponse? true"); } - + @Test public void canBeAccessedFromUIThread() { $(ButtonElement.class).first().click(); @@ -96,7 +96,7 @@ public class UIAccessTest extends MultiBrowserTest { waitForLogToContainText("1. Thread started, waiting for interruption"); waitForLogToContainText("2. I was interrupted"); } - + @Test public void testAccessSynchronously() { $(ButtonElement.class).get(5).click(); @@ -106,7 +106,7 @@ public class UIAccessTest extends MultiBrowserTest { assertTrue(logContainsText("2. has request after accessSynchronously? true")); assertTrue(logContainsText("3. Test value after accessSynchornously: Set in accessSynchronosly")); } - + @Test public void currentInstanceCanAccessValue() { $(ButtonElement.class).get(6).click(); diff --git a/uitest/src/com/vaadin/tests/components/ui/UISerializationTest.java b/uitest/src/com/vaadin/tests/components/ui/UISerializationTest.java index 2b6ba40e8c..649f48c9ce 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UISerializationTest.java +++ b/uitest/src/com/vaadin/tests/components/ui/UISerializationTest.java @@ -1,20 +1,24 @@ package com.vaadin.tests.components.ui; -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.tests.tb3.SingleBrowserTest; -import org.junit.Ignore; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.endsWith; +import static org.hamcrest.Matchers.startsWith; +import static org.junit.Assert.assertThat; + import org.junit.Test; -import static org.hamcrest.Matchers.*; -import static org.junit.Assert.assertThat; +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.tests.tb3.SingleBrowserTest; public class UISerializationTest extends SingleBrowserTest { @Test - @Ignore //Broken on all browsers since 9696e6c3e7e952b66ac3f5c9ddc3dfca4233451e - public void tb2test() throws Exception { + public void uiIsSerialized() throws Exception { openTestURL(); - $(ButtonElement.class).first().click(); + + serialize(); + assertThat(getLogRow(0), startsWith("3. Diff states match, size: ")); assertThat(getLogRow(1), startsWith("2. Deserialized UI in ")); assertThat( @@ -22,4 +26,8 @@ public class UISerializationTest extends SingleBrowserTest { allOf(startsWith("1. Serialized UI in"), containsString(" into "), endsWith(" bytes"))); } + + private void serialize() { + $(ButtonElement.class).first().click(); + } } diff --git a/uitest/src/com/vaadin/tests/components/window/WindowBGColorChameleonIE8.java b/uitest/src/com/vaadin/tests/components/window/WindowBGColorChameleonIE8.java new file mode 100644 index 0000000000..121d6300bc --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/window/WindowBGColorChameleonIE8.java @@ -0,0 +1,27 @@ +package com.vaadin.tests.components.window; + +import com.vaadin.annotations.Theme; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.UI; +import com.vaadin.ui.Window; + +@SuppressWarnings("serial") +@Theme("chameleon") +public class WindowBGColorChameleonIE8 extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + + final Window window = new Window(); + window.setCaption("Window"); + window.setModal(true); + window.setClosable(true); + window.setDraggable(true); + window.setWidth("400px"); + window.setHeight("300px"); + window.center(); + final UI ui = UI.getCurrent(); + ui.addWindow(window); + } +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/components/window/WindowBGColorChameleonIE8Test.java b/uitest/src/com/vaadin/tests/components/window/WindowBGColorChameleonIE8Test.java new file mode 100644 index 0000000000..18cb012cb2 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/window/WindowBGColorChameleonIE8Test.java @@ -0,0 +1,32 @@ +package com.vaadin.tests.components.window; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; + +import org.junit.Test; +import org.openqa.selenium.remote.DesiredCapabilities; + +import com.vaadin.tests.tb3.MultiBrowserTest; +import com.vaadin.tests.tb3.SingleBrowserTest; + +public class WindowBGColorChameleonIE8Test extends SingleBrowserTest { + + /* + * We care about IE8 here only (Or any very very old browsers) + * + * @see com.vaadin.tests.tb3.SingleBrowserTest#getBrowsersToTest() + */ + @Override + public List<DesiredCapabilities> getBrowsersToTest() { + + return Arrays.asList(MultiBrowserTest.Browser.IE8 + .getDesiredCapabilities()); + } + + @Test + public void testWindowColor() throws IOException { + openTestURL(); + compareScreen("grey-background-window"); + } +} diff --git a/uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java b/uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java index 4807bb9029..f2a8b24cb1 100644 --- a/uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java +++ b/uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java @@ -37,7 +37,8 @@ public class JavascriptManagerTest extends AbstractTestUI { @Override public void call(JsonArray arguments) { log.log("Got " + arguments.length() + " arguments"); - log.log("Argument 1 as a number: " + (int) arguments.getNumber(0)); + log.log("Argument 1 as a number: " + + (int) arguments.getNumber(0)); log.log("Argument 2 as a string: " + arguments.getString(1)); log.log("Argument 3.p as a boolean: " + arguments.getObject(2).getBoolean("p")); diff --git a/uitest/src/com/vaadin/tests/fieldgroup/MultipleValidationErrors.java b/uitest/src/com/vaadin/tests/fieldgroup/MultipleValidationErrors.java index 5110bf6dcf..58f2292f84 100644 --- a/uitest/src/com/vaadin/tests/fieldgroup/MultipleValidationErrors.java +++ b/uitest/src/com/vaadin/tests/fieldgroup/MultipleValidationErrors.java @@ -39,21 +39,27 @@ public class MultipleValidationErrors extends AbstractTestUI { try { fieldGroup.commit(); } catch (FieldGroup.CommitException e) { - if (e.getCause() != null && e.getCause() instanceof Validator.InvalidValueException) { - validationErrors.setValue(StringEscapeUtils.unescapeHtml( - AbstractErrorMessage.getErrorMessageForException(e.getCause()).getFormattedHtmlMessage())); + if (e.getCause() != null + && e.getCause() instanceof Validator.InvalidValueException) { + validationErrors.setValue(StringEscapeUtils + .unescapeHtml(AbstractErrorMessage + .getErrorMessageForException( + e.getCause()) + .getFormattedHtmlMessage())); } } - } }); } - private void bindTextField(BeanItem<PersonBeanWithValidationAnnotations> item, FieldGroup fieldGroup, - String caption, String propertyId) { - TextField textfield = new TextField(caption, item.getItemProperty(propertyId)); - textfield.addValidator(new BeanValidator(PersonBeanWithValidationAnnotations.class, propertyId)); + private void bindTextField( + BeanItem<PersonBeanWithValidationAnnotations> item, + FieldGroup fieldGroup, String caption, String propertyId) { + TextField textfield = new TextField(caption, + item.getItemProperty(propertyId)); + textfield.addValidator(new BeanValidator( + PersonBeanWithValidationAnnotations.class, propertyId)); fieldGroup.bind(textfield, propertyId); diff --git a/uitest/src/com/vaadin/tests/fieldgroup/MultipleValidationErrorsTest.java b/uitest/src/com/vaadin/tests/fieldgroup/MultipleValidationErrorsTest.java index 175b650be6..14527cff04 100644 --- a/uitest/src/com/vaadin/tests/fieldgroup/MultipleValidationErrorsTest.java +++ b/uitest/src/com/vaadin/tests/fieldgroup/MultipleValidationErrorsTest.java @@ -16,7 +16,8 @@ public class MultipleValidationErrorsTest extends MultiBrowserTest { } private void clearTextField(String caption) { - TextFieldElement textField = $(TextFieldElement.class).caption(caption).first(); + TextFieldElement textField = $(TextFieldElement.class).caption(caption) + .first(); textField.clear(); } @@ -29,9 +30,14 @@ public class MultipleValidationErrorsTest extends MultiBrowserTest { commitTextFields(); - String validationErrors = $(LabelElement.class).id("validationErrors").getText(); + String validationErrors = $(LabelElement.class).id("validationErrors") + .getText(); - assertThat(validationErrors, containsString(MultipleValidationErrors.FIRST_NAME_NOT_EMPTY_VALIDATION_MESSAGE)); - assertThat(validationErrors, containsString(MultipleValidationErrors.LAST_NAME_NOT_EMPTY_VALIDATION_MESSAGE)); + assertThat( + validationErrors, + containsString(MultipleValidationErrors.FIRST_NAME_NOT_EMPTY_VALIDATION_MESSAGE)); + assertThat( + validationErrors, + containsString(MultipleValidationErrors.LAST_NAME_NOT_EMPTY_VALIDATION_MESSAGE)); } } diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/JSAPIUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/JSAPIUI.java index e98fe6d066..ea9cd52d34 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/JSAPIUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/JSAPIUI.java @@ -28,7 +28,8 @@ public class JSAPIUI extends UI { } else { // type should be in [1] Notification.show(caption, - Type.values()[((int) arguments.getNumber(1))]); + Type.values()[((int) arguments + .getNumber(1))]); } } catch (JsonException e) { diff --git a/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersLongPollingTest.java b/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersLongPollingTest.java index fd89982253..c00f95a950 100644 --- a/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersLongPollingTest.java +++ b/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersLongPollingTest.java @@ -1,6 +1,7 @@ package com.vaadin.tests.push; -public class SendMultibyteCharactersLongPollingTest extends SendMultibyteCharactersTest { +public class SendMultibyteCharactersLongPollingTest extends + SendMultibyteCharactersTest { @Override protected String getTransport() { diff --git a/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersStreamingTest.java b/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersStreamingTest.java index 7b9ec38487..bc1debb9da 100644 --- a/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersStreamingTest.java +++ b/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersStreamingTest.java @@ -1,6 +1,7 @@ package com.vaadin.tests.push; -public class SendMultibyteCharactersStreamingTest extends SendMultibyteCharactersTest { +public class SendMultibyteCharactersStreamingTest extends + SendMultibyteCharactersTest { @Override protected String getTransport() { diff --git a/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersTest.java b/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersTest.java index 1ced2fb506..a639f7dbe3 100644 --- a/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersTest.java +++ b/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersTest.java @@ -25,7 +25,7 @@ public abstract class SendMultibyteCharactersTest extends MultiBrowserTest { TextAreaElement textArea = $(TextAreaElement.class).first(); StringBuilder text = new StringBuilder(); - for(int i=0;i < 20;i++) { + for (int i = 0; i < 20; i++) { text.append("之は日本語です、テストです。"); } diff --git a/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersWebSocketTest.java b/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersWebSocketTest.java index f37fb2efcb..f9ae472b99 100644 --- a/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersWebSocketTest.java +++ b/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersWebSocketTest.java @@ -1,11 +1,11 @@ package com.vaadin.tests.push; - import org.openqa.selenium.remote.DesiredCapabilities; import java.util.List; -public class SendMultibyteCharactersWebSocketTest extends SendMultibyteCharactersTest { +public class SendMultibyteCharactersWebSocketTest extends + SendMultibyteCharactersTest { @Override public List<DesiredCapabilities> getBrowsersToTest() { diff --git a/uitest/src/com/vaadin/tests/requesthandlers/CommunicationError.java b/uitest/src/com/vaadin/tests/requesthandlers/CommunicationError.java new file mode 100644 index 0000000000..31ec7658ee --- /dev/null +++ b/uitest/src/com/vaadin/tests/requesthandlers/CommunicationError.java @@ -0,0 +1,107 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.requesthandlers; + +import com.vaadin.launcher.ApplicationRunnerServlet; +import com.vaadin.server.CustomizedSystemMessages; +import com.vaadin.server.SystemMessages; +import com.vaadin.server.UIClassSelectionEvent; +import com.vaadin.server.UIProvider; +import com.vaadin.server.VaadinRequest; +import com.vaadin.server.VaadinService; +import com.vaadin.server.VaadinServletRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Label; +import com.vaadin.ui.UI; + +/** + * Test UI provider to check communication error json object null values. + * + * @author Vaadin Ltd + */ +public class CommunicationError extends UIProvider { + + @Override + public Class<? extends UI> getUIClass(UIClassSelectionEvent event) { + VaadinServletRequest request = (VaadinServletRequest) event + .getRequest(); + String currentUrl = request.getRequestURL().toString(); + StringBuilder redirectClass = new StringBuilder( + CommunicationError.class.getSimpleName()); + redirectClass.append('$'); + redirectClass.append(RedirectedUI.class.getSimpleName()); + + String restartApplication = "?restartApplication"; + if (!currentUrl.contains(restartApplication)) { + redirectClass.append(restartApplication); + } + final String url = currentUrl.replace( + CommunicationError.class.getSimpleName(), redirectClass); + + request.setAttribute( + ApplicationRunnerServlet.CUSTOM_SYSTEM_MESSAGES_PROPERTY, + createSystemMessages(url)); + + return CommunicationErrorUI.class; + } + + public static class CommunicationErrorUI extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + Button button = new Button("Send bad request", + new Button.ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + VaadinService.getCurrentResponse().setStatus(400); + } + }); + addComponent(button); + } + + @Override + protected Integer getTicketNumber() { + return 14594; + } + + @Override + protected String getTestDescription() { + return "Null values should be wrapped into JsonNull objects."; + } + } + + public static class RedirectedUI extends UI { + + @Override + protected void init(VaadinRequest request) { + Label label = new Label("redirected"); + label.addStyleName("redirected"); + setContent(label); + } + + } + + private SystemMessages createSystemMessages(String url) { + CustomizedSystemMessages messages = new CustomizedSystemMessages(); + messages.setCommunicationErrorCaption(null); + messages.setCommunicationErrorMessage(null); + messages.setCommunicationErrorURL(url); + return messages; + } +} diff --git a/uitest/src/com/vaadin/tests/requesthandlers/CommunicationErrorTest.java b/uitest/src/com/vaadin/tests/requesthandlers/CommunicationErrorTest.java new file mode 100644 index 0000000000..f295ec5ba3 --- /dev/null +++ b/uitest/src/com/vaadin/tests/requesthandlers/CommunicationErrorTest.java @@ -0,0 +1,41 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.requesthandlers; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test for null values in communication error json object . + * + * @author Vaadin Ltd + */ +public class CommunicationErrorTest extends MultiBrowserTest { + + @Test + public void testRedirection() { + openTestURL(); + + $(ButtonElement.class).first().click(); + + Assert.assertTrue(isElementPresent(By.className("redirected"))); + } + +} diff --git a/uitest/src/com/vaadin/tests/serialization/SerializerTest.java b/uitest/src/com/vaadin/tests/serialization/SerializerTest.java index df37601f23..2ac10c161d 100644 --- a/uitest/src/com/vaadin/tests/serialization/SerializerTest.java +++ b/uitest/src/com/vaadin/tests/serialization/SerializerTest.java @@ -17,9 +17,11 @@ package com.vaadin.tests.serialization; import java.text.DateFormat; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.HashSet; @@ -387,9 +389,17 @@ public class SerializerTest extends AbstractTestUI { @Override public void sendSet(Set<Integer> intSet, Set<Connector> connectorSet, Set<SimpleTestBean> beanSet) { - log.log("sendSet: " + intSet + ", " - + connectorCollectionToString(connectorSet) + ", " - + beanSet); + List<Integer> intList = new ArrayList<Integer>(intSet); + Collections.sort(intList); + List<Connector> connectorList = new ArrayList<Connector>( + connectorSet); + Collections.sort(connectorList, new ConnectorComparator()); + List<SimpleTestBean> beanList = new ArrayList<SimpleTestBean>( + beanSet); + Collections.sort(beanList, new SimpleBeanComparator()); + log.log("sendSet: " + intList + ", " + + connectorCollectionToString(connectorList) + ", " + + beanList); } @Override @@ -483,4 +493,19 @@ public class SerializerTest extends AbstractTestUI { return Integer.valueOf(8655); } + private static class ConnectorComparator implements Comparator<Connector> { + + @Override + public int compare(Connector o1, Connector o2) { + return o1.getConnectorId().compareTo(o2.getConnectorId()); + } + } + + private static class SimpleBeanComparator implements + Comparator<SimpleTestBean> { + @Override + public int compare(SimpleTestBean o1, SimpleTestBean o2) { + return Integer.valueOf(o1.getValue()).compareTo(o2.getValue()); + } + } } diff --git a/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java b/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java index a5216546b3..23af74c78b 100644 --- a/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java +++ b/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java @@ -92,8 +92,10 @@ public class SerializerTestTest extends MultiBrowserTest { getLogRow(logRow++)); Assert.assertEquals("state.floatArray: [57, 0, -12]", getLogRow(logRow++)); - Assert.assertTrue(getLogRow(logRow++).startsWith("state.floatObjectValue: 1.0000001")); - Assert.assertTrue(getLogRow(logRow++).startsWith("state.floatValue: 3.14159")); + Assert.assertTrue(getLogRow(logRow++).startsWith( + "state.floatObjectValue: 1.0000001")); + Assert.assertTrue(getLogRow(logRow++).startsWith( + "state.floatValue: 3.14159")); Assert.assertEquals("state.longArray: [-57841235865, 57]", getLogRow(logRow++)); Assert.assertEquals("state.longObjectValue: 577431841360", diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java index b5a345bd30..2e3d25cbbe 100644 --- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java +++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java @@ -837,7 +837,8 @@ public abstract class AbstractTB3Test extends TestBenchTestCase { runPath = "/run-push"; } - if (UI.class.isAssignableFrom(uiClass)) { + if (UI.class.isAssignableFrom(uiClass) + || UIProvider.class.isAssignableFrom(uiClass)) { return runPath + "/" + uiClass.getCanonicalName() + (isDebug() ? "?debug" : ""); } else if (LegacyApplication.class.isAssignableFrom(uiClass)) { diff --git a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java index ebcb02002e..5a25a4ebb8 100644 --- a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java +++ b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java @@ -41,7 +41,8 @@ import org.openqa.selenium.remote.DesiredCapabilities; public abstract class MultiBrowserTest extends PrivateTB3Configuration { protected List<DesiredCapabilities> getBrowsersSupportingWebSocket() { - List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>(getAllBrowsers()); + List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>( + getAllBrowsers()); browsers.remove(Browser.IE8.getDesiredCapabilities()); browsers.remove(Browser.IE9.getDesiredCapabilities()); @@ -51,7 +52,8 @@ public abstract class MultiBrowserTest extends PrivateTB3Configuration { } protected List<DesiredCapabilities> getBrowsersExcludingPhantomJS() { - List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>(getAllBrowsers()); + List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>( + getAllBrowsers()); browsers.remove(Browser.PHANTOMJS.getDesiredCapabilities()); @@ -59,7 +61,8 @@ public abstract class MultiBrowserTest extends PrivateTB3Configuration { } protected List<DesiredCapabilities> getBrowsersExcludingIE() { - List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>(getAllBrowsers()); + List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>( + getAllBrowsers()); browsers.remove(Browser.IE8.getDesiredCapabilities()); browsers.remove(Browser.IE9.getDesiredCapabilities()); browsers.remove(Browser.IE10.getDesiredCapabilities()); @@ -69,14 +72,15 @@ public abstract class MultiBrowserTest extends PrivateTB3Configuration { } protected List<DesiredCapabilities> getBrowsersSupportingShiftClick() { - List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>(getAllBrowsers()); + List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>( + getAllBrowsers()); - //IE supports shift click only when require window focus is true + // IE supports shift click only when require window focus is true browsers.remove(Browser.FIREFOX.getDesiredCapabilities()); browsers.remove(Browser.PHANTOMJS.getDesiredCapabilities()); - return browsers; - } + return browsers; + } protected List<DesiredCapabilities> getIEBrowsersOnly() { List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>(); @@ -88,7 +92,6 @@ public abstract class MultiBrowserTest extends PrivateTB3Configuration { return browsers; } - public enum Browser { FIREFOX(BrowserUtil.firefox(24)), CHROME(BrowserUtil.chrome(33)), SAFARI( BrowserUtil.safari(7)), IE8(BrowserUtil.ie(8)), IE9(BrowserUtil diff --git a/uitest/src/com/vaadin/tests/tb3/RetryOnFail.java b/uitest/src/com/vaadin/tests/tb3/RetryOnFail.java index 3c22057863..7a1656a0d2 100644 --- a/uitest/src/com/vaadin/tests/tb3/RetryOnFail.java +++ b/uitest/src/com/vaadin/tests/tb3/RetryOnFail.java @@ -50,9 +50,10 @@ public class RetryOnFail implements TestRule { } private int getRetryCount() { - String retryCount = System.getProperty("com.vaadin.testbench.max.retries"); + String retryCount = System + .getProperty("com.vaadin.testbench.max.retries"); - if(retryCount != null && retryCount != "") { + if (retryCount != null && retryCount != "") { return Integer.parseInt(retryCount); } diff --git a/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java b/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java index ddcc6d5d76..7f65357a65 100644 --- a/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java +++ b/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java @@ -39,6 +39,7 @@ public abstract class WebsocketTest extends MultiBrowserTest { @Override public List<DesiredCapabilities> getBrowsersToTest() { - return new ArrayList<DesiredCapabilities>(getBrowsersSupportingWebSocket()); + return new ArrayList<DesiredCapabilities>( + getBrowsersSupportingWebSocket()); } } diff --git a/uitest/src/com/vaadin/tests/themes/FaviconTest.java b/uitest/src/com/vaadin/tests/themes/FaviconTest.java index 31134f656f..3ba86fd3e4 100644 --- a/uitest/src/com/vaadin/tests/themes/FaviconTest.java +++ b/uitest/src/com/vaadin/tests/themes/FaviconTest.java @@ -44,8 +44,10 @@ public class FaviconTest extends SingleBrowserTest { private int getResponseCode(String theme) { try { - URL url = new URL(String.format("%s/VAADIN/themes/%s/favicon.ico", getBaseURL(), theme)); - HttpURLConnection connection = (HttpURLConnection)url.openConnection(); + URL url = new URL(String.format("%s/VAADIN/themes/%s/favicon.ico", + getBaseURL(), theme)); + HttpURLConnection connection = (HttpURLConnection) url + .openConnection(); connection.setRequestMethod("GET"); connection.connect(); diff --git a/uitest/src/com/vaadin/tests/themes/chameleon/ChameleonNotification.java b/uitest/src/com/vaadin/tests/themes/chameleon/ChameleonNotification.java index efb953530c..fc26a7b4f4 100644 --- a/uitest/src/com/vaadin/tests/themes/chameleon/ChameleonNotification.java +++ b/uitest/src/com/vaadin/tests/themes/chameleon/ChameleonNotification.java @@ -12,7 +12,6 @@ public class ChameleonNotification extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - addButton("Notification", new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { diff --git a/uitest/src/com/vaadin/tests/themes/chameleon/ChameleonNotificationTest.java b/uitest/src/com/vaadin/tests/themes/chameleon/ChameleonNotificationTest.java index ef41ef3df9..46c7382726 100644 --- a/uitest/src/com/vaadin/tests/themes/chameleon/ChameleonNotificationTest.java +++ b/uitest/src/com/vaadin/tests/themes/chameleon/ChameleonNotificationTest.java @@ -16,8 +16,8 @@ public class ChameleonNotificationTest extends MultiBrowserTest { openTestURL(); $(ButtonElement.class).first().click(); - NotificationElement notificationElement - = $(NotificationElement.class).first(); + NotificationElement notificationElement = $(NotificationElement.class) + .first(); assertThat(notificationElement.getCssValue("background-image"), containsString("chameleon/img/grad")); diff --git a/uitest/src/com/vaadin/tests/themes/valo/ModalWindowTest.java b/uitest/src/com/vaadin/tests/themes/valo/ModalWindowTest.java index b97ce43ed6..0b21d4f34c 100644 --- a/uitest/src/com/vaadin/tests/themes/valo/ModalWindowTest.java +++ b/uitest/src/com/vaadin/tests/themes/valo/ModalWindowTest.java @@ -23,9 +23,11 @@ public class ModalWindowTest extends SingleBrowserTest { openModalWindow(); - WebElement modalityCurtain = findElement(By.className("v-window-modalitycurtain")); + WebElement modalityCurtain = findElement(By + .className("v-window-modalitycurtain")); - assertThat(modalityCurtain.getCssValue("-webkit-animation-name"), is("none")); + assertThat(modalityCurtain.getCssValue("-webkit-animation-name"), + is("none")); } private void openModalWindow() { diff --git a/uitest/src/com/vaadin/tests/themes/valo/TableSortIndicator.java b/uitest/src/com/vaadin/tests/themes/valo/TableSortIndicator.java index 74e5fcd0ef..8e873b0f1a 100644 --- a/uitest/src/com/vaadin/tests/themes/valo/TableSortIndicator.java +++ b/uitest/src/com/vaadin/tests/themes/valo/TableSortIndicator.java @@ -12,8 +12,8 @@ public class TableSortIndicator extends AbstractTestUI { Table table = new Table(); table.addContainerProperty("Index", Integer.class, ""); - for(int i=0;i<10;i++) { - table.addItem(new Object[] {i}, i); + for (int i = 0; i < 10; i++) { + table.addItem(new Object[] { i }, i); } table.setPageLength(0); @@ -23,8 +23,8 @@ public class TableSortIndicator extends AbstractTestUI { @Override protected String getTestDescription() { - return "For Valo, sorting indicators should point up when sorted asc " + - "and down when sorted desc."; + return "For Valo, sorting indicators should point up when sorted asc " + + "and down when sorted desc."; } @Override |