incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1539294 - /sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/integration/HttpTestBase.java
Date Wed, 06 Nov 2013 10:18:06 GMT
Author: bdelacretaz
Date: Wed Nov  6 10:18:06 2013
New Revision: 1539294

URL: http://svn.apache.org/r1539294
Log:
Delete test node under /WaitForSlingStartup once done testing

Modified:
    sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/integration/HttpTestBase.java

Modified: sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/integration/HttpTestBase.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/integration/HttpTestBase.java?rev=1539294&r1=1539293&r2=1539294&view=diff
==============================================================================
--- sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/integration/HttpTestBase.java
(original)
+++ sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/integration/HttpTestBase.java
Wed Nov  6 10:18:06 2013
@@ -238,8 +238,9 @@ public class HttpTestBase extends TestCa
         props.put("time", time);
 
         // POST, get URL of created node and get content
-        {
-            final String urlOfNewNode = testClient.createNode(url, props, null, true);
+        String urlOfNewNode = null; 
+        try {
+            urlOfNewNode = testClient.createNode(url, props, null, true);
             final GetMethod get = new GetMethod(urlOfNewNode + DEFAULT_EXT);
             final int status = httpClient.executeMethod(get);
             if(status!=200) {
@@ -256,6 +257,13 @@ public class HttpTestBase extends TestCa
             if(!content.contains(time)) {
                 throw new IOException("Content does not contain '" + time + "' (" + content
+ ") at URL=" + urlOfNewNode);
             }
+        } finally {
+            if(urlOfNewNode != null) {
+                try {
+                    testClient.delete(urlOfNewNode);
+                } catch(Exception ignore) {
+                }
+            }
         }
 
         // Also check that the WebDAV root is ready



Mime
View raw message