wildfly/wildfly — pull request #4682 by jaikiran (2013-06-21 15:43:15+00:00)
Title: WFLY-1554 Cleanup the org.jboss.as.test.integration.management.api.web.DeploymentScannerTestCase

The commit here cleans up the org.jboss.as.test.integration.management.api.web.DeploymentScannerTestCase to remove the Thread.sleep(s) and at the same time ensure that it doesn't run into intermittent failures. The real problem with this test was that it was doing this:

There are 3 test methods in that testcase one of the test methods did:

1) add deployment scanner which is expected to fail
2) test that it has failed
3) add a deployment scanner "foo" which is expected to pass
4) also add a valid .war which is expected to deploy fine
5) wait for 2 seconds for the deployed marker to be visible

If step 5 fails (which is what happens from what i have seen) then the "foo" deployment scanner which was added in step#3 is left around.

Now the other 2 test methods all add the "foo" deployment scanner themselves and since the first test method didn't clean itself after that failure, the other 2 test methods used to fail with duplicate resource for that "foo" scanner.

The commit here uses a different technique to ensure that the presence/absence of the deployment scanner instead of waiting for a random time to check for the presence of a deployment (marker).