@@ -0,0 +1,3442 @@
+package org.jboss.hal.testsuite.test.runtime.deployments;%0A%0A%0Aimport org.jboss.arquillian.drone.api.annotation.Drone;%0Aimport org.jboss.arquillian.junit.Arquillian;%0Aimport org.jboss.hal.testsuite.category.Standalone;%0Aimport org.jboss.hal.testsuite.creaper.ManagementClientProvider;%0Aimport org.jboss.hal.testsuite.creaper.command.DeployCommand;%0Aimport org.jboss.hal.testsuite.finder.FinderNames;%0Aimport org.jboss.hal.testsuite.finder.FinderNavigation;%0Aimport org.jboss.hal.testsuite.finder.Row;%0Aimport org.jboss.hal.testsuite.page.runtime.StandaloneDeploymentEntryPoint;%0Aimport org.jboss.hal.testsuite.util.Console;%0Aimport org.junit.AfterClass;%0Aimport org.junit.Assert;%0Aimport org.junit.Before;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0Aimport org.junit.experimental.categories.Category;%0Aimport org.junit.runner.RunWith;%0Aimport org.openqa.selenium.NoAlertPresentException;%0Aimport org.openqa.selenium.WebDriver;%0Aimport org.wildfly.extras.creaper.core.CommandFailedException;%0Aimport org.wildfly.extras.creaper.core.online.OnlineManagementClient;%0Aimport org.wildfly.extras.creaper.core.online.operations.OperationException;%0Aimport org.wildfly.extras.creaper.core.online.operations.admin.Administration;%0A%0Aimport java.io.IOException;%0Aimport java.util.concurrent.TimeoutException;%0A%0A%0A/**%0A * @author %3Ca href=%22mailto:padamec@redhat.com%22%3EPetr Adamec%3C/a%3E%0A */%0A@RunWith(Arquillian.class)%0A@Category(Standalone.class)%0Apublic class XssScriptingTestCase %7B%0A    private static final String FILE_NAME = %22mockWar.war%22;%0A    private static final String SHORT_NAME = %22xss%3Csvg/onload=alert(document.domain)%3Exss%22;%0A    private static final String NAME = SHORT_NAME + %22 --disabled%22;%0A%0A    private static OnlineManagementClient client = ManagementClientProvider.createOnlineManagementClient();%0A    private static Administration administration = new Administration(client);%0A    private static DeploymentsOperations ops = new DeploymentsOperations(client);%0A    private FinderNavigation navigation;%0A%0A    @Drone%0A    WebDriver browser;%0A%0A    @BeforeClass%0A    public static void setUp() throws IOException, TimeoutException, InterruptedException, CommandFailedException %7B%0A        client.apply(new DeployCommand.Builder(XssScriptingTestCase.class.getClassLoader().getResource(FILE_NAME).getFile())%0A                .name(NAME)%0A                .build());%0A    %7D%0A%0A    @AfterClass%0A    public static void cleanUp() throws IOException, CommandFailedException, OperationException, TimeoutException, InterruptedException %7B%0A        try %7B%0A            ops.undeployIfExists(SHORT_NAME);%0A            administration.reloadIfRequired();%0A        %7D finally %7B%0A            client.close();%0A        %7D%0A    %7D%0A%0A    @Before%0A    public void before() %7B%0A        navigation = new FinderNavigation(browser, StandaloneDeploymentEntryPoint.class);%0A    %7D%0A%0A%0A    /**%0A     * Test if any alert window is displayed.%0A     * %3Ca href=%22issues.jboss.org/browse/HAL-1511%22%3EHAL-1511%3C/a%3E%0A     */%0A    @Test%0A    public void testIfAlertWindowIsDisplayed() %7B%0A        FinderNavigation nav = navigation.step(FinderNames.DEPLOYMENT, SHORT_NAME);%0A        Row row = nav.selectRow(false);%0A        Console.withBrowser(browser).dismissReloadRequiredWindowIfPresent();%0A        row.invoke(FinderNames.VIEW);%0A        try %7B%0A            if (browser.switchTo().alert() != null) %7B%0A                Assert.fail(%22Cross-site scripting (XSS) in JBoss Management%22);%0A            %7D%0A        %7D catch (NoAlertPresentException e) %7B%0A        %7D%0A    %7D%0A%0A%0A%7D%0A

Add test for HAL-1511