return self().timezone;
}
+ /**
+ * Returns the active settings.
+ *
+ * @return the active settings
+ */
+ public static IStoredSettings getSettings() {
+ return self().settings;
+ }
+
/**
* Returns the user-defined blob encodings.
*
git.repositoriesFolder = ${baseFolder}/git
git.searchRepositoriesSubfolders = true
git.enableGitServlet = true
-groovy.scriptsFolder = ${baseFolder}/groovy
+groovy.scriptsFolder = src/main/distrib/data/groovy
groovy.preReceiveScripts = blockpush
groovy.postReceiveScripts = sendmail
web.authenticateViewPages = false
web.authenticateAdminPages = true
web.allowCookieAuthentication = true
-realm.userService = test-users.conf
+realm.userService = ${baseFolder}/src/test/config/test-users.conf
realm.passwordStorage = md5
realm.minPasswordLength = 5
-web.siteName =
+web.siteName = Test Gitblit
web.allowAdministration = true
web.enableRpcServlet = true
web.enableRpcManagement = true
assertEquals(-1, FileUtils.folderSize(null));\r
assertEquals(-1, FileUtils.folderSize(new File(System.getProperty("user.dir"), "pretend")));\r
\r
- File dir = new File(System.getProperty("user.dir"), "distrib");\r
+ File dir = new File(System.getProperty("user.dir"), "src/main/distrib");\r
long size = FileUtils.folderSize(dir);\r
assertTrue("size is actually " + size, size >= 470000L);\r
\r
public class GitBlitSuite {\r
\r
public static final File REPOSITORIES = new File("data/git");\r
+ \r
+ public static final File SETTINGS = new File("src/test/config/test-gitblit.properties");\r
+ \r
+ public static final File USERSCONF = new File("src/test/config/test-users.conf");\r
\r
static int port = 8280;\r
static int gitPort = 8300;\r
GitBlitServer.main("--httpPort", "" + port, "--httpsPort", "0", "--shutdownPort",\r
"" + shutdownPort, "--gitPort", "" + gitPort, "--repositoriesFolder",\r
"\"" + GitBlitSuite.REPOSITORIES.getAbsolutePath() + "\"", "--userService",\r
- "test-users.conf", "--settings", "test-gitblit.properties",\r
+ GitBlitSuite.USERSCONF.getAbsolutePath(), "--settings", GitBlitSuite.SETTINGS.getAbsolutePath(),\r
"--baseFolder", "data");\r
}\r
});\r
\r
@Test\r
public void testFileSettings() throws Exception {\r
- FileSettings settings = new FileSettings("distrib/gitblit.properties");\r
+ FileSettings settings = new FileSettings("src/main/distrib/data/gitblit.properties");\r
assertEquals(true, settings.getBoolean("missing", true));\r
assertEquals("default", settings.getString("missing", "default"));\r
assertEquals(10, settings.getInteger("missing", 10));\r
assertEquals(5, GitBlit.getInteger("realm.userService", 5));\r
\r
assertTrue(GitBlit.getBoolean("git.enableGitServlet", false));\r
- assertEquals("test-users.conf", GitBlit.getString("realm.userService", null));\r
+ assertEquals(GitBlitSuite.USERSCONF.getAbsolutePath(), GitBlit.getString("realm.userService", null));\r
assertEquals(5, GitBlit.getInteger("realm.minPasswordLength", 0));\r
List<String> mdExtensions = GitBlit.getStrings("web.markdownExtensions");\r
assertTrue(mdExtensions.size() > 0);\r