diff options
143 files changed, 1798 insertions, 826 deletions
diff --git a/WebContent/VAADIN/themes/base/menubar/menubar.scss b/WebContent/VAADIN/themes/base/menubar/menubar.scss index 5ffac6de09..ad701f1b42 100644 --- a/WebContent/VAADIN/themes/base/menubar/menubar.scss +++ b/WebContent/VAADIN/themes/base/menubar/menubar.scss @@ -56,7 +56,16 @@ .#{$primaryStyleName} span.#{$primaryStyleName}-menuitem-disabled:active { opacity: .5; filter: alpha(opacity=50); + + .v-ie8 & { + filter: none; + color: #999; + img { + filter: alpha(opacity=50); + } + } } + .#{$primaryStyleName}-more-menuitem { /* Arial has the most coverage for geometric entity characters */ font-family: arial, helvetica, sans-serif; diff --git a/WebContent/VAADIN/themes/valo/util/_anim.scss b/WebContent/VAADIN/themes/valo/util/_anim.scss index 0cb738d832..12c557d7de 100644 --- a/WebContent/VAADIN/themes/valo/util/_anim.scss +++ b/WebContent/VAADIN/themes/valo/util/_anim.scss @@ -75,7 +75,7 @@ $valo-anim-keyframes-included: false !default; @include transform(translatey(30%)); } } - + $valo-anim-keyframes-included: true; } @@ -88,7 +88,7 @@ $valo-anim-keyframes-included: false !default; * @param {time} $delay (null) - the delay of the fade */ @mixin valo-animate-in-fade ($duration: 180ms, $delay: null){ - @include animation(valo-animate-in-fade $duration $delay); + @include animation(valo-animate-in-fade $duration $delay backwards); } /** @@ -100,7 +100,7 @@ $valo-anim-keyframes-included: false !default; * @param {time} $delay (null) - the delay of the fade */ @mixin valo-animate-out-fade ($duration: 180ms, $delay: null){ - @include animation(valo-animate-out-fade $duration $delay); + @include animation(valo-animate-out-fade $duration $delay backwards); } /** @@ -112,7 +112,7 @@ $valo-anim-keyframes-included: false !default; * @param {time} $delay (null) - the delay of the slide */ @mixin valo-animate-in-slide-down ($duration: 400ms, $delay: null){ - @include animation(valo-animate-in-slide-down $duration $delay); + @include animation(valo-animate-in-slide-down $duration $delay backwards); } /** @@ -124,7 +124,7 @@ $valo-anim-keyframes-included: false !default; * @param {time} $delay (null) - the delay of the slide */ @mixin valo-animate-in-slide-up ($duration: 400ms, $delay: null){ - @include animation(valo-animate-in-slide-up $duration $delay); + @include animation(valo-animate-in-slide-up $duration $delay backwards); } /** @@ -136,7 +136,7 @@ $valo-anim-keyframes-included: false !default; * @param {time} $delay (null) - the delay of the slide */ @mixin valo-animate-in-slide-left ($duration: 400ms, $delay: null){ - @include animation(valo-animate-in-slide-left $duration $delay); + @include animation(valo-animate-in-slide-left $duration $delay backwards); } /** @@ -148,5 +148,5 @@ $valo-anim-keyframes-included: false !default; * @param {time} $delay (null) - the delay of the slide */ @mixin valo-animate-in-slide-right ($duration: 400ms, $delay: null){ - @include animation(valo-animate-in-slide-right $duration $delay); + @include animation(valo-animate-in-slide-right $duration $delay backwards); } diff --git a/WebContent/release-notes.html b/WebContent/release-notes.html index f573eac1d4..ea65948baa 100644 --- a/WebContent/release-notes.html +++ b/WebContent/release-notes.html @@ -112,6 +112,7 @@ <li>The push path has been changed from /PUSH/ to /PUSH to be compatible with JSR 356.</li> <li>Widgetset files and other pre-compressed resources are sent as gzip to compatible browsers. This may interfere with custom response compression solutions that do not respect the Content-Encoding response header.</li> + <li>Unused methods related to the "out of sync" message have been removed from SystemMessages class.</li> </ul> <h3 id="knownissues">Known Issues and Limitations</h3> <ul> @@ -468,7 +469,7 @@ <li>Oracle WebLogic Server 10.3-12</li> <li>IBM WebSphere Application Server 7-8</li> <li>JBoss Application Server 4-7</li> - <li>Wildfly 8</li> + <li>Wildfly 8-9</li> <li>Jetty 5-9</li> <li>Glassfish 2-4</li> </ul> diff --git a/client/src/com/vaadin/client/ApplicationConnection.java b/client/src/com/vaadin/client/ApplicationConnection.java index 510994745e..23ea44237c 100644 --- a/client/src/com/vaadin/client/ApplicationConnection.java +++ b/client/src/com/vaadin/client/ApplicationConnection.java @@ -1768,7 +1768,8 @@ public class ApplicationConnection implements HasHandlers { if (meta.containsKey("appError")) { ValueMap error = meta.getValueMap("appError"); - showError(null, error.getString("caption"), + showError(error.getString("details"), + error.getString("caption"), error.getString("message"), error.getString("url")); 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/ComputedStyle.java b/client/src/com/vaadin/client/ComputedStyle.java index e806e9e197..7a04296b4b 100644 --- a/client/src/com/vaadin/client/ComputedStyle.java +++ b/client/src/com/vaadin/client/ComputedStyle.java @@ -129,6 +129,15 @@ public class ComputedStyle { }-*/; + /** + * Retrieves the given computed property as an integer + * + * Returns 0 if the property cannot be converted to an integer + * + * @param name + * the property to retrieve + * @return the integer value of the property or 0 + */ public final int getIntProperty(String name) { Profiler.enter("ComputedStyle.getIntProperty"); String value = getProperty(name); @@ -138,6 +147,23 @@ public class ComputedStyle { } /** + * Retrieves the given computed property as a double + * + * Returns NaN if the property cannot be converted to a double + * + * @param name + * the property to retrieve + * @return the double value of the property + */ + public final int getDoubleProperty(String name) { + Profiler.enter("ComputedStyle.getDoubleProperty"); + String value = getProperty(name); + int result = parseDoubleNative(value); + Profiler.leave("ComputedStyle.getDoubleProperty"); + return result; + } + + /** * Get current margin values from the DOM. The array order is the default * CSS order: top, right, bottom, left. */ @@ -177,6 +203,26 @@ public class ComputedStyle { } /** + * Returns the current width from the DOM. + * + * @since + * @return the computed width + */ + public double getWidth() { + return getDoubleProperty("width"); + } + + /** + * Returns the current height from the DOM. + * + * @since + * @return the computed height + */ + public double getHeight() { + return getDoubleProperty("height"); + } + + /** * Takes a String value e.g. "12px" and parses that to Integer 12. * * @param String @@ -221,4 +267,17 @@ public class ComputedStyle { return number; }-*/; + /** + * Takes a String value e.g. "12.3px" and parses that to a double, 12.3. + * + * @param String + * a value starting with a number + * @return the value from the string before any non-numeric characters or + * NaN if the value cannot be parsed as a number + */ + private static native int parseDoubleNative(final String value) + /*-{ + return parseFloat(value); + }-*/; + } 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/WidgetUtil.java b/client/src/com/vaadin/client/WidgetUtil.java index fca6fbccbc..b9d22193de 100644 --- a/client/src/com/vaadin/client/WidgetUtil.java +++ b/client/src/com/vaadin/client/WidgetUtil.java @@ -389,6 +389,7 @@ public class WidgetUtil { } private static int detectedScrollbarSize = -1; + private static int detectedSubPixelRoundingFactor = -1; public static int getNativeScrollbarSize() { if (detectedScrollbarSize < 0) { @@ -553,10 +554,11 @@ public class WidgetUtil { double reqWidth = getRequiredWidthBoundingClientRectDouble(element); if (BrowserInfo.get().isIE() && !BrowserInfo.get().isIE8()) { double csWidth = getRequiredWidthComputedStyleDouble(element); - if (csWidth > reqWidth && csWidth < (reqWidth + 1)) { + if (csWidth > reqWidth && csWidth <= (reqWidth + 1)) { // IE9 rounds reqHeight to integers BUT sometimes reports wrong // csHeight it seems, so we only use csHeight if it is within a // rounding error + return csWidth; } } @@ -602,10 +604,14 @@ public class WidgetUtil { double reqHeight = getRequiredHeightBoundingClientRectDouble(element); if (BrowserInfo.get().isIE() && !BrowserInfo.get().isIE8()) { double csHeight = getRequiredHeightComputedStyleDouble(element); - if (csHeight > reqHeight && csHeight < (reqHeight + 1)) { + if (csHeight > reqHeight && csHeight <= (reqHeight + 1)) { // IE9 rounds reqHeight to integers BUT sometimes reports wrong // csHeight it seems, so we only use csHeight if it is within a // rounding error + + // Although sometimes it also happens that IE9 returns an + // incorrectly rounded down requiredHeight and a computed height + // which is exactly one larger, hence the "<="... return csHeight; } } @@ -1625,4 +1631,134 @@ public class WidgetUtil { return heightWithBorder - heightWithoutBorder; } }-*/; + + /** + * Rounds the given size up to a value which the browser will accept. + * + * Safari/WebKit uses 1/64th of a pixel to enable using integer math + * (http://trac.webkit.org/wiki/LayoutUnit). + * + * Firefox uses 1/60th of a pixel because it is divisible by three + * (https://bugzilla.mozilla.org/show_bug.cgi?id=1070940) + * + * @since + * @param size + * the value to round + * @return the rounded value + */ + public static double roundSizeUp(double size) { + return roundSize(size, true); + } + + /** + * Rounds the given size down to a value which the browser will accept. + * + * Safari/WebKit uses 1/64th of a pixel to enable using integer math + * (http://trac.webkit.org/wiki/LayoutUnit). + * + * Firefox uses 1/60th of a pixel because it is divisible by three + * (https://bugzilla.mozilla.org/show_bug.cgi?id=1070940) + * + * IE9+ uses 1/100th of a pixel + * + * @since + * @param size + * the value to round + * @return the rounded value + */ + public static double roundSizeDown(double size) { + return roundSize(size, false); + } + + private static double roundSize(double size, boolean roundUp) { + if (BrowserInfo.get().isIE8()) { + if (roundUp) { + return Math.ceil(size); + } else { + return (int) size; + } + } + + double factor = getSubPixelRoundingFactor(); + if (factor < 0 || size < 0) { + return size; + } + + if (roundUp) { + return roundSizeUp(size, factor); + } else { + return roundSizeDown(size, factor); + } + } + + /** + * Returns the factor used by browsers to round subpixel values + * + * @since + * @return the factor N used by the browser when storing subpixels as X+Y/N + */ + private static double getSubPixelRoundingFactor() { + // Detects how the browser does subpixel rounding + // Currently Firefox uses 1/60th pixels + // and Safari uses 1/64th pixels + // IE 1/100th pixels + if (detectedSubPixelRoundingFactor != -1) { + return detectedSubPixelRoundingFactor; + } + + double probeSize = 0.999999; + DivElement div = Document.get().createDivElement(); + Document.get().getBody().appendChild(div); + div.getStyle().setHeight(probeSize, Unit.PX); + ComputedStyle computedStyle = new ComputedStyle(div); + double computedHeight = computedStyle.getHeight(); + + if (computedHeight < probeSize) { + // Rounded down by browser, all browsers but Firefox do this + // today + detectedSubPixelRoundingFactor = (int) Math + .round(1.0 / (1.0 - computedHeight)); + } else { + // Rounded up / to nearest by browser + probeSize = 1; + + while (computedStyle.getHeight() != 0.0) { + computedHeight = computedStyle.getHeight(); + probeSize /= 2.0; + div.getStyle().setHeight(probeSize, Unit.PX); + } + + detectedSubPixelRoundingFactor = (int) Math + .round(1.0 / computedHeight); + } + + div.removeFromParent(); + return detectedSubPixelRoundingFactor; + } + + private static double roundSizeUp(double size, double divisor) { + // In: 12.51, 60.0 + + // 12 + double integerPart = (int) size; + + // (12.51 - 12) * 60 = 30.6 + double nrFractions = (size - integerPart) * divisor; + + // 12 + ceil(30.6) / 60 = 12 + 31/60 = 12.51666 + return integerPart + (Math.ceil(nrFractions)) / divisor; + } + + private static double roundSizeDown(double size, double divisor) { + // In: 12.51, 60.0 + + // 12 + double integerPart = (int) size; + + // (12.51 - 12) * 60 = 30.6 + double nrFractions = (size - integerPart) * divisor; + + // 12 + int(30.6) / 60 = 12 + 30/60 = 12.5 + return integerPart + ((int) nrFractions) / divisor; + } } 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/VFilterSelect.java b/client/src/com/vaadin/client/ui/VFilterSelect.java index d99779b7ec..7951759fa2 100644 --- a/client/src/com/vaadin/client/ui/VFilterSelect.java +++ b/client/src/com/vaadin/client/ui/VFilterSelect.java @@ -79,6 +79,7 @@ import com.vaadin.shared.AbstractComponentState; import com.vaadin.shared.EventId; import com.vaadin.shared.ui.ComponentStateUtil; import com.vaadin.shared.ui.combobox.FilteringMode; +import com.vaadin.shared.util.SharedUtil; /** * Client side implementation of the Select component. @@ -98,7 +99,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, private final String key; private final String caption; - private String iconUri; + private String untranslatedIconUri; /** * Constructor @@ -110,8 +111,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, key = uidl.getStringAttribute("key"); caption = uidl.getStringAttribute("caption"); if (uidl.hasAttribute("icon")) { - iconUri = client.translateVaadinUri(uidl - .getStringAttribute("icon")); + untranslatedIconUri = uidl.getStringAttribute("icon"); } } @@ -124,7 +124,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, @Override public String getDisplayString() { final StringBuffer sb = new StringBuffer(); - final Icon icon = client.getIcon(iconUri); + final Icon icon = client.getIcon(client + .translateVaadinUri(untranslatedIconUri)); if (icon != null) { sb.append(icon.getElement().getString()); } @@ -164,7 +165,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * @return */ public String getIconUri() { - return iconUri; + return client.translateVaadinUri(untranslatedIconUri); } /** @@ -190,8 +191,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, || (caption != null && !caption.equals(other.caption))) { return false; } - if ((iconUri == null && other.iconUri != null) - || (iconUri != null && !iconUri.equals(other.iconUri))) { + if (!SharedUtil.equals(untranslatedIconUri, + other.untranslatedIconUri)) { return false; } return true; 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/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java index d3958a2f00..6bb3199b08 100644 --- a/client/src/com/vaadin/client/ui/VScrollTable.java +++ b/client/src/com/vaadin/client/ui/VScrollTable.java @@ -303,7 +303,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, */ private double cache_rate = CACHE_RATE_DEFAULT; /** - * fraction of pageLenght which can be scrolled without making new request + * fraction of pageLength which can be scrolled without making new request */ private double cache_react_rate = 0.75 * cache_rate; @@ -1443,7 +1443,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (uidl.hasAttribute("pagelength")) { pageLength = uidl.getIntAttribute("pagelength"); } else { - // pagelenght is "0" meaning scrolling is turned off + // pagelength is "0" meaning scrolling is turned off pageLength = totalRows; } @@ -1647,8 +1647,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, actionMap.put(key + "_c", caption); if (action.hasAttribute("icon")) { // TODO need some uri handling ?? - actionMap.put(key + "_i", client.translateVaadinUri(action - .getStringAttribute("icon"))); + actionMap.put(key + "_i", action.getStringAttribute("icon")); } else { actionMap.remove(key + "_i"); } @@ -1661,7 +1660,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } public String getActionIcon(String actionKey) { - return actionMap.get(actionKey + "_i"); + return client.translateVaadinUri(actionMap.get(actionKey + "_i")); } private void updateHeader(String[] strings) { 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/src/com/vaadin/client/ui/textfield/TextFieldConnector.java b/client/src/com/vaadin/client/ui/textfield/TextFieldConnector.java index fad094b87f..0d85e98ee3 100644 --- a/client/src/com/vaadin/client/ui/textfield/TextFieldConnector.java +++ b/client/src/com/vaadin/client/ui/textfield/TextFieldConnector.java @@ -89,9 +89,10 @@ public class TextFieldConnector extends AbstractFieldConnector implements * side value). <input> is updated only when it looses focus, so we * force updating if not focused. Lost focus issue appeared in (#15144) */ - if (Util.getFocusedElement() != getWidget().getElement() + if (!(Util.getFocusedElement() == getWidget().getElement()) || !uidl.getBooleanAttribute(TextFieldConstants.ATTR_NO_VALUE_CHANGE_BETWEEN_PAINTS) - || getWidget().valueBeforeEdit == null) { + || getWidget().valueBeforeEdit == null + || !text.equals(getWidget().valueBeforeEdit)) { getWidget().updateFieldContent(text); } diff --git a/client/src/com/vaadin/client/ui/ui/UIConnector.java b/client/src/com/vaadin/client/ui/ui/UIConnector.java index 8249b45855..9d8aa5b877 100644 --- a/client/src/com/vaadin/client/ui/ui/UIConnector.java +++ b/client/src/com/vaadin/client/ui/ui/UIConnector.java @@ -1013,6 +1013,8 @@ public class UIConnector extends AbstractSingleComponentContainerConnector activeTheme); } + String oldThemeBase = getConnection().translateVaadinUri("theme://"); + activeTheme = newTheme; if (newTheme != null) { @@ -1021,13 +1023,62 @@ public class UIConnector extends AbstractSingleComponentContainerConnector activeTheme); updateVaadinFavicon(newTheme); + } forceStateChangeRecursively(UIConnector.this); + // UIDL has no stored URL which we can repaint so we do some find and + // replace magic... + String newThemeBase = getConnection().translateVaadinUri("theme://"); + replaceThemeAttribute(oldThemeBase, newThemeBase); + getLayoutManager().forceLayout(); } /** + * Finds all attributes where theme:// urls have possibly been used and + * replaces any old theme url with a new one + * + * @param oldPrefix + * The start of the old theme URL + * @param newPrefix + * The start of the new theme URL + */ + private void replaceThemeAttribute(String oldPrefix, String newPrefix) { + // Images + replaceThemeAttribute("src", oldPrefix, newPrefix); + // Embedded flash + replaceThemeAttribute("value", oldPrefix, newPrefix); + replaceThemeAttribute("movie", oldPrefix, newPrefix); + } + + /** + * Finds any attribute of the given type where theme:// urls have possibly + * been used and replaces any old theme url with a new one + * + * @param attributeName + * The name of the attribute, e.g. "src" + * @param oldPrefix + * The start of the old theme URL + * @param newPrefix + * The start of the new theme URL + */ + private void replaceThemeAttribute(String attributeName, String oldPrefix, + String newPrefix) { + // Find all "attributeName=" which start with "oldPrefix" using e.g. + // [^src='http://oldpath'] + NodeList<Element> elements = querySelectorAll("[" + attributeName + + "^='" + oldPrefix + "']"); + for (int i = 0; i < elements.getLength(); i++) { + Element element = elements.getItem(i); + element.setAttribute( + attributeName, + element.getAttribute(attributeName).replace(oldPrefix, + newPrefix)); + } + } + + /** * Force a full recursive recheck of every connector's state variables. * * @see #forceStateChange() diff --git a/client/src/com/vaadin/client/widgets/Escalator.java b/client/src/com/vaadin/client/widgets/Escalator.java index 514fce26dc..3e08cc1f1f 100644 --- a/client/src/com/vaadin/client/widgets/Escalator.java +++ b/client/src/com/vaadin/client/widgets/Escalator.java @@ -821,7 +821,6 @@ public class Escalator extends Widget implements RequiresResize, double scrollContentHeight = body.calculateTotalRowHeight() + body.spacerContainer.getSpacerHeightsSum(); double scrollContentWidth = columnConfiguration.calculateRowWidth(); - double tableWrapperHeight = heightOfEscalator; double tableWrapperWidth = widthOfEscalator; @@ -879,7 +878,6 @@ public class Escalator extends Widget implements RequiresResize, .getCalculatedColumnsWidth(Range.between( columnConfiguration.getFrozenColumnCount(), columnConfiguration.getColumnCount())); - unfrozenPixels -= subpixelBrowserBugDetector.getActiveAdjustment(); double frozenPixels = scrollContentWidth - unfrozenPixels; double hScrollOffsetWidth = tableWrapperWidth - frozenPixels; horizontalScrollbar.setOffsetSize(hScrollOffsetWidth); @@ -2085,7 +2083,6 @@ public class Escalator extends Widget implements RequiresResize, rowElement.insertBefore(cellClone, cellOriginal); double requiredWidth = WidgetUtil .getRequiredWidthBoundingClientRectDouble(cellClone); - if (BrowserInfo.get().isIE()) { /* * IE browsers have some issues with subpixels. Occasionally @@ -4147,8 +4144,7 @@ public class Escalator extends Widget implements RequiresResize, * @return the width of a row, in pixels */ public double calculateRowWidth() { - return getCalculatedColumnsWidth(Range.between(0, getColumnCount())) - - subpixelBrowserBugDetector.getActiveAdjustment(); + return getCalculatedColumnsWidth(Range.between(0, getColumnCount())); } private void assertArgumentsAreValidAndWithinRange(final int index, @@ -4179,8 +4175,6 @@ public class Escalator extends Widget implements RequiresResize, */ @Override public void insertColumns(final int index, final int numberOfColumns) { - subpixelBrowserBugDetector.invalidateFix(); - // Validate if (index < 0 || index > getColumnCount()) { throw new IndexOutOfBoundsException("The given index(" + index @@ -4333,11 +4327,10 @@ public class Escalator extends Widget implements RequiresResize, int index = entry.getKey().intValue(); double width = entry.getValue().doubleValue(); - if (index == getColumnCount() - 1) { - subpixelBrowserBugDetector.invalidateFix(); - } - checkValidColumnIndex(index); + + // Not all browsers will accept any fractional size.. + width = WidgetUtil.roundSizeDown(width); columns.get(index).setWidth(width); } @@ -4347,8 +4340,6 @@ public class Escalator extends Widget implements RequiresResize, body.reapplyColumnWidths(); footer.reapplyColumnWidths(); - subpixelBrowserBugDetector.checkAndFix(); - recalculateElementSizes(); } @@ -4443,145 +4434,6 @@ public class Escalator extends Widget implements RequiresResize, } } - private class SubpixelBrowserBugDetector { - private static final double SUBPIXEL_ADJUSTMENT = .1; - private boolean fixActive = false; - - /** - * This is a fix essentially for Firefox and how it handles subpixels. - * <p> - * Even if an element has {@code style="width: 1000.12px"}, the bounding - * box's width in Firefox is usually nothing of that sort. It's actually - * 1000.11669921875 (in version 35.0.1). That's not even close, when - * talking about floating point precision. Other browsers handle the - * subpixels way better - * <p> - * In any case, we need to fix that. And that's fixed by simply checking - * if the sum of the width of all the cells is larger than the width of - * the row. If it is, we <i>hack</i> the last column - * {@value #SUBPIXEL_ADJUSTMENT}px narrower. - */ - public void checkAndFix() { - if (!fixActive && hasSubpixelBrowserBug()) { - fixSubpixelBrowserBug(); - fixActive = true; - } - } - - private double getActiveAdjustment() { - if (fixActive) { - return -SUBPIXEL_ADJUSTMENT; - } else { - return 0.0; - } - } - - public void invalidateFix() { - adjustBookkeepingPixels(SUBPIXEL_ADJUSTMENT); - fixActive = false; - } - - private boolean hasSubpixelBrowserBug() { - final RowContainer rowContainer; - if (header.getRowCount() > 0) { - rowContainer = header; - } else if (body.getRowCount() > 0) { - rowContainer = body; - } else if (footer.getRowCount() > 0) { - rowContainer = footer; - } else { - return false; - } - - double sumOfCellWidths = 0; - TableRowElement tr = rowContainer.getElement().getRows().getItem(0); - - if (tr == null) { - /* - * for some weird reason, the row might be null at this point in - * (some?) webkit browsers. - */ - return false; - } - - NodeList<TableCellElement> cells = tr.getCells(); - assert cells != null : "cells was null, why is it null?"; - - for (int i = 0; i < cells.getLength(); i++) { - TableCellElement cell = cells.getItem(i); - if (!cell.getStyle().getDisplay() - .equals(Display.NONE.getCssName())) { - sumOfCellWidths += WidgetUtil.getBoundingClientRect(cell) - .getWidth(); - } - } - - double rowWidth = WidgetUtil.getBoundingClientRect(tr).getWidth(); - return sumOfCellWidths >= rowWidth; - } - - private void fixSubpixelBrowserBug() { - assert columnConfiguration.getColumnCount() > 0 : "Why are we running this code if there are no columns?"; - - adjustBookkeepingPixels(-SUBPIXEL_ADJUSTMENT); - - fixSubpixelBrowserBugFor(header); - fixSubpixelBrowserBugFor(body); - fixSubpixelBrowserBugFor(footer); - } - - private void adjustBookkeepingPixels(double adjustment) { - int lastColumnIndex = columnConfiguration.columns.size() - 1; - if (lastColumnIndex < 0) { - return; - } - - columnConfiguration.columns.get(lastColumnIndex).calculatedWidth += adjustment; - if (columnConfiguration.widthsArray != null) { - columnConfiguration.widthsArray[lastColumnIndex] += adjustment; - } - } - - /** - * Adjust the last non-spanned cell by {@link #SUBPIXEL_ADJUSTMENT} ( - * {@value #SUBPIXEL_ADJUSTMENT}px). - * <p> - * We'll do this brute-force, by individually measuring and shrinking - * the last non-spanned cell. Brute-force, since each row might be - * spanned differently - we can't simply pick one index and one width, - * and mass-apply that to everything :( - */ - private void fixSubpixelBrowserBugFor(RowContainer rowContainer) { - if (rowContainer.getRowCount() == 0) { - return; - } - - NodeList<TableRowElement> rows = rowContainer.getElement() - .getRows(); - for (int i = 0; i < rows.getLength(); i++) { - - NodeList<TableCellElement> cells = rows.getItem(i).getCells(); - TableCellElement lastNonspannedCell = null; - for (int j = cells.getLength() - 1; j >= 0; j--) { - TableCellElement cell = cells.getItem(j); - if (!cell.getStyle().getDisplay() - .equals(Display.NONE.getCssName())) { - lastNonspannedCell = cell; - break; - } - } - - assert lastNonspannedCell != null : "all cells were \"display: none\" on row " - + i + " in " + rowContainer.getElement().getTagName(); - - double cellWidth = WidgetUtil.getBoundingClientRect( - lastNonspannedCell).getWidth(); - double newWidth = cellWidth - SUBPIXEL_ADJUSTMENT; - lastNonspannedCell.getStyle().setWidth(newWidth, Unit.PX); - } - } - } - /** * A decision on how to measure a spacer when it is partially within a * designated range. @@ -5647,8 +5499,6 @@ public class Escalator extends Widget implements RequiresResize, } }; - private final SubpixelBrowserBugDetector subpixelBrowserBugDetector = new SubpixelBrowserBugDetector(); - private final ElementPositionBookkeeper positions = new ElementPositionBookkeeper(); /** 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/build.xml b/server/build.xml index e88b53d937..4bb2bde730 100644 --- a/server/build.xml +++ b/server/build.xml @@ -22,9 +22,17 @@ <fileset dir="${vaadin.basedir}/WebContent"> <include name="VAADIN/vaadinBootstrap.js" /> </fileset> + <fileset dir="${result.dir}"> + <include name="VAADIN/*" /> + </fileset> </union> - <target name="jar"> + <target name="compress-files"> + <mkdir dir="${result.dir}/VAADIN" /> + <gzip src="${vaadin.basedir}/WebContent/VAADIN/vaadinBootstrap.js" + destfile="${result.dir}/VAADIN/vaadinBootstrap.js.gz" /> + </target> + <target name="jar" depends="compress-files"> <property name="server.osgi.import" value="javax.servlet;version="2.4.0",javax.servlet.http;version="2.4.0",javax.validation;version="1.0.0.GA";resolution:=optional,org.jsoup;version="1.6.3",org.jsoup.parser;version="1.6.3",org.jsoup.nodes;version="1.6.3",org.jsoup.helper;version="1.6.3",org.jsoup.safety;version="1.6.3",org.jsoup.select;version="1.6.3"" /> <property name="server.osgi.require" diff --git a/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java b/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java index f07b7ecc58..86e9069e90 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java @@ -1279,7 +1279,7 @@ public class SQLContainer implements Container, Container.Filterable, } /** - * Fetches a page from the data source based on the values of pageLenght and + * Fetches a page from the data source based on the values of pageLength and * currentOffset. Also updates the set of primary keys, used in * identification of RowItems. */ diff --git a/server/src/com/vaadin/server/ClientConnector.java b/server/src/com/vaadin/server/ClientConnector.java index b784aa5d35..63483bc254 100644 --- a/server/src/com/vaadin/server/ClientConnector.java +++ b/server/src/com/vaadin/server/ClientConnector.java @@ -256,10 +256,6 @@ public interface ClientConnector extends Connector { * client. Gives the connector an opportunity to set computed/dynamic state * values or to invoke last minute RPC methods depending on other component * features. - * <p> - * This method must not alter the component hierarchy in any way. Calling - * {@link #markAsDirty()} from this method will have no effect. - * </p> * * @param initial * <code>true</code> if the client-side connector will be created diff --git a/server/src/com/vaadin/server/ComponentSizeValidator.java b/server/src/com/vaadin/server/ComponentSizeValidator.java index 1fbd840932..71023782ef 100644 --- a/server/src/com/vaadin/server/ComponentSizeValidator.java +++ b/server/src/com/vaadin/server/ComponentSizeValidator.java @@ -598,6 +598,12 @@ public class ComponentSizeValidator implements Serializable { if (parent == null) { return false; } else if (parent.getWidth() < 0) { + if (parent instanceof Window) { + // Window has some weird haxxors to support 100% children when + // window is -1 + return false; + } + return true; } else if (parent.getWidthUnits() == Unit.PERCENTAGE) { return isEffectiveUndefinedWidth(parent.getParent()); @@ -615,6 +621,12 @@ public class ComponentSizeValidator implements Serializable { if (parent == null) { return false; } else if (parent.getHeight() < 0) { + if (parent instanceof Window) { + // Window has some weird haxxors to support 100% children when + // window is -1 + return false; + } + return true; } else if (parent.getHeightUnits() == Unit.PERCENTAGE) { return isEffectiveUndefinedHeight(parent.getParent()); diff --git a/server/src/com/vaadin/server/LegacyCommunicationManager.java b/server/src/com/vaadin/server/LegacyCommunicationManager.java index fda5ad444f..e982cdf10a 100644 --- a/server/src/com/vaadin/server/LegacyCommunicationManager.java +++ b/server/src/com/vaadin/server/LegacyCommunicationManager.java @@ -388,17 +388,15 @@ public class LegacyCommunicationManager implements Serializable { } /** - * Handles an exception that occurred when processing RPC calls or a file - * upload. + * Handles an exception related to a connector by invoking the appropriate + * error handler. * * @deprecated As of 7.1. See #11411. * - * @param ui - * The UI where the exception occured * @param throwable - * The exception + * the exception to handle * @param connector - * The Rpc target + * the connector that the exception is related to */ @Deprecated public void handleConnectorRelatedException(ClientConnector connector, diff --git a/server/src/com/vaadin/server/VaadinService.java b/server/src/com/vaadin/server/VaadinService.java index 74f0051e30..bff71fedee 100644 --- a/server/src/com/vaadin/server/VaadinService.java +++ b/server/src/com/vaadin/server/VaadinService.java @@ -1574,8 +1574,8 @@ public abstract class VaadinService implements Serializable { JsonObject appError = Json.createObject(); putValueOrJsonNull(appError, "caption", caption); putValueOrJsonNull(appError, "url", url); - putValueOrJsonNull(appError, "message", - createCriticalNotificationMessage(message, details)); + putValueOrJsonNull(appError, "message", message); + putValueOrJsonNull(appError, "details", details); JsonObject meta = Json.createObject(); meta.put("appError", appError); @@ -1595,17 +1595,6 @@ public abstract class VaadinService implements Serializable { return "for(;;);[" + returnString + "]"; } - private static String createCriticalNotificationMessage(String message, - String details) { - if (message == null) { - return details; - } else if (details != null) { - return message + "<br/><br/>" + details; - } - - return message; - } - private static void putValueOrJsonNull(JsonObject json, String key, String value) { if (value == null) { diff --git a/server/src/com/vaadin/server/communication/UidlWriter.java b/server/src/com/vaadin/server/communication/UidlWriter.java index 3b2caba55b..a4797e49aa 100644 --- a/server/src/com/vaadin/server/communication/UidlWriter.java +++ b/server/src/com/vaadin/server/communication/UidlWriter.java @@ -23,7 +23,9 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Comparator; +import java.util.HashSet; import java.util.List; +import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; @@ -81,22 +83,44 @@ public class UidlWriter implements Serializable { // to write out service.runPendingAccessTasks(session); - ArrayList<ClientConnector> dirtyVisibleConnectors = ui - .getConnectorTracker().getDirtyVisibleConnectors(); + Set<ClientConnector> processedConnectors = new HashSet<ClientConnector>(); + LegacyCommunicationManager manager = session.getCommunicationManager(); // Paints components ConnectorTracker uiConnectorTracker = ui.getConnectorTracker(); getLogger().log(Level.FINE, "* Creating response to client"); + while (true) { + ArrayList<ClientConnector> connectorsToProcess = new ArrayList<ClientConnector>(); + for (ClientConnector c : uiConnectorTracker.getDirtyConnectors()) { + if (!processedConnectors.contains(c) + && LegacyCommunicationManager + .isConnectorVisibleToClient(c)) { + connectorsToProcess.add(c); + } + } + + if (connectorsToProcess.isEmpty()) { + break; + } + + for (ClientConnector connector : connectorsToProcess) { + boolean initialized = uiConnectorTracker + .isClientSideInitialized(connector); + processedConnectors.add(connector); + + try { + connector.beforeClientResponse(!initialized); + } catch (RuntimeException e) { + manager.handleConnectorRelatedException(connector, e); + } + } + } + getLogger().log( Level.FINE, - "Found " + dirtyVisibleConnectors.size() + "Found " + processedConnectors.size() + " dirty connectors to paint"); - for (ClientConnector connector : dirtyVisibleConnectors) { - boolean initialized = uiConnectorTracker - .isClientSideInitialized(connector); - connector.beforeClientResponse(!initialized); - } uiConnectorTracker.setWritingResponse(true); try { @@ -292,7 +316,7 @@ public class UidlWriter implements Serializable { session.getDragAndDropService().printJSONResponse(writer); - for (ClientConnector connector : dirtyVisibleConnectors) { + for (ClientConnector connector : processedConnectors) { uiConnectorTracker.markClientSideInitialized(connector); } diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java index 18c3509af7..f499cb1fec 100644 --- a/server/src/com/vaadin/ui/AbstractComponent.java +++ b/server/src/com/vaadin/ui/AbstractComponent.java @@ -1170,16 +1170,16 @@ public abstract class AbstractComponent extends AbstractClientConnector // first try the full shorthands if (widthFull && heightFull) { - attributes.put("size-full", "true"); + attributes.put("size-full", ""); } else if (widthAuto && heightAuto) { - attributes.put("size-auto", "true"); + attributes.put("size-auto", ""); } else { // handle width if (!hasEqualWidth(defaultInstance)) { if (widthFull) { - attributes.put("width-full", "true"); + attributes.put("width-full", ""); } else if (widthAuto) { - attributes.put("width-auto", "true"); + attributes.put("width-auto", ""); } else { String widthString = DesignAttributeHandler.getFormatter() .format(getWidth()) + getWidthUnits().getSymbol(); @@ -1190,9 +1190,9 @@ public abstract class AbstractComponent extends AbstractClientConnector if (!hasEqualHeight(defaultInstance)) { // handle height if (heightFull) { - attributes.put("height-full", "true"); + attributes.put("height-full", ""); } else if (heightAuto) { - attributes.put("height-auto", "true"); + attributes.put("height-auto", ""); } else { String heightString = DesignAttributeHandler.getFormatter() .format(getHeight()) + getHeightUnits().getSymbol(); diff --git a/server/src/com/vaadin/ui/AbstractTextField.java b/server/src/com/vaadin/ui/AbstractTextField.java index 14c135228c..93025ac0fd 100644 --- a/server/src/com/vaadin/ui/AbstractTextField.java +++ b/server/src/com/vaadin/ui/AbstractTextField.java @@ -126,22 +126,25 @@ public abstract class AbstractTextField extends AbstractField<String> implements selectionPosition = -1; } - target.addAttribute(TextFieldConstants.ATTR_TEXTCHANGE_EVENTMODE, - getTextChangeEventMode().toString()); - target.addAttribute(TextFieldConstants.ATTR_TEXTCHANGE_TIMEOUT, - getTextChangeTimeout()); - if (lastKnownTextContent != null) { - /* - * The field has be repainted for some reason (e.g. caption, size, - * stylename), but the value has not been changed since the last - * text change event. Let the client side know about the value the - * server side knows. Client side may then ignore the actual value, - * depending on its state. - */ - target.addAttribute( - TextFieldConstants.ATTR_NO_VALUE_CHANGE_BETWEEN_PAINTS, - true); + if (hasListeners(TextChangeEvent.class)) { + target.addAttribute(TextFieldConstants.ATTR_TEXTCHANGE_EVENTMODE, + getTextChangeEventMode().toString()); + target.addAttribute(TextFieldConstants.ATTR_TEXTCHANGE_TIMEOUT, + getTextChangeTimeout()); + if (lastKnownTextContent != null) { + /* + * The field has be repainted for some reason (e.g. caption, + * size, stylename), but the value has not been changed since + * the last text change event. Let the client side know about + * the value the server side knows. Client side may then ignore + * the actual value, depending on its state. + */ + target.addAttribute( + TextFieldConstants.ATTR_NO_VALUE_CHANGE_BETWEEN_PAINTS, + true); + } } + } @Override diff --git a/server/src/com/vaadin/ui/Grid.java b/server/src/com/vaadin/ui/Grid.java index b0542352b9..64f26b6205 100644 --- a/server/src/com/vaadin/ui/Grid.java +++ b/server/src/com/vaadin/ui/Grid.java @@ -3627,6 +3627,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, private final Footer footer = new Footer(this); private Object editedItemId = null; + private boolean editorActive = false; private FieldGroup editorFieldGroup = new CustomFieldGroup(); private CellStyleGenerator cellStyleGenerator; @@ -5803,7 +5804,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, * @return true iff the editor is open */ public boolean isEditorActive() { - return editedItemId != null; + return editorActive; } private void checkColumnExists(Object propertyId) { @@ -5878,6 +5879,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, .getPropertyId()); } + editorActive = true; // Must ensure that all fields, recursively, are sent to the client // This is needed because the fields are hidden using isRendered for (Field<?> f : getEditorFields()) { @@ -5929,6 +5931,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, protected void doCancelEditor() { editedItemId = null; + editorActive = false; editorFieldGroup.discard(); editorFieldGroup.setItemDataSource(null); } @@ -5946,6 +5949,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, } editedItemId = null; + editorActive = false; editorFieldGroup = new CustomFieldGroup(); } diff --git a/server/src/com/vaadin/ui/GridLayout.java b/server/src/com/vaadin/ui/GridLayout.java index 6ccb272704..792ad72dcc 100644 --- a/server/src/com/vaadin/ui/GridLayout.java +++ b/server/src/com/vaadin/ui/GridLayout.java @@ -1319,11 +1319,15 @@ public class GridLayout extends AbstractLayout implements setMargin(readMargin(design, getMargin(), designContext)); - // Prepare a 2D map for reading column contents - Elements rowElements = design.getElementsByTag("row"); + List<Element> rowElements = new ArrayList<Element>(); List<Map<Integer, Component>> rows = new ArrayList<Map<Integer, Component>>(); - for (int i = 0; i < rowElements.size(); ++i) { - rows.add(new HashMap<Integer, Component>()); + // Prepare a 2D map for reading column contents + for (Element e : design.children()) { + if (e.tagName().equalsIgnoreCase("row")) { + rowElements.add(e); + rows.add(new HashMap<Integer, Component>()); + + } } setRows(Math.max(rows.size(), 1)); 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/declarative/DesignFormatter.java b/server/src/com/vaadin/ui/declarative/DesignFormatter.java index b1d2520631..73c45caed4 100644 --- a/server/src/com/vaadin/ui/declarative/DesignFormatter.java +++ b/server/src/com/vaadin/ui/declarative/DesignFormatter.java @@ -94,7 +94,11 @@ public class DesignFormatter implements Serializable { public String convertToPresentation(Boolean value, Class<? extends String> targetType, Locale locale) throws Converter.ConversionException { - return String.valueOf(value.booleanValue()); + if (value.booleanValue()) { + return ""; + } else { + return "false"; + } } @Override 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/server/VaadinServiceTest.java b/server/tests/src/com/vaadin/server/VaadinServiceTest.java index 4b655e7855..bd3da6277a 100644 --- a/server/tests/src/com/vaadin/server/VaadinServiceTest.java +++ b/server/tests/src/com/vaadin/server/VaadinServiceTest.java @@ -42,9 +42,10 @@ public class VaadinServiceTest { } } - private String createCriticalNotification(String caption, String message, String details, String url) { - return VaadinService - .createCriticalNotificationJSON(caption, message, details, url); + private String createCriticalNotification(String caption, String message, + String details, String url) { + return VaadinService.createCriticalNotificationJSON(caption, message, + details, url); } @Test @@ -77,64 +78,64 @@ public class VaadinServiceTest { @Test public void captionIsSetToACriticalNotification() { - String notification = - createCriticalNotification("foobar", "message", "details", "url"); + String notification = createCriticalNotification("foobar", "message", + "details", "url"); assertThat(notification, containsString("\"caption\":\"foobar\"")); } @Test public void nullCaptionIsSetToACriticalNotification() { - String notification = - createCriticalNotification(null, "message", "details", "url"); + String notification = createCriticalNotification(null, "message", + "details", "url"); assertThat(notification, containsString("\"caption\":null")); } @Test public void messageWithDetailsIsSetToACriticalNotification() { - String notification = - createCriticalNotification("caption", "foo", "bar", "url"); + String notification = createCriticalNotification("caption", "foo", + "bar", "url"); - assertThat(notification, containsString("\"message\":\"foo<br/><br/>bar\"")); + assertThat(notification, containsString("\"details\":\"bar\"")); } @Test - public void nullMessageIsReplacedByDetailsInACriticalNotification() { - String notification = - createCriticalNotification("caption", null, "foobar", "url"); + public void nullMessageSentAsNullInACriticalNotification() { + String notification = createCriticalNotification("caption", null, + "foobar", "url"); - assertThat(notification, containsString("\"message\":\"foobar\"")); + assertThat(notification, containsString("\"message\":null")); } @Test public void nullMessageIsSetToACriticalNotification() { - String notification = - createCriticalNotification("caption", null, null, "url"); + String notification = createCriticalNotification("caption", null, null, + "url"); assertThat(notification, containsString("\"message\":null")); } @Test public void messageSetToACriticalNotification() { - String notification = - createCriticalNotification("caption", "foobar", null, "url"); + String notification = createCriticalNotification("caption", "foobar", + null, "url"); assertThat(notification, containsString("\"message\":\"foobar\"")); } @Test public void urlIsSetToACriticalNotification() { - String notification = - createCriticalNotification("caption", "message", "details", "foobar"); + String notification = createCriticalNotification("caption", "message", + "details", "foobar"); assertThat(notification, containsString("\"url\":\"foobar\"")); } @Test public void nullUrlIsSetToACriticalNotification() { - String notification = - createCriticalNotification("caption", "message", "details", null); + String notification = createCriticalNotification("caption", "message", + "details", null); assertThat(notification, containsString("\"url\":null")); } diff --git a/server/tests/src/com/vaadin/tests/components/menubar/MenuBarDeclarativeTest.java b/server/tests/src/com/vaadin/tests/components/menubar/MenuBarDeclarativeTest.java index 3bc1ebfbf9..d058ae1dcd 100644 --- a/server/tests/src/com/vaadin/tests/components/menubar/MenuBarDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/components/menubar/MenuBarDeclarativeTest.java @@ -38,10 +38,10 @@ public class MenuBarDeclarativeTest extends DeclarativeTestBase<MenuBar> { @Test // #16328 public void testReadWrite() throws IOException { - String design = "<v-menu-bar auto-open='true' tabindex=5>" - + "<menu checkable='true'>Save</menu>" + String design = "<v-menu-bar auto-open='' tabindex=5>" + + "<menu checkable=''>Save</menu>" + "<menu description='Open a file'>Open</menu>" - + "<menu disabled='true'>Close</menu>" + + "<menu disabled=''>Close</menu>" + "<menu icon='http://foo.bar/ico.png'>Help</menu>" + "<menu visible='false'>About</menu>" + "<menu>Sub<menu>Item</menu></menu>" @@ -69,19 +69,19 @@ public class MenuBarDeclarativeTest extends DeclarativeTestBase<MenuBar> { @Test // #16328 public void testTicketSpec1() throws IOException { - String design = "<v-menu-bar auto-open='true' plain-text tabindex=5> " + String design = "<v-menu-bar auto-open='' plain-text tabindex=5> " + "<menu>File" + "<menu>Save</menu>" + "<menu icon=\"theme://../runo/icons/16/folder.png\">Open</menu>" - + "<menu separator='true' />" - + "<menu disabled='true'>Exit</menu>" + + "<menu separator='' />" + + "<menu disabled=''>Exit</menu>" + "<menu visible='false'>Not for everybody</menu>" + "</menu>" + "<menu description=\"This contains many items in sub menus\">Other" + "<menu style-name=\"fancy\">Sub" - + "<menu checkable='true' checked='true'>Option 1 - no <b>html</b></menu>" - + "<menu checkable='true'>Option 2</menu>" - + "<menu checkable='true'>Option 3</menu>" // + + "<menu checkable='' checked=''>Option 1 - no <b>html</b></menu>" + + "<menu checkable=''>Option 2</menu>" + + "<menu checkable=''>Option 3</menu>" // + "</menu>" // + "</menu>" // + "<menu more icon=\"theme://icon.png\">foo</menu>" @@ -124,8 +124,7 @@ public class MenuBarDeclarativeTest extends DeclarativeTestBase<MenuBar> { + "<menu><b>File</b>" + "<menu><font style=\"color: red\">Save</font></menu>" + "<menu icon=\"theme://../runo/icons/16/folder.png\">Open</menu>" - + "<menu separator='true' />" - + "<menu disabled='true'>Exit</menu>" // + + "<menu separator='' />" + "<menu disabled=''>Exit</menu>" // + "</menu></v-menu-bar>"; MenuBar menuBar = new MenuBar(); menuBar.setHtmlContentAllowed(true); diff --git a/server/tests/src/com/vaadin/tests/design/AbstractComponentSetResponsiveTest.java b/server/tests/src/com/vaadin/tests/design/AbstractComponentSetResponsiveTest.java index 83b3e577dc..1119301c55 100644 --- a/server/tests/src/com/vaadin/tests/design/AbstractComponentSetResponsiveTest.java +++ b/server/tests/src/com/vaadin/tests/design/AbstractComponentSetResponsiveTest.java @@ -29,7 +29,7 @@ public class AbstractComponentSetResponsiveTest extends label.setContentMode(ContentMode.HTML); label.setResponsive(true); - String design = "<v-label responsive='true' />"; + String design = "<v-label responsive='' />"; testWrite(design, label); testRead(design, label); 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/DesignFormatterTest.java b/server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java index 00af20ea8c..acee3e2ca8 100644 --- a/server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java +++ b/server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java @@ -78,7 +78,7 @@ public class DesignFormatterTest { @Test public void testBoolean() { - assertEquals("true", formatter.format(true)); + assertEquals("", formatter.format(true)); assertEquals("false", formatter.format(false)); assertEquals(true, formatter.parse("true", boolean.class)); 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/DeclarativeMarginTestBase.java b/server/tests/src/com/vaadin/tests/server/component/DeclarativeMarginTestBase.java index 9fcb64acca..42715e52ae 100644 --- a/server/tests/src/com/vaadin/tests/server/component/DeclarativeMarginTestBase.java +++ b/server/tests/src/com/vaadin/tests/server/component/DeclarativeMarginTestBase.java @@ -52,19 +52,19 @@ public abstract class DeclarativeMarginTestBase<L extends Layout & MarginHandler String s = "<" + componentTag + " "; if (left && right && top && bottom) { - s += "margin='true'"; + s += "margin=''"; } else { if (left) { - s += "margin-left='true' "; + s += "margin-left='' "; } if (right) { - s += "margin-right='true' "; + s += "margin-right='' "; } if (top) { - s += "margin-top='true' "; + s += "margin-top='' "; } if (bottom) { - s += "margin-bottom='true' "; + s += "margin-bottom='' "; } } return s + " />"; 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/abstractcomponent/AbstractComponentDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentDeclarativeTest.java index 4f45168a32..71021a06e1 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentDeclarativeTest.java @@ -71,7 +71,7 @@ public class AbstractComponentDeclarativeTest extends public void testProperties() { String design = "<v-label id=\"testId\" primary-style-name=\"test-style\" " + "caption=\"test-caption\" locale=\"fi_FI\" description=\"test-description\" " - + "error=\"<div>test-error</div>\" immediate=\"true\"/>"; + + "error=\"<div>test-error</div>\" immediate=\"\"/>"; component.setId("testId"); component.setPrimaryStyleName("test-style"); component.setCaption("test-caption"); @@ -139,7 +139,7 @@ public class AbstractComponentDeclarativeTest extends @Test public void testSizeFull() { - String design = "<v-label size-full=\"true\"/>"; + String design = "<v-label size-full=\"\"/>"; component.setSizeFull(); testRead(design, component); testWrite(design, component); @@ -147,7 +147,7 @@ public class AbstractComponentDeclarativeTest extends @Test public void testSizeAuto() { - String design = "<v-label size-auto=\"true\"/>"; + String design = "<v-label size-auto=\"\"/>"; component.setSizeUndefined(); testRead(design, component); testWrite(design, component); @@ -155,7 +155,7 @@ public class AbstractComponentDeclarativeTest extends @Test public void testHeightFull() { - String design = "<v-label height-full=\"true\"/ width=\"20px\"/>"; + String design = "<v-label height-full=\"\"/ width=\"20px\"/>"; component.setHeight("100%"); component.setWidth("20px"); testRead(design, component); @@ -164,7 +164,7 @@ public class AbstractComponentDeclarativeTest extends @Test public void testHeightAuto() { - String design = "<v-horizontal-split-panel height-auto=\"true\"/ width=\"20px\" >"; + String design = "<v-horizontal-split-panel height-auto=\"\"/ width=\"20px\" >"; // we need to have default height of 100% -> use split panel AbstractComponent component = new HorizontalSplitPanel(); component.setHeight(null); @@ -175,7 +175,7 @@ public class AbstractComponentDeclarativeTest extends @Test public void testWidthFull() { - String design = "<v-button width-full=\"true\"/ height=\"20px\">Foo</button>"; + String design = "<v-button width-full=\"\"/ height=\"20px\">Foo</button>"; AbstractComponent component = new Button(); component.setCaptionAsHtml(true); component.setCaption("Foo"); @@ -187,7 +187,7 @@ public class AbstractComponentDeclarativeTest extends @Test public void testWidthAuto() { - String design = "<v-label height=\"20px\"/ width-auto=\"true\"/>"; + String design = "<v-label height=\"20px\"/ width-auto=\"\"/>"; component.setCaptionAsHtml(false); component.setHeight("20px"); component.setWidth(null); @@ -197,7 +197,7 @@ public class AbstractComponentDeclarativeTest extends @Test public void testResponsive() { - String design = "<v-label responsive =\"true\"/>"; + String design = "<v-label responsive =\"\"/>"; Responsive.makeResponsive(component); testRead(design, component); testWrite(design, component); diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbstractFieldDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbstractFieldDeclarativeTest.java index 55231e5494..b4afde5923 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbstractFieldDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbstractFieldDeclarativeTest.java @@ -33,9 +33,9 @@ public class AbstractFieldDeclarativeTest extends @Test public void testPlainText() { - String design = "<v-text-field buffered='true' validation-visible='false' invalid-committed='true'" - + " invalid-allowed='false' required='true' required-error='This is a required field'" - + " conversion-error='Input {0} cannot be parsed' tabindex=3 readonly='true'/>"; + String design = "<v-text-field buffered='' validation-visible='false' invalid-committed=''" + + " invalid-allowed='false' required='' required-error='This is a required field'" + + " conversion-error='Input {0} cannot be parsed' tabindex=3 readonly=''/>"; AbstractField tf = new TextField(); tf.setBuffered(true); tf.setBuffered(true); @@ -51,7 +51,7 @@ public class AbstractFieldDeclarativeTest extends testWrite(design, tf); // Test with readonly=false - design = design.replace("readonly='true'", ""); + design = design.replace("readonly=''", ""); tf.setReadOnly(false); testRead(design, tf); testWrite(design, tf); diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractselect/AbstractSelectDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/abstractselect/AbstractSelectDeclarativeTest.java index b3867a7a3a..b294ffad72 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstractselect/AbstractSelectDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstractselect/AbstractSelectDeclarativeTest.java @@ -42,7 +42,7 @@ public class AbstractSelectDeclarativeTest extends DeclarativeTestBase<AbstractSelect> { public String getDesignSingleSelectNewItemsAllowed() { - return "<v-combo-box new-items-allowed='true' item-caption-mode='icon_only'" + return "<v-combo-box new-items-allowed='' item-caption-mode='icon_only'" + " null-selection-item-id='nullIid'/>"; } @@ -57,7 +57,7 @@ public class AbstractSelectDeclarativeTest extends } public String getDesignMultiSelect() { - return "<v-list-select multi-select='true' null-selection-allowed='false' new-items-allowed='true' item-caption-mode='property' />"; + return "<v-list-select multi-select='' null-selection-allowed='false' new-items-allowed='' item-caption-mode='property' />"; } public AbstractSelect getExpectedMultiSelect() { @@ -210,7 +210,7 @@ public class AbstractSelectDeclarativeTest extends attributes.put("item-caption-mode", "property"); attributes.put("item-caption-property-id", "name"); attributes.put("item-icon-property-id", "icon"); - attributes.put("null-selection-allowed", "true"); + attributes.put("null-selection-allowed", ""); attributes.put("null-selection-item-id", "No items selected"); return new Element(Tag.valueOf("v-combo-box"), "", attributes); } @@ -231,7 +231,7 @@ public class AbstractSelectDeclarativeTest extends assertEquals("Wrong caption for the combo box.", "A combo box", e.attr("caption")); Assert.assertTrue("Adding new items should be allowed.", - "true".equals(e.attr("new-items-allowed"))); + "".equals(e.attr("new-items-allowed"))); assertEquals("Wrong item caption mode.", "icon_only", e.attr("item-caption-mode")); assertEquals("Wrong item icon property id.", "icon", 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/abstractselect/OptionGroupDeclarativeTests.java b/server/tests/src/com/vaadin/tests/server/component/abstractselect/OptionGroupDeclarativeTests.java index 4d75e0b59f..efcdc3e997 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstractselect/OptionGroupDeclarativeTests.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstractselect/OptionGroupDeclarativeTests.java @@ -111,7 +111,7 @@ public class OptionGroupDeclarativeTests extends //@formatter:off String expected = - "<v-option-group html-content-allowed='true'>" + "<v-option-group html-content-allowed=''>" + "<option item-id=\"foo\"><b>True</b></option>" + "<option item-id=\"bar\"><font color='red'>False</font></option>" + "<option>baz</option>" diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/AbstractSplitPanelDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/AbstractSplitPanelDeclarativeTest.java index 2d6db6d19a..11d97d191b 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/AbstractSplitPanelDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/AbstractSplitPanelDeclarativeTest.java @@ -38,7 +38,7 @@ public class AbstractSplitPanelDeclarativeTest extends @Test public void testWithBothChildren() { String design = "<v-horizontal-split-panel split-position=20.5% " - + "min-split-position=20% max-split-position=50px locked=true " + + "min-split-position=20% max-split-position=50px locked='' " + "reversed=\"\"> <v-table /> <v-vertical-layout />" + "</v-horizontal-split-panel>"; AbstractSplitPanel sp = new HorizontalSplitPanel(); diff --git a/server/tests/src/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldDeclarativeTest.java index a3594b7159..b8e570bc89 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldDeclarativeTest.java @@ -34,7 +34,7 @@ public class AbstractTextFieldDeclarativeTest extends @Test public void testAttributes() { String design = "<v-text-field null-representation=this-is-null " - + "null-setting-allowed=true maxlength=5 columns=3 " + + "null-setting-allowed='' maxlength=5 columns=3 " + "input-prompt=input text-change-event-mode=eager " + "text-change-timeout=100 />"; AbstractTextField tf = new TextField(); 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/audio/AudioDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/audio/AudioDeclarativeTest.java index 4390499c4e..ec2b5241f3 100644 --- a/server/tests/src/com/vaadin/tests/server/component/audio/AudioDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/audio/AudioDeclarativeTest.java @@ -43,7 +43,7 @@ public class AudioDeclarativeTest extends DeclarativeTestBase<Audio> { @Test public void testAudioMultipleSources() { - String design = "<v-audio muted='true' show-controls='false'>" + String design = "<v-audio muted='' show-controls='false'>" + "some <b>text</b>" // + "<source href='http://foo.pl' />" + "<source href='https://bar.pl' />" // diff --git a/server/tests/src/com/vaadin/tests/server/component/audio/VideoDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/audio/VideoDeclarativeTest.java index fc0b3d9512..5be70bd2db 100644 --- a/server/tests/src/com/vaadin/tests/server/component/audio/VideoDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/audio/VideoDeclarativeTest.java @@ -36,7 +36,7 @@ public class VideoDeclarativeTest extends DeclarativeTestBase<Video> { @Test public void testVideoMultipleSources() { - String design = "<v-video muted='true' show-controls='false'>" + String design = "<v-video muted='' show-controls='false'>" + "some <b>text</b>" // + "<source href='http://foo.pl' />" + "<source href='https://bar.pl' />" // diff --git a/server/tests/src/com/vaadin/tests/server/component/checkbox/CheckboxDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/checkbox/CheckboxDeclarativeTest.java index 6162e41494..e0f0b7c3e9 100644 --- a/server/tests/src/com/vaadin/tests/server/component/checkbox/CheckboxDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/checkbox/CheckboxDeclarativeTest.java @@ -38,7 +38,7 @@ public class CheckboxDeclarativeTest extends DeclarativeTestBase<CheckBox> { @Test public void testUnchecked() { - String design = "<v-check-box checked='true' />"; + String design = "<v-check-box checked='' />"; CheckBox checkBox = new CheckBox(); checkBox.setValue(true); testRead(design, checkBox); diff --git a/server/tests/src/com/vaadin/tests/server/component/colorpicker/AbstractColorPickerDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/colorpicker/AbstractColorPickerDeclarativeTest.java index 59b2efdc42..33521d3af2 100644 --- a/server/tests/src/com/vaadin/tests/server/component/colorpicker/AbstractColorPickerDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/colorpicker/AbstractColorPickerDeclarativeTest.java @@ -29,7 +29,7 @@ public class AbstractColorPickerDeclarativeTest extends @Test public void testAllAbstractColorPickerFeatures() { - String design = "<v-color-picker color='#fafafa' default-caption-enabled='true' position='100,100'" + String design = "<v-color-picker color='#fafafa' default-caption-enabled='' position='100,100'" + " popup-style='simple' rgb-visibility='false' hsv-visibility='false'" + " history-visibility=false textfield-visibility=false />"; ColorPicker colorPicker = new ColorPicker(); @@ -58,7 +58,7 @@ public class AbstractColorPickerDeclarativeTest extends @Test public void testAllAbstractColorPickerAreaFeatures() { - String design = "<v-color-picker-area color='#fafafa' default-caption-enabled='true' position='100,100'" + String design = "<v-color-picker-area color='#fafafa' default-caption-enabled='' position='100,100'" + " popup-style='simple' rgb-visibility='false' hsv-visibility='false'" + " history-visibility=false textfield-visibility=false />"; AbstractColorPicker colorPicker = new ColorPickerArea(); diff --git a/server/tests/src/com/vaadin/tests/server/component/datefield/DateFieldDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/datefield/DateFieldDeclarativeTest.java index 5058cf5a5f..4087f1ad11 100644 --- a/server/tests/src/com/vaadin/tests/server/component/datefield/DateFieldDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/datefield/DateFieldDeclarativeTest.java @@ -44,7 +44,7 @@ public class DateFieldDeclarativeTest extends DeclarativeTestBase<DateField> { } private String getTimezoneDesign() { - return "<v-date-field range-start=\"2014-05-05 00:00:00+0300\" range-end=\"2014-06-05 00:00:00+0300\" date-out-of-range-message=\"Please select a sensible date\" date-format=\"yyyy-MM-dd\" lenient='true' show-iso-week-numbers='true' parse-error-message=\"You are doing it wrong\" time-zone=\"GMT+05:00\" value=\"2014-05-15 00:00:00+0300\"/>"; + return "<v-date-field range-start=\"2014-05-05 00:00:00+0300\" range-end=\"2014-06-05 00:00:00+0300\" date-out-of-range-message=\"Please select a sensible date\" date-format=\"yyyy-MM-dd\" lenient='' show-iso-week-numbers='' parse-error-message=\"You are doing it wrong\" time-zone=\"GMT+05:00\" value=\"2014-05-15 00:00:00+0300\"/>"; } private DateField getTimezoneExpected() { diff --git a/server/tests/src/com/vaadin/tests/server/component/grid/declarative/GridColumnDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/grid/declarative/GridColumnDeclarativeTest.java index 6cf9ef55ad..aa9a499469 100644 --- a/server/tests/src/com/vaadin/tests/server/component/grid/declarative/GridColumnDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/grid/declarative/GridColumnDeclarativeTest.java @@ -25,11 +25,11 @@ public class GridColumnDeclarativeTest extends GridDeclarativeTestBase { public void testSimpleGridColumns() { String design = "<v-grid><table>"// + "<colgroup>" - + " <col sortable=true width='100' property-id='Column1'>" + + " <col sortable='' width='100' property-id='Column1'>" + " <col sortable=false max-width='200' expand='2' property-id='Column2'>" - + " <col sortable=true editable=false min-width='15' expand='1' property-id='Column3'>" - + " <col sortable=true hidable=true hiding-toggle-caption='col 4' property-id='Column4'>" - + " <col sortable=true hidden=true property-id='Column5'>" + + " <col sortable='' editable=false min-width='15' expand='1' property-id='Column3'>" + + " <col sortable='' hidable='' hiding-toggle-caption='col 4' property-id='Column4'>" + + " <col sortable='' hidden='' property-id='Column5'>" + "</colgroup>" // + "<thead />" // + "</table></v-grid>"; diff --git a/server/tests/src/com/vaadin/tests/server/component/grid/declarative/GridDeclarativeAttributeTest.java b/server/tests/src/com/vaadin/tests/server/component/grid/declarative/GridDeclarativeAttributeTest.java index 8ffe749f6f..43f394eafc 100644 --- a/server/tests/src/com/vaadin/tests/server/component/grid/declarative/GridDeclarativeAttributeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/grid/declarative/GridDeclarativeAttributeTest.java @@ -37,8 +37,8 @@ public class GridDeclarativeAttributeTest extends DeclarativeTestBase<Grid> { @Test public void testBasicAttributes() { - String design = "<v-grid editable='true' rows=20 frozen-columns=-1 " - + "editor-save-caption='Tallenna' editor-cancel-caption='Peruuta' column-reordering-allowed=true>"; + String design = "<v-grid editable='' rows=20 frozen-columns=-1 " + + "editor-save-caption='Tallenna' editor-cancel-caption='Peruuta' column-reordering-allowed=''>"; Grid grid = new Grid(); grid.setEditorEnabled(true); diff --git a/server/tests/src/com/vaadin/tests/server/component/grid/declarative/GridHeaderFooterDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/grid/declarative/GridHeaderFooterDeclarativeTest.java index b4e82950cb..8e1d880c5e 100644 --- a/server/tests/src/com/vaadin/tests/server/component/grid/declarative/GridHeaderFooterDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/grid/declarative/GridHeaderFooterDeclarativeTest.java @@ -30,12 +30,12 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { public void testSingleDefaultHeader() { String design = "<v-grid><table>"// + "<colgroup>" - + " <col sortable=true property-id='Column1'>" - + " <col sortable=true property-id='Column2'>" - + " <col sortable=true property-id='Column3'>" + + " <col sortable='' property-id='Column1'>" + + " <col sortable='' property-id='Column2'>" + + " <col sortable='' property-id='Column3'>" + "</colgroup>" // + "<thead>" // - + " <tr default='true'><th plain-text=''>Column1<th plain-text=''>Column2<th plain-text=''>Column3</tr>" // + + " <tr default=''><th plain-text=''>Column1<th plain-text=''>Column2<th plain-text=''>Column3</tr>" // + "</thead>" // + "</table></v-grid>"; Grid grid = new Grid(); @@ -51,12 +51,11 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { public void testSingleDefaultHTMLHeader() { String design = "<v-grid><table>"// + "<colgroup>" - + " <col sortable=true property-id='Column1'>" - + " <col sortable=true property-id='Column2'>" - + " <col sortable=true property-id='Column3'>" - + "</colgroup>" // + + " <col sortable='' property-id='Column1'>" + + " <col sortable='' property-id='Column2'>" + + " <col sortable='' property-id='Column3'>" + "</colgroup>" // + "<thead>" // - + " <tr default='true'><th>Column1<th>Column2<th>Column3</tr>" // + + " <tr default=''><th>Column1<th>Column2<th>Column3</tr>" // + "</thead>" // + "</table></v-grid>"; Grid grid = new Grid(); @@ -77,7 +76,7 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { public void testNoHeaderRows() { String design = "<v-grid><table>"// + "<colgroup>" - + " <col sortable=true property-id='Column1'>" + + " <col sortable='' property-id='Column1'>" + "</colgroup>" // + "<thead />" // + "</table></v-grid>"; @@ -94,13 +93,13 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { public void testMultipleHeadersWithColSpans() { String design = "<v-grid><table>"// + "<colgroup>" - + " <col sortable=true property-id='Column1'>" - + " <col sortable=true property-id='Column2'>" - + " <col sortable=true property-id='Column3'>" + + " <col sortable='' property-id='Column1'>" + + " <col sortable='' property-id='Column2'>" + + " <col sortable='' property-id='Column3'>" + "</colgroup>" // + "<thead>" // + " <tr><th colspan=3>Baz</tr>" - + " <tr default='true'><th>Column1<th>Column2<th>Column3</tr>" // + + " <tr default=''><th>Column1<th>Column2<th>Column3</tr>" // + " <tr><th>Foo<th colspan=2>Bar</tr>" // + "</thead>" // + "</table></v-grid>"; @@ -128,9 +127,9 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { public void testSingleDefaultFooter() { String design = "<v-grid><table>"// + "<colgroup>" - + " <col sortable=true property-id='Column1'>" - + " <col sortable=true property-id='Column2'>" - + " <col sortable=true property-id='Column3'>" + + " <col sortable='' property-id='Column1'>" + + " <col sortable='' property-id='Column2'>" + + " <col sortable='' property-id='Column3'>" + "</colgroup>" // + "<thead />" // No headers read or written + "<tfoot>" // @@ -157,10 +156,9 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { public void testSingleDefaultHTMLFooter() { String design = "<v-grid><table>"// + "<colgroup>" - + " <col sortable=true property-id='Column1'>" - + " <col sortable=true property-id='Column2'>" - + " <col sortable=true property-id='Column3'>" - + "</colgroup>" // + + " <col sortable='' property-id='Column1'>" + + " <col sortable='' property-id='Column2'>" + + " <col sortable='' property-id='Column3'>" + "</colgroup>" // + "<thead />" // No headers read or written + "<tfoot>" // + " <tr><td>Column1<td>Column2<td>Column3</tr>" // @@ -186,9 +184,9 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { public void testMultipleFootersWithColSpans() { String design = "<v-grid><table>"// + "<colgroup>" - + " <col sortable=true property-id='Column1'>" - + " <col sortable=true property-id='Column2'>" - + " <col sortable=true property-id='Column3'>" + + " <col sortable='' property-id='Column1'>" + + " <col sortable='' property-id='Column2'>" + + " <col sortable='' property-id='Column3'>" + "</colgroup>" // + "<thead />" // No headers read or written. + "<tfoot>" // @@ -223,10 +221,10 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { public void testComponentInGridHeader() { String design = "<v-grid><table>"// + "<colgroup>" - + " <col sortable=true property-id='Column1'>" + + " <col sortable='' property-id='Column1'>" + "</colgroup>" // + "<thead>" // - + "<tr default=true><th><v-label><b>Foo</b></v-label></tr>" + + "<tr default=''><th><v-label><b>Foo</b></v-label></tr>" + "</thead>"// + "</table></v-grid>"; @@ -245,7 +243,7 @@ public class GridHeaderFooterDeclarativeTest extends GridDeclarativeTestBase { public void testComponentInGridFooter() { String design = "<v-grid><table>"// + "<colgroup>" - + " <col sortable=true property-id='Column1'>" + + " <col sortable='' property-id='Column1'>" + "</colgroup>" // + "<thead />" // No headers read or written + "<tfoot>" // diff --git a/server/tests/src/com/vaadin/tests/server/component/grid/declarative/GridInlineDataDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/grid/declarative/GridInlineDataDeclarativeTest.java index fefd49a587..d7feb4aa70 100644 --- a/server/tests/src/com/vaadin/tests/server/component/grid/declarative/GridInlineDataDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/grid/declarative/GridInlineDataDeclarativeTest.java @@ -25,7 +25,7 @@ public class GridInlineDataDeclarativeTest extends GridDeclarativeTestBase { public void testSimpleInlineData() { String design = "<v-grid><table>"// + "<colgroup>" - + " <col sortable=true property-id='Col1' />" + + " <col sortable='' property-id='Col1' />" + "</colgroup>" // + "<thead />" // No headers read or written + "<tbody>" // @@ -51,9 +51,9 @@ public class GridInlineDataDeclarativeTest extends GridDeclarativeTestBase { public void testMultipleColumnsInlineData() { String design = "<v-grid><table>"// + "<colgroup>" - + " <col sortable=true property-id='Col1' />" - + " <col sortable=true property-id='Col2' />" - + " <col sortable=true property-id='Col3' />" // + + " <col sortable='' property-id='Col1' />" + + " <col sortable='' property-id='Col2' />" + + " <col sortable='' property-id='Col3' />" // + "</colgroup>" // + "<thead />" // No headers read or written + "<tbody>" // @@ -79,9 +79,9 @@ public class GridInlineDataDeclarativeTest extends GridDeclarativeTestBase { public void testMultipleColumnsInlineDataReordered() { String design = "<v-grid><table>"// + "<colgroup>" - + " <col sortable=true property-id='Col2' />" - + " <col sortable=true property-id='Col3' />" - + " <col sortable=true property-id='Col1' />" // + + " <col sortable='' property-id='Col2' />" + + " <col sortable='' property-id='Col3' />" + + " <col sortable='' property-id='Col1' />" // + "</colgroup>" // + "<thead />" // No headers read or written + "<tbody>" // diff --git a/server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java index 9d3b5001da..d69fd92984 100644 --- a/server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java @@ -203,4 +203,37 @@ public class GridLayoutDeclarativeTest extends } return result; } + + @Test + public void testNestedGridLayouts() { + String design = "<!DOCTYPE html>" + // + "<html>" + // + " <body> " + // + " <v-grid-layout> " + // + " <row> " + // + " <column> " + // + " <v-grid-layout> " + // + " <row> " + // + " <column> " + // + " <v-button>" + // + " Button " + // + " </v-button> " + // + " </column> " + // + " </row> " + // + " </v-grid-layout> " + // + " </column> " + // + " </row> " + // + " </v-grid-layout> " + // + " </body>" + // + "</html>"; + GridLayout outer = new GridLayout(); + GridLayout inner = new GridLayout(); + Button b = new Button("Button"); + b.setCaptionAsHtml(true); + inner.addComponent(b); + outer.addComponent(inner); + testRead(design, outer); + testWrite(design, outer); + + } } diff --git a/server/tests/src/com/vaadin/tests/server/component/popupview/PopupViewDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/popupview/PopupViewDeclarativeTest.java index 8bad68f5b9..1b50a517ae 100644 --- a/server/tests/src/com/vaadin/tests/server/component/popupview/PopupViewDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/popupview/PopupViewDeclarativeTest.java @@ -48,7 +48,7 @@ public class PopupViewDeclarativeTest extends DeclarativeTestBase<PopupView> { component.setHideOnMouseOut(true); component.setPopupVisible(true); // hide-on-mouse-out is true by default. not seen in design - String design = "<v-popup-view popup-visible='true'>" // + String design = "<v-popup-view popup-visible=''>" // + "Click <u>here</u> to open" + "<popup-content>" + new DesignContext().createElement(verticalLayout) diff --git a/server/tests/src/com/vaadin/tests/server/component/progressbar/ProgressBarDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/progressbar/ProgressBarDeclarativeTest.java index c98883a4a7..bed19644ff 100644 --- a/server/tests/src/com/vaadin/tests/server/component/progressbar/ProgressBarDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/progressbar/ProgressBarDeclarativeTest.java @@ -29,7 +29,7 @@ public class ProgressBarDeclarativeTest extends DeclarativeTestBase<ProgressBar> { public String getBasicDesign() { - return "<v-progress-bar value=0.5 indeterminate='true'>"; + return "<v-progress-bar value=0.5 indeterminate=''>"; } diff --git a/server/tests/src/com/vaadin/tests/server/component/richtextarea/RichTextAreaDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/richtextarea/RichTextAreaDeclarativeTest.java index 9d61656801..0d614b7b9a 100644 --- a/server/tests/src/com/vaadin/tests/server/component/richtextarea/RichTextAreaDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/richtextarea/RichTextAreaDeclarativeTest.java @@ -24,7 +24,7 @@ public class RichTextAreaDeclarativeTest extends DeclarativeTestBase<RichTextArea> { private String getBasicDesign() { - return "<v-rich-text-area null-representation='' null-setting-allowed='true'>\n" + return "<v-rich-text-area null-representation='' null-setting-allowed=''>\n" + "\n <b>Header</b> <br/>Some text\n " + "</v-rich-text-area>"; } 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/table/TableDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/table/TableDeclarativeTest.java index c395d8501c..3de5ae0524 100644 --- a/server/tests/src/com/vaadin/tests/server/component/table/TableDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/table/TableDeclarativeTest.java @@ -38,10 +38,10 @@ public class TableDeclarativeTest extends TableDeclarativeTestBase { String design = "<" + getTag() - + " page-length=30 cache-rate=3 selectable=true editable=true " + + " page-length=30 cache-rate=3 selectable='' editable='' " + "sortable=false sort-ascending=false sort-container-property-id=foo " + "drag-mode=row multi-select-mode=simple column-header-mode=id row-header-mode=id " - + "column-reordering-allowed=true column-collapsing-allowed=true />"; + + "column-reordering-allowed='' column-collapsing-allowed='' />"; Table table = getTable(); table.setPageLength(30); @@ -69,12 +69,12 @@ public class TableDeclarativeTest extends TableDeclarativeTestBase { public void testColumns() { String design = "<" + getTag() - + " column-collapsing-allowed=true>" // + + " column-collapsing-allowed=''>" // + " <table>" // + " <colgroup>" + " <col property-id='foo' width=300>" + " <col property-id='bar' center expand=1 collapsible=false>" - + " <col property-id='baz' right expand=2 collapsed=true>" + + " <col property-id='baz' right expand=2 collapsed=''>" + " </colgroup>" // + " </table>"; diff --git a/server/tests/src/com/vaadin/tests/server/component/tabsheet/TabSheetDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/tabsheet/TabSheetDeclarativeTest.java index a92101f550..c218f93a02 100644 --- a/server/tests/src/com/vaadin/tests/server/component/tabsheet/TabSheetDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/tabsheet/TabSheetDeclarativeTest.java @@ -36,7 +36,7 @@ public class TabSheetDeclarativeTest extends DeclarativeTestBase<TabSheet> { @Test public void testFeatures() { String design = "<v-tab-sheet tabindex=5><tab caption=test-caption " - + "visible=false closable=true enabled=false icon=http://www.vaadin.com/test.png" + + "visible=false closable='' enabled=false icon=http://www.vaadin.com/test.png" + " icon-alt=OK description=test-desc style-name=test-style " + "id=test-id><v-text-field/></tab></v-tab-sheet>"; TabSheet ts = new TabSheet(); @@ -59,7 +59,7 @@ public class TabSheetDeclarativeTest extends DeclarativeTestBase<TabSheet> { @Test public void testSelected() { - String design = "<v-tab-sheet><tab selected=true><v-text-field/></tab></v-tab-sheet>"; + String design = "<v-tab-sheet><tab selected=''><v-text-field/></tab></v-tab-sheet>"; TabSheet ts = new TabSheet(); TextField tf = new TextField(); ts.addTab(tf); @@ -71,7 +71,7 @@ public class TabSheetDeclarativeTest extends DeclarativeTestBase<TabSheet> { @Test public void tabsNotShown() { String design = "<v-tab-sheet tabs-visible=\"false\">\n" - + " <tab caption=\"My Tab\" selected=\"true\">\n" + + " <tab caption=\"My Tab\" selected=\"\">\n" + " <v-label>My Content</v-label>\n" + " </tab>\n" + "</v-tab-sheet>\n"; TabSheet ts = new TabSheet(); @@ -84,4 +84,4 @@ public class TabSheetDeclarativeTest extends DeclarativeTestBase<TabSheet> { testWrite(design, ts); } -}
\ No newline at end of file +} diff --git a/server/tests/src/com/vaadin/tests/server/component/treetable/TreeTableDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/treetable/TreeTableDeclarativeTest.java index 5f487aa021..a30ca2a3ef 100644 --- a/server/tests/src/com/vaadin/tests/server/component/treetable/TreeTableDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/treetable/TreeTableDeclarativeTest.java @@ -33,7 +33,7 @@ public class TreeTableDeclarativeTest extends TableDeclarativeTest { @Test public void testAttributes() { - String design = "<v-tree-table animations-enabled=true>"; + String design = "<v-tree-table animations-enabled=''>"; TreeTable table = getTable(); table.setAnimationsEnabled(true); 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/component/window/WindowDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/window/WindowDeclarativeTest.java index 1ab0011442..1d233af494 100644 --- a/server/tests/src/com/vaadin/tests/server/component/window/WindowDeclarativeTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/window/WindowDeclarativeTest.java @@ -50,10 +50,10 @@ public class WindowDeclarativeTest extends DeclarativeTestBase<Window> { public void testFeatures() { String design = "<v-window position='100,100' window-mode='maximized' " - + "center modal=true resizable=false resize-lazy=true closable=false draggable=false " + + "center modal='' resizable=false resize-lazy='' closable=false draggable=false " + "close-shortcut='ctrl-alt-escape' " + "assistive-prefix='Hello' assistive-postfix='World' assistive-role='alertdialog' " - + "tab-stop-enabled=true " + + "tab-stop-enabled='' " + "tab-stop-top-assistive-text='Do not move above the window' " + "tab-stop-bottom-assistive-text='End of window'>" + "</v-window>"; 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/themes/build.xml b/themes/build.xml index 487376ebdf..0bb167855f 100644 --- a/themes/build.xml +++ b/themes/build.xml @@ -104,6 +104,9 @@ <jvmarg value="-Djava.awt.headless=true" /> </java> + <!-- Compress theme to serve using gzip --> + <gzip src="${theme.result.dir}/${theme}/styles.css" + destfile="${theme.result.dir}/${theme}/styles.css.gz" /> </target> diff --git a/uitest/integration-testscripts/GateIn-3/integration-test-GateIn-3.1.0-portlet2.html b/uitest/integration-testscripts/GateIn-3/integration-test-GateIn-3.1.0-portlet2.html index 7df5894f15..258e698c94 100644 --- a/uitest/integration-testscripts/GateIn-3/integration-test-GateIn-3.1.0-portlet2.html +++ b/uitest/integration-testscripts/GateIn-3/integration-test-GateIn-3.1.0-portlet2.html @@ -181,13 +181,13 @@ <!--Start of actual portlet test--> <tr> <td>waitForElementPresent</td> - <td>//div[2]/div/div/div/span</td> + <td>//div[contains(@class,'PORTLET-FRAGMENT')]/div[contains(@class,'v-app')]</td> <td></td> </tr> <tr> - <td>assertText</td> - <td>//div[2]/div/div/div/span</td> + <td>assertTextPresent</td> <td>Test of ApplicationResources with full path</td> + <td></td> </tr> <tr> <td>assertText</td> diff --git a/uitest/integration_tests.xml b/uitest/integration_tests.xml index d28ba47320..d56ba2683f 100644 --- a/uitest/integration_tests.xml +++ b/uitest/integration_tests.xml @@ -224,7 +224,12 @@ <param name="target-server" value="wildfly8" /> </antcall> </target> - + <target name="integration-test-wildfly9"> + <antcall target="run-generic-integration-test"> + <param name="startDelay" value="10" /> + <param name="target-server" value="wildfly9" /> + </antcall> + </target> <target name="integration-test-glassfish3"> <antcall target="run-generic-integration-test"> <param name="startDelay" value="10" /> @@ -389,6 +394,7 @@ <antcall target="integration-test-jboss7" /> <antcall target="integration-test-jboss-eap6" /> <antcall target="integration-test-wildfly8" /> + <antcall target="integration-test-wildfly9" /> <antcall target="integration-test-jetty7" /> <antcall target="integration-test-jetty8" /> <antcall target="integration-test-jetty9" /> diff --git a/uitest/src/com/vaadin/launcher/DevelopmentServerLauncher.java b/uitest/src/com/vaadin/launcher/DevelopmentServerLauncher.java index 871111ad8b..aa2c63393b 100644 --- a/uitest/src/com/vaadin/launcher/DevelopmentServerLauncher.java +++ b/uitest/src/com/vaadin/launcher/DevelopmentServerLauncher.java @@ -49,6 +49,7 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.nio.SelectChannelConnector; import org.eclipse.jetty.server.ssl.SslSocketConnector; import org.eclipse.jetty.util.Scanner; +import org.eclipse.jetty.util.log.JavaUtilLog; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.webapp.WebAppContext; @@ -74,6 +75,8 @@ public class DevelopmentServerLauncher { */ public static void main(String[] args) { System.setProperty("java.awt.headless", "true"); + System.setProperty("org.eclipse.jetty.util.log.class", + JavaUtilLog.class.getName()); assertAssertionsEnabled(); diff --git a/uitest/src/com/vaadin/tests/application/CriticalNotifications.java b/uitest/src/com/vaadin/tests/application/CriticalNotifications.java index bde3fbaf6f..14b4cb62e9 100644 --- a/uitest/src/com/vaadin/tests/application/CriticalNotifications.java +++ b/uitest/src/com/vaadin/tests/application/CriticalNotifications.java @@ -26,16 +26,21 @@ import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.CheckBox; public class CriticalNotifications extends AbstractTestUI { private SystemMessages systemMessages; + private CheckBox includeDetails; @Override protected void setup(VaadinRequest request) { systemMessages = VaadinService.getCurrent().getSystemMessages( getLocale(), request); + includeDetails = new CheckBox("Include details"); + addComponent(includeDetails); + Button sessionExpired = new Button("Session expired"); addComponent(sessionExpired); sessionExpired.addClickListener(new ClickListener() { @@ -43,7 +48,8 @@ public class CriticalNotifications extends AbstractTestUI { public void buttonClick(ClickEvent event) { showCriticalNotification( systemMessages.getSessionExpiredCaption(), - systemMessages.getSessionExpiredMessage(), null, + systemMessages.getSessionExpiredMessage(), + getDetailsMessage(), systemMessages.getSessionExpiredURL()); } @@ -56,7 +62,8 @@ public class CriticalNotifications extends AbstractTestUI { public void buttonClick(ClickEvent event) { showCriticalNotification( systemMessages.getAuthenticationErrorCaption(), - systemMessages.getAuthenticationErrorMessage(), null, + systemMessages.getAuthenticationErrorMessage(), + getDetailsMessage(), systemMessages.getAuthenticationErrorURL()); } @@ -69,7 +76,8 @@ public class CriticalNotifications extends AbstractTestUI { public void buttonClick(ClickEvent event) { showCriticalNotification( systemMessages.getCommunicationErrorCaption(), - systemMessages.getCommunicationErrorMessage(), null, + systemMessages.getCommunicationErrorMessage(), + getDetailsMessage(), systemMessages.getCommunicationErrorURL()); } @@ -82,7 +90,8 @@ public class CriticalNotifications extends AbstractTestUI { public void buttonClick(ClickEvent event) { showCriticalNotification( systemMessages.getInternalErrorCaption(), - systemMessages.getInternalErrorMessage(), null, + systemMessages.getInternalErrorMessage(), + getDetailsMessage(), systemMessages.getInternalErrorURL()); } @@ -95,7 +104,8 @@ public class CriticalNotifications extends AbstractTestUI { public void buttonClick(ClickEvent event) { showCriticalNotification( systemMessages.getCookiesDisabledCaption(), - systemMessages.getCookiesDisabledMessage(), null, + systemMessages.getCookiesDisabledMessage(), + getDetailsMessage(), systemMessages.getCookiesDisabledURL()); } @@ -112,6 +122,14 @@ public class CriticalNotifications extends AbstractTestUI { }); } + protected String getDetailsMessage() { + if (includeDetails.getValue()) { + return "Some details for the error"; + } else { + return null; + } + } + protected void showCriticalNotification(String caption, String message, String details, String url) { VaadinService service = VaadinService.getCurrent(); diff --git a/uitest/src/com/vaadin/tests/applicationservlet/SystemMessages.java b/uitest/src/com/vaadin/tests/applicationservlet/SystemMessages.java index 00547aa2d2..9912e660ef 100644 --- a/uitest/src/com/vaadin/tests/applicationservlet/SystemMessages.java +++ b/uitest/src/com/vaadin/tests/applicationservlet/SystemMessages.java @@ -14,13 +14,15 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.NativeSelect; +import elemental.json.JsonObject; + public class SystemMessages extends AbstractTestUI { public class MyButton extends Button { private boolean fail = false; @Override - public void beforeClientResponse(boolean initial) { + public JsonObject encodeState() { // Set the error message to contain the current locale. VaadinService.getCurrentRequest().setAttribute( ApplicationRunnerServlet.CUSTOM_SYSTEM_MESSAGES_PROPERTY, @@ -30,9 +32,10 @@ public class SystemMessages extends AbstractTestUI { return "MessagesInfo locale: " + getLocale(); } }); - super.beforeClientResponse(initial); if (fail) { throw new RuntimeException("Failed on purpose"); + } else { + return super.encodeState(); } } } 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/abstractcomponent/ChangeHierarchyBeforeResponse.java b/uitest/src/com/vaadin/tests/components/abstractcomponent/ChangeHierarchyBeforeResponse.java new file mode 100644 index 0000000000..e6daf8356c --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/abstractcomponent/ChangeHierarchyBeforeResponse.java @@ -0,0 +1,71 @@ +/* + * 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.abstractcomponent; + +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.CssLayout; +import com.vaadin.ui.Label; + +public class ChangeHierarchyBeforeResponse extends AbstractTestUI { + private CssLayout layout = new CssLayout() { + @Override + public void beforeClientResponse(boolean initial) { + super.beforeClientResponse(initial); + if (initial) { + addComponent(buttonToAdd); + removeComponent(labelToRemove); + } + } + }; + + private Button buttonToAdd = new Button("Added from beforeClientResponse", + new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + layout.addComponent(labelToRemove); + } + }) { + @Override + public void beforeClientResponse(boolean initial) { + super.beforeClientResponse(initial); + setCaption("Add label to layout"); + } + }; + + private Label labelToRemove = new Label("Label to remove") { + int count = 0; + + @Override + public void beforeClientResponse(boolean initial) { + super.beforeClientResponse(initial); + if (initial) { + count++; + setValue("Initial count: " + count); + } + } + }; + + @Override + protected void setup(VaadinRequest request) { + layout.addComponent(labelToRemove); + + addComponent(layout); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/abstractcomponent/ChangeHierarchyBeforeResponseTest.java b/uitest/src/com/vaadin/tests/components/abstractcomponent/ChangeHierarchyBeforeResponseTest.java new file mode 100644 index 0000000000..485e218a68 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/abstractcomponent/ChangeHierarchyBeforeResponseTest.java @@ -0,0 +1,43 @@ +/* + * 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.abstractcomponent; + +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.LabelElement; +import com.vaadin.tests.tb3.SingleBrowserTest; + +public class ChangeHierarchyBeforeResponseTest extends SingleBrowserTest { + @Test + public void testHierarchyChangeBeforeResponse() { + openTestURL(); + + ButtonElement button = $(ButtonElement.class).first(); + + Assert.assertEquals( + "Button caption should change by its own beforeClientResponse", + "Add label to layout", button.getText()); + + button.click(); + + LabelElement label = $(LabelElement.class).all().get(1); + + Assert.assertEquals("Label should have been considered initial twice", + "Initial count: 2", label.getText()); + } +} diff --git a/uitest/src/com/vaadin/tests/components/abstractcomponent/ResponseWritingErrorHandling.java b/uitest/src/com/vaadin/tests/components/abstractcomponent/ResponseWritingErrorHandling.java new file mode 100644 index 0000000000..23be0f62b4 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/abstractcomponent/ResponseWritingErrorHandling.java @@ -0,0 +1,61 @@ +/* + * 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.abstractcomponent; + +import com.vaadin.server.ErrorHandler; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUIWithLog; +import com.vaadin.ui.Button; + +public class ResponseWritingErrorHandling extends AbstractTestUIWithLog { + + @Override + protected void setup(VaadinRequest request) { + ErrorHandler errorHandler = new ErrorHandler() { + @Override + public void error(com.vaadin.server.ErrorEvent event) { + String message = event.getThrowable().getMessage(); + log(message); + } + }; + + Button button = new Button("Throw in beforeClientResponse") { + private boolean throwInBeforeClientResponse = false; + { + addClickListener(new ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + throwInBeforeClientResponse = true; + // Make sure beforeClientResponse is called + markAsDirty(); + } + }); + } + + @Override + public void beforeClientResponse(boolean initial) { + if (throwInBeforeClientResponse) { + throwInBeforeClientResponse = false; + throw new RuntimeException("Button.beforeClientResponse"); + } + } + }; + button.setErrorHandler(errorHandler); + + addComponent(button); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/abstractcomponent/ResponseWritingErrorHandlingTest.java b/uitest/src/com/vaadin/tests/components/abstractcomponent/ResponseWritingErrorHandlingTest.java new file mode 100644 index 0000000000..7b939a5627 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/abstractcomponent/ResponseWritingErrorHandlingTest.java @@ -0,0 +1,35 @@ +/* + * 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.abstractcomponent; + +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.tests.tb3.SingleBrowserTest; + +public class ResponseWritingErrorHandlingTest extends SingleBrowserTest { + + @Test + public void testExceptionInBeforeClientResponse() { + openTestURL(); + + $(ButtonElement.class).first().click(); + + Assert.assertEquals("Message should be logged by error handler", + "1. Button.beforeClientResponse", getLogRow(0)); + } +} diff --git a/uitest/src/com/vaadin/tests/components/accordion/AccordionRemoveComponentTest.java b/uitest/src/com/vaadin/tests/components/accordion/AccordionRemoveComponentTest.java index 84f1734897..785acddcb7 100644 --- a/uitest/src/com/vaadin/tests/components/accordion/AccordionRemoveComponentTest.java +++ b/uitest/src/com/vaadin/tests/components/accordion/AccordionRemoveComponentTest.java @@ -15,9 +15,7 @@ */ package com.vaadin.tests.components.accordion; -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; @@ -36,8 +34,7 @@ public class AccordionRemoveComponentTest extends MultiBrowserTest { $(ButtonElement.class).first().click(); - Assert.assertFalse( - "Error notification with client side exception is shown", - isElementPresent(By.className("v-Notification-error"))); + assertNoErrorNotifications(); } + } diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxBorderTest.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxBorderTest.java new file mode 100644 index 0000000000..4d40e455a6 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxBorderTest.java @@ -0,0 +1,39 @@ +/* + * 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.combobox; + +import java.io.IOException; + +import org.junit.Test; +import org.openqa.selenium.Keys; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.elements.LabelElement; +import com.vaadin.tests.tb3.MultiBrowserTest; +import com.vaadin.tests.tb3.newelements.ComboBoxElement; + +public class ComboBoxBorderTest extends MultiBrowserTest { + @Test + public void testComboBoxArrow() throws IOException { + openTestURL(); + ComboBoxElement cb = $(ComboBoxElement.class).first(); + cb.openPopup(); + cb.sendKeys(Keys.DOWN, Keys.ENTER); + Actions actions = new Actions(getDriver()); + actions.moveToElement($(LabelElement.class).first()).perform(); + compareScreen("arrow"); + } +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/components/grid/GridClientDataChangeHandlerTest.java b/uitest/src/com/vaadin/tests/components/grid/GridClientDataChangeHandlerTest.java index 251039c644..02ca206b5e 100644 --- a/uitest/src/com/vaadin/tests/components/grid/GridClientDataChangeHandlerTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/GridClientDataChangeHandlerTest.java @@ -20,8 +20,10 @@ import static org.junit.Assert.assertFalse; import org.junit.Test; import com.vaadin.testbench.elements.NotificationElement; +import com.vaadin.testbench.parallel.TestCategory; import com.vaadin.tests.tb3.SingleBrowserTest; +@TestCategory("grid") public class GridClientDataChangeHandlerTest extends SingleBrowserTest { @Test diff --git a/uitest/src/com/vaadin/tests/components/grid/GridColumnWidthRecalculationTest.java b/uitest/src/com/vaadin/tests/components/grid/GridColumnWidthRecalculationTest.java index fab3bd8a1c..17bfcfc6c1 100644 --- a/uitest/src/com/vaadin/tests/components/grid/GridColumnWidthRecalculationTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/GridColumnWidthRecalculationTest.java @@ -23,8 +23,10 @@ import org.openqa.selenium.Dimension; import com.vaadin.testbench.elements.ButtonElement; import com.vaadin.testbench.elements.GridElement; import com.vaadin.testbench.elements.GridElement.GridCellElement; +import com.vaadin.testbench.parallel.TestCategory; import com.vaadin.tests.tb3.SingleBrowserTest; +@TestCategory("grid") public class GridColumnWidthRecalculationTest extends SingleBrowserTest { private GridElement grid; diff --git a/uitest/src/com/vaadin/tests/components/grid/GridColumnWidthsWithoutDataTest.java b/uitest/src/com/vaadin/tests/components/grid/GridColumnWidthsWithoutDataTest.java index c215fa0a59..3d88427ada 100644 --- a/uitest/src/com/vaadin/tests/components/grid/GridColumnWidthsWithoutDataTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/GridColumnWidthsWithoutDataTest.java @@ -25,8 +25,10 @@ import com.vaadin.testbench.elements.GridElement; import com.vaadin.testbench.elements.GridElement.GridCellElement; import com.vaadin.testbench.elements.NativeSelectElement; import com.vaadin.testbench.elements.NotificationElement; +import com.vaadin.testbench.parallel.TestCategory; import com.vaadin.tests.tb3.SingleBrowserTest; +@TestCategory("grid") public class GridColumnWidthsWithoutDataTest extends SingleBrowserTest { @Test diff --git a/uitest/src/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolledTest.java b/uitest/src/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolledTest.java index 6a452e1fec..f2e3a8e77e 100644 --- a/uitest/src/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolledTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolledTest.java @@ -25,8 +25,10 @@ import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.interactions.Actions; import com.vaadin.testbench.elements.GridElement; +import com.vaadin.testbench.parallel.TestCategory; import com.vaadin.tests.tb3.MultiBrowserTest; +@TestCategory("grid") public class GridDragSelectionWhileScrolledTest extends MultiBrowserTest { @Override diff --git a/uitest/src/com/vaadin/tests/components/grid/GridEditingWithNoScrollBarsTest.java b/uitest/src/com/vaadin/tests/components/grid/GridEditingWithNoScrollBarsTest.java index 6400b17449..8a67d180c6 100644 --- a/uitest/src/com/vaadin/tests/components/grid/GridEditingWithNoScrollBarsTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/GridEditingWithNoScrollBarsTest.java @@ -20,8 +20,10 @@ import static org.junit.Assert.assertEquals; import org.junit.Test; import com.vaadin.testbench.elements.GridElement; +import com.vaadin.testbench.parallel.TestCategory; import com.vaadin.tests.tb3.MultiBrowserTest; +@TestCategory("grid") public class GridEditingWithNoScrollBarsTest extends MultiBrowserTest { @Test diff --git a/uitest/src/com/vaadin/tests/components/grid/GridEditorCustomFieldTest.java b/uitest/src/com/vaadin/tests/components/grid/GridEditorCustomFieldTest.java index 3187e629c1..ae81eb9303 100644 --- a/uitest/src/com/vaadin/tests/components/grid/GridEditorCustomFieldTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/GridEditorCustomFieldTest.java @@ -22,8 +22,10 @@ import com.vaadin.testbench.TestBenchElement; import com.vaadin.testbench.elements.ComboBoxElement; import com.vaadin.testbench.elements.GridElement; import com.vaadin.testbench.elements.GridElement.GridEditorElement; +import com.vaadin.testbench.parallel.TestCategory; import com.vaadin.tests.tb3.MultiBrowserTest; +@TestCategory("grid") public class GridEditorCustomFieldTest extends MultiBrowserTest { @Test diff --git a/uitest/src/com/vaadin/tests/components/grid/GridEditorMultiselectTest.java b/uitest/src/com/vaadin/tests/components/grid/GridEditorMultiselectTest.java index ba689fb5e1..9b53766d96 100644 --- a/uitest/src/com/vaadin/tests/components/grid/GridEditorMultiselectTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/GridEditorMultiselectTest.java @@ -8,8 +8,10 @@ import org.openqa.selenium.WebElement; import com.vaadin.testbench.By; import com.vaadin.testbench.elements.GridElement; +import com.vaadin.testbench.parallel.TestCategory; import com.vaadin.tests.tb3.MultiBrowserTest; +@TestCategory("grid") public class GridEditorMultiselectTest extends MultiBrowserTest { @Test diff --git a/uitest/src/com/vaadin/tests/components/grid/GridExtensionCommunicationTest.java b/uitest/src/com/vaadin/tests/components/grid/GridExtensionCommunicationTest.java index 9fd35fe3e9..a6a1231fa0 100644 --- a/uitest/src/com/vaadin/tests/components/grid/GridExtensionCommunicationTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/GridExtensionCommunicationTest.java @@ -21,8 +21,10 @@ import org.junit.Test; import com.vaadin.testbench.elements.GridElement; import com.vaadin.testbench.elements.GridElement.GridCellElement; +import com.vaadin.testbench.parallel.TestCategory; import com.vaadin.tests.tb3.SingleBrowserTest; +@TestCategory("grid") public class GridExtensionCommunicationTest extends SingleBrowserTest { @Test 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/ProgrammaticEditorControl.java b/uitest/src/com/vaadin/tests/components/grid/ProgrammaticEditorControl.java new file mode 100644 index 0000000000..a9075a77d1 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/grid/ProgrammaticEditorControl.java @@ -0,0 +1,46 @@ +package com.vaadin.tests.components.grid; + +import com.vaadin.data.util.IndexedContainer; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUIWithLog; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.Grid; + +@SuppressWarnings("serial") +// @Push +public class ProgrammaticEditorControl extends AbstractTestUIWithLog { + + private Grid grid; + private IndexedContainer container = new IndexedContainer(); + + @Override + protected void setup(VaadinRequest request) { + container.addContainerProperty("name", String.class, null); + container.addItem("test").getItemProperty("name").setValue("test"); + grid = new Grid(); + grid.setContainerDataSource(container); + grid.setEditorEnabled(true); + addComponent(grid); + + Button button = new Button("Edit", new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + grid.editItem("test"); + } + }); + addComponent(button); + Button button2 = new Button("Cancel", new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + grid.cancelEditor(); + } + }); + addComponent(button2); + + } + +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/components/grid/ProgrammaticEditorControlTest.java b/uitest/src/com/vaadin/tests/components/grid/ProgrammaticEditorControlTest.java new file mode 100644 index 0000000000..811bd03a64 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/grid/ProgrammaticEditorControlTest.java @@ -0,0 +1,62 @@ +/* + * 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.grid; + +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.GridElement; +import com.vaadin.testbench.elements.TextFieldElement; +import com.vaadin.tests.tb3.SingleBrowserTest; + +public class ProgrammaticEditorControlTest extends SingleBrowserTest { + + @Test + public void multipleOpenFromServerSide() { + openTestURL(); + GridElement grid = $(GridElement.class).first(); + ButtonElement editButton = $(ButtonElement.class).caption("Edit") + .first(); + ButtonElement cancelButton = $(ButtonElement.class).caption("Cancel") + .first(); + + editButton.click(); + assertEditorFieldContents(grid, "test"); + cancelButton.click(); + + assertEditorNotPresent(grid); + + editButton.click(); + assertEditorFieldContents(grid, "test"); + } + + private void assertEditorFieldContents(GridElement grid, String text) { + TextFieldElement editorField = wrap(TextFieldElement.class, grid + .getEditor().getField(0)); + Assert.assertEquals(text, editorField.getValue()); + } + + private void assertEditorNotPresent(GridElement grid) { + try { + grid.getEditor(); + Assert.fail("Editor should not be present"); + } catch (Exception e) { + + } + } + +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridSortingIndicatorsTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridSortingIndicatorsTest.java index 66c937aa81..b6bf2b35d1 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridSortingIndicatorsTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridSortingIndicatorsTest.java @@ -20,8 +20,10 @@ import java.io.IOException; import org.junit.Test; import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.parallel.TestCategory; import com.vaadin.tests.tb3.MultiBrowserTest; +@TestCategory("grid") public class GridSortingIndicatorsTest extends MultiBrowserTest { @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/javascriptcomponent/JavaScriptResizeListenerTest.java b/uitest/src/com/vaadin/tests/components/javascriptcomponent/JavaScriptResizeListenerTest.java new file mode 100644 index 0000000000..92ebc3a335 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/javascriptcomponent/JavaScriptResizeListenerTest.java @@ -0,0 +1,92 @@ +/* + * 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.javascriptcomponent; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +import com.vaadin.testbench.elements.AbstractJavaScriptComponentElement; +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.CheckBoxElement; +import com.vaadin.testbench.parallel.TestCategory; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Re-implementation of Javascript Resize Listener TB2 Test in TB4. + */ +@TestCategory("javascript") +public class JavaScriptResizeListenerTest extends MultiBrowserTest { + + @Test + public void testResizeListener() throws InterruptedException { + openTestURL(); + + // Get handles to relevant elements in page + AbstractJavaScriptComponentElement jsComponent = $( + AbstractJavaScriptComponentElement.class).first(); + + ButtonElement sizeToggleButton = $(ButtonElement.class).first(); + + CheckBoxElement listenerToggleBox = $(CheckBoxElement.class).first(); + + // Make sure we're initialized correctly + assertEquals("Initial state", jsComponent.getText()); + + // Try to use the toggle button - nothing should happen + sizeToggleButton.click(); + Thread.sleep(1000); + assertEquals("Initial state", jsComponent.getText()); + + // Enable the JavaScript resize listener + listenerToggleBox.click(); + + // Vaadin doesn't do a server round-trip here, which means that + // waitForVaadin will fail to Do The Right Thing. Instead, we'll have to + // wait for a bit before resuming execution + Thread.sleep(2500); + + // The listener should change the text to reflect current component size + sizeToggleButton.click(); + Thread.sleep(1000); + assertEquals("Current size is 100 x 100", jsComponent.getText()); + + // Click button to change size + sizeToggleButton.click(); + Thread.sleep(1000); + assertEquals("Current size is 200 x 50", jsComponent.getText()); + + // Click it again to revert to previous state + sizeToggleButton.click(); + Thread.sleep(1000); + assertEquals("Current size is 100 x 100", jsComponent.getText()); + + // Disable the listener + listenerToggleBox.click(); + + // Again, we'll need to sleep for a bit due to waitForVaadin not doing + // the right thing + Thread.sleep(2500); + assertEquals("Listener disabled", jsComponent.getText()); + + // Check that nothing happens when clicking the button again + sizeToggleButton.click(); + Thread.sleep(1000); + assertEquals("Listener disabled", jsComponent.getText()); + + } + +} 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/optiongroup/ReadOnlyOptionGroupTest.java b/uitest/src/com/vaadin/tests/components/optiongroup/ReadOnlyOptionGroupTest.java index dfafe8fb40..090286b1ad 100644 --- a/uitest/src/com/vaadin/tests/components/optiongroup/ReadOnlyOptionGroupTest.java +++ b/uitest/src/com/vaadin/tests/components/optiongroup/ReadOnlyOptionGroupTest.java @@ -38,9 +38,7 @@ public class ReadOnlyOptionGroupTest extends MultiBrowserTest { WebElement checkboxInput = checkbox.findElement(By.tagName("input")); checkboxInput.click(); - Assert.assertFalse("There is a client side exception after unset " - + "readonly mode for option group", - isElementPresent(By.className("v-Notification-error"))); + assertNoErrorNotifications(); Assert.assertFalse("Radio button in option group is still disabled " + "after unset reaonly", diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/OrderedLayoutInfiniteLayoutPasses.java b/uitest/src/com/vaadin/tests/components/orderedlayout/OrderedLayoutInfiniteLayoutPasses.java new file mode 100644 index 0000000000..9c54dbab8d --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/OrderedLayoutInfiniteLayoutPasses.java @@ -0,0 +1,68 @@ +package com.vaadin.tests.components.orderedlayout; + +import com.vaadin.server.Page; +import com.vaadin.server.Page.Styles; +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.HorizontalLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.UI; +import com.vaadin.ui.VerticalLayout; +import com.vaadin.ui.Window; + +@SuppressWarnings("serial") +public class OrderedLayoutInfiniteLayoutPasses extends UI { + + @Override + protected void init(VaadinRequest request) { + VerticalLayout layout = new VerticalLayout(); + layout.addComponent(createOpenWindowButton()); + setContent(layout); + + Styles styles = Page.getCurrent().getStyles(); + styles.add(".my-separator {background-color: lightgray; min-height:2px;max-height:2px} "); + } + + private Button createOpenWindowButton() { + Button button = new Button("Open modal window"); + button.addClickListener(new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + UI.getCurrent().addWindow(createWindow()); + } + }); + return button; + } + + private Window createWindow() { + VerticalLayout contentHolder = new VerticalLayout(); + contentHolder.addComponent(new Label("window content")); + + Label separator = new Label(); + separator.setWidth(100, Unit.PERCENTAGE); + separator.addStyleName("my-separator"); + + HorizontalLayout buttons = new HorizontalLayout(); + buttons.addComponent(new Button("button 1")); + buttons.addComponent(new Button("button 2")); + + VerticalLayout windowContent = new VerticalLayout(); + windowContent.setSizeFull(); + windowContent.addComponent(contentHolder); + windowContent.addComponent(separator); + windowContent.addComponent(buttons); + windowContent.setExpandRatio(contentHolder, 1.0f); + + Window window = new Window(); + window.setModal(true); + window.setWidth(680, Unit.PIXELS); + window.setHeight(700, Unit.PIXELS); + window.setContent(windowContent); + + return window; + } + +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/OrderedLayoutInfiniteLayoutPassesTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/OrderedLayoutInfiniteLayoutPassesTest.java new file mode 100644 index 0000000000..1a2a9cbedf --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/OrderedLayoutInfiniteLayoutPassesTest.java @@ -0,0 +1,72 @@ +/* + * 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.orderedlayout; + +import java.util.List; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.remote.DesiredCapabilities; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.parallel.Browser; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class OrderedLayoutInfiniteLayoutPassesTest extends MultiBrowserTest { + + @Override + protected boolean requireWindowFocusForIE() { + return true; + } + + @Override + public List<DesiredCapabilities> getBrowsersToTest() { + List<DesiredCapabilities> b = super.getBrowsersToTest(); + // Chrome and PhantomJS do not support browser zoom changes + b.remove(Browser.CHROME.getDesiredCapabilities()); + b.remove(Browser.PHANTOMJS.getDesiredCapabilities()); + return b; + } + + @Test + public void ensureFiniteLayoutPhase() throws Exception { + openTestURL("debug"); + zoomBrowserIn(); + try { + $(ButtonElement.class).first().click(); + assertNoErrorNotifications(); + resetZoom(); + assertNoErrorNotifications(); + } finally { + // Reopen test to ensure that modal window does not prevent zoom + // reset from taking place + openTestURL(); + resetZoom(); + } + } + + private void zoomBrowserIn() { + WebElement html = driver.findElement(By.tagName("html")); + html.sendKeys(Keys.chord(Keys.CONTROL, Keys.SUBTRACT)); + } + + private void resetZoom() { + WebElement html = driver.findElement(By.tagName("html")); + html.sendKeys(Keys.chord(Keys.CONTROL, "0")); + } +} diff --git a/uitest/src/com/vaadin/tests/components/popupview/PopupViewWithExtensionTest.java b/uitest/src/com/vaadin/tests/components/popupview/PopupViewWithExtensionTest.java index 4d11190ea9..073fd321e5 100644 --- a/uitest/src/com/vaadin/tests/components/popupview/PopupViewWithExtensionTest.java +++ b/uitest/src/com/vaadin/tests/components/popupview/PopupViewWithExtensionTest.java @@ -15,7 +15,6 @@ */ package com.vaadin.tests.components.popupview; -import org.junit.Assert; import org.junit.Test; import org.openqa.selenium.WebElement; @@ -38,10 +37,7 @@ public class PopupViewWithExtensionTest extends MultiBrowserTest { WebElement view = driver.findElement(By.className("v-popupview")); view.click(); - Assert.assertFalse( - "Popup view with extension should not throw an exception. " - + "(Error notification window is shown).", - isElementPresent(By.className("v-Notification-error"))); + assertNoErrorNotifications(); } } diff --git a/uitest/src/com/vaadin/tests/components/table/ColumnReorderingWithManyColumnsTest.java b/uitest/src/com/vaadin/tests/components/table/ColumnReorderingWithManyColumnsTest.java new file mode 100644 index 0000000000..4a5947c145 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/ColumnReorderingWithManyColumnsTest.java @@ -0,0 +1,38 @@ +package com.vaadin.tests.components.table; + +import static org.junit.Assert.assertEquals; + +import java.io.IOException; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.elements.TableElement; +import com.vaadin.testbench.elements.TableHeaderElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class ColumnReorderingWithManyColumnsTest extends MultiBrowserTest { + @Test + public void testReordering() throws IOException { + openTestURL(); + TableElement table = $(TableElement.class).first(); + TableHeaderElement sourceCell = table.getHeaderCell(0); + TableHeaderElement targetCell = table.getHeaderCell(10); + drag(sourceCell, targetCell); + WebElement markedElement = table.findElement(By + .className("v-table-focus-slot-right")); + String markedColumnName = markedElement.findElement(By.xpath("..")) + .getText(); + assertEquals("col-9", markedColumnName.toLowerCase()); + } + + private void drag(WebElement source, WebElement target) { + Actions actions = new Actions(getDriver()); + actions.moveToElement(source, 10, 10); + actions.clickAndHold(source); + actions.moveToElement(target, 10, 10); + actions.perform(); + } +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/components/table/DndEmptyTableTest.java b/uitest/src/com/vaadin/tests/components/table/DndEmptyTableTest.java index 4c682637b1..6fb0d446d3 100644 --- a/uitest/src/com/vaadin/tests/components/table/DndEmptyTableTest.java +++ b/uitest/src/com/vaadin/tests/components/table/DndEmptyTableTest.java @@ -15,7 +15,6 @@ */ package com.vaadin.tests.components.table; -import org.junit.Assert; import org.junit.Test; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; @@ -42,8 +41,7 @@ public class DndEmptyTableTest extends MultiBrowserTest { Actions actions = new Actions(driver); actions.clickAndHold(source).moveToElement(target).release(); - Assert.assertFalse(isElementPresent(By - .className("v-Notification-error"))); + assertNoErrorNotifications(); } } 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/textfield/RemoveTextChangeListener.java b/uitest/src/com/vaadin/tests/components/textfield/RemoveTextChangeListener.java deleted file mode 100644 index 339160e6ff..0000000000 --- a/uitest/src/com/vaadin/tests/components/textfield/RemoveTextChangeListener.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.vaadin.tests.components.textfield; - -import com.vaadin.event.FieldEvents; -import com.vaadin.server.VaadinRequest; -import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.TextField; - -public class RemoveTextChangeListener extends AbstractTestUI { - @Override - protected void setup(VaadinRequest request) { - final TextField textfield = new TextField(); - - textfield.addTextChangeListener(new FieldEvents.TextChangeListener() { - @Override - public void textChange(FieldEvents.TextChangeEvent event) { - textfield.removeTextChangeListener(this); - } - }); - - addComponent(textfield); - } - - @Override - protected Integer getTicketNumber() { - return 16270; - } - - @Override - protected String getTestDescription() { - return "Removing text change listener on text change event should not reset the input."; - } -} diff --git a/uitest/src/com/vaadin/tests/components/textfield/RemoveTextChangeListenerTest.java b/uitest/src/com/vaadin/tests/components/textfield/RemoveTextChangeListenerTest.java deleted file mode 100644 index 0b876864bc..0000000000 --- a/uitest/src/com/vaadin/tests/components/textfield/RemoveTextChangeListenerTest.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.vaadin.tests.components.textfield; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -import org.junit.Test; - -import com.vaadin.testbench.elements.TextFieldElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -public class RemoveTextChangeListenerTest extends MultiBrowserTest { - - @Test - public void serverValueIsUpdated() { - openTestURL(); - - TextFieldElement textfield = $(TextFieldElement.class).first(); - - textfield.sendKeys("f"); - - assertThat(textfield.getValue(), is("f")); - } - -}
\ No newline at end of file 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/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java index 2e33cc2741..5b05d1d50a 100644 --- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java +++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java @@ -1065,4 +1065,21 @@ public abstract class AbstractTB3Test extends ParallelTest { Assert.assertFalse("Element is present", isElementPresent(by)); } + /** + * Asserts that no error notifications are shown. Requires the use of + * "?debug" as exceptions are otherwise not shown as notifications. + */ + protected void assertNoErrorNotifications() { + Assert.assertTrue( + "Debug window must be open to be able to see error notifications", + isDebugWindowOpen()); + Assert.assertFalse( + "Error notification with client side exception is shown", + isElementPresent(By.className("v-Notification-error"))); + } + + private boolean isDebugWindowOpen() { + return isElementPresent(By.className("v-debugwindow")); + } + } 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/tb3/PrivateTB3Configuration.java b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java index 1c0542b209..7df65829ae 100644 --- a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java +++ b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java @@ -97,7 +97,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { super.setup(); } - private static DesiredCapabilities getRunLocallyCapabilities() { + protected static DesiredCapabilities getRunLocallyCapabilities() { VaadinBrowserFactory factory = new VaadinBrowserFactory(); try { return factory.create(Browser.valueOf(properties.getProperty( @@ -159,7 +159,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { return getConfiguredDeploymentHostname(); } - private boolean isRunLocally() { + protected boolean isRunLocally() { if (properties.containsKey(RUN_LOCALLY_PROPERTY)) { return true; } diff --git a/uitest/src/com/vaadin/tests/tb3/SingleBrowserTest.java b/uitest/src/com/vaadin/tests/tb3/SingleBrowserTest.java index 960d6b8777..b5389d3eec 100644 --- a/uitest/src/com/vaadin/tests/tb3/SingleBrowserTest.java +++ b/uitest/src/com/vaadin/tests/tb3/SingleBrowserTest.java @@ -25,6 +25,9 @@ import com.vaadin.testbench.parallel.Browser; public abstract class SingleBrowserTest extends PrivateTB3Configuration { @Override public List<DesiredCapabilities> getBrowsersToTest() { + if (isRunLocally()) { + return Collections.singletonList(getRunLocallyCapabilities()); + } return Collections.singletonList(Browser.PHANTOMJS .getDesiredCapabilities()); } diff --git a/uitest/src/com/vaadin/tests/themes/LegacyComponentThemeChange.java b/uitest/src/com/vaadin/tests/themes/LegacyComponentThemeChange.java new file mode 100644 index 0000000000..4582123f5f --- /dev/null +++ b/uitest/src/com/vaadin/tests/themes/LegacyComponentThemeChange.java @@ -0,0 +1,101 @@ +/* + * Copyright 2000-2013 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.themes; + +import com.vaadin.annotations.Theme; +import com.vaadin.event.Action; +import com.vaadin.event.Action.Handler; +import com.vaadin.server.ThemeResource; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUIWithLog; +import com.vaadin.tests.util.PersonContainer; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.ComboBox; +import com.vaadin.ui.Embedded; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.MenuBar; +import com.vaadin.ui.Table; +import com.vaadin.ui.VerticalLayout; + +@Theme("reindeer") +public class LegacyComponentThemeChange extends AbstractTestUIWithLog { + + @Override + protected void setup(VaadinRequest request) { + VerticalLayout vl = new VerticalLayout(); + vl.setCaption("Change theme by clicking a button"); + HorizontalLayout hl = new HorizontalLayout(); + for (final String theme : new String[] { "reindeer", "runo" }) { + Button b = new Button(theme); + b.setId(theme + ""); + b.addClickListener(new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + getUI().setTheme(theme); + } + }); + hl.addComponent(b); + } + vl.addComponent(hl); + + // Always wants to use icon from Runo, even if we change theme + ThemeResource alwaysTheSameIconImage = new ThemeResource( + "../runo/icons/16/ok.png"); + ThemeResource varyingIcon = new ThemeResource("menubar-theme-icon.png"); + MenuBar bar = new MenuBar(); + bar.addItem("runo", alwaysTheSameIconImage, null); + bar.addItem("seletedtheme", varyingIcon, null); + + vl.addComponent(bar); + + ComboBox cb = new ComboBox("ComboBox"); + cb.addItem("No icon"); + cb.addItem("Icon"); + cb.setItemIcon("Icon", new ThemeResource("comboboxicon.png")); + cb.setValue("Icon"); + + vl.addComponent(cb); + + Embedded e = new Embedded("embedded"); + e.setMimeType("application/x-shockwave-flash"); + e.setType(Embedded.TYPE_OBJECT); + e.setSource(new ThemeResource("embedded.src")); + vl.addComponent(e); + + Table t = new Table(); + t.addActionHandler(new Handler() { + @Override + public void handleAction(Action action, Object sender, Object target) { + } + + @Override + public Action[] getActions(Object target, Object sender) { + return new Action[] { new Action("Theme icon", + new ThemeResource("action-icon.png")) }; + } + }); + PersonContainer pc = PersonContainer.createWithTestData(); + pc.addNestedContainerBean("address"); + t.setContainerDataSource(pc); + vl.addComponent(t); + + addComponent(vl); + } + +} diff --git a/uitest/src/com/vaadin/tests/themes/LegacyComponentThemeChangeTest.java b/uitest/src/com/vaadin/tests/themes/LegacyComponentThemeChangeTest.java new file mode 100644 index 0000000000..c6593104da --- /dev/null +++ b/uitest/src/com/vaadin/tests/themes/LegacyComponentThemeChangeTest.java @@ -0,0 +1,163 @@ +/* + * Copyright 2000-2013 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.themes; + +import java.util.List; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.remote.DesiredCapabilities; +import org.openqa.selenium.support.ui.ExpectedCondition; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.ComboBoxElement; +import com.vaadin.testbench.elements.EmbeddedElement; +import com.vaadin.testbench.elements.MenuBarElement; +import com.vaadin.testbench.elements.TableElement; +import com.vaadin.testbench.parallel.Browser; +import com.vaadin.testbench.parallel.BrowserUtil; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class LegacyComponentThemeChangeTest extends MultiBrowserTest { + + @Override + public List<DesiredCapabilities> getBrowsersToTest() { + // Seems like stylesheet onload is not fired on PhantomJS + // https://github.com/ariya/phantomjs/issues/12332 + List<DesiredCapabilities> l = getBrowsersExcludingPhantomJS(); + + // For some reason, IE times out when trying to open the combobox, + // #18341 + l.remove(Browser.IE11.getDesiredCapabilities()); + return l; + } + + @Test + public void legacyComponentThemeResourceChange() { + openTestURL(); + String theme = "reindeer"; + assertMenubarTheme(theme); + assertCombobBoxTheme(theme); + assertTableTheme(theme); + assertEmbeddedTheme(theme); + + theme = "runo"; + changeTheme(theme); + assertMenubarTheme(theme); + assertCombobBoxTheme(theme); + assertTableTheme(theme); + assertEmbeddedTheme(theme); + + theme = "reindeer"; + changeTheme(theme); + assertMenubarTheme(theme); + assertCombobBoxTheme(theme); + assertTableTheme(theme); + assertEmbeddedTheme(theme); + + } + + private void assertEmbeddedTheme(String theme) { + if (BrowserUtil.isIE8(getDesiredCapabilities())) { + // IE8 won't initialize the dummy flash properly + return; + } + EmbeddedElement e = $(EmbeddedElement.class).first(); + WebElement movieParam = e.findElement(By + .xpath(".//param[@name='movie']")); + WebElement embed = e.findElement(By.xpath(".//embed")); + assertAttributePrefix(movieParam, "value", theme); + assertAttributePrefix(embed, "src", theme); + assertAttributePrefix(embed, "movie", theme); + } + + private void assertTableTheme(String theme) { + TableElement t = $(TableElement.class).first(); + t.getRow(0).contextClick(); + WebElement popup = findElement(By.className("v-contextmenu")); + + WebElement actionImage = popup.findElement(By.xpath(".//img")); + assertAttributePrefix(actionImage, "src", theme); + } + + private void assertCombobBoxTheme(String theme) { + ComboBoxElement cb = $(ComboBoxElement.class).first(); + WebElement selectedImage = cb.findElement(By.xpath("./img")); + assertAttributePrefix(selectedImage, "src", theme); + + cb.openPopup(); + WebElement popup = findElement(By + .className("v-filterselect-suggestpopup")); + WebElement itemImage = popup.findElement(By.xpath(".//img")); + assertAttributePrefix(itemImage, "src", theme); + } + + private void assertMenubarTheme(String theme) { + // The runoImage must always come from Runo + WebElement runoImage = $(MenuBarElement.class).first().findElement( + By.xpath(".//span[text()='runo']/img")); + String runoImageSrc = runoImage.getAttribute("src"); + + // Something in Selenium normalizes the image so it becomes + // "/themes/runo/icons/16/ok.png" here although it is + // "/themes/<currenttheme>/../runo/icons/16/ok.png" in the browser + Assert.assertEquals(getThemeURL("runo") + "icons/16/ok.png", + runoImageSrc); + + // The other image should change with the theme + WebElement themeImage = $(MenuBarElement.class).first().findElement( + By.xpath(".//span[text()='seletedtheme']/img")); + assertAttributePrefix(themeImage, "src", theme); + } + + private void assertAttributePrefix(WebElement element, String attribute, + String theme) { + String value = element.getAttribute(attribute); + String expectedPrefix = getThemeURL(theme); + Assert.assertTrue("Attribute " + attribute + "='" + value + + "' does not start with " + expectedPrefix, + value.startsWith(expectedPrefix)); + + } + + private String getThemeURL(String theme) { + return getBaseURL() + "/VAADIN/themes/" + theme + "/"; + } + + private void changeTheme(String theme) { + $(ButtonElement.class).id(theme).click(); + waitForThemeToChange(theme); + } + + private void waitForThemeToChange(final String theme) { + + final WebElement rootDiv = findElement(By + .xpath("//div[contains(@class,'v-app')]")); + waitUntil(new ExpectedCondition<Boolean>() { + + @Override + public Boolean apply(WebDriver input) { + String rootClass = rootDiv.getAttribute("class").trim(); + + return rootClass.contains(theme); + } + }, 30); + } + +} diff --git a/uitest/src/com/vaadin/tests/themes/base/DisabledMenuBarItemTest.java b/uitest/src/com/vaadin/tests/themes/base/DisabledMenuBarItemTest.java index bec28d7929..3a5ddf5f3b 100644 --- a/uitest/src/com/vaadin/tests/themes/base/DisabledMenuBarItemTest.java +++ b/uitest/src/com/vaadin/tests/themes/base/DisabledMenuBarItemTest.java @@ -21,19 +21,17 @@ public class DisabledMenuBarItemTest extends MultiBrowserTest { WebElement element = driver.findElement(By .className("v-menubar-menuitem-disabled")); - assertThat(element.getCssValue("opacity"), is("0.5")); - - if (browserIsIE8or9()) { + if (Browser.IE9.getDesiredCapabilities().equals( + getDesiredCapabilities())) { assertThat(element.getCssValue("filter"), is("alpha(opacity=50)")); + } else if (Browser.IE8.getDesiredCapabilities().equals( + getDesiredCapabilities())) { + WebElement icon = element.findElement(By.tagName("img")); + assertThat(icon.getCssValue("filter"), is("alpha(opacity=50)")); + } else { + assertThat(element.getCssValue("opacity"), is("0.5")); } compareScreen("transparent"); } - - private boolean browserIsIE8or9() { - return Browser.IE8.getDesiredCapabilities().equals( - getDesiredCapabilities()) - || Browser.IE9.getDesiredCapabilities().equals( - getDesiredCapabilities()); - } }
\ No newline at end of file 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()) { diff --git a/uitest/tb2/com/vaadin/tests/components/combobox/ComboBoxBorder.html b/uitest/tb2/com/vaadin/tests/components/combobox/ComboBoxBorder.html deleted file mode 100644 index bb83cbc097..0000000000 --- a/uitest/tb2/com/vaadin/tests/components/combobox/ComboBoxBorder.html +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="http://localhost:8888/" /> -<title>ComboBoxBorder</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">ComboBoxBorder</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/ComboBoxBorder?restartApplication</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runComboBoxBorder::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]#textbox</td> - <td>53,10</td> -</tr> -<tr> - <td>pressSpecialKey</td> - <td>vaadin=runComboBoxBorder::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]#textbox</td> - <td>down</td> -</tr> -<tr> - <td>pressSpecialKey</td> - <td>vaadin=runComboBoxBorder::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]#textbox</td> - <td>down</td> -</tr> -<tr> - <td>pressSpecialKey</td> - <td>vaadin=runComboBoxBorder::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]#textbox</td> - <td>enter</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td></td> -</tr> - -</tbody></table> -</body> -</html> diff --git a/uitest/tb2/com/vaadin/tests/components/javascriptcomponent/JavaScriptResizeListener.html b/uitest/tb2/com/vaadin/tests/components/javascriptcomponent/JavaScriptResizeListener.html deleted file mode 100644 index 53af1d4ceb..0000000000 --- a/uitest/tb2/com/vaadin/tests/components/javascriptcomponent/JavaScriptResizeListener.html +++ /dev/null @@ -1,81 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="" /> -<title>New Test</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.javascriptcomponent.JavaScriptResizeListener?restartApplication&debug</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsjavascriptcomponentJavaScriptResizeListener::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VCssLayout[0]/JavaScriptWidget[0]</td> - <td>Initial state</td> -</tr> -<!--Changing size has no effect without listener--> -<tr> - <td>click</td> - <td>vaadin=runcomvaadintestscomponentsjavascriptcomponentJavaScriptResizeListener::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsjavascriptcomponentJavaScriptResizeListener::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VCssLayout[0]/JavaScriptWidget[0]</td> - <td>Initial state</td> -</tr> -<!--Reports the size when the listener is added--> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsjavascriptcomponentJavaScriptResizeListener::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VCheckBox[0]/domChild[0]</td> - <td>52,4</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsjavascriptcomponentJavaScriptResizeListener::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VCssLayout[0]/JavaScriptWidget[0]</td> - <td>Current size is 200 x 50</td> -</tr> -<!--Size change is detected when listener is active--> -<tr> - <td>click</td> - <td>vaadin=runcomvaadintestscomponentsjavascriptcomponentJavaScriptResizeListener::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsjavascriptcomponentJavaScriptResizeListener::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VCssLayout[0]/JavaScriptWidget[0]</td> - <td>Current size is 100 x 100</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsjavascriptcomponentJavaScriptResizeListener::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VCheckBox[0]/domChild[0]</td> - <td>69,2</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsjavascriptcomponentJavaScriptResizeListener::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VCssLayout[0]/JavaScriptWidget[0]</td> - <td>Listener disabled</td> -</tr> -<!--Nothing happens when changing size after removing listener--> -<tr> - <td>click</td> - <td>vaadin=runcomvaadintestscomponentsjavascriptcomponentJavaScriptResizeListener::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsjavascriptcomponentJavaScriptResizeListener::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VCssLayout[0]/JavaScriptWidget[0]</td> - <td>Listener disabled</td> -</tr> - -</tbody></table> -</body> -</html> diff --git a/uitest/tb2/com/vaadin/tests/components/table/ColumnReorderingWithManyColumns.html b/uitest/tb2/com/vaadin/tests/components/table/ColumnReorderingWithManyColumns.html deleted file mode 100644 index 5b5c83e629..0000000000 --- a/uitest/tb2/com/vaadin/tests/components/table/ColumnReorderingWithManyColumns.html +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="http://localhost:8068/" /> -<title>ColumnReorderingWithManyColumns</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">ColumnReorderingWithManyColumns</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/ColumnReorderingWithManyColumns?restartApplication</td> - <td></td> -</tr> -<tr> - <td>drag</td> - <td>vaadin=runColumnReorderingWithManyColumns::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/</td> - <td>10,10</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runColumnReorderingWithManyColumns::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[10]/domChild[2]</td> - <td>10,10</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td></td> -</tr> -<tr> - <td>drop</td> - <td>vaadin=runColumnReorderingWithManyColumns::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[10]/domChild[2]</td> - <td>10,10</td> -</tr> - -</tbody></table> -</body> -</html> diff --git a/widgets/build.xml b/widgets/build.xml index d796c7f159..63317fb5ad 100644 --- a/widgets/build.xml +++ b/widgets/build.xml @@ -49,7 +49,7 @@ <include name="com/vaadin/client/Profiler.java" /> <include name="com/vaadin/client/StyleConstants.java" /> <include name="com/vaadin/client/WidgetUtil.java" /> - <include name="com/vaadin/client/FocusUtil.java" /> + <include name="com/vaadin/client/ui/FocusUtil.java" /> <include name="com/vaadin/client/data/**/*.java" /> <include name="com/vaadin/client/widget/**/*.java" /> <include name="com/vaadin/client/Focusable.java" /> |