James Moger
2012-07-11 f3ce6e80794ff3a234dbd8850c8501abda95cedb
Fixes and adjustments to test suite
5 files modified
19 ■■■■ changed files
test-users.conf 1 ●●●● patch | view | raw | blame | history
tests/com/gitblit/tests/GitBlitSuite.java 7 ●●●● patch | view | raw | blame | history
tests/com/gitblit/tests/GitServletTest.java 5 ●●●●● patch | view | raw | blame | history
tests/com/gitblit/tests/SyndicationUtilsTest.java 2 ●●● patch | view | raw | blame | history
tests/com/gitblit/tests/TicgitUtilsTest.java 4 ●●● patch | view | raw | blame | history
test-users.conf
@@ -1,5 +1,6 @@
[user "admin"]
    password = admin
    cookie = dd94709528bb1c83d08f3088d4043f4742891f4f
    role = "#admin"
    role = "#notfederated"
[team "admins"]
tests/com/gitblit/tests/GitBlitSuite.java
@@ -101,6 +101,9 @@
            // already started
            return false;
        }
        GitServletTest.deleteWorkingFolders();
        // Start a Gitblit instance
        Executors.newSingleThreadExecutor().execute(new Runnable() {
            public void run() {
@@ -123,7 +126,7 @@
        GitBlitServer.main("--stop", "--shutdownPort", "" + shutdownPort);
        // Wait a few seconds for it to be running
        Thread.sleep(2500);
        Thread.sleep(5000);
    }
    @BeforeClass
@@ -132,7 +135,7 @@
        if (REPOSITORIES.exists() || REPOSITORIES.mkdirs()) {
            cloneOrFetch("helloworld.git", "https://github.com/git/hello-world.git");
            cloneOrFetch("ticgit.git", "https://github.com/jeffWelling/ticgit.git");
            cloneOrFetch("ticgit.git", "https://github.com/schacon/ticgit.git");
            cloneOrFetch("test/jgit.git", "https://github.com/eclipse/jgit.git");
            cloneOrFetch("test/helloworld.git", "https://github.com/git/hello-world.git");
            cloneOrFetch("test/ambition.git", "https://github.com/defunkt/ambition.git");
tests/com/gitblit/tests/GitServletTest.java
@@ -42,7 +42,6 @@
    @BeforeClass
    public static void startGitblit() throws Exception {
        deleteWorkingFolders();
        started.set(GitBlitSuite.startGitblit());
    }
@@ -50,11 +49,11 @@
    public static void stopGitblit() throws Exception {
        if (started.get()) {
            GitBlitSuite.stopGitblit();
            deleteWorkingFolders();
        }
        deleteWorkingFolders();
    }
    
    private static void deleteWorkingFolders() throws Exception {
    public static void deleteWorkingFolders() throws Exception {
        if (ticgitFolder.exists()) {
            FileUtils.delete(ticgitFolder, FileUtils.RECURSIVE);
        }
tests/com/gitblit/tests/SyndicationUtilsTest.java
@@ -67,7 +67,7 @@
        Set<String> links = new HashSet<String>();
        for (int i = 0; i < 2; i++) {
            List<FeedEntryModel> feed = SyndicationUtils.readFeed(GitBlitSuite.url, "ticgit.git",
                    "deving", 5, i, GitBlitSuite.account, GitBlitSuite.password.toCharArray());
                    "master", 5, i, GitBlitSuite.account, GitBlitSuite.password.toCharArray());
            assertTrue(feed != null);
            assertTrue(feed.size() > 0);
            assertEquals(5, feed.size());
tests/com/gitblit/tests/TicgitUtilsTest.java
@@ -82,8 +82,6 @@
                .getTicket(repository, tickets.get(tickets.size() - 1).name);
        repository.close();
        assertNotNull(ticket);
        assertEquals(
                "1254123752_comments-on-ticgits-longer-than-5-lines-can-t-be-viewed-entirely_266",
                ticket.name);
        assertEquals("1206206148_add-attachment-to-ticket_138", ticket.name);
    }
}