Author: cziegeler
Date: Wed Mar  6 16:59:40 2013
New Revision: 1453423

URL: http://svn.apache.org/r1453423
Log:
SLING-2673 : Tweak PostServletCreateTest.testCreatingNodeUnderFile test to 
allow the presence of a PersistenceException

Modified:
    
sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletCreateTest.java

Modified: 
sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletCreateTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletCreateTest.java?rev=1453423&r1=1453422&r2=1453423&view=diff
==============================================================================
--- 
sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletCreateTest.java
 (original)
+++ 
sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletCreateTest.java
 Wed Mar  6 16:59:40 2013
@@ -25,7 +25,6 @@ import java.util.Map;
 
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.commons.httpclient.HttpMethod;
 import org.apache.commons.httpclient.NameValuePair;
 import org.apache.sling.commons.testing.integration.HttpTestBase;
 import org.apache.sling.servlets.post.SlingPostConstants;
@@ -169,7 +168,7 @@ public class PostServletCreateTest exten
     }
 
     /**
-     * SLING-1091: test create node with an exact node name (no filtering) 
+     * SLING-1091: test create node with an exact node name (no filtering)
      */
     public void testCreateNodeWithExactName() throws IOException {
        Map<String,String> nodeProperties = new HashMap<String, String>();
@@ -186,8 +185,8 @@ public class PostServletCreateTest exten
     }
 
     /**
-     * SLING-1091: test error reporting when attempting to create a node with 
an 
-     * invalid exact node name. 
+     * SLING-1091: test error reporting when attempting to create a node with 
an
+     * invalid exact node name.
      */
     public void testCreateNodeWithInvalidExactName() throws IOException {
                String location = postUrl + SLASH;
@@ -198,12 +197,12 @@ public class PostServletCreateTest exten
     }
 
     /**
-     * SLING-1091: test error reporting when attempting to create a node with 
an 
-     * already used node name. 
+     * SLING-1091: test error reporting when attempting to create a node with 
an
+     * already used node name.
      */
     public void testCreateNodeWithAlreadyUsedExactName() throws IOException {
         String testNodeName = "alreadyUsedExactNodeName";
-       
+
        Map<String,String> nodeProperties = new HashMap<String, String>();
        nodeProperties.put(SlingPostConstants.RP_NODE_NAME, testNodeName);
         final String location = testClient.createNode(postUrl + SLASH, 
nodeProperties);
@@ -253,11 +252,10 @@ public class PostServletCreateTest exten
         list.add(new NameValuePair("prop", "value"));
         list.add(new NameValuePair("jcr:primaryType", "nt:unstructured"));
 
-        final HttpMethod method = assertPostStatus(childUrl, 500, list,
+        assertPostStatus(childUrl, 500, list,
                 "Response to creating a child under nt:file should fail.");
-        final String body = method.getResponseBodyAsString();
-        assertTrue("Failure should result from a ConstraintViolationException",
-                
body.contains("javax.jcr.nodetype.ConstraintViolationException"));
+        // we shouldn't check for a specific exception as that one is 
implementation specific (see SLING-2763)
+        // a result of 500 is enough.
     }
 
 }
\ No newline at end of file


Reply via email to