@Test
  @InSequence(1)
  public void stopServers(
      @ArquillianResource @OperateOnDeployment(DEPLOYMENT_1) ManagementClient client1,
      @ArquillianResource @OperateOnDeployment(DEPLOYMENT_2) ManagementClient client2)
      throws Exception {

    SSOTestBase.removeSso(client1.getControllerClient());
    SSOTestBase.removeSso(client2.getControllerClient());

    deployer.undeploy(DEPLOYMENT_1);
    controller.stop(CONTAINER_1);
    deployer.undeploy(DEPLOYMENT_2);
    controller.stop(CONTAINER_2);
  }
 /** Test single sign-on across two web apps using form based auth */
 @Test
 public void testNoAuthSingleSignOn(
     @ArquillianResource(LogoutServlet.class) @OperateOnDeployment(DEPLOYMENT_1) URL baseURL1,
     @ArquillianResource(LogoutServlet.class) @OperateOnDeployment(DEPLOYMENT_2) URL baseURL2)
     throws Exception {
   log.info("+++ testNoAuthSingleSignOn");
   SSOTestBase.executeNoAuthSingleSignOnTest(new URL(baseURL1, "/"), new URL(baseURL2, "/"), log);
 }
  @Test
  @InSequence(-1)
  public void setupSSO(
      @ArquillianResource @OperateOnDeployment(DEPLOYMENT_1) ManagementClient client1,
      @ArquillianResource @OperateOnDeployment(DEPLOYMENT_2) ManagementClient client2)
      throws Exception {

    // add sso valves
    SSOTestBase.addClusteredSso(client1.getControllerClient());
    SSOTestBase.addClusteredSso(client2.getControllerClient());

    controller.stop(CONTAINER_1);
    controller.stop(CONTAINER_2);

    controller.start(CONTAINER_1);
    controller.start(CONTAINER_2);

    deployer.deploy(DEPLOYMENT_1);
    deployer.deploy(DEPLOYMENT_2);
  }
 @Deployment(name = DEPLOYMENT_2, managed = false, testable = false)
 @TargetsContainer(CONTAINER_2)
 public static EnterpriseArchive deployment2() {
   return SSOTestBase.createSsoEar();
 }