subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1636101 - /subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
Date Sun, 02 Nov 2014 11:56:56 GMT
Author: brane
Date: Sun Nov  2 11:56:56 2014
New Revision: 1636101

URL: http://svn.apache.org/r1636101
Log:
Add a JavaHL test for getting status from an external tree.

* subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
  (BasicTests.testExternalStatus): New test case.

Modified:
    subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java

Modified: subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java?rev=1636101&r1=1636100&r2=1636101&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
(original)
+++ subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
Sun Nov  2 11:56:56 2014
@@ -701,6 +701,47 @@ public class BasicTests extends SVNTests
     }
 
     /**
+     * Test SVNClient.status on externals.
+     * @throws Throwable
+     */
+    public void testExternalStatus() throws Throwable
+    {
+        // build the test setup
+        OneTest thisTest = new OneTest();
+
+
+        // Add an externals reference to the working copy.
+        client.propertySetLocal(thisTest.getWCPathSet(), "svn:externals",
+                                "^/A/D/H ADHext".getBytes(),
+                                Depth.empty, null, false);
+
+        // Update the working copy to bring in the external subtree.
+        client.update(thisTest.getWCPathSet(), Revision.HEAD,
+                      Depth.unknown, false, false, false, false);
+
+        // Test status of an external file
+        File psi = new File(thisTest.getWorkingCopy() + "/ADHext", "psi");
+
+        MyStatusCallback statusCallback = new MyStatusCallback();
+        client.status(fileToSVNPath(psi, false), Depth.unknown,
+                      false, true, true, false, false, false,
+                      null, statusCallback);
+
+        final int statusCount = statusCallback.getStatusArray().length;
+        if (statusCount == 1)
+        {
+            Status st = statusCallback.getStatusArray()[0];
+            assertFalse(st.isConflicted());
+            assertEquals(Status.Kind.normal, st.getNodeStatus());
+            assertEquals(NodeKind.file, st.getNodeKind());
+        }
+        else if (statusCount > 1)
+            fail("File psi should not return more than one status.");
+        else
+            fail("File psi should return exactly one status.");
+    }
+
+    /**
      * Test the basic SVNClient.checkout functionality.
      * @throws Throwable
      */



Mime
View raw message