@@ -0,0 +1,3184 @@
+package com.vaadin.tests.application;%0A%0Aimport com.vaadin.event.ShortcutAction.KeyCode;%0Aimport com.vaadin.tests.components.AbstractTestCase;%0Aimport com.vaadin.ui.Button;%0Aimport com.vaadin.ui.Button.ClickEvent;%0Aimport com.vaadin.ui.Button.ClickListener;%0Aimport com.vaadin.ui.Component;%0Aimport com.vaadin.ui.FormLayout;%0Aimport com.vaadin.ui.HorizontalLayout;%0Aimport com.vaadin.ui.Label;%0Aimport com.vaadin.ui.TextField;%0Aimport com.vaadin.ui.VerticalLayout;%0Aimport com.vaadin.ui.Window;%0A%0Apublic class ErrorInUnloadEvent extends AbstractTestCase %7B%0A%0A    private Window mainWindow;%0A%0A    @Override%0A    public void init() %7B%0A        if (getUser() == null) %7B%0A            showLoginWindow();%0A        %7D else %7B%0A            showMainWindow();%0A        %7D%0A    %7D%0A%0A    private void showLoginWindow() %7B%0A        if (mainWindow == null) %7B%0A            mainWindow = new Window();%0A        %7D else %7B%0A            mainWindow.removeAllComponents();%0A        %7D%0A        mainWindow.setCaption(%22Please login%22);%0A%0A        FormLayout formLayout = new FormLayout();%0A        final TextField userField = new TextField(%22Username%22);%0A        userField.setDebugId(%22user%22);%0A        final TextField passwordField = new TextField(%22Password%22);%0A        passwordField.setDebugId(%22pwd%22);%0A        passwordField.setSecret(true);%0A        Button login = new Button(%22login%22);%0A        login.setDebugId(%22loginButton%22);%0A        login.setClickShortcut(KeyCode.ENTER);%0A        formLayout.addComponent(userField);%0A        formLayout.addComponent(passwordField);%0A        formLayout.addComponent(login);%0A        mainWindow.setContent(formLayout);%0A%0A        login.addListener(new ClickListener() %7B%0A            public void buttonClick(final ClickEvent event) %7B%0A                String username = (String) userField.getValue();%0A                String password = (String) passwordField.getValue();%0A%0A                setUser(username);%0A                showMainWindow();%0A            %7D%0A        %7D);%0A%0A        setMainWindow(mainWindow);%0A    %7D%0A%0A    private void showMainWindow() %7B%0A        if (mainWindow == null) %7B%0A            mainWindow = new Window();%0A        %7D else %7B%0A            mainWindow.removeAllComponents();%0A        %7D%0A        VerticalLayout root = new VerticalLayout();%0A        root.addComponent(createHeader());%0A%0A        mainWindow.addComponent(root);%0A    %7D%0A%0A    private Component createHeader() %7B%0A        HorizontalLayout header = new HorizontalLayout();%0A        header.addStyleName(%22header-background%22);%0A        Label title = new Label(%22...Title...%22);%0A        title.addStyleName(%22header-title%22);%0A        header.addComponent(title);%0A        Button logout = new Button(%22Logout%22);%0A        logout.addListener(new ClickListener() %7B%0A            public void buttonClick(final ClickEvent event) %7B%0A                setUser(null);%0A                showLoginWindow();%0A            %7D%0A%0A        %7D);%0A        header.addComponent(logout);%0A        return header;%0A    %7D%0A%0A    @Override%0A    protected String getDescription() %7B%0A        return %22Enter a text in the password field and press enter. Then reload the page. No error message should be printed about ignoring a variable change.%22;%0A    %7D%0A%0A    @Override%0A    protected Integer getTicketNumber() %7B%0A        return 6316;%0A    %7D%0A%7D

Test for #6316