You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2013/10/29 14:45:28 UTC
svn commit: r1536713 -
/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/RepositoryNameTest.java
Author: bdelacretaz
Date: Tue Oct 29 13:45:27 2013
New Revision: 1536713
URL: http://svn.apache.org/r1536713
Log:
SLING-2788 - more explicit fail message
Modified:
sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/RepositoryNameTest.java
Modified: sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/RepositoryNameTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/RepositoryNameTest.java?rev=1536713&r1=1536712&r2=1536713&view=diff
==============================================================================
--- sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/RepositoryNameTest.java (original)
+++ sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/RepositoryNameTest.java Tue Oct 29 13:45:27 2013
@@ -38,12 +38,18 @@ public class RepositoryNameTest extends
public void testName() throws Exception {
final String runMode = System.getProperty(RUN_MODE_PROP, DEFAULT_RUN_MODE);
- final String name = RUNMODE_TO_NAME.get(runMode);
- assertNotNull("Expecting to have a repository name for run mode " + runMode, name);
+ final String expectedName = RUNMODE_TO_NAME.get(runMode);
+ assertNotNull("Expecting to have a repository name for run mode " + runMode, expectedName);
final String path = "/testing/RepositoryDescriptors.json";
final JSONObject json = new JSONObject(getContent(HTTP_BASE_URL + path, CONTENT_TYPE_JSON));
final String key = "jcr.repository.name";
- assertEquals("Expecting " + key + "=" + name, name, json.getJSONObject("descriptors").getString(key));
+ final String actualName = json.getJSONObject("descriptors").getString(key);
+ if(!expectedName.equals(actualName)) {
+ fail(
+ "Repository descriptor '" + key + "' value '" + actualName + "' does not match expected value '" + expectedName + "'. "
+ + "Note that this test uses the " + RUN_MODE_PROP + " system property to select the expected value."
+ );
+ }
}
}