You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/06/19 08:50:18 UTC

svn commit: r1494474 - /subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java

Author: brane
Date: Wed Jun 19 06:50:18 2013
New Revision: 1494474

URL: http://svn.apache.org/r1494474
Log:
On the javahl-ra branch: Add more test cases.

[in subversion/bindings/javahl/tests/org/apache/subversion/javahl]
* SVNRemoteTests.java: Reorder test cases.
  (SVNRemoteTests.testDispose,
   SVNRemoteTests.testGetUrl_viaSVNClientWorkingCopy,
   SVNRemoteTests.testGetCommitEditor,
   SVNRemoteTests.testDisposeCommitEditor): New test cases.

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

Modified: subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java?rev=1494474&r1=1494473&r2=1494474&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java (original)
+++ subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java Wed Jun 19 06:50:18 2013
@@ -57,6 +57,31 @@ public class SVNRemoteTests extends SVNT
         thisTest = new OneTest();
     }
 
+    public static ISVNRemote getSession(String url, String configDirectory)
+    {
+        try
+        {
+            RemoteFactory factory = new RemoteFactory();
+            factory.setConfigDirectory(configDirectory);
+            factory.setUsername(USERNAME);
+            factory.setPassword(PASSWORD);
+            factory.setPrompt(new DefaultPromptUserPassword());
+
+            ISVNRemote raSession = factory.openRemoteSession(url);
+            assertNotNull("Null session was returned by factory", raSession);
+            return raSession;
+        }
+        catch (Exception ex)
+        {
+            throw new RuntimeException(ex);
+        }
+    }
+
+    private ISVNRemote getSession()
+    {
+        return getSession(getTestRepoUrl(), super.conf.getAbsolutePath());
+    }
+
     /**
      * Test the basic SVNAdmin.create functionality
      * @throws SubversionException
@@ -67,8 +92,32 @@ public class SVNRemoteTests extends SVNT
         assertTrue("repository exists", thisTest.getRepository().exists());
     }
 
-    public void testDatedRev()
-        throws SubversionException, IOException
+    public void testGetSession_ConfigConstructor() throws Exception
+    {
+        ISVNRemote session;
+        try
+        {
+            session = new RemoteFactory(
+                super.conf.getAbsolutePath(),
+                USERNAME, PASSWORD,
+                new DefaultPromptUserPassword(), null)
+                .openRemoteSession(getTestRepoUrl());
+        }
+        catch (ClientException ex)
+        {
+            throw new RuntimeException(ex);
+        }
+        assertNotNull("Null session was returned by factory", session);
+        assertEquals(getTestRepoUrl(), session.getSessionUrl());
+    }
+
+    public void testDispose() throws Exception
+    {
+        ISVNRemote session = getSession();
+        session.dispose();
+    }
+
+    public void testDatedRev() throws Exception
     {
         ISVNRemote session = getSession();
 
@@ -76,8 +125,7 @@ public class SVNRemoteTests extends SVNT
         assertEquals(revision, 1);
     }
 
-    public void testGetLocks()
-        throws SubversionException, IOException
+    public void testGetLocks() throws Exception
     {
         ISVNRemote session = getSession();
 
@@ -95,8 +143,7 @@ public class SVNRemoteTests extends SVNT
         assertEquals(lock.getOwner(), "jrandom");
     }
 
-    public void testCheckPath()
-        throws SubversionException, IOException
+    public void testCheckPath() throws Exception
     {
         ISVNRemote session = getSession();
 
@@ -110,31 +157,6 @@ public class SVNRemoteTests extends SVNT
         assertEquals(NodeKind.dir, kind);
     }
 
-    public static ISVNRemote getSession(String url, String configDirectory)
-    {
-        try
-        {
-            RemoteFactory factory = new RemoteFactory();
-            factory.setConfigDirectory(configDirectory);
-            factory.setUsername(USERNAME);
-            factory.setPassword(PASSWORD);
-            factory.setPrompt(new DefaultPromptUserPassword());
-
-            ISVNRemote raSession = factory.openRemoteSession(url);
-            assertNotNull("Null session was returned by factory", raSession);
-            return raSession;
-        }
-        catch (Exception ex)
-        {
-            throw new RuntimeException(ex);
-        }
-    }
-
-    private ISVNRemote getSession()
-    {
-        return getSession(getTestRepoUrl(), super.conf.getAbsolutePath());
-    }
-
     private String getTestRepoUrl()
     {
         return thisTest.getUrl().toASCIIString();
@@ -173,22 +195,10 @@ public class SVNRemoteTests extends SVNT
         assertEquals(getTestRepoUrl(), session.getSessionUrl());
     }
 
-    public void testGetSession_ConfigConstructor() throws Exception
+    public void testGetUrl_viaSVNClientWorkingCopy() throws Exception
     {
-        ISVNRemote session;
-        try
-        {
-            session = new RemoteFactory(
-                super.conf.getAbsolutePath(),
-                USERNAME, PASSWORD,
-                new DefaultPromptUserPassword(), null)
-                .openRemoteSession(getTestRepoUrl());
-        }
-        catch (ClientException ex)
-        {
-            throw new RuntimeException(ex);
-        }
-        assertNotNull("Null session was returned by factory", session);
+        ISVNRemote session = client.openRemoteSession(thisTest.getWCPath());
+
         assertEquals(getTestRepoUrl(), session.getSessionUrl());
     }
 
@@ -212,4 +222,17 @@ public class SVNRemoteTests extends SVNT
         relPath = session.getReposRelativePath(baseUrl + "/beta");
         assertEquals("A/B/E/beta", relPath);
     }
+
+    public void testGetCommitEditor() throws Exception
+    {
+        ISVNRemote session = getSession();
+        session.getCommitEditor();
+    }
+
+    public void testDisposeCommitEditor() throws Exception
+    {
+        ISVNRemote session = getSession();
+        session.getCommitEditor();
+        session.dispose();
+    }
 }