Change-Id: I0efe8538f2472d1a6cf5ec10aadcde13ed39f9adtags/7.3.0.beta1^0
} | } | ||||
.#{$primaryStyleName}-popup { | .#{$primaryStyleName}-popup { | ||||
background: #fff; | background: #fff; | ||||
.v-ie9 &, .v-ie10 &, .v-ie11 & { | |||||
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, .5); | |||||
} | |||||
} | } | ||||
.#{$primaryStyleName}-popupcalendar input.#{$primaryStyleName}-textfield { | .#{$primaryStyleName}-popupcalendar input.#{$primaryStyleName}-textfield { | ||||
-webkit-box-sizing: border-box; | -webkit-box-sizing: border-box; |
.v-contextmenu, | .v-contextmenu, | ||||
.v-Notification, | .v-Notification, | ||||
.v-menubar-submenu { | .v-menubar-submenu { | ||||
background: #fff url(../img/grad-light-top.png) repeat-x; | |||||
background-color: rgba(255,255,255,.85); | |||||
border: 1px solid #adadad; | border: 1px solid #adadad; | ||||
border-color: rgba(0,0,0,.4); | border-color: rgba(0,0,0,.4); | ||||
border-radius: 4px; | border-radius: 4px; | ||||
-moz-border-radius: 4px; | -moz-border-radius: 4px; | ||||
overflow: hidden; | overflow: hidden; | ||||
} | } | ||||
.v-window, | |||||
.v-popupview-popup, | |||||
.v-filterselect-suggestpopup, | |||||
.v-datefield-popup, | |||||
.v-contextmenu, | |||||
.v-menubar-submenu{ | |||||
background: rgba(232,232,232,.90) url(../img/grad-light-top.png) repeat-x; | |||||
} | |||||
.v-filterselect-suggestpopup, | .v-filterselect-suggestpopup, | ||||
.v-contextmenu, | .v-contextmenu, | ||||
.v-menubar-submenu { | .v-menubar-submenu { |
.v-window | .v-window | ||||
.v-datefield-popup, | .v-datefield-popup, | ||||
.v-filterselect-suggestpopup, | .v-filterselect-suggestpopup, | ||||
.v-menubar-menuitem, | |||||
.v-slider-popup, | |||||
.v-tooltip-text, | |||||
.v-menubar-popup, | |||||
.v-slider-feedback, | |||||
.v-popupview-popup, | .v-popupview-popup, | ||||
.v-contextmenu { | .v-contextmenu { | ||||
box-shadow: 0 2px 5px 0 rgba(0,0,0, .28); | box-shadow: 0 2px 5px 0 rgba(0,0,0, .28); |
</init-param> | </init-param> | ||||
<async-supported>true</async-supported> | <async-supported>true</async-supported> | ||||
</servlet> | </servlet> | ||||
<servlet> | |||||
<servlet-name>GwtRpcTest</servlet-name> | |||||
<servlet-class>com.vaadin.tests.widgetset.server.gwtrpc.GwtRpcServletTest</servlet-class> | |||||
</servlet> | |||||
<servlet> | <servlet> | ||||
<servlet-name>UI provider app</servlet-name> | <servlet-name>UI provider app</servlet-name> | ||||
<servlet-class>com.vaadin.server.VaadinServlet</servlet-class> | <servlet-class>com.vaadin.server.VaadinServlet</servlet-class> | ||||
<param-value>false</param-value> | <param-value>false</param-value> | ||||
</init-param> | </init-param> | ||||
</servlet> | </servlet> | ||||
<servlet-mapping> | <servlet-mapping> | ||||
<servlet-name>Embed App 1</servlet-name> | <servlet-name>Embed App 1</servlet-name> | ||||
<url-pattern>/embed1/*</url-pattern> | <url-pattern>/embed1/*</url-pattern> | ||||
</servlet-mapping> | </servlet-mapping> | ||||
<servlet-mapping> | <servlet-mapping> | ||||
<servlet-name>Embed App 2</servlet-name> | <servlet-name>Embed App 2</servlet-name> | ||||
<url-pattern>/embed2/*</url-pattern> | <url-pattern>/embed2/*</url-pattern> | ||||
</servlet-mapping> | </servlet-mapping> | ||||
<servlet-mapping> | |||||
<servlet-name>GwtRpcTest</servlet-name> | |||||
<url-pattern>/VAADIN/widgetsets/com.vaadin.tests.widgetset.TestingWidgetSet/GwtRpcTest/*</url-pattern> | |||||
</servlet-mapping> | |||||
<servlet-mapping> | <servlet-mapping> | ||||
<servlet-name>UI provider app</servlet-name> | <servlet-name>UI provider app</servlet-name> |
vaadin.url=http://vaadin.com | vaadin.url=http://vaadin.com | ||||
vaadin.java.version=1.6 | vaadin.java.version=1.6 | ||||
vaadin.version=0.0.0.unversioned-development-build | vaadin.version=0.0.0.unversioned-development-build | ||||
vaadin.sass.version=0.9.7 | |||||
vaadin.sass.version=0.9.8 | |||||
gwt.version=2.6.0.vaadin3 | gwt.version=2.6.0.vaadin3 | ||||
commons-io.version=2.4 | commons-io.version=2.4 |
/* | /* | ||||
* Copyright 2000-2014 Vaadin Ltd. | * Copyright 2000-2014 Vaadin Ltd. | ||||
* | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | * 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 | * use this file except in compliance with the License. You may obtain a copy of | ||||
* the License at | * the License at | ||||
* | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | * http://www.apache.org/licenses/LICENSE-2.0 | ||||
* | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | * Unless required by applicable law or agreed to in writing, software | ||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||||
* zero overhead unless enabled. To enable profiling, add | * zero overhead unless enabled. To enable profiling, add | ||||
* <code><set-property name="vaadin.profiler" value="true" /></code> to | * <code><set-property name="vaadin.profiler" value="true" /></code> to | ||||
* your .gwt.xml file. | * your .gwt.xml file. | ||||
* | |||||
* | |||||
* @author Vaadin Ltd | * @author Vaadin Ltd | ||||
* @since 7.0.0 | * @since 7.0.0 | ||||
*/ | */ | ||||
public class Profiler { | public class Profiler { | ||||
/** | /** | ||||
* Class to include using deferred binding to enable the profiling. | * Class to include using deferred binding to enable the profiling. | ||||
* | |||||
* | |||||
* @author Vaadin Ltd | * @author Vaadin Ltd | ||||
* @since 7.0.0 | * @since 7.0.0 | ||||
*/ | */ | ||||
/** | /** | ||||
* Checks whether the profiling gathering is enabled. | * Checks whether the profiling gathering is enabled. | ||||
* | |||||
* | |||||
* @return <code>true</code> if the profiling is enabled, else | * @return <code>true</code> if the profiling is enabled, else | ||||
* <code>false</code> | * <code>false</code> | ||||
*/ | */ | ||||
* Enters a named block. There should always be a matching invocation of | * Enters a named block. There should always be a matching invocation of | ||||
* {@link #leave(String)} when leaving the block. Calls to this method will | * {@link #leave(String)} when leaving the block. Calls to this method will | ||||
* be removed by the compiler unless profiling is enabled. | * be removed by the compiler unless profiling is enabled. | ||||
* | |||||
* | |||||
* @param name | * @param name | ||||
* the name of the entered block | * the name of the entered block | ||||
*/ | */ | ||||
* Leaves a named block. There should always be a matching invocation of | * Leaves a named block. There should always be a matching invocation of | ||||
* {@link #enter(String)} when entering the block. Calls to this method will | * {@link #enter(String)} when entering the block. Calls to this method will | ||||
* be removed by the compiler unless profiling is enabled. | * be removed by the compiler unless profiling is enabled. | ||||
* | |||||
* | |||||
* @param name | * @param name | ||||
* the name of the left block | * the name of the left block | ||||
*/ | */ | ||||
* enabled because it will then remove a logger function that might have | * enabled because it will then remove a logger function that might have | ||||
* been included in the HTML page and that would leak memory unless removed. | * been included in the HTML page and that would leak memory unless removed. | ||||
* </p> | * </p> | ||||
* | |||||
* | |||||
* @since 7.0.2 | * @since 7.0.2 | ||||
*/ | */ | ||||
public static void initialize() { | public static void initialize() { | ||||
/** | /** | ||||
* Overridden in {@link EnabledProfiler} to make {@link #isEnabled()} return | * Overridden in {@link EnabledProfiler} to make {@link #isEnabled()} return | ||||
* true if GWT.create returns that class. | * true if GWT.create returns that class. | ||||
* | |||||
* | |||||
* @return <code>true</code> if the profiling is enabled, else | * @return <code>true</code> if the profiling is enabled, else | ||||
* <code>false</code> | * <code>false</code> | ||||
*/ | */ | ||||
if (typeof $wnd.__gwtStatsEvent != 'function') { | if (typeof $wnd.__gwtStatsEvent != 'function') { | ||||
if (typeof $wnd.vaadin.gwtStatsEvents != 'object') { | if (typeof $wnd.vaadin.gwtStatsEvents != 'object') { | ||||
$wnd.vaadin.gwtStatsEvents = []; | $wnd.vaadin.gwtStatsEvents = []; | ||||
} | |||||
} | |||||
$wnd.__gwtStatsEvent = function(event) { | $wnd.__gwtStatsEvent = function(event) { | ||||
$wnd.vaadin.gwtStatsEvents.push(event); | $wnd.vaadin.gwtStatsEvents.push(event); | ||||
return true; | return true; | ||||
if (typeof $wnd.vaadin.gwtStatsEvents == 'object') { | if (typeof $wnd.vaadin.gwtStatsEvents == 'object') { | ||||
delete $wnd.vaadin.gwtStatsEvents; | delete $wnd.vaadin.gwtStatsEvents; | ||||
if (typeof $wnd.__gwtStatsEvent == 'function') { | if (typeof $wnd.__gwtStatsEvent == 'function') { | ||||
$wnd.__gwtStatsEvent = function(){}; | |||||
$wnd.__gwtStatsEvent = function() { return true; }; | |||||
} | } | ||||
} | |||||
} | |||||
}-*/; | }-*/; | ||||
private static native JsArray<GwtStatsEvent> clearEventsList() | private static native JsArray<GwtStatsEvent> clearEventsList() | ||||
* <p> | * <p> | ||||
* <b>Warning!</b> This is internal API and should not be used by | * <b>Warning!</b> This is internal API and should not be used by | ||||
* applications or add-ons. | * applications or add-ons. | ||||
* | |||||
* | |||||
* @since 7.1.4 | * @since 7.1.4 | ||||
* @param profilerResultConsumer | * @param profilerResultConsumer | ||||
* the consumer that gets profiler data | * the consumer that gets profiler data |
import com.vaadin.shared.communication.ServerRpc; | import com.vaadin.shared.communication.ServerRpc; | ||||
import com.vaadin.shared.communication.SharedState; | import com.vaadin.shared.communication.SharedState; | ||||
import com.vaadin.shared.ui.ComponentStateUtil; | import com.vaadin.shared.ui.ComponentStateUtil; | ||||
import com.vaadin.ui.Component; | |||||
import com.vaadin.ui.Component.Event; | import com.vaadin.ui.Component.Event; | ||||
import com.vaadin.ui.HasComponents; | import com.vaadin.ui.HasComponents; | ||||
import com.vaadin.ui.LegacyComponent; | import com.vaadin.ui.LegacyComponent; | ||||
} | } | ||||
} | } | ||||
private static final class AllChildrenIterable implements | |||||
Iterable<ClientConnector>, Serializable { | |||||
private final ClientConnector connector; | |||||
private AllChildrenIterable(ClientConnector connector) { | |||||
this.connector = connector; | |||||
} | |||||
@Override | |||||
public Iterator<ClientConnector> iterator() { | |||||
CombinedIterator<ClientConnector> iterator = new CombinedIterator<ClientConnector>(); | |||||
if (connector instanceof HasComponents) { | |||||
HasComponents hasComponents = (HasComponents) connector; | |||||
iterator.addIterator(hasComponents.iterator()); | |||||
} | |||||
Collection<Extension> extensions = connector.getExtensions(); | |||||
if (extensions.size() > 0) { | |||||
iterator.addIterator(extensions.iterator()); | |||||
} | |||||
return iterator; | |||||
} | |||||
} | |||||
private class RpcInvocationHandler implements InvocationHandler, | private class RpcInvocationHandler implements InvocationHandler, | ||||
Serializable { | Serializable { | ||||
} | } | ||||
} | } | ||||
private static final class CombinedIterator<T> implements Iterator<T>, | |||||
Serializable { | |||||
private final Collection<Iterator<? extends T>> iterators = new ArrayList<Iterator<? extends T>>(); | |||||
public void addIterator(Iterator<? extends T> iterator) { | |||||
iterators.add(iterator); | |||||
} | |||||
@Override | |||||
public boolean hasNext() { | |||||
for (Iterator<? extends T> i : iterators) { | |||||
if (i.hasNext()) { | |||||
return true; | |||||
} | |||||
} | |||||
return false; | |||||
} | |||||
@Override | |||||
public T next() { | |||||
for (Iterator<? extends T> i : iterators) { | |||||
if (i.hasNext()) { | |||||
return i.next(); | |||||
} | |||||
} | |||||
throw new NoSuchElementException(); | |||||
} | |||||
@Override | |||||
public void remove() { | |||||
throw new UnsupportedOperationException(); | |||||
} | |||||
} | |||||
/** | /** | ||||
* Get an Iterable for iterating over all child connectors, including both | * Get an Iterable for iterating over all child connectors, including both | ||||
* extensions and child components. | * extensions and child components. | ||||
* the connector to get children for | * the connector to get children for | ||||
* @return an Iterable giving all child connectors. | * @return an Iterable giving all child connectors. | ||||
*/ | */ | ||||
public static Iterable<ClientConnector> getAllChildrenIterable( | |||||
public static Iterable<? extends ClientConnector> getAllChildrenIterable( | |||||
final ClientConnector connector) { | final ClientConnector connector) { | ||||
return new AllChildrenIterable(connector); | |||||
Collection<Extension> extensions = connector.getExtensions(); | |||||
boolean hasComponents = connector instanceof HasComponents; | |||||
boolean hasExtensions = extensions.size() > 0; | |||||
if (!hasComponents && !hasExtensions) { | |||||
// If has neither component nor extensions, return immutable empty | |||||
// list as iterable. | |||||
return Collections.emptyList(); | |||||
} | |||||
if (hasComponents && !hasExtensions) { | |||||
// only components | |||||
return (HasComponents) connector; | |||||
} | |||||
if (!hasComponents && hasExtensions) { | |||||
// only extensions | |||||
return extensions; | |||||
} | |||||
// combine the iterators of extensions and components to a new iterable. | |||||
final Iterator<Component> componentsIterator = ((HasComponents) connector) | |||||
.iterator(); | |||||
final Iterator<Extension> extensionsIterator = extensions.iterator(); | |||||
Iterable<? extends ClientConnector> combinedIterable = new Iterable<ClientConnector>() { | |||||
@Override | |||||
public Iterator<ClientConnector> iterator() { | |||||
return new Iterator<ClientConnector>() { | |||||
@Override | |||||
public boolean hasNext() { | |||||
return componentsIterator.hasNext() | |||||
|| extensionsIterator.hasNext(); | |||||
} | |||||
@Override | |||||
public ClientConnector next() { | |||||
if (componentsIterator.hasNext()) { | |||||
return componentsIterator.next(); | |||||
} | |||||
if (extensionsIterator.hasNext()) { | |||||
return extensionsIterator.next(); | |||||
} | |||||
throw new NoSuchElementException(); | |||||
} | |||||
@Override | |||||
public void remove() { | |||||
throw new UnsupportedOperationException(); | |||||
} | |||||
}; | |||||
} | |||||
}; | |||||
return combinedIterable; | |||||
} | } | ||||
@Override | @Override |
ClientConnector connector = stack.pop(); | ClientConnector connector = stack.pop(); | ||||
danglingConnectors.remove(connector); | danglingConnectors.remove(connector); | ||||
Iterable<ClientConnector> children = AbstractClientConnector | |||||
Iterable<? extends ClientConnector> children = AbstractClientConnector | |||||
.getAllChildrenIterable(connector); | .getAllChildrenIterable(connector); | ||||
for (ClientConnector child : children) { | for (ClientConnector child : children) { | ||||
stack.add(child); | stack.add(child); |
"com\\.vaadin\\.sass.*", // | "com\\.vaadin\\.sass.*", // | ||||
"com\\.vaadin\\.testbench.*", // | "com\\.vaadin\\.testbench.*", // | ||||
"com\\.vaadin\\.util\\.CurrentInstance\\$1", // | "com\\.vaadin\\.util\\.CurrentInstance\\$1", // | ||||
"com\\.vaadin\\.server\\.AbstractClientConnector\\$1", // | |||||
"com\\.vaadin\\.server\\.AbstractClientConnector\\$1\\$1", // | |||||
"com\\.vaadin\\.server\\.JsonCodec\\$1", // | "com\\.vaadin\\.server\\.JsonCodec\\$1", // | ||||
"com\\.vaadin\\.server\\.communication\\.PushConnection", // | "com\\.vaadin\\.server\\.communication\\.PushConnection", // | ||||
"com\\.vaadin\\.server\\.communication\\.AtmospherePushConnection", // | "com\\.vaadin\\.server\\.communication\\.AtmospherePushConnection", // |
assertPopupOpen(true); | assertPopupOpen(true); | ||||
// Close the popup and change the locale. | // Close the popup and change the locale. | ||||
toggleDatePopup(); | |||||
toggleDatePopupWorkaroundClosePopupIE(); | |||||
assertPopupOpen(false); | assertPopupOpen(false); | ||||
driver.findElement(By.className("v-button")).click(); // Locale change. | driver.findElement(By.className("v-button")).click(); // Locale change. | ||||
driver.findElement(By.className("v-datefield-button")).click(); | driver.findElement(By.className("v-datefield-button")).click(); | ||||
} | } | ||||
/* | |||||
* Work around bug reported in ticket #14086. Delete this method once fixed | |||||
* andd use toggleDatePopup() instead. | |||||
*/ | |||||
private void toggleDatePopupWorkaroundClosePopupIE() { | |||||
if (!BrowserUtil.isIE(getDesiredCapabilities())) { | |||||
driver.findElement(By.className("v-datefield-button")).click(); | |||||
} else { | |||||
boolean popupOpen = driver.findElements( | |||||
By.className("v-datefield-popup")).size() == 1; | |||||
if (popupOpen) { | |||||
driver.findElement( | |||||
By.className("v-datefield-calendarpanel-day-selected")) | |||||
.click(); | |||||
} else { | |||||
driver.findElement(By.className("v-datefield-button")).click(); | |||||
} | |||||
} | |||||
} | |||||
private String getDateValue() { | private String getDateValue() { | ||||
return driver.findElement(By.className("v-datefield-textfield")) | return driver.findElement(By.className("v-datefield-textfield")) | ||||
.getAttribute("value"); | .getAttribute("value"); |
/* | |||||
* 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.widgetset.client.gwtrpc; | |||||
import java.util.logging.Level; | |||||
import java.util.logging.Logger; | |||||
import com.google.gwt.core.shared.GWT; | |||||
import com.google.gwt.event.dom.client.ClickEvent; | |||||
import com.google.gwt.event.dom.client.ClickHandler; | |||||
import com.google.gwt.user.client.rpc.AsyncCallback; | |||||
import com.google.gwt.user.client.ui.Button; | |||||
import com.google.gwt.user.client.ui.DialogBox; | |||||
import com.google.gwt.user.client.ui.Label; | |||||
import com.vaadin.client.ui.AbstractComponentConnector; | |||||
import com.vaadin.shared.ui.Connect; | |||||
import com.vaadin.tests.widgetset.server.gwtrpc.GwtRpcButton; | |||||
/** | |||||
* Dummy connector to test our Vaadin/GWT RPC bug. In a Vaadin environment with | |||||
* DevMode enabled, a pure GWT RPC call would throw an exception. See #11709. | |||||
* | |||||
* @author Vaadin Ltd | |||||
*/ | |||||
@SuppressWarnings("serial") | |||||
@Connect(GwtRpcButton.class) | |||||
public class GwtRpcButtonConnector extends AbstractComponentConnector { | |||||
static Logger logger = Logger.getLogger(GwtRpcButtonConnector.class | |||||
.getName()); | |||||
static { | |||||
logger.setLevel(Level.ALL); | |||||
} | |||||
@Override | |||||
public Button getWidget() { | |||||
return (Button) super.getWidget(); | |||||
} | |||||
@Override | |||||
protected Button createWidget() { | |||||
return GWT.create(Button.class); | |||||
} | |||||
private void log(String message) { | |||||
logger.log(Level.INFO, message); | |||||
} | |||||
@Override | |||||
public void init() { | |||||
super.init(); | |||||
log("GwtRpcButtonTestConnector init"); | |||||
getWidget().setText("Click me"); | |||||
getWidget().addClickHandler(new ClickHandler() { | |||||
@Override | |||||
public void onClick(ClickEvent event) { | |||||
doRPC(); | |||||
} | |||||
}); | |||||
} | |||||
/** | |||||
* The ID of the label in case the test is successful. | |||||
*/ | |||||
public static final String SUCCESS_LABEL_ID = "yes"; | |||||
/** | |||||
* The ID of the label in case the test failed. | |||||
*/ | |||||
public static final String FAIL_LABEL_ID = "no"; | |||||
/* | |||||
* Make an RPC to test our bug. | |||||
*/ | |||||
private void doRPC() { | |||||
log("GwtRpcButtonTestConnector onClick"); | |||||
GwtRpcServiceTestAsync service = GWT.create(GwtRpcServiceTest.class); | |||||
service.giveMeThat("honey", "sugar", new AsyncCallback<String>() { | |||||
@Override | |||||
public void onSuccess(String result) { | |||||
showResult(result, SUCCESS_LABEL_ID); | |||||
} | |||||
@Override | |||||
public void onFailure(Throwable caught) { | |||||
showResult(caught.getMessage(), FAIL_LABEL_ID); | |||||
} | |||||
/* | |||||
* Show the result box. | |||||
*/ | |||||
private void showResult(String result, String labelID) { | |||||
DialogBox box = new DialogBox(true); | |||||
Label label = new Label(result); | |||||
label.getElement().setId(labelID); | |||||
box.add(label); | |||||
box.center(); | |||||
box.show(); | |||||
} | |||||
}); | |||||
} | |||||
} |
/* | |||||
* 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.widgetset.client.gwtrpc; | |||||
import com.google.gwt.user.client.rpc.RemoteService; | |||||
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; | |||||
/** | |||||
* Test GWT RPC in Vaadin DevMode. | |||||
* | |||||
* @author Vaadin Ltd | |||||
*/ | |||||
@RemoteServiceRelativePath("GwtRpcTest") | |||||
public interface GwtRpcServiceTest extends RemoteService { | |||||
/* | |||||
* Dummy method to verify if RPC works. | |||||
*/ | |||||
String giveMeThat(String that, String haveThis); | |||||
} |
/* | |||||
* 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.widgetset.client.gwtrpc; | |||||
import com.google.gwt.user.client.rpc.AsyncCallback; | |||||
/** | |||||
* Test GWT RPC in Vaadin DevMode. | |||||
* | |||||
* @author Vaadin Ltd | |||||
*/ | |||||
public interface GwtRpcServiceTestAsync { | |||||
/* | |||||
* Dummy async method to verify if RPC works. | |||||
*/ | |||||
void giveMeThat(String that, String haveThis, AsyncCallback<String> callback); | |||||
} |
/* | |||||
* 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.widgetset.server.gwtrpc; | |||||
import com.vaadin.annotations.Widgetset; | |||||
import com.vaadin.server.VaadinRequest; | |||||
import com.vaadin.tests.components.AbstractTestUI; | |||||
import com.vaadin.tests.widgetset.TestingWidgetSet; | |||||
/** | |||||
* Test the GWT RPC with Vaadin DevMode. See #11709. | |||||
* | |||||
* @author Vaadin Ltd | |||||
*/ | |||||
@SuppressWarnings("serial") | |||||
@Widgetset(TestingWidgetSet.NAME) | |||||
public class GwtRpc extends AbstractTestUI { | |||||
/** | |||||
* Id of the button triggering the test case. | |||||
*/ | |||||
public final static String BUTTON_ID = "gwtRpcButton"; | |||||
@Override | |||||
protected void setup(VaadinRequest request) { | |||||
GwtRpcButton button = new GwtRpcButton(); | |||||
button.setId(BUTTON_ID); | |||||
button.setCaption("Press me"); | |||||
addComponent(button); | |||||
} | |||||
@Override | |||||
protected String getTestDescription() { | |||||
return "Cannot call RPC in development mode"; | |||||
} | |||||
@Override | |||||
protected Integer getTicketNumber() { | |||||
return 11709; | |||||
} | |||||
} |
/* | |||||
* 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.widgetset.server.gwtrpc; | |||||
import com.vaadin.ui.AbstractComponent; | |||||
/** | |||||
* Dummy client connector to link with the client functionality where the GWT | |||||
* RPC is triggered. | |||||
* | |||||
* @since | |||||
* @author Vaadin Ltd | |||||
*/ | |||||
@SuppressWarnings("serial") | |||||
public class GwtRpcButton extends AbstractComponent { | |||||
} |
/* | |||||
* 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.widgetset.server.gwtrpc; | |||||
import com.google.gwt.user.server.rpc.RemoteServiceServlet; | |||||
import com.vaadin.tests.widgetset.client.gwtrpc.GwtRpcServiceTest; | |||||
/** | |||||
* Test GWT RPC in Vaadin DevMode. | |||||
* | |||||
* @author Vaadin Ltd | |||||
*/ | |||||
@SuppressWarnings("serial") | |||||
public class GwtRpcServletTest extends RemoteServiceServlet implements | |||||
GwtRpcServiceTest { | |||||
@Override | |||||
public String giveMeThat(String that, String haveThis) { | |||||
return "Take " + that + " for " + haveThis; | |||||
} | |||||
} |
/* | |||||
* 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.widgetset.server.gwtrpc; | |||||
import org.junit.Test; | |||||
import org.openqa.selenium.By; | |||||
import com.vaadin.tests.tb3.MultiBrowserTest; | |||||
import com.vaadin.tests.widgetset.client.gwtrpc.GwtRpcButtonConnector; | |||||
/** | |||||
* Test the GWT RPC with Vaadin DevMode. See #11709. | |||||
* | |||||
* @author Vaadin Ltd | |||||
*/ | |||||
public class GwtRpcTest extends MultiBrowserTest { | |||||
@Test | |||||
public void testGwtRpc() { | |||||
openTestURL(); | |||||
getDriver().findElement(By.id(GwtRpc.BUTTON_ID)).click(); | |||||
By label = By.id(GwtRpcButtonConnector.SUCCESS_LABEL_ID); | |||||
waitForElementToBePresent(label); | |||||
getDriver().findElement(label); | |||||
} | |||||
} |