Author: hwright
Date: Thu Dec 30 17:45:32 2010
New Revision: 1053953
URL: http://svn.apache.org/viewvc?rev=1053953&view=rev
Log:
JavaHL: Remove the String version of the propertySet Java API, and at the same
time introduce a similar helper for the tests.
[ in subversion/bindings/javahl/ ]
* tests/org/apache/subversion/javahl/BasicTests.java
(setprop): New helper.
[elsewhere]: Use the new helper.
* src/org/apache/subversion/javahl/SVNClient.java,
src/org/apache/subversion/javahl/ISVNClient.java
(propertySet): Remove the String-value version.
* src/org/tigris/subversion/javahl/SVNClient.java
(propertySet): Update compat wrapper.
Modified:
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
Modified:
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java?rev=1053953&r1=1053952&r2=1053953&view=diff
==============================================================================
---
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
(original)
+++
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
Thu Dec 30 17:45:32 2010
@@ -680,11 +680,6 @@ public interface ISVNClient
Map<String, String> revpropTable, CommitCallback callback)
throws ClientException;
- void propertySet(String path, String name, String value, Depth depth,
- Collection<String> changelists, boolean force,
- Map<String, String> revpropTable, CommitCallback callback)
- throws ClientException;
-
/**
* Remove one property of an item.
* @param path path of the item
Modified:
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java?rev=1053953&r1=1053952&r2=1053953&view=diff
==============================================================================
---
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
(original)
+++
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
Thu Dec 30 17:45:32 2010
@@ -422,17 +422,6 @@ public class SVNClient implements ISVNCl
CommitCallback callback)
throws ClientException;
- public void propertySet(String path, String name, String value,
- Depth depth, Collection<String> changelists,
- boolean force,
- Map<String, String> revpropTable,
- CommitCallback callback)
- throws ClientException
- {
- propertySet(path, name, value != null ? value.getBytes() : null,
- depth, changelists, force, revpropTable, callback);
- }
-
/**
* @since 1.5
*/
Modified:
subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java?rev=1053953&r1=1053952&r2=1053953&view=diff
==============================================================================
---
subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
(original)
+++
subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
Thu Dec 30 17:45:32 2010
@@ -1853,7 +1853,9 @@ public class SVNClient implements SVNCli
{
try
{
- aSVNClient.propertySet(path, name, value, Depth.toADepth(depth),
+ aSVNClient.propertySet(path, name,
+ value == null ? null : value.getBytes(),
+ Depth.toADepth(depth),
changelists == null ? null
: Arrays.asList(changelists),
force, revpropTable, null);
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=1053953&r1=1053952&r2=1053953&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
Thu Dec 30 17:45:32 2010
@@ -335,8 +335,7 @@ public class BasicTests extends SVNTests
assertEquals("wrong revision from update",
update(thisTest), rev);
thisTest.checkStatus();
- client.propertySet(thisTest.getWCPath(), "propname", "propval",
- Depth.empty, null, false, null, null);
+ setprop(thisTest.getWCPath(), "propname", "propval");
thisTest.getWc().setItemPropStatus("", Status.Kind.modified);
addExpectedCommitItem(thisTest.getWCPath(),
thisTest.getUrl().toString(),
null, NodeKind.dir,
CommitItemStateFlags.PropMods);
@@ -373,8 +372,7 @@ public class BasicTests extends SVNTests
String nuAuthor = status.getLastCommitAuthor();
// ----- r9: Prop change on A/B/F ---------------------------
- client.propertySet(thisTest.getWCPath() + "/A/B/F", "propname",
- "propval", Depth.empty, null, false, null, null);
+ setprop(thisTest.getWCPath() + "/A/B/F", "propname", "propval");
addExpectedCommitItem(thisTest.getWCPath(),
thisTest.getUrl().toString(),
"A/B/F", NodeKind.dir,
CommitItemStateFlags.PropMods);
@@ -688,8 +686,7 @@ public class BasicTests extends SVNTests
byte[] BINARY_DATA = {-12, -125, -51, 43, 5, 47, 116, -72, -120,
2, -98, -100, -73, 61, 118, 74, 36, 38, 56, 107, 45, 91, 38,
107, -87,
119, -107, -114, -45, -128, -69, 96};
- client.propertySet(itemPath, "abc", BINARY_DATA, Depth.empty, null,
false,
- null, null);
+ setprop(itemPath, "abc", BINARY_DATA);
Map<String, byte[]> properties = collectProperties(itemPath, null,
null, Depth.empty, null);
@@ -703,8 +700,7 @@ public class BasicTests extends SVNTests
"/A/B/E/alpha"),
false);
String alphaVal = "qrz";
- client.propertySet(itemPath, "cqcq", alphaVal.getBytes(), Depth.empty,
- null, false, null, null);
+ setprop(itemPath, "cqcq", alphaVal.getBytes());
final Map<String, Map<String, byte[]>> propMaps =
new HashMap<String, Map<String, byte[]>>();
@@ -1418,13 +1414,13 @@ public class BasicTests extends SVNTests
thisTest.getWc().setItemTextStatus("A/D/H/chi", Status.Kind.modified);
// set a property on A/D/G/rho file
- client.propertySet(thisTest.getWCPath()+"/A/D/G/rho", "abc", "def",
- Depth.infinity, null, false, null, null);
+ client.propertySet(thisTest.getWCPath()+"/A/D/G/rho", "abc",
+ (new String("def")).getBytes(),
+ Depth.infinity, null, false, null, null);
thisTest.getWc().setItemPropStatus("A/D/G/rho", Status.Kind.modified);
// set a property on A/B/F directory
- client.propertySet(thisTest.getWCPath()+"/A/B/F", "abc", "def",
- Depth.empty, null, false, null, null);
+ setprop(thisTest.getWCPath()+"/A/B/F", "abc", "def");
thisTest.getWc().setItemPropStatus("A/B/F", Status.Kind.modified);
// create a unversioned A/C/sigma file
@@ -2024,9 +2020,7 @@ public class BasicTests extends SVNTests
Set<String> muPathSet = new HashSet<String>(1);
muPathSet.add(thisTest.getWCPath()+"/A/mu");
- client.propertySet(thisTest.getWCPath()+"/A/mu",
- Property.NEEDS_LOCK, "*", Depth.empty,
- null, false, null, null);
+ setprop(thisTest.getWCPath()+"/A/mu", Property.NEEDS_LOCK, "*");
addExpectedCommitItem(thisTest.getWCPath(),
thisTest.getUrl().toString(),
"A/mu",NodeKind.file,
@@ -2749,8 +2743,7 @@ public class BasicTests extends SVNTests
"## -0,0 +1 ##" + NL +
"+Test property value." + NL;
- client.propertySet(aPath, "testprop", "Test property value.",
- Depth.empty, null, false, null, null);
+ setprop(aPath, "testprop", "Test property value.");
client.diff(aPath, Revision.BASE, aPath, Revision.WORKING, wcPath,
diffOutput.getPath(), Depth.infinity, null, true, true,
false, false);
@@ -2768,8 +2761,7 @@ public class BasicTests extends SVNTests
"## -0,0 +1 ##" + NL +
"+Test property value." + NL;
- client.propertySet(aPath, "testprop", "Test property value.",
- Depth.empty, null, false, null, null);
+ setprop(aPath, "testprop", "Test property value.");
client.diff(aPath, Revision.BASE, aPath, Revision.WORKING, aPath,
diffOutput.getPath(), Depth.infinity, null, true, true,
false, false);
@@ -2796,8 +2788,7 @@ public class BasicTests extends SVNTests
if (operativeRevision == 2) {
// Set svn:eol-style=native on iota
- client.propertySet(iotaPath, "svn:eol-style", "native",
- Depth.empty, null, false, null, null);
+ setprop(iotaPath, "svn:eol-style", "native");
Set<String> paths = new HashSet<String>(1);
paths.add(iotaPath);
addExpectedCommitItem(thisTest.getWCPath(),
@@ -3990,4 +3981,18 @@ public class BasicTests extends SVNTests
return client.update(thisTest.getWCPathSet(subpath), null,
Depth.unknown, false, false, false, false)[0];
}
+
+ private void setprop(String path, String name, String value)
+ throws ClientException
+ {
+ client.propertySet(path, name, value != null ? value.getBytes() : null,
+ Depth.empty, null, false, null, null);
+ }
+
+ private void setprop(String path, String name, byte[] value)
+ throws ClientException
+ {
+ client.propertySet(path, name, value, Depth.empty,
+ null, false, null, null);
+ }
}