@TestCategory("push")
abstract class PushConfigurationTest extends MultiBrowserTest {
+ @Override
+ protected Class<?> getUIClass() {
+ return PushConfiguration.class;
+ }
+
@Override
public void setup() throws Exception {
super.setup();
+ setDebug(true);
- openTestURL();
+ openTestURL("restartApplication");
disablePush();
}
- @Override
- protected String getDeploymentPath() {
- return "/run/" + PushConfiguration.class.getCanonicalName()
- + "?restartApplication&debug";
- }
-
protected String getStatusText() {
WebElement statusLabel = vaadinElementById("status");
import java.lang.reflect.Field;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
+import java.util.HashSet;
import java.util.List;
import java.util.NoSuchElementException;
+import java.util.Set;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
* {@link #isPush()}.
*/
protected void openTestURL(Class<?> uiClass, String... parameters) {
+ openTestURL(uiClass, new HashSet<String>(Arrays.asList(parameters)));
+ }
+
+ private void openTestURL(Class<?> uiClass, Set<String> parameters) {
String url = getTestURL(uiClass);
- if (parameters.length > 0) {
+ if(isDebug()) {
+ parameters.add("debug");
+ }
+
+ if (LegacyApplication.class.isAssignableFrom(uiClass)) {
+ parameters.add("restartApplication");
+ }
+
+ if (parameters.size() > 0) {
url += "?" + Joiner.on("&").join(parameters);
}
}
if (UI.class.isAssignableFrom(uiClass)
- || UIProvider.class.isAssignableFrom(uiClass)) {
- return runPath + "/" + uiClass.getCanonicalName()
- + (isDebug() ? "?debug" : "");
- } else if (LegacyApplication.class.isAssignableFrom(uiClass)) {
- return runPath + "/" + uiClass.getCanonicalName()
- + "?restartApplication" + (isDebug() ? "&debug" : "");
+ || UIProvider.class.isAssignableFrom(uiClass)
+ || LegacyApplication.class.isAssignableFrom(uiClass)) {
+ return runPath + "/" + uiClass.getCanonicalName();
} else {
throw new IllegalArgumentException(
"Unable to determine path for enclosing class "