From f3ce6e80794ff3a234dbd8850c8501abda95cedb Mon Sep 17 00:00:00 2001 From: James Moger Date: Wed, 11 Jul 2012 17:14:30 -0400 Subject: Fixes and adjustments to test suite --- tests/com/gitblit/tests/GitBlitSuite.java | 7 +++++-- tests/com/gitblit/tests/GitServletTest.java | 5 ++--- tests/com/gitblit/tests/SyndicationUtilsTest.java | 2 +- tests/com/gitblit/tests/TicgitUtilsTest.java | 4 +--- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'tests/com') diff --git a/tests/com/gitblit/tests/GitBlitSuite.java b/tests/com/gitblit/tests/GitBlitSuite.java index 0cb63ec7..07c5e08e 100644 --- a/tests/com/gitblit/tests/GitBlitSuite.java +++ b/tests/com/gitblit/tests/GitBlitSuite.java @@ -101,6 +101,9 @@ public class GitBlitSuite { // already started return false; } + + GitServletTest.deleteWorkingFolders(); + // Start a Gitblit instance Executors.newSingleThreadExecutor().execute(new Runnable() { public void run() { @@ -123,7 +126,7 @@ public class GitBlitSuite { 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 @@ public class GitBlitSuite { 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"); diff --git a/tests/com/gitblit/tests/GitServletTest.java b/tests/com/gitblit/tests/GitServletTest.java index 2f9a9c42..848a1d05 100644 --- a/tests/com/gitblit/tests/GitServletTest.java +++ b/tests/com/gitblit/tests/GitServletTest.java @@ -42,7 +42,6 @@ public class GitServletTest { @BeforeClass public static void startGitblit() throws Exception { - deleteWorkingFolders(); started.set(GitBlitSuite.startGitblit()); } @@ -50,11 +49,11 @@ public class GitServletTest { 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); } diff --git a/tests/com/gitblit/tests/SyndicationUtilsTest.java b/tests/com/gitblit/tests/SyndicationUtilsTest.java index ca6678de..4542adbd 100644 --- a/tests/com/gitblit/tests/SyndicationUtilsTest.java +++ b/tests/com/gitblit/tests/SyndicationUtilsTest.java @@ -67,7 +67,7 @@ public class SyndicationUtilsTest { Set links = new HashSet(); for (int i = 0; i < 2; i++) { List 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()); diff --git a/tests/com/gitblit/tests/TicgitUtilsTest.java b/tests/com/gitblit/tests/TicgitUtilsTest.java index a77dae43..74f9e44e 100644 --- a/tests/com/gitblit/tests/TicgitUtilsTest.java +++ b/tests/com/gitblit/tests/TicgitUtilsTest.java @@ -82,8 +82,6 @@ public class TicgitUtilsTest { .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); } } \ No newline at end of file -- cgit v1.2.3