From e23cd08c09ac25b671edd07895596b2ad274e5d7 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Fri, 12 Oct 2012 18:04:17 -0400
Subject: [PATCH] Added an IntelliJ module file for fun
---
tests/com/gitblit/tests/RpcTests.java | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/tests/com/gitblit/tests/RpcTests.java b/tests/com/gitblit/tests/RpcTests.java
index 123dd97..3ad0ec5 100644
--- a/tests/com/gitblit/tests/RpcTests.java
+++ b/tests/com/gitblit/tests/RpcTests.java
@@ -33,6 +33,7 @@
import org.junit.Test;
import com.gitblit.Constants.AccessRestrictionType;
+import com.gitblit.Constants.AuthorizationControl;
import com.gitblit.GitBlitException.UnauthorizedException;
import com.gitblit.Keys;
import com.gitblit.RpcServlet;
@@ -164,6 +165,7 @@
model.description = "created by RpcUtils";
model.owner = "garbage";
model.accessRestriction = AccessRestrictionType.VIEW;
+ model.authorizationControl = AuthorizationControl.AUTHENTICATED;
// create
assertTrue("Failed to create repository!",
@@ -172,6 +174,7 @@
RepositoryModel retrievedRepository = findRepository(model.name);
assertNotNull("Failed to find " + model.name, retrievedRepository);
assertEquals(AccessRestrictionType.VIEW, retrievedRepository.accessRestriction);
+ assertEquals(AuthorizationControl.AUTHENTICATED, retrievedRepository.authorizationControl);
// rename and change access restriciton
String originalName = model.name;
@@ -244,7 +247,7 @@
// Create the A-Team
TeamModel aTeam = new TeamModel("A-Team");
aTeam.users.add("admin");
- aTeam.repositories.add("helloworld.git");
+ aTeam.addRepositoryPermission("helloworld.git");
assertTrue(RpcUtils.createTeam(aTeam, url, account, password.toCharArray()));
aTeam = null;
@@ -258,7 +261,7 @@
}
assertNotNull(aTeam);
assertTrue(aTeam.hasUser("admin"));
- assertTrue(aTeam.hasRepository("helloworld.git"));
+ assertTrue(aTeam.hasRepositoryPermission("helloworld.git"));
RepositoryModel helloworld = null;
Map<String, RepositoryModel> repositories = RpcUtils.getRepositories(url, account,
@@ -352,6 +355,11 @@
// restore setting
newValue = !newValue;
updated.put(Keys.web.showRepositorySizes, String.valueOf(newValue));
+ success = RpcUtils.updateSettings(updated, url, account, password.toCharArray());
+ assertTrue("Failed to update server settings", success);
+ settings = RpcUtils.getSettings(url, account, password.toCharArray());
+ showSizes = settings.get(Keys.web.showRepositorySizes).getBoolean(true);
+ assertEquals(newValue, showSizes);
}
@Test
--
Gitblit v1.9.1