summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2011-10-28 08:08:00 -0400
committerJames Moger <james.moger@gitblit.com>2011-10-28 08:08:00 -0400
commitc75304637f5535e634e57d4ed933c0fdb594d890 (patch)
tree347171533279f8c75bb3be8914ab665186800969 /tests
parent565ee056cd74a119b6b7c108239a6470976d02b7 (diff)
downloadgitblit-c75304637f5535e634e57d4ed933c0fdb594d890.tar.gz
gitblit-c75304637f5535e634e57d4ed933c0fdb594d890.zip
Added a list branches rpc
Diffstat (limited to 'tests')
-rw-r--r--tests/com/gitblit/tests/RpcTests.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/com/gitblit/tests/RpcTests.java b/tests/com/gitblit/tests/RpcTests.java
index 2860f32b..637d488e 100644
--- a/tests/com/gitblit/tests/RpcTests.java
+++ b/tests/com/gitblit/tests/RpcTests.java
@@ -16,6 +16,7 @@
package com.gitblit.tests;
import java.io.IOException;
+import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -220,25 +221,32 @@ public class RpcTests extends TestCase {
public void testUpdateSettings() throws Exception {
Map<String, String> updated = new HashMap<String, String>();
-
+
// grab current setting
ServerSettings settings = RpcUtils.getSettings(url, account, password.toCharArray());
boolean showSizes = settings.get(Keys.web.showRepositorySizes).getBoolean(true);
showSizes = !showSizes;
-
+
// update setting
updated.put(Keys.web.showRepositorySizes, String.valueOf(showSizes));
boolean success = RpcUtils.updateSettings(updated, "http://localhost:8080/gb", account,
password.toCharArray());
assertTrue("Failed to update server settings", success);
-
+
// confirm setting change
settings = RpcUtils.getSettings(url, account, password.toCharArray());
boolean newValue = settings.get(Keys.web.showRepositorySizes).getBoolean(false);
assertEquals(newValue, showSizes);
-
+
// restore setting
newValue = !newValue;
updated.put(Keys.web.showRepositorySizes, String.valueOf(newValue));
}
+
+ public void testBranches() throws Exception {
+ Map<String, Collection<String>> branches = RpcUtils.getAllBranches(url, account,
+ password.toCharArray());
+ assertTrue(branches != null);
+ assertTrue(branches.size() > 0);
+ }
}