Skip to content

Commit

Permalink
fix: rewrite UI IT to avoid removed annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Anisimov committed Dec 18, 2020
1 parent aba867a commit a221f98
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,28 @@
*/
package com.vaadin.flow.memoryleaks.ui;

import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;

import com.vaadin.flow.component.Text;
import com.vaadin.flow.component.UI;
import com.vaadin.flow.component.html.NativeButton;
import com.vaadin.flow.server.VaadinRequest;
import com.vaadin.flow.server.VaadinServlet;
import com.vaadin.flow.server.VaadinServletConfiguration;

public class MemoryLeakUI extends UI {

@WebServlet(asyncSupported = true, urlPatterns = { "/*" })
@VaadinServletConfiguration(productionMode = false, ui = MemoryLeakUI.class)
@WebServlet(asyncSupported = true, urlPatterns = "/*", initParams = {
@WebInitParam(name = "ui", value = "com.vaadin.flow.memoryleaks.ui.MemoryLeakUI"),
@WebInitParam(name = "productionMode", value = "false") })
public static class MemoryLeakServlet extends VaadinServlet {

}

@Override
protected void init(VaadinRequest request) {
NativeButton button = new NativeButton("Hello", e -> add(new Text("Hello")));
NativeButton button = new NativeButton("Hello",
e -> add(new Text("Hello")));
button.setId("hello");
add(button);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.vaadin.flow.test.scalability;

import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;

import com.vaadin.flow.component.Text;
import com.vaadin.flow.component.UI;
import com.vaadin.flow.component.html.NativeButton;
import com.vaadin.flow.server.VaadinRequest;
import com.vaadin.flow.server.VaadinServlet;
import com.vaadin.flow.server.VaadinServletConfiguration;

/*
* Copyright 2000-2020 Vaadin Ltd.
Expand All @@ -29,12 +29,15 @@ public class HelloWorldUI extends UI {

public static final String PATH = "/helloworld/";

public static final String HELLO_WORLD_UI = HelloWorldUI.class.getName();

/**
* The main servlet for the application.
*/
@WebServlet(urlPatterns = PATH
+ "*", name = "UIServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = HelloWorldUI.class, productionMode = false)
+ "*", name = "UIServlet", asyncSupported = true, initParams = {
@WebInitParam(name = "ui", value = "com.vaadin.flow.test.scalability.HelloWorldUI"),
@WebInitParam(name = "productionMode", value = "false") })
public static class Servlet extends VaadinServlet {
}

Expand Down

0 comments on commit a221f98

Please sign in to comment.