Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-3873

Using SlingTestBase does not work with a non-standard password set on the sling server




      I was using SlingTestBase class and was trying to run the tests against a hosted CQ server. I am not using a standard "Admin/admin" username/password and the base class was not initializing. Upon debugging the code, i noticed the following potential bug (unless you can tell me how to override this).

          public void checkBundleInstalled(String symbolicName, int timeoutSeconds) {
              final String path = getBundlePath(symbolicName, ".json");
              new RetryingContentChecker(executor, builder).check(path, 200, timeoutSeconds, 500);

      Note that this class is calling the RetryingContentChecker without a username and password. This calls the constructor as follows

          public RetryingContentChecker(RequestExecutor executor, RequestBuilder builder) {
              this(executor, builder, null, SlingTestBase.ADMIN);
          public RetryingContentChecker(RequestExecutor executor, RequestBuilder builder, String username, String password) {
              this.executor = executor;
              this.builder = builder;
              if (username != null) {
                  this.username = username;
              } else {
                  this.username = SlingTestBase.ADMIN;
              if (password != null) {
                  this.password = password;
              } else {
                  this.password = SlingTestBase.ADMIN;

      I you read the logic, even though I have passed my password in system properties, the default password "Admin" gets set and the connection to my hosted server doesnt work and this fails for me.

      I really need this to be fixed and may try to provide a patch, but i need to know if i invest the time to setup the development environment on my local machine - checkout, compile, pass test cases, understand how the lifecycle works for you, how soon can a patch build be released to maven repository so that i can use that JAR. If that's not going to happen soon, i will just override classes locally for now.



          Issue Links



              • Assignee:
                rombert Robert Munteanu
                kvahuja Kapil V Ahuja
              • Votes:
                1 Vote for this issue
                4 Start watching this issue


                • Created: