incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r886156 - in /sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/userManager: CreateGroupTest.java CreateUserTest.java
Date Wed, 02 Dec 2009 14:31:30 GMT
Author: fmeschbe
Date: Wed Dec  2 14:31:29 2009
New Revision: 886156

URL: http://svn.apache.org/viewvc?rev=886156&view=rev
Log:
SLING-1208 As of Jackrabbit 1.6 the protected properties of the repository reflection of users
and groups are not returned as Authorizable properties any more. Therefore the rep:principalName
property which is checked in the integration test does not exist any longer.

Modified:
    sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/userManager/CreateGroupTest.java
    sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/userManager/CreateUserTest.java

Modified: sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/userManager/CreateGroupTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/userManager/CreateGroupTest.java?rev=886156&r1=886155&r2=886156&view=diff
==============================================================================
--- sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/userManager/CreateGroupTest.java
(original)
+++ sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/userManager/CreateGroupTest.java
Wed Dec  2 14:31:29 2009
@@ -34,7 +34,7 @@
 public class CreateGroupTest extends AbstractUserManagerTest {
 
 	String testGroupId = null;
-	
+
 	@Override
 	protected void tearDown() throws Exception {
 		if (testGroupId != null) {
@@ -53,15 +53,16 @@
 		testGroupId = "testGroup" + (counter++);
 		List<NameValuePair> postParams = new ArrayList<NameValuePair>();
 		postParams.add(new NameValuePair(":name", testGroupId));
+		postParams.add(new NameValuePair("marker", testGroupId));
 		assertAuthenticatedAdminPostStatus(postUrl, HttpServletResponse.SC_OK, postParams, null);
-		
+
 		//fetch the group profile json to verify the settings
 		String getUrl = HTTP_BASE_URL + "/system/userManager/group/" + testGroupId + ".json";
 		Credentials creds = new UsernamePasswordCredentials("admin", "admin");
 		String json = getAuthenticatedContent(creds, getUrl, CONTENT_TYPE_JSON, null, HttpServletResponse.SC_OK);
 		assertNotNull(json);
 		JSONObject jsonObj = new JSONObject(json);
-		assertEquals(testGroupId, jsonObj.getString("rep:principalName"));
+		assertEquals(testGroupId, jsonObj.getString("marker"));
 	}
 
 	public void testCreateGroupMissingGroupId() throws IOException {
@@ -78,17 +79,18 @@
 		List<NameValuePair> postParams = new ArrayList<NameValuePair>();
 		postParams.add(new NameValuePair(":name", testGroupId));
 		assertAuthenticatedAdminPostStatus(postUrl, HttpServletResponse.SC_OK, postParams, null);
-		
+
 		//post the same info again, should fail
 		assertAuthenticatedAdminPostStatus(postUrl, HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
postParams, null);
 	}
-	
+
 	public void testCreateGroupWithExtraProperties() throws IOException, JSONException {
         String postUrl = HTTP_BASE_URL + "/system/userManager/group.create.html";
 
 		testGroupId = "testGroup" + (counter++);
 		List<NameValuePair> postParams = new ArrayList<NameValuePair>();
 		postParams.add(new NameValuePair(":name", testGroupId));
+		postParams.add(new NameValuePair("marker", testGroupId));
 		postParams.add(new NameValuePair("displayName", "My Test Group"));
 		postParams.add(new NameValuePair("url", "http://www.apache.org"));
 		assertAuthenticatedAdminPostStatus(postUrl, HttpServletResponse.SC_OK, postParams, null);
@@ -99,8 +101,8 @@
 		String json = getAuthenticatedContent(creds, getUrl, CONTENT_TYPE_JSON, null, HttpServletResponse.SC_OK);
 		assertNotNull(json);
 		JSONObject jsonObj = new JSONObject(json);
-		assertEquals(testGroupId, jsonObj.getString("rep:principalName"));
+		assertEquals(testGroupId, jsonObj.getString("marker"));
 		assertEquals("My Test Group", jsonObj.getString("displayName"));
 		assertEquals("http://www.apache.org", jsonObj.getString("url"));
-	}		
+	}
 }

