subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From v...@apache.org
Subject svn commit: r1352736 - /subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRATests.java
Date Fri, 22 Jun 2012 01:35:06 GMT
Author: vmpn
Date: Fri Jun 22 01:35:05 2012
New Revision: 1352736

URL: http://svn.apache.org/viewvc?rev=1352736&view=rev
Log:
On the javahl-ra branch:

JavaHL: Implement a test for getLatestRevision() function

[ in subversion/bindings/javahl/src/org/tigris/subversion/javahl/ra ]

* SVNRATests.java
  (getSession): New support functions for RA testing
  (testGetLatestRevision): New test for the getLatestRevision function

Modified:
    subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRATests.java

Modified: subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRATests.java
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRATests.java?rev=1352736&r1=1352735&r2=1352736&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRATests.java
(original)
+++ subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRATests.java
Fri Jun 22 01:35:05 2012
@@ -22,6 +22,7 @@
  */
 package org.apache.subversion.javahl;
 
+import org.apache.subversion.javahl.SVNTests.DefaultPromptUserPassword;
 import org.apache.subversion.javahl.callback.*;
 
 import java.net.URI;
@@ -31,6 +32,9 @@ import java.util.Map;
 import java.util.HashSet;
 import java.io.IOException;
 
+import org.apache.subversion.javahl.ra.ISVNRa;
+import org.apache.subversion.javahl.ra.SVNRaConfigDefault;
+import org.apache.subversion.javahl.ra.SVNRaFactory;
 import org.apache.subversion.javahl.types.Depth;
 import org.apache.subversion.javahl.types.Lock;
 import org.apache.subversion.javahl.types.NodeKind;
@@ -110,4 +114,31 @@ public class SVNRATests extends SVNTests
         kind = ra.checkPath("A", Revision.getInstance(1));
         assertEquals(NodeKind.dir, kind);
     }
+    
+    public static ISVNRa getSession(String url, String configDirectory)
+    {
+        SVNRaConfigDefault config = new SVNRaConfigDefault();
+        config.setUsername(USERNAME);
+        config.setPassword(PASSWORD);
+        config.setPrompt(new DefaultPromptUserPassword());
+        config.setConfigDirectory(configDirectory);
+        
+        ISVNRa raSession = SVNRaFactory.createRaSession(url, null, config);
+
+        assertNotNull("Null session was returned by factory", raSession);
+
+        return raSession;
+    }
+    
+    private ISVNRa getSession()
+    {
+        return getSession(thisTest.getUrl().toASCIIString(), super.conf.getAbsolutePath());
+    }
+    
+    public void testGetLatestRevision() throws Exception
+    {
+        ISVNRa session = getSession();
+
+        assertEquals(1, session.getLatestRevision());
+    }
 }



Mime
View raw message