--- /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 org.junit.runners.BlockJUnit4ClassRunner;
+import org.junit.runners.model.FrameworkMethod;
+import org.junit.runners.model.InitializationError;
+
+/**
+ * JUnit runner for integration tests.
+ *
+ * @since
+ * @author Vaadin Ltd
+ */
+public class IntegrationTestRunner extends BlockJUnit4ClassRunner {
+
+ private Class<?> testClass;
+
+ /**
+ * @param klass
+ * @throws InitializationError
+ */
+ public IntegrationTestRunner(Class<?> klass) throws InitializationError {
+ super(klass);
+ testClass = klass;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.junit.runners.BlockJUnit4ClassRunner#testName(org.junit.runners.model
+ * .FrameworkMethod)
+ */
+ @Override
+ protected String testName(FrameworkMethod method) {
+ if (IntegrationTestTB3.class.isAssignableFrom(testClass)) {
+ return testClass.getSimpleName() + "-"
+ + System.getProperty("server-name");
+ } else {
+ return super.testName(method);
+ }
+ }
+}
package com.vaadin.tests.integration;\r
\r
-public class IntegrationTestStreamingTB3 extends IntegrationTestXhrTB3 {\r
+public class IntegrationTestStreamingTB3 extends IntegrationTestTB3 {\r
\r
@Override\r
protected Class<?> getUIClass() {\r
--- /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.junit.runner.RunWith;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.tests.tb3.PrivateTB3Configuration;
+
+/**
+ *
+ * @since
+ * @author Vaadin Ltd
+ */
+@RunWith(IntegrationTestRunner.class)
+public class IntegrationTestTB3 extends PrivateTB3Configuration {
+ @Test
+ public void runTest() throws IOException, AssertionError {
+ 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]";
+ }
+
+ @Override
+ protected String getPath() {
+ return "/demo" + super.getPath();
+ }
+
+ @Override
+ protected String getBaseURL() {
+ return System.getProperty("deployment.url");
+ }
+
+ @Override
+ protected String getTestName() {
+ // Note that this is used for screenshots. The test name shown in the
+ // build server and when running the JUnit test is produced by
+ // IntegrationTestRunner
+ return super.getTestName() + "-" + System.getProperty("server-name");
+ }
+
+}
package com.vaadin.tests.integration;\r
\r
-\r
-public class IntegrationTestWebsocketTB3 extends IntegrationTestXhrTB3 {\r
+public class IntegrationTestWebsocketTB3 extends IntegrationTestTB3 {\r
\r
@Override\r
protected Class<?> getUIClass() {\r
- return com.vaadin.tests.integration.IntegrationTestStreaming.class;\r
+ return com.vaadin.tests.integration.IntegrationTestWebsocket.class;\r
}\r
}\r
package com.vaadin.tests.integration;\r
\r
-import java.io.IOException;\r
-\r
-import org.junit.Test;\r
-import org.openqa.selenium.WebElement;\r
-\r
-import com.vaadin.tests.tb3.PrivateTB3Configuration;\r
-\r
-public class IntegrationTestXhrTB3 extends PrivateTB3Configuration {\r
-\r
- @Test\r
- public void runTest() throws IOException, AssertionError {\r
- compareScreen("initial");\r
-\r
- WebElement cell = vaadinElement(getTableCell(getTable(), 0, 1));\r
- testBenchElement(cell).click(51, 13);\r
-\r
- compareScreen("finland");\r
- }\r
-\r
- private String getTableCell(String tableLocator, int row, int col) {\r
- return tableLocator\r
- + "/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild["\r
- + row + "]/domChild[" + col + "]/domChild[0]";\r
- }\r
-\r
- protected String getTable() {\r
- return "/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]";\r
- }\r
\r
+public class IntegrationTestXhrTB3 extends IntegrationTestTB3 {\r
@Override\r
protected Class<?> getUIClass() {\r
return IntegrationTestUI.class;\r
}\r
\r
- @Override\r
- protected String getPath() {\r
- return "/demo" + super.getPath();\r
- }\r
-\r
- @Override\r
- protected String getBaseURL() {\r
- return System.getProperty("deployment.url");\r
- }\r
-\r
- @Override\r
- protected String getTestName() {\r
- return super.getTestName() + "-" + System.getProperty("server-name");\r
- }\r
}\r