From fb8cf5cb457f6fe95bd3b07d2fb1a1fb03a3be8f Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Fri, 21 Sep 2012 16:51:20 +0300 Subject: Allow specifying UIProvider using a servlet parameter (#9628) --- .../applicationservlet/InitParamUIProvider.java | 36 ++++++++++++++++++++ .../UIProviderInitParameter.html | 39 ++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java create mode 100644 uitest/src/com/vaadin/tests/applicationservlet/UIProviderInitParameter.html (limited to 'uitest') diff --git a/uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java b/uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java new file mode 100644 index 0000000000..6a2f5c500b --- /dev/null +++ b/uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java @@ -0,0 +1,36 @@ +/* + * Copyright 2011 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.applicationservlet; + +import com.vaadin.server.UIProvider; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.javascriptcomponent.BasicJavaScriptComponent; +import com.vaadin.ui.UI; + +public class InitParamUIProvider extends UIProvider { + + @Override + public Class getUIClass(VaadinRequest request) { + String pathInfo = request.getRequestPathInfo(); + if ("/test".equals(pathInfo)) { + return BasicJavaScriptComponent.class; + } else { + return null; + } + } + +} diff --git a/uitest/src/com/vaadin/tests/applicationservlet/UIProviderInitParameter.html b/uitest/src/com/vaadin/tests/applicationservlet/UIProviderInitParameter.html new file mode 100644 index 0000000000..8a5f89cbad --- /dev/null +++ b/uitest/src/com/vaadin/tests/applicationservlet/UIProviderInitParameter.html @@ -0,0 +1,39 @@ + + + + + + +New Test + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
New Test
open/uiprovider
assertTextvaadin=uiprovider::/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VLabel[0]Tests whether the testing server is run with assertions enabled.
open/uiprovider/test
assertTextvaadin=uiprovider::/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VLabel[0]Test for basic JavaScript component functionality.
+ + -- cgit v1.2.3