jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1152232 - in /jackrabbit/trunk/jackrabbit-webdav/src/test/java/org/apache/jackrabbit/webdav/server: RFC4918IfHeaderTest.java RFC4918PropfindTest.java
Date Fri, 29 Jul 2011 14:19:46 GMT
Author: angela
Date: Fri Jul 29 14:19:45 2011
New Revision: 1152232

URL: http://svn.apache.org/viewvc?rev=1152232&view=rev
Log:
fix indention

Modified:
    jackrabbit/trunk/jackrabbit-webdav/src/test/java/org/apache/jackrabbit/webdav/server/RFC4918IfHeaderTest.java
    jackrabbit/trunk/jackrabbit-webdav/src/test/java/org/apache/jackrabbit/webdav/server/RFC4918PropfindTest.java

Modified: jackrabbit/trunk/jackrabbit-webdav/src/test/java/org/apache/jackrabbit/webdav/server/RFC4918IfHeaderTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webdav/src/test/java/org/apache/jackrabbit/webdav/server/RFC4918IfHeaderTest.java?rev=1152232&r1=1152231&r2=1152232&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webdav/src/test/java/org/apache/jackrabbit/webdav/server/RFC4918IfHeaderTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-webdav/src/test/java/org/apache/jackrabbit/webdav/server/RFC4918IfHeaderTest.java
Fri Jul 29 14:19:45 2011
@@ -53,7 +53,7 @@ public class RFC4918IfHeaderTest extends
     private URI uri;
     private String username, password;
     private HttpClient client;
-    
+
     @Override
     protected void setUp() throws Exception {
         this.uri = URI.create(System.getProperty("webdav.test.url"));
@@ -69,16 +69,16 @@ public class RFC4918IfHeaderTest extends
                 new UsernamePasswordCredentials(this.username, this.password));
         super.setUp();
     }
-  
+
     @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
-    
+
     public void testPutIfEtag() throws HttpException, IOException, DavException, URISyntaxException
{
-  
+
         String testuri = this.root + "iftest";
-    
+
         int status;
         try {
             PutMethod put = new PutMethod(testuri);
@@ -96,76 +96,74 @@ public class RFC4918IfHeaderTest extends
     }
 
     public void testPutIfLockToken() throws HttpException, IOException, DavException, URISyntaxException
{
-      
-      String testuri = this.root + "iflocktest";
-      String locktoken = null;
-      
-      int status;
-      try {
-          PutMethod put = new PutMethod(testuri);
-          put.setRequestEntity(new StringRequestEntity("1"));
-          status = this.client.executeMethod(put);
-          assertTrue("status: " + status, status == 200 || status == 201 || status == 204);
-
-          LockMethod lock = new LockMethod(testuri, new LockInfo(
-                  Scope.EXCLUSIVE, Type.WRITE, "testcase", 10000, true));
-          status = this.client.executeMethod(lock);
-          assertEquals("status", 200, status);
-          locktoken = lock.getLockToken();
-          assertNotNull(locktoken);
-          
-          // try to overwrite without lock token
-          put = new PutMethod(testuri);
-          put.setRequestEntity(new StringRequestEntity("2"));
-          status = this.client.executeMethod(put);
-          assertEquals("status: " + status, 423, status);
-          
-          // try to overwrite using bad lock token
-          put = new PutMethod(testuri);
-          put.setRequestEntity(new StringRequestEntity("2"));
-          put.setRequestHeader("If", "(<" + "DAV:foobar" + ">)");
-          status = this.client.executeMethod(put);
-          assertEquals("status: " + status, 412, status);
-          
-          // try to overwrite using correct lock token, using  No-Tag-list format
-          put = new PutMethod(testuri);
-          put.setRequestEntity(new StringRequestEntity("2"));
-          put.setRequestHeader("If", "(<" + locktoken + ">)");
-          status = this.client.executeMethod(put);
-          assertTrue("status: " + status, status == 200 || status == 204);
-
-          // try to overwrite using correct lock token, using Tagged-list format
-          // and full URI
-          put = new PutMethod(testuri);
-          put.setRequestEntity(new StringRequestEntity("3"));
-          put.setRequestHeader("If", "<" + testuri + ">" + "(<" + locktoken + ">)");
-          status = this.client.executeMethod(put);
-          assertTrue("status: " + status, status == 200 || status == 204);
-
-          // try to overwrite using correct lock token, using Tagged-list format
-          // and absolute path only
-          put = new PutMethod(testuri);
-          put.setRequestEntity(new StringRequestEntity("4"));
-          put.setRequestHeader("If", "<" + new URI(testuri).getRawPath() + ">" + "(<"
+ locktoken + ">)");
-          status = this.client.executeMethod(put);
-          assertTrue("status: " + status, status == 200 || status == 204);
-
-          // try to overwrite using correct lock token, using Tagged-list format
-          // and bad path
-          put = new PutMethod(testuri);
-          put.setRequestEntity(new StringRequestEntity("5"));
-          put.setRequestHeader("If", "</foobar>" + "(<" + locktoken + ">)");
-          status = this.client.executeMethod(put);
-          assertTrue("status: " + status, status == 404 || status == 412);
-      }
-      finally {
-          DeleteMethod delete = new DeleteMethod(testuri);
-          if (locktoken != null) {
-              delete.setRequestHeader("If", "(<" + locktoken + ">)");
-          }
-          status = this.client.executeMethod(delete);
-          assertTrue("status: " + status, status == 200 || status == 204 || status == 404);
-      }
-  }
-  
+
+        String testuri = this.root + "iflocktest";
+        String locktoken = null;
+
+        int status;
+        try {
+            PutMethod put = new PutMethod(testuri);
+            put.setRequestEntity(new StringRequestEntity("1"));
+            status = this.client.executeMethod(put);
+            assertTrue("status: " + status, status == 200 || status == 201 || status == 204);
+
+            LockMethod lock = new LockMethod(testuri, new LockInfo(
+                    Scope.EXCLUSIVE, Type.WRITE, "testcase", 10000, true));
+            status = this.client.executeMethod(lock);
+            assertEquals("status", 200, status);
+            locktoken = lock.getLockToken();
+            assertNotNull(locktoken);
+
+            // try to overwrite without lock token
+            put = new PutMethod(testuri);
+            put.setRequestEntity(new StringRequestEntity("2"));
+            status = this.client.executeMethod(put);
+            assertEquals("status: " + status, 423, status);
+
+            // try to overwrite using bad lock token
+            put = new PutMethod(testuri);
+            put.setRequestEntity(new StringRequestEntity("2"));
+            put.setRequestHeader("If", "(<" + "DAV:foobar" + ">)");
+            status = this.client.executeMethod(put);
+            assertEquals("status: " + status, 412, status);
+
+            // try to overwrite using correct lock token, using  No-Tag-list format
+            put = new PutMethod(testuri);
+            put.setRequestEntity(new StringRequestEntity("2"));
+            put.setRequestHeader("If", "(<" + locktoken + ">)");
+            status = this.client.executeMethod(put);
+            assertTrue("status: " + status, status == 200 || status == 204);
+
+            // try to overwrite using correct lock token, using Tagged-list format
+            // and full URI
+            put = new PutMethod(testuri);
+            put.setRequestEntity(new StringRequestEntity("3"));
+            put.setRequestHeader("If", "<" + testuri + ">" + "(<" + locktoken +
">)");
+            status = this.client.executeMethod(put);
+            assertTrue("status: " + status, status == 200 || status == 204);
+
+            // try to overwrite using correct lock token, using Tagged-list format
+            // and absolute path only
+            put = new PutMethod(testuri);
+            put.setRequestEntity(new StringRequestEntity("4"));
+            put.setRequestHeader("If", "<" + new URI(testuri).getRawPath() + ">" +
"(<" + locktoken + ">)");
+            status = this.client.executeMethod(put);
+            assertTrue("status: " + status, status == 200 || status == 204);
+
+            // try to overwrite using correct lock token, using Tagged-list format
+            // and bad path
+            put = new PutMethod(testuri);
+            put.setRequestEntity(new StringRequestEntity("5"));
+            put.setRequestHeader("If", "</foobar>" + "(<" + locktoken + ">)");
+            status = this.client.executeMethod(put);
+            assertTrue("status: " + status, status == 404 || status == 412);
+        } finally {
+            DeleteMethod delete = new DeleteMethod(testuri);
+            if (locktoken != null) {
+                delete.setRequestHeader("If", "(<" + locktoken + ">)");
+            }
+            status = this.client.executeMethod(delete);
+            assertTrue("status: " + status, status == 200 || status == 204 || status == 404);
+        }
+    }
 }

