<servlet-class>com.vaadin.server.VaadinServlet</servlet-class>
<init-param>
<param-name>UI</param-name>
- <param-value>com.vaadin.tests.integration.IntegrationTestUI</param-value>
+ <param-value>com.vaadin.tests.integration.ServletIntegrationUI</param-value>
</init-param>
<async-supported>true</async-supported>
</servlet>
<servlet-class>com.vaadin.server.VaadinServlet</servlet-class>
<init-param>
<param-name>UI</param-name>
- <param-value>com.vaadin.tests.integration.IntegrationTestUI</param-value>
+ <param-value>com.vaadin.tests.integration.ServletIntegrationUI</param-value>
</init-param>
</servlet>
<servlet-mapping>
--- /dev/null
+/*
+ * 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.integration;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized.Parameters;
+import org.openqa.selenium.remote.DesiredCapabilities;
+
+import com.vaadin.tests.tb3.PrivateTB3Configuration;
+
+/**
+ * Base class for integration tests. Integration tests use the
+ * {@literal deployment.url} parameter to determine the base deployment url
+ * (http://hostname:123)
+ *
+ * @author Vaadin Ltd
+ */
+@RunWith(IntegrationTestRunner.class)
+public abstract class AbstractIntegrationTest extends
+ PrivateTB3Configuration {
+ @Override
+ protected String getBaseURL() {
+ String deploymentUrl = System.getProperty("deployment.url");
+ if (deploymentUrl == null || deploymentUrl.equals("")) {
+ throw new RuntimeException(
+ "Deployment url must be given as deployment.url");
+ }
+
+ return deploymentUrl;
+ }
+
+ @Parameters
+ public static Collection<DesiredCapabilities> getBrowsersForTest() {
+ return Collections.singleton(BrowserUtil.firefox(17));
+ }
+
+}
+++ /dev/null
-/*
- * 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.integration;
-
-import java.util.Collection;
-import java.util.Collections;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized.Parameters;
-import org.openqa.selenium.remote.DesiredCapabilities;
-
-import com.vaadin.tests.tb3.PrivateTB3Configuration;
-
-/**
- * Base class for integration tests. Integration tests use the
- * {@literal deployment.url} parameter to determine the base deployment url
- * (http://hostname:123)
- *
- * @author Vaadin Ltd
- */
-@RunWith(IntegrationTestRunner.class)
-public abstract class AbstractIntegrationTestTB3 extends
- PrivateTB3Configuration {
- @Override
- protected String getBaseURL() {
- String deploymentUrl = System.getProperty("deployment.url");
- if (deploymentUrl == null || deploymentUrl.equals("")) {
- throw new RuntimeException(
- "Deployment url must be given as deployment.url");
- }
-
- return deploymentUrl;
- }
-
- @Parameters
- public static Collection<DesiredCapabilities> getBrowsersForTest() {
- return Collections.singleton(BrowserUtil.firefox(17));
- }
-
-}
--- /dev/null
+/*
+ * 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.integration;
+
+import java.io.IOException;
+
+import org.junit.Test;
+import org.openqa.selenium.WebElement;
+
+/**
+ * Base class for servlet integration tests. Automatically prepends "/demo" to
+ * the deployment path
+ *
+ * @author Vaadin Ltd
+ */
+public abstract class AbstractServletIntegrationTest extends
+ AbstractIntegrationTest {
+
+ @Test
+ public void runTest() throws IOException, AssertionError {
+ openTestURL();
+ compareScreen("initial");
+
+ WebElement cell = vaadinElement(getTableCell(getTable(), 0, 1));
+ testBenchElement(cell).click(51, 13);
+
+ compareScreen("finland");
+ }
+
+ private String getTableCell(String tableLocator, int row, int col) {
+ return tableLocator
+ + "/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild["
+ + row + "]/domChild[" + col + "]/domChild[0]";
+ }
+
+ protected String getTable() {
+ return "/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.tests.tb3.AbstractTB3Test#getDeploymentPath()
+ */
+ @Override
+ protected String getDeploymentPath() {
+ return "/demo" + super.getDeploymentPath();
+ }
+
+}
*/
@Override
protected String testName(FrameworkMethod method) {
- if (AbstractIntegrationTestTB3.class.isAssignableFrom(testClass)) {
+ if (AbstractIntegrationTest.class.isAssignableFrom(testClass)) {
return System.getProperty("server-name");
} else {
return super.testName(method);
+++ /dev/null
-/*
- * 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.integration;
-
-import com.vaadin.annotations.Push;
-import com.vaadin.shared.ui.ui.Transport;
-
-/**
- * Server test which uses streaming
- *
- * @since 7.1
- * @author Vaadin Ltd
- */
-@Push(transport = Transport.STREAMING)
-public class IntegrationTestStreaming extends IntegrationTestUI {
-
- public static class IntegrationTestStreamingTB3 extends
- ServletIntegrationTestTB3 {
- // Uses the test method declared in the super class
- }
-
-}
+++ /dev/null
-package com.vaadin.tests.integration;
-
-import com.vaadin.data.Item;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.data.Property.ValueChangeListener;
-import com.vaadin.server.ClassResource;
-import com.vaadin.server.Resource;
-import com.vaadin.server.VaadinRequest;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Table;
-import com.vaadin.ui.UI;
-import com.vaadin.ui.VerticalLayout;
-
-public class IntegrationTestUI extends UI {
-
- public class IntegrationTestXhrTB3 extends ServletIntegrationTestTB3 {
- // Uses the test method declared in the super class
- }
-
- @Override
- protected void init(VaadinRequest request) {
- VerticalLayout layout = new VerticalLayout();
- layout.setMargin(true);
- setContent(layout);
-
- final Table table = new Table();
- table.addContainerProperty("icon", Resource.class, null);
- table.setItemIconPropertyId("icon");
- table.addContainerProperty("country", String.class, null);
- table.setRowHeaderMode(Table.RowHeaderMode.ICON_ONLY);
- table.setImmediate(true);
- table.setSelectable(true);
- table.setVisibleColumns(new Object[] { "country" });
- layout.addComponent(table);
-
- Item item = table.addItem("FI");
- item.getItemProperty("icon").setValue(new ClassResource("fi.gif"));
- item.getItemProperty("country").setValue("Finland");
- item = table.addItem("SE");
- item.getItemProperty("icon").setValue(new FlagSeResource());
- item.getItemProperty("country").setValue("Sweden");
-
- final Label selectedLabel = new Label();
- table.addValueChangeListener(new ValueChangeListener() {
- @Override
- public void valueChange(ValueChangeEvent event) {
- selectedLabel.setValue(String.valueOf(table.getValue()));
- }
- });
- layout.addComponent(selectedLabel);
- }
-}
+++ /dev/null
-/*
- * 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.integration;
-
-import com.vaadin.annotations.Push;
-import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.ui.Transport;
-
-/**
- * Server test which uses websockets
- *
- * @since 7.1
- * @author Vaadin Ltd
- */
-@Push(transport = Transport.WEBSOCKET)
-public class IntegrationTestWebsocket extends IntegrationTestUI {
-
- public class IntegrationTestWebsocketTB3 extends ServletIntegrationTestTB3 {
- // Uses the test method declared in the super class
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.vaadin.tests.integration.IntegrationTestUI#init(com.vaadin.server
- * .VaadinRequest)
- */
- @Override
- protected void init(VaadinRequest request) {
- super.init(request);
- // Ensure no fallback is used
- getPushConfiguration().setFallbackTransport(Transport.WEBSOCKET);
- }
-
-}
--- /dev/null
+/*
+ * 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.integration;
+
+import com.vaadin.annotations.Push;
+import com.vaadin.shared.ui.ui.Transport;
+
+/**
+ * Server test which uses streaming
+ *
+ * @since 7.1
+ * @author Vaadin Ltd
+ */
+@Push(transport = Transport.STREAMING)
+public class ServletIntegrationStreamingUI extends ServletIntegrationUI {
+
+}
--- /dev/null
+/*
+ * 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.integration;
+
+public class ServletIntegrationStreamingUITest extends
+ AbstractServletIntegrationTest {
+ // Uses the test method declared in the super class
+}
\ No newline at end of file
+++ /dev/null
-/*
- * 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.integration;
-
-import java.io.IOException;
-
-import org.junit.Test;
-import org.openqa.selenium.WebElement;
-
-/**
- * Base class for servlet integration tests. Automatically prepends "/demo" to
- * the deployment path
- *
- * @author Vaadin Ltd
- */
-public abstract class ServletIntegrationTestTB3 extends
- AbstractIntegrationTestTB3 {
-
- @Test
- public void runTest() throws IOException, AssertionError {
- openTestURL();
- compareScreen("initial");
-
- WebElement cell = vaadinElement(getTableCell(getTable(), 0, 1));
- testBenchElement(cell).click(51, 13);
-
- compareScreen("finland");
- }
-
- private String getTableCell(String tableLocator, int row, int col) {
- return tableLocator
- + "/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild["
- + row + "]/domChild[" + col + "]/domChild[0]";
- }
-
- protected String getTable() {
- return "/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.vaadin.tests.tb3.AbstractTB3Test#getDeploymentPath()
- */
- @Override
- protected String getDeploymentPath() {
- return "/demo" + super.getDeploymentPath();
- }
-
-}
--- /dev/null
+package com.vaadin.tests.integration;
+
+import com.vaadin.data.Item;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.server.ClassResource;
+import com.vaadin.server.Resource;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.VerticalLayout;
+
+public class ServletIntegrationUI extends UI {
+
+ @Override
+ protected void init(VaadinRequest request) {
+ VerticalLayout layout = new VerticalLayout();
+ layout.setMargin(true);
+ setContent(layout);
+
+ final Table table = new Table();
+ table.addContainerProperty("icon", Resource.class, null);
+ table.setItemIconPropertyId("icon");
+ table.addContainerProperty("country", String.class, null);
+ table.setRowHeaderMode(Table.RowHeaderMode.ICON_ONLY);
+ table.setImmediate(true);
+ table.setSelectable(true);
+ table.setVisibleColumns(new Object[] { "country" });
+ layout.addComponent(table);
+
+ Item item = table.addItem("FI");
+ item.getItemProperty("icon").setValue(new ClassResource("fi.gif"));
+ item.getItemProperty("country").setValue("Finland");
+ item = table.addItem("SE");
+ item.getItemProperty("icon").setValue(new FlagSeResource());
+ item.getItemProperty("country").setValue("Sweden");
+
+ final Label selectedLabel = new Label();
+ table.addValueChangeListener(new ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ selectedLabel.setValue(String.valueOf(table.getValue()));
+ }
+ });
+ layout.addComponent(selectedLabel);
+ }
+}
--- /dev/null
+/*
+ * 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.integration;
+
+public class ServletIntegrationUITest extends AbstractServletIntegrationTest {
+ // Uses the test method declared in the super class
+}
\ No newline at end of file
--- /dev/null
+/*
+ * 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.integration;
+
+import com.vaadin.annotations.Push;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.shared.ui.ui.Transport;
+
+/**
+ * Server test which uses websockets
+ *
+ * @since 7.1
+ * @author Vaadin Ltd
+ */
+@Push(transport = Transport.WEBSOCKET)
+public class ServletIntegrationWebsocketUI extends ServletIntegrationUI {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.vaadin.tests.integration.IntegrationTestUI#init(com.vaadin.server
+ * .VaadinRequest)
+ */
+ @Override
+ protected void init(VaadinRequest request) {
+ super.init(request);
+ // Ensure no fallback is used
+ getPushConfiguration().setFallbackTransport(Transport.WEBSOCKET);
+ }
+
+}
--- /dev/null
+/*
+ * 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.integration;
+
+public class ServletIntegrationWebsocketUITest extends
+ AbstractServletIntegrationTest {
+ // Uses the test method declared in the super class
+}
\ No newline at end of file
import org.junit.runner.RunWith;
import org.junit.runners.model.InitializationError;
-import com.vaadin.tests.integration.ServletIntegrationTestTB3;
+import com.vaadin.tests.integration.AbstractServletIntegrationTest;
import com.vaadin.tests.tb3.ServletIntegrationTests.ServletIntegrationTestSuite;
@RunWith(ServletIntegrationTestSuite.class)
public static class ServletIntegrationTestSuite extends TB3TestSuite {
public ServletIntegrationTestSuite(Class<?> klass)
throws InitializationError {
- super(klass, ServletIntegrationTestTB3.class,
+ super(klass, AbstractServletIntegrationTest.class,
"com.vaadin.tests.integration", new String[] {});
}
}