Modified: sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/userManager/CreateUserTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/userManager/CreateUserTest.java?rev=886156&r1=886155&r2=886156&view=diff
==============================================================================
--- sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/userManager/CreateUserTest.java
(original)
+++ sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/userManager/CreateUserTest.java
Wed Dec  2 14:31:29 2009
@@ -34,7 +34,7 @@
 public class CreateUserTest extends AbstractUserManagerTest {
 
 	String testUserId = null;
-	
+
 	@Override
 	protected void tearDown() throws Exception {
 		if (testUserId != null) {
@@ -56,21 +56,22 @@
 	 */
 	public void testCreateUser() throws IOException, JSONException {
         String postUrl = HTTP_BASE_URL + "/system/userManager/user.create.html";
-        
+
 		testUserId = "testUser" + (counter++);
 		List<NameValuePair> postParams = new ArrayList<NameValuePair>();
 		postParams.add(new NameValuePair(":name", testUserId));
+		postParams.add(new NameValuePair("marker", testUserId));
 		postParams.add(new NameValuePair("pwd", "testPwd"));
 		postParams.add(new NameValuePair("pwdConfirm", "testPwd"));
 		assertPostStatus(postUrl, HttpServletResponse.SC_OK, postParams, null);
-		
+
 		//fetch the user profile json to verify the settings
 		String getUrl = HTTP_BASE_URL + "/system/userManager/user/" + testUserId + ".json";
 		Credentials creds = new UsernamePasswordCredentials("admin", "admin");
 		String json = getAuthenticatedContent(creds, getUrl, CONTENT_TYPE_JSON, null, HttpServletResponse.SC_OK);
 		assertNotNull(json);
 		JSONObject jsonObj = new JSONObject(json);
-		assertEquals(testUserId, jsonObj.getString("rep:principalName"));
+		assertEquals(testUserId, jsonObj.getString("marker"));
 		assertFalse(jsonObj.has(":name"));
 		assertFalse(jsonObj.has("pwd"));
 		assertFalse(jsonObj.has("pwdConfirm"));
@@ -112,11 +113,11 @@
 		postParams.add(new NameValuePair("pwd", "testPwd"));
 		postParams.add(new NameValuePair("pwdConfirm", "testPwd"));
 		assertPostStatus(postUrl, HttpServletResponse.SC_OK, postParams, null);
-		
+
 		//post the same info again, should fail
 		assertPostStatus(postUrl, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, postParams, null);
 	}
-	
+
 	/*
 	<form action="/system/userManager/user.create.html" method="POST">
 	   <div>Name: <input type="text" name=":name" value="testUser" /></div>
@@ -133,6 +134,7 @@
 		testUserId = "testUser" + (counter++);
 		List<NameValuePair> postParams = new ArrayList<NameValuePair>();
 		postParams.add(new NameValuePair(":name", testUserId));
+		postParams.add(new NameValuePair("marker", testUserId));
 		postParams.add(new NameValuePair("pwd", "testPwd"));
 		postParams.add(new NameValuePair("pwdConfirm", "testPwd"));
 		postParams.add(new NameValuePair("displayName", "My Test User"));
@@ -145,11 +147,11 @@
 		String json = getAuthenticatedContent(creds, getUrl, CONTENT_TYPE_JSON, null, HttpServletResponse.SC_OK);
 		assertNotNull(json);
 		JSONObject jsonObj = new JSONObject(json);
-		assertEquals(testUserId, jsonObj.getString("rep:principalName"));
+		assertEquals(testUserId, jsonObj.getString("marker"));
 		assertEquals("My Test User", jsonObj.getString("displayName"));
 		assertEquals("http://www.apache.org", jsonObj.getString("url"));
 		assertFalse(jsonObj.has(":name"));
 		assertFalse(jsonObj.has("pwd"));
 		assertFalse(jsonObj.has("pwdConfirm"));
-	}		
+	}
 }



Mime
View raw message