Modified: jackrabbit/trunk/jackrabbit-webdav/src/test/java/org/apache/jackrabbit/webdav/server/RFC4918PropfindTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webdav/src/test/java/org/apache/jackrabbit/webdav/server/RFC4918PropfindTest.java?rev=1152232&r1=1152231&r2=1152232&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webdav/src/test/java/org/apache/jackrabbit/webdav/server/RFC4918PropfindTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-webdav/src/test/java/org/apache/jackrabbit/webdav/server/RFC4918PropfindTest.java
Fri Jul 29 14:19:45 2011
@@ -57,7 +57,7 @@ public class RFC4918PropfindTest extends
     private URI uri;
     private String username, password;
     private HttpClient client;
-    
+
     @Override
     protected void setUp() throws Exception {
         this.uri = URI.create(System.getProperty("webdav.test.url"));
@@ -73,12 +73,12 @@ public class RFC4918PropfindTest extends
                 new UsernamePasswordCredentials(this.username, this.password));
         super.setUp();
     }
-  
+
     @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
-    
+
     public void testOptions() throws HttpException, IOException, DavException, URISyntaxException
{
         OptionsMethod options = new OptionsMethod(this.root);
         this.client.executeMethod(options);
@@ -86,16 +86,16 @@ public class RFC4918PropfindTest extends
     }
 
     public void testPropfindInclude() throws HttpException, IOException, DavException, URISyntaxException
{
-  
+
         String testuri = this.root + "iftest";
-    
+
         int status;
         try {
             PutMethod put = new PutMethod(testuri);
             put.setRequestEntity(new StringRequestEntity("1"));
             status = this.client.executeMethod(put);
             assertEquals("status: " + status, 201, status);
-            
+
             DavPropertyNameSet names = new DavPropertyNameSet();
             names.add(DeltaVConstants.COMMENT);
             PropFindMethod propfind = new PropFindMethod(testuri, DavConstants.PROPFIND_ALL_PROP_INCLUDE,
names, 0);
@@ -109,7 +109,7 @@ public class RFC4918PropfindTest extends
             MultiStatusResponse response = responses[0];
             DavPropertySet found = response.getProperties(200);
             DavPropertySet notfound = response.getProperties(404);
-            
+
             assertTrue(found.contains(DeltaVConstants.COMMENT) || notfound.contains(DeltaVConstants.COMMENT));
         }
         finally {



Mime
View raw message