diff options
50 files changed, 269 insertions, 201 deletions
diff --git a/client/src/com/vaadin/client/BrowserInfo.java b/client/src/com/vaadin/client/BrowserInfo.java index 01968a17a6..8b274623c1 100644 --- a/client/src/com/vaadin/client/BrowserInfo.java +++ b/client/src/com/vaadin/client/BrowserInfo.java @@ -88,7 +88,8 @@ public class BrowserInfo { } else if (browserDetails.isIE()) { touchDevice = detectIETouchDevice(); } else { - //PhantomJS pretends to be a touch device which breaks some UI tests + // PhantomJS pretends to be a touch device which breaks some UI + // tests touchDevice = !browserDetails.isPhantomJS() && detectTouchDevice(); } } diff --git a/client/src/com/vaadin/client/VTooltip.java b/client/src/com/vaadin/client/VTooltip.java index b9392e3941..4e59040298 100644 --- a/client/src/com/vaadin/client/VTooltip.java +++ b/client/src/com/vaadin/client/VTooltip.java @@ -177,7 +177,7 @@ public class VTooltip extends VOverlay { int x = 0; int y = 0; - if(BrowserInfo.get().isTouchDevice()) { + if (BrowserInfo.get().isTouchDevice()) { setMaxWidth(Window.getClientWidth()); offsetWidth = getOffsetWidth(); offsetHeight = getOffsetHeight(); @@ -239,8 +239,8 @@ public class VTooltip extends VOverlay { private int getFinalTouchX(int offsetWidth) { int x = 0; int widthNeeded = 10 + offsetWidth; - int roomLeft = currentElement != null ? - currentElement.getAbsoluteLeft() : EVENT_XY_POSITION_OUTSIDE; + int roomLeft = currentElement != null ? currentElement + .getAbsoluteLeft() : EVENT_XY_POSITION_OUTSIDE; int viewPortWidth = Window.getClientWidth(); int roomRight = viewPortWidth - roomLeft; if (roomRight > widthNeeded) { @@ -249,7 +249,8 @@ public class VTooltip extends VOverlay { x = roomLeft - offsetWidth; } if (x + offsetWidth - Window.getScrollLeft() > viewPortWidth) { - x = viewPortWidth - offsetWidth + Window.getScrollLeft(); + x = viewPortWidth - offsetWidth + + Window.getScrollLeft(); } if (roomLeft != EVENT_XY_POSITION_OUTSIDE) { @@ -316,17 +317,20 @@ public class VTooltip extends VOverlay { */ private int getFinalTouchY(int offsetHeight) { int y = 0; - int heightNeeded = 10 + offsetHeight; - int roomAbove = currentElement != null ? - currentElement.getAbsoluteTop() + currentElement.getOffsetHeight() + int heightNeeded = 10 + offsetHeight; + int roomAbove = currentElement != null ? currentElement + .getAbsoluteTop() + + currentElement.getOffsetHeight() : EVENT_XY_POSITION_OUTSIDE; int roomBelow = Window.getClientHeight() - roomAbove; if (roomBelow > heightNeeded) { y = roomAbove; } else { - y = roomAbove - offsetHeight - - (currentElement != null ? currentElement.getOffsetHeight() : 0); + y = roomAbove + - offsetHeight + - (currentElement != null ? currentElement + .getOffsetHeight() : 0); } if (y + offsetHeight - Window.getScrollTop() > Window @@ -355,7 +359,6 @@ public class VTooltip extends VOverlay { } } - /** * For assistive tooltips to work correctly we must have the tooltip visible * and attached to the DOM well in advance. For this reason both isShowing @@ -537,7 +540,7 @@ public class VTooltip extends VOverlay { @Override public void onMouseDown(MouseDownEvent event) { - handleHideEvent(); + handleHideEvent(); } @Override diff --git a/client/src/com/vaadin/client/renderers/ImageRenderer.java b/client/src/com/vaadin/client/renderers/ImageRenderer.java index 9e61e60919..d52bc1ba6d 100644 --- a/client/src/com/vaadin/client/renderers/ImageRenderer.java +++ b/client/src/com/vaadin/client/renderers/ImageRenderer.java @@ -42,8 +42,7 @@ public class ImageRenderer extends ClickableRenderer<String, Image> { public void render(RendererCellReference cell, String url, Image image) { if (url == null) { image.setUrl(TRANSPARENT_GIF_1PX); - } - else { + } else { image.setUrl(url); } } diff --git a/client/src/com/vaadin/client/ui/VFormLayout.java b/client/src/com/vaadin/client/ui/VFormLayout.java index 42dbbde32a..84a9b4f3dd 100644 --- a/client/src/com/vaadin/client/ui/VFormLayout.java +++ b/client/src/com/vaadin/client/ui/VFormLayout.java @@ -366,7 +366,7 @@ public class VFormLayout extends SimplePanel { public ErrorFlag(ComponentConnector owner) { setStyleName(CLASSNAME); - if(!BrowserInfo.get().isTouchDevice()) { + if (!BrowserInfo.get().isTouchDevice()) { sinkEvents(VTooltip.TOOLTIP_EVENTS); } diff --git a/client/src/com/vaadin/client/ui/VMenuBar.java b/client/src/com/vaadin/client/ui/VMenuBar.java index c6c4b444e5..fb8ba013f7 100644 --- a/client/src/com/vaadin/client/ui/VMenuBar.java +++ b/client/src/com/vaadin/client/ui/VMenuBar.java @@ -914,8 +914,8 @@ public class VMenuBar extends SimpleFocusablePanel implements String currentStyles = super.getStyleName(); List<String> customStyles = new ArrayList<String>(); - for(String style : currentStyles.split(" ")) { - if(!style.isEmpty() && !style.startsWith(primaryStyleName)) { + for (String style : currentStyles.split(" ")) { + if (!style.isEmpty() && !style.startsWith(primaryStyleName)) { customStyles.add(style); } } diff --git a/client/src/com/vaadin/client/ui/VTabsheet.java b/client/src/com/vaadin/client/ui/VTabsheet.java index 8e4f3cb643..ded9977f5e 100644 --- a/client/src/com/vaadin/client/ui/VTabsheet.java +++ b/client/src/com/vaadin/client/ui/VTabsheet.java @@ -1101,7 +1101,8 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware } private boolean isScrollerHidden() { - return scroller.getStyle().getDisplay().equals(Display.NONE.getCssName()); + return scroller.getStyle().getDisplay() + .equals(Display.NONE.getCssName()); } private boolean isIndexSkippingHiddenTabs() { @@ -1124,16 +1125,16 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware // Should not set tabs visible if they are scrolled out of view tab.setVisible(false); } else { - //When the tab was hidden and then turned visible again - //and there is space for it, it should be in view (#17096) (#17333) + // When the tab was hidden and then turned visible again + // and there is space for it, it should be in view (#17096) (#17333) if (isTabSetVisibleBeforeScroller(tabState, index, tab)) { scrollerIndex = index; tab.setVisible(true); tab.setStyleNames(false, true); - //scroll to the currently selected tab if it got clipped - //after making another tab visible - if(isClippedTabs()) { + // scroll to the currently selected tab if it got clipped + // after making another tab visible + if (isClippedTabs()) { scrollIntoView(getActiveTab()); } } else { @@ -1149,16 +1150,20 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware } /** - * Checks whether the tab has been set to visible and the scroller is at the first visible tab. - * That means that the scroller has to be adjusted so that the tab is visible again. + * Checks whether the tab has been set to visible and the scroller is at the + * first visible tab. That means that the scroller has to be adjusted so + * that the tab is visible again. */ - private boolean isTabSetVisibleBeforeScroller(TabState tabState, int index, Tab tab) { + private boolean isTabSetVisibleBeforeScroller(TabState tabState, int index, + Tab tab) { return isIndexSkippingHiddenTabs() && isScrollerAtFirstVisibleTab() - && hasTabChangedVisibility(tabState, tab) && scrolledOutOfView(index); + && hasTabChangedVisibility(tabState, tab) + && scrolledOutOfView(index); } /** - * Checks whether the tab is visible on server but is not visible on client yet. + * Checks whether the tab is visible on server but is not visible on client + * yet. */ private boolean hasTabChangedVisibility(TabState tabState, Tab tab) { return !tab.isVisible() && tabState.visible; diff --git a/client/tests/src/com/vaadin/client/ApplicationConnectionURLGenerationTest.java b/client/tests/src/com/vaadin/client/ApplicationConnectionURLGenerationTest.java index f529ba0886..4dd2ddbaa4 100644 --- a/client/tests/src/com/vaadin/client/ApplicationConnectionURLGenerationTest.java +++ b/client/tests/src/com/vaadin/client/ApplicationConnectionURLGenerationTest.java @@ -52,8 +52,7 @@ public class ApplicationConnectionURLGenerationTest { public void testParameterAdding() { for (int i = 0; i < URIS.length; i++) { // Adding nothing - assertEquals(URIS[i], - SharedUtil.addGetParameters(URIS[i], "")); + assertEquals(URIS[i], SharedUtil.addGetParameters(URIS[i], "")); // Adding a=b&c=d assertEquals(URIS_WITH_ABCD_PARAM[i], @@ -61,16 +60,14 @@ public class ApplicationConnectionURLGenerationTest { // Fragments if (URIS_WITH_ABCD_PARAM_AND_FRAGMENT[i].length() > 0) { - assertEquals( - URIS_WITH_ABCD_PARAM_AND_FRAGMENT[i], - SharedUtil.addGetParameters(URIS[i] - + "#fragment", "a=b&c=d")); + assertEquals(URIS_WITH_ABCD_PARAM_AND_FRAGMENT[i], + SharedUtil.addGetParameters(URIS[i] + "#fragment", + "a=b&c=d")); // Empty fragment assertEquals(URIS_WITH_ABCD_PARAM_AND_FRAGMENT[i].replace( - "#fragment", "#"), - SharedUtil.addGetParameters(URIS[i] + "#", - "a=b&c=d")); + "#fragment", "#"), SharedUtil.addGetParameters(URIS[i] + + "#", "a=b&c=d")); } } } diff --git a/server/src/com/vaadin/ui/Slider.java b/server/src/com/vaadin/ui/Slider.java index 2e00628eb0..15c94b6d3c 100644 --- a/server/src/com/vaadin/ui/Slider.java +++ b/server/src/com/vaadin/ui/Slider.java @@ -285,7 +285,7 @@ public class Slider extends AbstractField<Double> { final int resolution = getResolution(); double ratio = Math.pow(10, resolution); - if(v >= 0) { + if (v >= 0) { return Math.floor(v * ratio) / ratio; } else { return Math.ceil(v * ratio) / ratio; diff --git a/server/src/com/vaadin/ui/renderers/AbstractJavaScriptRenderer.java b/server/src/com/vaadin/ui/renderers/AbstractJavaScriptRenderer.java index 104e07f02f..57e8130b29 100644 --- a/server/src/com/vaadin/ui/renderers/AbstractJavaScriptRenderer.java +++ b/server/src/com/vaadin/ui/renderers/AbstractJavaScriptRenderer.java @@ -105,7 +105,8 @@ public abstract class AbstractJavaScriptRenderer<T> extends AbstractRenderer<T> private JavaScriptCallbackHelper callbackHelper = new JavaScriptCallbackHelper( this); - protected AbstractJavaScriptRenderer(Class<T> presentationType, String nullRepresentation) { + protected AbstractJavaScriptRenderer(Class<T> presentationType, + String nullRepresentation) { super(presentationType, nullRepresentation); } diff --git a/server/src/com/vaadin/ui/renderers/ButtonRenderer.java b/server/src/com/vaadin/ui/renderers/ButtonRenderer.java index a747e45713..e7e723ebd6 100644 --- a/server/src/com/vaadin/ui/renderers/ButtonRenderer.java +++ b/server/src/com/vaadin/ui/renderers/ButtonRenderer.java @@ -45,7 +45,8 @@ public class ButtonRenderer extends ClickableRenderer<String> { * @param nullRepresentation * the textual representation of {@code null} value */ - public ButtonRenderer(RendererClickListener listener, String nullRepresentation) { + public ButtonRenderer(RendererClickListener listener, + String nullRepresentation) { this(nullRepresentation); addClickListener(listener); } diff --git a/server/src/com/vaadin/ui/renderers/ClickableRenderer.java b/server/src/com/vaadin/ui/renderers/ClickableRenderer.java index 01e939bb67..7210eb7840 100644 --- a/server/src/com/vaadin/ui/renderers/ClickableRenderer.java +++ b/server/src/com/vaadin/ui/renderers/ClickableRenderer.java @@ -106,7 +106,8 @@ public class ClickableRenderer<T> extends AbstractRenderer<T> { this(presentationType, null); } - protected ClickableRenderer(Class<T> presentationType, String nullRepresentation) { + protected ClickableRenderer(Class<T> presentationType, + String nullRepresentation) { super(presentationType, nullRepresentation); registerRpc(new RendererClickRpc() { @Override diff --git a/server/src/com/vaadin/ui/renderers/DateRenderer.java b/server/src/com/vaadin/ui/renderers/DateRenderer.java index 092b3f405e..dddeb6cd77 100644 --- a/server/src/com/vaadin/ui/renderers/DateRenderer.java +++ b/server/src/com/vaadin/ui/renderers/DateRenderer.java @@ -72,7 +72,8 @@ public class DateRenderer extends AbstractRenderer<Date> { * @throws IllegalArgumentException * if {@code locale} is {@code null} */ - public DateRenderer(Locale locale, String nullRepresentation) throws IllegalArgumentException { + public DateRenderer(Locale locale, String nullRepresentation) + throws IllegalArgumentException { this("%s", locale, nullRepresentation); } @@ -110,7 +111,8 @@ public class DateRenderer extends AbstractRenderer<Date> { * href="http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax">Format * String Syntax</a> */ - public DateRenderer(String formatString, String nullRepresentation) throws IllegalArgumentException { + public DateRenderer(String formatString, String nullRepresentation) + throws IllegalArgumentException { this(formatString, Locale.getDefault(), nullRepresentation); } @@ -132,8 +134,9 @@ public class DateRenderer extends AbstractRenderer<Date> { */ public DateRenderer(String formatString, Locale locale) throws IllegalArgumentException { - this(formatString,locale, ""); + this(formatString, locale, ""); } + /** * Creates a new date renderer. * <p> @@ -152,8 +155,8 @@ public class DateRenderer extends AbstractRenderer<Date> { * href="http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax">Format * String Syntax</a> */ - public DateRenderer(String formatString, Locale locale, String nullRepresentation) - throws IllegalArgumentException { + public DateRenderer(String formatString, Locale locale, + String nullRepresentation) throws IllegalArgumentException { super(Date.class, nullRepresentation); if (formatString == null) { @@ -182,6 +185,7 @@ public class DateRenderer extends AbstractRenderer<Date> { public DateRenderer(DateFormat dateFormat) throws IllegalArgumentException { this(dateFormat, ""); } + /** * Creates a new date renderer. * <p> @@ -192,7 +196,8 @@ public class DateRenderer extends AbstractRenderer<Date> { * @throws IllegalArgumentException * if {@code dateFormat} is {@code null} */ - public DateRenderer(DateFormat dateFormat, String nullRepresentation) throws IllegalArgumentException { + public DateRenderer(DateFormat dateFormat, String nullRepresentation) + throws IllegalArgumentException { super(Date.class, nullRepresentation); if (dateFormat == null) { throw new IllegalArgumentException("date format may not be null"); diff --git a/server/src/com/vaadin/ui/renderers/HtmlRenderer.java b/server/src/com/vaadin/ui/renderers/HtmlRenderer.java index df89c60ad2..2ec43800c0 100644 --- a/server/src/com/vaadin/ui/renderers/HtmlRenderer.java +++ b/server/src/com/vaadin/ui/renderers/HtmlRenderer.java @@ -28,7 +28,8 @@ public class HtmlRenderer extends AbstractRenderer<String> { /** * Creates a new HTML renderer. * - * @param nullRepresentation the html representation of {@code null} value + * @param nullRepresentation + * the html representation of {@code null} value */ public HtmlRenderer(String nullRepresentation) { super(String.class, nullRepresentation); diff --git a/server/src/com/vaadin/ui/renderers/NumberRenderer.java b/server/src/com/vaadin/ui/renderers/NumberRenderer.java index 1d4d7e0ec9..b1ba309c9a 100644 --- a/server/src/com/vaadin/ui/renderers/NumberRenderer.java +++ b/server/src/com/vaadin/ui/renderers/NumberRenderer.java @@ -69,7 +69,7 @@ public class NumberRenderer extends AbstractRenderer<Number> { * @param nullRepresentation * the textual representation of {@code null} value * @throws IllegalArgumentException - * if {@code numberFormat} is {@code null} + * if {@code numberFormat} is {@code null} */ public NumberRenderer(NumberFormat numberFormat, String nullRepresentation) throws IllegalArgumentException { @@ -112,8 +112,10 @@ public class NumberRenderer extends AbstractRenderer<Number> { * @throws IllegalArgumentException * if {@code locale} is {@code null} */ - public NumberRenderer(String formatString, Locale locale) throws IllegalArgumentException { - this(formatString, locale, ""); //This will call #toString() during formatting + public NumberRenderer(String formatString, Locale locale) + throws IllegalArgumentException { + this(formatString, locale, ""); // This will call #toString() during + // formatting } /** @@ -122,8 +124,8 @@ public class NumberRenderer extends AbstractRenderer<Number> { * The renderer is configured to render with the given format string in the * default locale. * - * @param - * formatString the format string with which to format the number + * @param formatString + * the format string with which to format the number * @throws IllegalArgumentException * if {@code formatString} is {@code null} * @see <a @@ -150,7 +152,8 @@ public class NumberRenderer extends AbstractRenderer<Number> { * href="http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax">Format * String Syntax</a> */ - public NumberRenderer(String formatString, Locale locale, String nullRepresentation) { + public NumberRenderer(String formatString, Locale locale, + String nullRepresentation) { super(Number.class, nullRepresentation); if (formatString == null) { diff --git a/server/src/com/vaadin/ui/renderers/TextRenderer.java b/server/src/com/vaadin/ui/renderers/TextRenderer.java index 0045024b2f..ce8a73d057 100644 --- a/server/src/com/vaadin/ui/renderers/TextRenderer.java +++ b/server/src/com/vaadin/ui/renderers/TextRenderer.java @@ -35,6 +35,7 @@ public class TextRenderer extends AbstractRenderer<String> { /** * Creates a new text renderer + * * @param nullRepresentation * the textual representation of {@code null} value */ diff --git a/server/tests/src/com/vaadin/data/util/filter/AndOrFilterTest.java b/server/tests/src/com/vaadin/data/util/filter/AndOrFilterTest.java index 012d0ef0bc..1f42f4e935 100644 --- a/server/tests/src/com/vaadin/data/util/filter/AndOrFilterTest.java +++ b/server/tests/src/com/vaadin/data/util/filter/AndOrFilterTest.java @@ -6,7 +6,8 @@ import com.vaadin.data.Container.Filter; import com.vaadin.data.Item; import com.vaadin.data.util.BeanItem; -public class AndOrFilterTest extends AbstractFilterTestBase<AbstractJunctionFilter> { +public class AndOrFilterTest extends + AbstractFilterTestBase<AbstractJunctionFilter> { protected Item item1 = new BeanItem<Integer>(1); protected Item item2 = new BeanItem<Integer>(2); diff --git a/server/tests/src/com/vaadin/tests/design/ComponentFactoryTest.java b/server/tests/src/com/vaadin/tests/design/ComponentFactoryTest.java index 4115872fb7..85efa22c40 100644 --- a/server/tests/src/com/vaadin/tests/design/ComponentFactoryTest.java +++ b/server/tests/src/com/vaadin/tests/design/ComponentFactoryTest.java @@ -117,7 +117,7 @@ public class ComponentFactoryTest { currentComponentFactory.set(new ComponentFactory() { @Override public Component createComponent(String fullyQualifiedClassName, - DesignContext context) { + DesignContext context) { classes.add(fullyQualifiedClassName); return defaultFactory.createComponent(fullyQualifiedClassName, context); @@ -127,8 +127,10 @@ public class ComponentFactoryTest { DesignContext designContext = new DesignContext(); designContext.getDefaultInstance(new DefaultInstanceTestComponent()); - Assert.assertEquals("There should be one class requests", 1, classes.size()); - Assert.assertEquals("First class should be DefaultInstanceTestComponent", + Assert.assertEquals("There should be one class requests", 1, + classes.size()); + Assert.assertEquals( + "First class should be DefaultInstanceTestComponent", DefaultInstanceTestComponent.class.getName(), classes.get(0)); } diff --git a/server/tests/src/com/vaadin/tests/design/ParseAllSupportedComponentsTest.java b/server/tests/src/com/vaadin/tests/design/ParseAllSupportedComponentsTest.java index 5f901cd746..d944826f10 100644 --- a/server/tests/src/com/vaadin/tests/design/ParseAllSupportedComponentsTest.java +++ b/server/tests/src/com/vaadin/tests/design/ParseAllSupportedComponentsTest.java @@ -40,7 +40,7 @@ public class ParseAllSupportedComponentsTest { public void allComponentsAreParsed() throws FileNotFoundException { DesignContext ctx = Design .read(new FileInputStream( - "server/tests/src/com/vaadin/tests/design/all-components.html"), + "server/tests/src/com/vaadin/tests/design/all-components.html"), null); assertThat(ctx, is(not(nullValue()))); diff --git a/server/tests/src/com/vaadin/tests/design/ParseLayoutTest.java b/server/tests/src/com/vaadin/tests/design/ParseLayoutTest.java index 70376c79f8..50ab261195 100644 --- a/server/tests/src/com/vaadin/tests/design/ParseLayoutTest.java +++ b/server/tests/src/com/vaadin/tests/design/ParseLayoutTest.java @@ -138,7 +138,8 @@ public class ParseLayoutTest { return Design.read(in, null); } - private ByteArrayOutputStream serializeDesign(DesignContext context) throws IOException { + private ByteArrayOutputStream serializeDesign(DesignContext context) + throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(); Design.write(context, out); @@ -192,7 +193,8 @@ public class ParseLayoutTest { assertThat(hlayout.getComponent(0).getCaption(), is("FooBar")); assertThat(hlayout.getComponent(1).getCaption(), is("Native click me")); assertThat(hlayout.getComponent(2).getCaption(), is("Another button")); - assertThat(hlayout.getComponent(3).getCaption(), is("Yet another button")); + assertThat(hlayout.getComponent(3).getCaption(), + is("Yet another button")); assertThat(hlayout.getComponent(4).getCaption(), is("Click me")); assertThat(hlayout.getComponent(4).getWidth(), is(150f)); diff --git a/server/tests/src/com/vaadin/tests/server/AbstractContainerListenersTest.java b/server/tests/src/com/vaadin/tests/server/AbstractContainerListenersTest.java index a5c7dc3ab2..91036c03ed 100644 --- a/server/tests/src/com/vaadin/tests/server/AbstractContainerListenersTest.java +++ b/server/tests/src/com/vaadin/tests/server/AbstractContainerListenersTest.java @@ -7,7 +7,8 @@ import com.vaadin.data.Container.PropertySetChangeListener; import com.vaadin.data.util.IndexedContainer; import com.vaadin.tests.server.component.AbstractListenerMethodsTestBase; -public class AbstractContainerListenersTest extends AbstractListenerMethodsTestBase { +public class AbstractContainerListenersTest extends + AbstractListenerMethodsTestBase { public void testItemSetChangeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(IndexedContainer.class, diff --git a/server/tests/src/com/vaadin/tests/server/AbstractPropertyListenersTest.java b/server/tests/src/com/vaadin/tests/server/AbstractPropertyListenersTest.java index 28e6f7e0a5..fd38b52a37 100644 --- a/server/tests/src/com/vaadin/tests/server/AbstractPropertyListenersTest.java +++ b/server/tests/src/com/vaadin/tests/server/AbstractPropertyListenersTest.java @@ -8,7 +8,8 @@ import com.vaadin.data.util.AbstractProperty; import com.vaadin.data.util.ObjectProperty; import com.vaadin.tests.server.component.AbstractListenerMethodsTestBase; -public class AbstractPropertyListenersTest extends AbstractListenerMethodsTestBase { +public class AbstractPropertyListenersTest extends + AbstractListenerMethodsTestBase { public void testValueChangeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(AbstractProperty.class, ValueChangeEvent.class, ValueChangeListener.class, diff --git a/server/tests/src/com/vaadin/tests/server/CsrfTokenMissingTest.java b/server/tests/src/com/vaadin/tests/server/CsrfTokenMissingTest.java index 18fbf70a2a..cd9beafa10 100644 --- a/server/tests/src/com/vaadin/tests/server/CsrfTokenMissingTest.java +++ b/server/tests/src/com/vaadin/tests/server/CsrfTokenMissingTest.java @@ -184,8 +184,8 @@ public class CsrfTokenMissingTest { rpcRequest.getCsrfToken()); } - private static Logger LOGGER = Logger - .getLogger(CsrfTokenMissingTest.class.getName()); + private static Logger LOGGER = Logger.getLogger(CsrfTokenMissingTest.class + .getName()); static { LOGGER.setLevel(Level.ALL); } diff --git a/server/tests/src/com/vaadin/tests/server/IndexedContainerListenersTest.java b/server/tests/src/com/vaadin/tests/server/IndexedContainerListenersTest.java index 2e1fa83540..594f5627dd 100644 --- a/server/tests/src/com/vaadin/tests/server/IndexedContainerListenersTest.java +++ b/server/tests/src/com/vaadin/tests/server/IndexedContainerListenersTest.java @@ -7,7 +7,8 @@ import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.util.IndexedContainer; import com.vaadin.tests.server.component.AbstractListenerMethodsTestBase; -public class IndexedContainerListenersTest extends AbstractListenerMethodsTestBase { +public class IndexedContainerListenersTest extends + AbstractListenerMethodsTestBase { public void testValueChangeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(IndexedContainer.class, ValueChangeEvent.class, ValueChangeListener.class); diff --git a/server/tests/src/com/vaadin/tests/server/PropertysetItemListenersTest.java b/server/tests/src/com/vaadin/tests/server/PropertysetItemListenersTest.java index 7edaa2826a..8a91ea1868 100644 --- a/server/tests/src/com/vaadin/tests/server/PropertysetItemListenersTest.java +++ b/server/tests/src/com/vaadin/tests/server/PropertysetItemListenersTest.java @@ -5,7 +5,8 @@ import com.vaadin.data.Item.PropertySetChangeListener; import com.vaadin.data.util.PropertysetItem; import com.vaadin.tests.server.component.AbstractListenerMethodsTestBase; -public class PropertysetItemListenersTest extends AbstractListenerMethodsTestBase { +public class PropertysetItemListenersTest extends + AbstractListenerMethodsTestBase { public void testPropertySetChangeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(PropertysetItem.class, PropertySetChangeEvent.class, PropertySetChangeListener.class); diff --git a/server/tests/src/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java b/server/tests/src/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java index ec3754d037..4e8f987def 100644 --- a/server/tests/src/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java +++ b/server/tests/src/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java @@ -48,8 +48,8 @@ public abstract class AbstractListenerMethodsTestBase extends TestCase { System.out.println("package " + packageName + ";"); System.out.println("import " - + AbstractListenerMethodsTestBase.class.getName() - + ";"); + + AbstractListenerMethodsTestBase.class + .getName() + ";"); System.out.println("import " + c.getName() + ";"); System.out.println("public class " + c.getSimpleName() diff --git a/server/tests/src/com/vaadin/tests/server/component/absolutelayout/AbsoluteLayoutListenersTest.java b/server/tests/src/com/vaadin/tests/server/component/absolutelayout/AbsoluteLayoutListenersTest.java index 062a89ad62..ece4b5f380 100644 --- a/server/tests/src/com/vaadin/tests/server/component/absolutelayout/AbsoluteLayoutListenersTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/absolutelayout/AbsoluteLayoutListenersTest.java @@ -5,7 +5,8 @@ import com.vaadin.event.LayoutEvents.LayoutClickListener; import com.vaadin.tests.server.component.AbstractListenerMethodsTestBase; import com.vaadin.ui.AbsoluteLayout; -public class AbsoluteLayoutListenersTest extends AbstractListenerMethodsTestBase { +public class AbsoluteLayoutListenersTest extends + AbstractListenerMethodsTestBase { public void testLayoutClickListenerAddGetRemove() throws Exception { testListenerAddGetRemove(AbsoluteLayout.class, LayoutClickEvent.class, LayoutClickListener.class); diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractselect/AbstractSelectListenersTest.java b/server/tests/src/com/vaadin/tests/server/component/abstractselect/AbstractSelectListenersTest.java index 8ec0414e03..ee806cb5f7 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstractselect/AbstractSelectListenersTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstractselect/AbstractSelectListenersTest.java @@ -7,7 +7,8 @@ import com.vaadin.data.Container.PropertySetChangeListener; import com.vaadin.tests.server.component.AbstractListenerMethodsTestBase; import com.vaadin.ui.ComboBox; -public class AbstractSelectListenersTest extends AbstractListenerMethodsTestBase { +public class AbstractSelectListenersTest extends + AbstractListenerMethodsTestBase { public void testItemSetChangeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(ComboBox.class, ItemSetChangeEvent.class, ItemSetChangeListener.class); diff --git a/server/tests/src/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldListenersTest.java b/server/tests/src/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldListenersTest.java index 1b7f4fdce1..0896b5d649 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldListenersTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldListenersTest.java @@ -9,7 +9,8 @@ import com.vaadin.event.FieldEvents.TextChangeListener; import com.vaadin.tests.server.component.AbstractListenerMethodsTestBase; import com.vaadin.ui.TextField; -public class AbstractTextFieldListenersTest extends AbstractListenerMethodsTestBase { +public class AbstractTextFieldListenersTest extends + AbstractListenerMethodsTestBase { public void testTextChangeListenerAddGetRemove() throws Exception { testListenerAddGetRemove(TextField.class, TextChangeEvent.class, TextChangeListener.class); diff --git a/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java b/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java index 7f20f29648..8c093fdf72 100644 --- a/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java @@ -88,7 +88,7 @@ public class SliderTest { @Test public void valuesGreaterThanIntMaxValueCanBeUsed() { - double minValue = (double)Integer.MAX_VALUE + 1; + double minValue = (double) Integer.MAX_VALUE + 1; Slider s = new Slider(minValue, minValue + 1, 0); diff --git a/server/tests/src/com/vaadin/tests/server/component/table/TableColumnAlignmentsTest.java b/server/tests/src/com/vaadin/tests/server/component/table/TableColumnAlignmentsTest.java index 5e33ff2f4a..69aaf2e3a9 100644 --- a/server/tests/src/com/vaadin/tests/server/component/table/TableColumnAlignmentsTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/table/TableColumnAlignmentsTest.java @@ -26,8 +26,8 @@ public class TableColumnAlignmentsTest { @Test public void explicitColumnAlignments() { int properties = 5; - Table t = TableGeneratorTest - .createTableWithDefaultContainer(properties, 10); + Table t = TableGeneratorTest.createTableWithDefaultContainer( + properties, 10); Align[] explicitAlignments = new Align[] { Align.CENTER, Align.LEFT, Align.RIGHT, Align.RIGHT, Align.LEFT }; @@ -122,8 +122,8 @@ public class TableColumnAlignmentsTest { @Test public void explicitColumnAlignmentOneByOne() { int properties = 5; - Table t = TableGeneratorTest - .createTableWithDefaultContainer(properties, 10); + Table t = TableGeneratorTest.createTableWithDefaultContainer( + properties, 10); Align[] explicitAlignments = new Align[] { Align.CENTER, Align.LEFT, Align.RIGHT, Align.RIGHT, Align.LEFT }; diff --git a/server/tests/src/com/vaadin/tests/server/component/ui/CustomUIClassLoaderTest.java b/server/tests/src/com/vaadin/tests/server/component/ui/CustomUIClassLoaderTest.java index be23a998a3..470f04c15c 100644 --- a/server/tests/src/com/vaadin/tests/server/component/ui/CustomUIClassLoaderTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/ui/CustomUIClassLoaderTest.java @@ -68,8 +68,8 @@ public class CustomUIClassLoaderTest extends TestCase { private static DeploymentConfiguration createConfigurationMock() { Properties properties = new Properties(); properties.put(VaadinSession.UI_PARAMETER, MyUI.class.getName()); - return new DefaultDeploymentConfiguration(CustomUIClassLoaderTest.class, - properties); + return new DefaultDeploymentConfiguration( + CustomUIClassLoaderTest.class, properties); } private static VaadinRequest createRequestMock(ClassLoader classloader) { diff --git a/server/tests/src/com/vaadin/tests/server/renderer/RendererTest.java b/server/tests/src/com/vaadin/tests/server/renderer/RendererTest.java index 8a01464180..eb07fae07f 100644 --- a/server/tests/src/com/vaadin/tests/server/renderer/RendererTest.java +++ b/server/tests/src/com/vaadin/tests/server/renderer/RendererTest.java @@ -67,14 +67,14 @@ public class RendererTest { @Override public TestBean convertToModel(String value, - Class<? extends TestBean> targetType, Locale locale) + Class<? extends TestBean> targetType, Locale locale) throws ConversionException { return null; } @Override public String convertToPresentation(TestBean value, - Class<? extends String> targetType, Locale locale) + Class<? extends String> targetType, Locale locale) throws ConversionException { if (value instanceof ExtendedBean) { return "ExtendedBean(" + value.i + ", " @@ -227,21 +227,27 @@ public class RendererTest { assertEquals("", dateColumn.getRenderer().encode(null).asString()); assertEquals("", buttonColumn.getRenderer().encode(null).asString()); } - @Test + @Test public void testNullEncodingWithDefault() { textColumn.setRenderer(new TextRenderer("default value")); htmlColumn.setRenderer(new HtmlRenderer("default value")); - numberColumn.setRenderer(new NumberRenderer("%s", Locale.getDefault(), "default value")); + numberColumn.setRenderer(new NumberRenderer("%s", Locale.getDefault(), + "default value")); dateColumn.setRenderer(new DateRenderer("%s", "default value")); buttonColumn.setRenderer(new ButtonRenderer("default value")); - assertEquals("default value", textColumn.getRenderer().encode(null).asString()); - assertEquals("default value", htmlColumn.getRenderer().encode(null).asString()); - assertEquals("default value", numberColumn.getRenderer().encode(null).asString()); - assertEquals("default value", dateColumn.getRenderer().encode(null).asString()); - assertEquals("default value", buttonColumn.getRenderer().encode(null).asString()); + assertEquals("default value", textColumn.getRenderer().encode(null) + .asString()); + assertEquals("default value", htmlColumn.getRenderer().encode(null) + .asString()); + assertEquals("default value", numberColumn.getRenderer().encode(null) + .asString()); + assertEquals("default value", dateColumn.getRenderer().encode(null) + .asString()); + assertEquals("default value", buttonColumn.getRenderer().encode(null) + .asString()); } private TestConverter converter() { diff --git a/uitest/src/com/vaadin/tests/components/TouchDevicesTooltip.java b/uitest/src/com/vaadin/tests/components/TouchDevicesTooltip.java index ac4b48711e..764d5a49a3 100644 --- a/uitest/src/com/vaadin/tests/components/TouchDevicesTooltip.java +++ b/uitest/src/com/vaadin/tests/components/TouchDevicesTooltip.java @@ -26,17 +26,19 @@ public class TouchDevicesTooltip extends AbstractTestUI { private void createTextField(int n) { TextField textField = new TextField("Value" + n); textField.setConverter(new StringToIntegerConverter()); - textField.addValidator(new IntegerRangeValidator(getErrorMessage(n), 0, 100)); + textField.addValidator(new IntegerRangeValidator(getErrorMessage(n), 0, + 100)); textField.setImmediate(true); textField.setValue("-5"); addComponent(textField); } private String getErrorMessage(int n) { - if(n % 2 == 0) { + if (n % 2 == 0) { return "incorrect value" + n; } else { - return "super long long long long long long long long long long long error message " + n; + return "super long long long long long long long long long long long error message " + + n; } } diff --git a/uitest/src/com/vaadin/tests/components/grid/GridSpacerDecoClipTest.java b/uitest/src/com/vaadin/tests/components/grid/GridSpacerDecoClipTest.java index c4db770ae1..c2cfe3cd7d 100644 --- a/uitest/src/com/vaadin/tests/components/grid/GridSpacerDecoClipTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/GridSpacerDecoClipTest.java @@ -32,6 +32,7 @@ import org.openqa.selenium.SearchContext; public class GridSpacerDecoClipTest extends MultiBrowserTest { private static final String SPACER_CSS_CLASS_DECO = "v-grid-spacer-deco"; + @Override protected Class<?> getUIClass() { return ShowingExtraDataForRows.class; @@ -52,7 +53,8 @@ public class GridSpacerDecoClipTest extends MultiBrowserTest { nearToBottomRow.doubleClick(); deco = getSpacerDeco(0); System.out.println("Lower deco.clip = " + deco.getCssValue("clip")); - Assert.assertNotEquals("Spacer deco clipping is not updated after opening another spacer", + Assert.assertNotEquals( + "Spacer deco clipping is not updated after opening another spacer", "auto", deco.getCssValue("clip")); } @@ -63,28 +65,31 @@ public class GridSpacerDecoClipTest extends MultiBrowserTest { GridElement gridElement = $(GridElement.class).first(); gridElement.scrollToRow(999); GridElement.GridRowElement lastRow = gridElement.getRow(999); - lastRow.doubleClick(); //Open lowest Row Details + lastRow.doubleClick(); // Open lowest Row Details TestBenchElement deco = getSpacerDeco(0); System.out.println("deco.rect = " + deco.getCssValue("clip")); GridElement.GridRowElement nearToBottomRow = gridElement.getRow(993); - nearToBottomRow.doubleClick(); //Open upper Row Details, lower Row Details goes out of visible range + nearToBottomRow.doubleClick(); // Open upper Row Details, lower Row + // Details goes out of visible range Thread.sleep(500); - nearToBottomRow.doubleClick(); //Close upper Row Details, lower Row Details goes back to visible range + nearToBottomRow.doubleClick(); // Close upper Row Details, lower Row + // Details goes back to visible range deco = getSpacerDeco(0); String clip = deco.getCssValue("clip"); System.out.println("deco.rect = " + clip); - Assert.assertTrue("Part of lower Row Details is visible, its deco clip height should be positive, but it is negative", + Assert.assertTrue( + "Part of lower Row Details is visible, its deco clip height should be positive, but it is negative", clip.indexOf('-') < 0); } private TestBenchElement getSpacerDeco(int index) { SearchContext context = this.getContext(); - return (TestBenchElement) context.findElements(By.className(SPACER_CSS_CLASS_DECO)).get(index); + return (TestBenchElement) context.findElements( + By.className(SPACER_CSS_CLASS_DECO)).get(index); } } - diff --git a/uitest/src/com/vaadin/tests/components/grid/NullRenderers.java b/uitest/src/com/vaadin/tests/components/grid/NullRenderers.java index 5ef5c12a7b..db86847690 100644 --- a/uitest/src/com/vaadin/tests/components/grid/NullRenderers.java +++ b/uitest/src/com/vaadin/tests/components/grid/NullRenderers.java @@ -62,13 +62,17 @@ public class NullRenderers extends AbstractTestUI { gridDefaults.setSelectionMode(SelectionMode.NONE); gridDefaults.setWidth("100%"); - gridDefaults.getColumn(TextRenderer.class).setRenderer(new TextRenderer("-- No Text --")); - gridDefaults.getColumn(HtmlRenderer.class).setRenderer(new HtmlRenderer("-- No Jokes --")); - gridDefaults.getColumn(DateRenderer.class).setRenderer(new DateRenderer("%s", Locale.getDefault(), "-- Never --")); - gridDefaults.getColumn(NumberRenderer.class).setRenderer(new NumberRenderer("%s", Locale.getDefault(),"-- Nothing --")); + gridDefaults.getColumn(TextRenderer.class).setRenderer( + new TextRenderer("-- No Text --")); + gridDefaults.getColumn(HtmlRenderer.class).setRenderer( + new HtmlRenderer("-- No Jokes --")); + gridDefaults.getColumn(DateRenderer.class).setRenderer( + new DateRenderer("%s", Locale.getDefault(), "-- Never --")); + gridDefaults.getColumn(NumberRenderer.class).setRenderer( + new NumberRenderer("%s", Locale.getDefault(), "-- Nothing --")); gridDefaults.getColumn(ProgressBarRenderer.class).setRenderer( - new ProgressBarRenderer()); + new ProgressBarRenderer()); gridDefaults.getColumn(ButtonRenderer.class).setRenderer( new ButtonRenderer(new RendererClickListener() { @@ -93,10 +97,14 @@ public class NullRenderers extends AbstractTestUI { gridNoDefaults.setSelectionMode(SelectionMode.NONE); gridNoDefaults.setWidth("100%"); - gridNoDefaults.getColumn(TextRenderer.class).setRenderer(new TextRenderer()); - gridNoDefaults.getColumn(HtmlRenderer.class).setRenderer(new HtmlRenderer()); - gridNoDefaults.getColumn(DateRenderer.class).setRenderer(new DateRenderer()); - gridNoDefaults.getColumn(NumberRenderer.class).setRenderer(new NumberRenderer()); + gridNoDefaults.getColumn(TextRenderer.class).setRenderer( + new TextRenderer()); + gridNoDefaults.getColumn(HtmlRenderer.class).setRenderer( + new HtmlRenderer()); + gridNoDefaults.getColumn(DateRenderer.class).setRenderer( + new DateRenderer()); + gridNoDefaults.getColumn(NumberRenderer.class).setRenderer( + new NumberRenderer()); gridNoDefaults.getColumn(ProgressBarRenderer.class).setRenderer( new ProgressBarRenderer()); diff --git a/uitest/src/com/vaadin/tests/components/grid/NullRenderersTest.java b/uitest/src/com/vaadin/tests/components/grid/NullRenderersTest.java index 4cc40e5769..f100c03d4f 100644 --- a/uitest/src/com/vaadin/tests/components/grid/NullRenderersTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/NullRenderersTest.java @@ -32,11 +32,11 @@ public class NullRenderersTest extends MultiBrowserTest { openTestURL(); GridElement grid = findGridWithDefaults(); - assertEquals("-- No Text --", grid.getCell(0, 0).getText()); + assertEquals("-- No Text --", grid.getCell(0, 0).getText()); assertEquals("-- No Jokes --", grid.getCell(0, 1).getText()); - assertEquals("-- Never --", grid.getCell(0, 2).getText()); - assertEquals("-- Nothing --", grid.getCell(0, 3).getText()); - assertEquals("-- No Control --", grid.getCell(0, 5).getText()); + assertEquals("-- Never --", grid.getCell(0, 2).getText()); + assertEquals("-- Nothing --", grid.getCell(0, 3).getText()); + assertEquals("-- No Control --", grid.getCell(0, 5).getText()); } @Test diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridClientCompositeKeyEventsTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridClientCompositeKeyEventsTest.java index a09a31830f..fada87b15d 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridClientCompositeKeyEventsTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridClientCompositeKeyEventsTest.java @@ -2,8 +2,7 @@ package com.vaadin.tests.components.grid.basicfeatures.client; import org.junit.Before; -public class GridClientCompositeKeyEventsTest extends - GridClientKeyEventsTest { +public class GridClientCompositeKeyEventsTest extends GridClientKeyEventsTest { @Before public void setUp() { diff --git a/uitest/src/com/vaadin/tests/components/menubar/MenuItemStyleRemovedTest.java b/uitest/src/com/vaadin/tests/components/menubar/MenuItemStyleRemovedTest.java index 2ba63587fe..e25aa664cd 100644 --- a/uitest/src/com/vaadin/tests/components/menubar/MenuItemStyleRemovedTest.java +++ b/uitest/src/com/vaadin/tests/components/menubar/MenuItemStyleRemovedTest.java @@ -19,7 +19,8 @@ public class MenuItemStyleRemovedTest extends MultiBrowserTest { $(ButtonElement.class).caption("Add styles").first().click(); MenuBarElement menu = $(MenuBarElement.class).first(); - List<WebElement> elements = menu.findElements(By.className("custom-menu-item")); + List<WebElement> elements = menu.findElements(By + .className("custom-menu-item")); Assert.assertEquals(2, elements.size()); menu.clickItem("first"); diff --git a/uitest/src/com/vaadin/tests/components/notification/ChromeBottomNotification.java b/uitest/src/com/vaadin/tests/components/notification/ChromeBottomNotification.java index 0fdc8df360..df1e0048be 100644 --- a/uitest/src/com/vaadin/tests/components/notification/ChromeBottomNotification.java +++ b/uitest/src/com/vaadin/tests/components/notification/ChromeBottomNotification.java @@ -12,8 +12,7 @@ public class ChromeBottomNotification extends AbstractTestUI { addButton("Show notification", new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { - Notification notification = new Notification( - "Hello world", + Notification notification = new Notification("Hello world", Notification.Type.ERROR_MESSAGE); notification.setPosition(Position.BOTTOM_CENTER); notification.show(getPage()); diff --git a/uitest/src/com/vaadin/tests/components/table/TableSetUndefinedSize.java b/uitest/src/com/vaadin/tests/components/table/TableSetUndefinedSize.java index 3b5ee875e9..e355c0d0ea 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableSetUndefinedSize.java +++ b/uitest/src/com/vaadin/tests/components/table/TableSetUndefinedSize.java @@ -36,24 +36,27 @@ public class TableSetUndefinedSize extends AbstractTestUI { private HorizontalLayout createWidthButtons(final Table table) { HorizontalLayout layout = new HorizontalLayout(); - layout.addComponent(new Button("width 500px", new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent event) { - table.setWidth("500px"); - } - })); - layout.addComponent(new Button("width 100%", new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent event) { - table.setWidth("100%"); - } - })); - layout.addComponent(new Button("undefined width", new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent event) { - table.setWidthUndefined(); - } - })); + layout.addComponent(new Button("width 500px", + new Button.ClickListener() { + @Override + public void buttonClick(Button.ClickEvent event) { + table.setWidth("500px"); + } + })); + layout.addComponent(new Button("width 100%", + new Button.ClickListener() { + @Override + public void buttonClick(Button.ClickEvent event) { + table.setWidth("100%"); + } + })); + layout.addComponent(new Button("undefined width", + new Button.ClickListener() { + @Override + public void buttonClick(Button.ClickEvent event) { + table.setWidthUndefined(); + } + })); return layout; } @@ -61,30 +64,34 @@ public class TableSetUndefinedSize extends AbstractTestUI { private HorizontalLayout createHeigthButtons(final Table table) { HorizontalLayout layout = new HorizontalLayout(); - layout.addComponent(new Button("height 200px", new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent event) { - table.setHeight("200px"); - } - })); - layout.addComponent(new Button("height 300px", new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent event) { - table.setHeight("300px"); - } - })); - layout.addComponent(new Button("height 100%", new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent event) { - table.setHeight("100%"); - } - })); - layout.addComponent(new Button("undefined height", new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent event) { - table.setHeightUndefined(); - } - })); + layout.addComponent(new Button("height 200px", + new Button.ClickListener() { + @Override + public void buttonClick(Button.ClickEvent event) { + table.setHeight("200px"); + } + })); + layout.addComponent(new Button("height 300px", + new Button.ClickListener() { + @Override + public void buttonClick(Button.ClickEvent event) { + table.setHeight("300px"); + } + })); + layout.addComponent(new Button("height 100%", + new Button.ClickListener() { + @Override + public void buttonClick(Button.ClickEvent event) { + table.setHeight("100%"); + } + })); + layout.addComponent(new Button("undefined height", + new Button.ClickListener() { + @Override + public void buttonClick(Button.ClickEvent event) { + table.setHeightUndefined(); + } + })); return layout; } @@ -96,7 +103,7 @@ public class TableSetUndefinedSize extends AbstractTestUI { table.addContainerProperty("column 2", String.class, "column 2 value"); table.addContainerProperty("column 3", String.class, "column 3 value"); - for(int i=0; i<5; i++) { + for (int i = 0; i < 5; i++) { table.addItem(); } diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleWhenTabsheetNotClipped.java b/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleWhenTabsheetNotClipped.java index 6d66f1d295..969e76691e 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleWhenTabsheetNotClipped.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleWhenTabsheetNotClipped.java @@ -93,8 +93,8 @@ public class FirstTabNotVisibleWhenTabsheetNotClipped extends AbstractTestUI { addComponent(layout); } - private Button.ClickListener createTabListener(final HashMap<String, TabSheet.Tab> map, - final TabSheet tabsheet) { + private Button.ClickListener createTabListener( + final HashMap<String, TabSheet.Tab> map, final TabSheet tabsheet) { Button.ClickListener clickListener = new Button.ClickListener() { diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleWhenTabsheetNotClippedTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleWhenTabsheetNotClippedTest.java index 74a725f5ed..4d72f3e6fb 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleWhenTabsheetNotClippedTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleWhenTabsheetNotClippedTest.java @@ -8,29 +8,32 @@ import org.junit.Assert; import org.junit.Test; import org.openqa.selenium.WebElement; -public class FirstTabNotVisibleWhenTabsheetNotClippedTest extends MultiBrowserTest { +public class FirstTabNotVisibleWhenTabsheetNotClippedTest extends + MultiBrowserTest { @Test public void testNotClippedTabIsVisible() throws InterruptedException { openTestURL(); - ButtonElement toggleNotClipped = $(ButtonElement.class) - .caption("Toggle first not clipped tab").first(); + ButtonElement toggleNotClipped = $(ButtonElement.class).caption( + "Toggle first not clipped tab").first(); toggleNotClipped.click(); TabSheetElement notClippedTabSheet = $(TabSheetElement.class).get(0); - WebElement firstTab = notClippedTabSheet.findElement( - By.className("v-tabsheet-tabitemcell-first")); - String caption = firstTab.findElement(By.className("v-captiontext")).getText(); - Assert.assertEquals("Tab with -first style should be Tab 1", "Tab 1", caption); + WebElement firstTab = notClippedTabSheet.findElement(By + .className("v-tabsheet-tabitemcell-first")); + String caption = firstTab.findElement(By.className("v-captiontext")) + .getText(); + Assert.assertEquals("Tab with -first style should be Tab 1", "Tab 1", + caption); toggleNotClipped.click(); - firstTab = notClippedTabSheet.findElement( - By.className("v-tabsheet-tabitemcell-first")); + firstTab = notClippedTabSheet.findElement(By + .className("v-tabsheet-tabitemcell-first")); caption = firstTab.findElement(By.className("v-captiontext")).getText(); - Assert.assertEquals("Tab with -first style should be Tab 0", "Tab 0", caption); + Assert.assertEquals("Tab with -first style should be Tab 0", "Tab 0", + caption); } - @Test public void testShowPreviouslyHiddenTab() { openTestURL(); @@ -38,18 +41,20 @@ public class FirstTabNotVisibleWhenTabsheetNotClippedTest extends MultiBrowserTe $(ButtonElement.class).caption("show tab D").get(0).click(); $(ButtonElement.class).caption("show tab C").get(0).click(); - WebElement firstTab = $(TabSheetElement.class).get(2) - .findElement(By.className("v-tabsheet-tabitemcell-first")); - String firstCaption = firstTab.findElement(By.className("v-captiontext")).getText(); + WebElement firstTab = $(TabSheetElement.class).get(2).findElement( + By.className("v-tabsheet-tabitemcell-first")); + String firstCaption = firstTab.findElement( + By.className("v-captiontext")).getText(); org.junit.Assert.assertEquals("tab C", firstCaption); $(ButtonElement.class).caption("show tab D").get(1).click(); $(ButtonElement.class).caption("show tab C").get(1).click(); - WebElement secondTab = $(TabSheetElement.class).get(3) - .findElement(By.className("v-tabsheet-tabitemcell-first")); - String secondCaption = secondTab.findElement(By.className("v-captiontext")).getText(); + WebElement secondTab = $(TabSheetElement.class).get(3).findElement( + By.className("v-tabsheet-tabitemcell-first")); + String secondCaption = secondTab.findElement( + By.className("v-captiontext")).getText(); org.junit.Assert.assertEquals("tab C", secondCaption); } diff --git a/uitest/src/com/vaadin/tests/components/window/MaximizedWindowOrder.java b/uitest/src/com/vaadin/tests/components/window/MaximizedWindowOrder.java index 8fe6c0ce5a..7da1517e8f 100644 --- a/uitest/src/com/vaadin/tests/components/window/MaximizedWindowOrder.java +++ b/uitest/src/com/vaadin/tests/components/window/MaximizedWindowOrder.java @@ -42,7 +42,8 @@ public class MaximizedWindowOrder extends AbstractTestUI { layout.addComponent(button); window.setContent(layout); - window.setWindowMode(maximized ? WindowMode.MAXIMIZED : WindowMode.NORMAL); + window.setWindowMode(maximized ? WindowMode.MAXIMIZED + : WindowMode.NORMAL); addWindow(window); } diff --git a/uitest/src/com/vaadin/tests/extensions/IframeIsOpenedInNonIOS.java b/uitest/src/com/vaadin/tests/extensions/IframeIsOpenedInNonIOS.java index a62b6bba88..d1b2e12e42 100644 --- a/uitest/src/com/vaadin/tests/extensions/IframeIsOpenedInNonIOS.java +++ b/uitest/src/com/vaadin/tests/extensions/IframeIsOpenedInNonIOS.java @@ -18,12 +18,13 @@ public class IframeIsOpenedInNonIOS extends AbstractTestUI { protected void setup(VaadinRequest request) { final Label errorLabel = new Label("No error"); Button button = new Button("Download"); - FileDownloader downloader = new FileDownloader(new StreamResource(new StreamResource.StreamSource() { - @Override - public InputStream getStream () { - return createSomeFile(); - } - }, FILE_NAME)); + FileDownloader downloader = new FileDownloader(new StreamResource( + new StreamResource.StreamSource() { + @Override + public InputStream getStream() { + return createSomeFile(); + } + }, FILE_NAME)); downloader.extend(button); addComponents(errorLabel, button); diff --git a/uitest/src/com/vaadin/tests/extensions/IframeIsOpenedInNonIOSTest.java b/uitest/src/com/vaadin/tests/extensions/IframeIsOpenedInNonIOSTest.java index c544b495ab..e5614b60a4 100644 --- a/uitest/src/com/vaadin/tests/extensions/IframeIsOpenedInNonIOSTest.java +++ b/uitest/src/com/vaadin/tests/extensions/IframeIsOpenedInNonIOSTest.java @@ -21,19 +21,23 @@ public class IframeIsOpenedInNonIOSTest extends MultiBrowserTest { List<WebElement> iframes = driver.findElements(By.tagName("iframe")); boolean containsFileIframe = false; for (WebElement iframe : iframes) { - containsFileIframe = containsFileIframe | - iframe.getAttribute("src").contains(IframeIsOpenedInNonIOS.FILE_NAME); + containsFileIframe = containsFileIframe + | iframe.getAttribute("src").contains( + IframeIsOpenedInNonIOS.FILE_NAME); } - Assert.assertTrue("page doesn't contain iframe with the file", containsFileIframe); + Assert.assertTrue("page doesn't contain iframe with the file", + containsFileIframe); } @Override public List<DesiredCapabilities> getBrowsersToTest() { - //once running ios is possible, this test should be fixed to exclude it from the browsers list + // once running ios is possible, this test should be fixed to exclude it + // from the browsers list - //The test is failing in all IEs for some reason even though the iframe is in place. - //Probably related to some IE driver issue + // The test is failing in all IEs for some reason even though the iframe + // is in place. + // Probably related to some IE driver issue return getBrowsersExcludingIE(); } } diff --git a/uitest/src/com/vaadin/tests/fieldgroup/Country.java b/uitest/src/com/vaadin/tests/fieldgroup/Country.java index 4956f0a085..2c2ffd7160 100644 --- a/uitest/src/com/vaadin/tests/fieldgroup/Country.java +++ b/uitest/src/com/vaadin/tests/fieldgroup/Country.java @@ -15,7 +15,6 @@ */ package com.vaadin.tests.fieldgroup; - public enum Country { FINLAND, SWEDEN, NORWAY, DENMARK, ICELAND, USA, RUSSIA, ESTONIA; diff --git a/uitest/src/com/vaadin/tests/serialization/EncodeResultDisplay.java b/uitest/src/com/vaadin/tests/serialization/EncodeResultDisplay.java index d67b01c71c..01d1b14243 100644 --- a/uitest/src/com/vaadin/tests/serialization/EncodeResultDisplay.java +++ b/uitest/src/com/vaadin/tests/serialization/EncodeResultDisplay.java @@ -27,7 +27,8 @@ import com.vaadin.tests.widgetset.client.EncoderResultDisplayConnector.ReportRpc public class EncodeResultDisplay extends AbstractTestUIWithLog { public static class EncoderResultDisplayExtension extends AbstractExtension { - public EncoderResultDisplayExtension(EncoderResultDisplayConnector.ReportRpc rpc) { + public EncoderResultDisplayExtension( + EncoderResultDisplayConnector.ReportRpc rpc) { registerRpc(rpc); } diff --git a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java index b166590c43..678b38c4f1 100644 --- a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java +++ b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java @@ -97,8 +97,10 @@ public abstract class MultiBrowserTest extends PrivateTB3Configuration { desiredCapabilities.setCapability("project", "Vaadin Framework"); desiredCapabilities.setCapability("build", String.format("%s / %s", getDeploymentHostname(), Calendar.getInstance().getTime())); - desiredCapabilities.setCapability("name", String.format("%s.%s", - getClass().getCanonicalName(), testName.getMethodName())); + desiredCapabilities.setCapability( + "name", + String.format("%s.%s", getClass().getCanonicalName(), + testName.getMethodName())); super.setDesiredCapabilities(desiredCapabilities); } diff --git a/uitest/src/com/vaadin/tests/themes/valo/NotificationStyleTest.java b/uitest/src/com/vaadin/tests/themes/valo/NotificationStyleTest.java index b2db29443a..7adae9ce65 100644 --- a/uitest/src/com/vaadin/tests/themes/valo/NotificationStyleTest.java +++ b/uitest/src/com/vaadin/tests/themes/valo/NotificationStyleTest.java @@ -66,11 +66,10 @@ public class NotificationStyleTest extends MultiBrowserTest { WebElement description = notification.findElement(By .className("v-Notification-description")); String display = description.getCssValue("display"); - String displayP2 = notification.findElement( - By.className("tested-p")).getCssValue("display"); + String displayP2 = notification.findElement(By.className("tested-p")) + .getCssValue("display"); Assert.assertNotEquals("Styles for notification defined 'p' tag " - + "and custom HTML tag are the same", display, - displayP2); + + "and custom HTML tag are the same", display, displayP2); } private ExpectedCondition<Boolean> notificationPresentCondition() { diff --git a/uitest/src/com/vaadin/tests/widgetset/client/grid/GridBasicClientFeaturesWidget.java b/uitest/src/com/vaadin/tests/widgetset/client/grid/GridBasicClientFeaturesWidget.java index 12c2443c01..aa1d7d60a4 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/grid/GridBasicClientFeaturesWidget.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/grid/GridBasicClientFeaturesWidget.java @@ -534,8 +534,7 @@ public class GridBasicClientFeaturesWidget extends public void onContextMenu(ContextMenuEvent event) { event.preventDefault(); final String location; - EventCellReference<?> cellRef = grid - .getEventCell(); + EventCellReference<?> cellRef = grid.getEventCell(); if (cellRef.isHeader()) { location = "header"; } else if (cellRef.isBody()) { |