James Moger
2013-11-24 f8f6aa4d07cdfaaf23e24bf9eaf0a5fb9b437dda
src/test/java/com/gitblit/tests/GitBlitSuite.java
@@ -33,11 +33,11 @@
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
import com.gitblit.GitBlit;
import com.gitblit.GitBlitException;
import com.gitblit.GitBlitServer;
import com.gitblit.manager.IRepositoryManager;
import com.gitblit.models.RepositoryModel;
import com.gitblit.servlet.GitblitContext;
import com.gitblit.utils.JGitUtils;
/**
@@ -65,6 +65,8 @@
      ModelUtilsTest.class, JnaUtilsTest.class })
public class GitBlitSuite {
   public static final File BASEFOLDER = new File("data");
   public static final File REPOSITORIES = new File("data/git");
   public static final File SETTINGS = new File("src/test/config/test-gitblit.properties");
@@ -83,30 +85,35 @@
   private static AtomicBoolean started = new AtomicBoolean(false);
   public static Repository getHelloworldRepository() throws Exception {
   public static Repository getHelloworldRepository() {
      return getRepository("helloworld.git");
   }
   public static Repository getTicgitRepository() throws Exception {
   public static Repository getTicgitRepository() {
      return getRepository("ticgit.git");
   }
   public static Repository getJGitRepository() throws Exception {
   public static Repository getJGitRepository() {
      return getRepository("test/jgit.git");
   }
   public static Repository getAmbitionRepository() throws Exception {
   public static Repository getAmbitionRepository() {
      return getRepository("test/ambition.git");
   }
   public static Repository getGitectiveRepository() throws Exception {
   public static Repository getGitectiveRepository() {
      return getRepository("test/gitective.git");
   }
   private static Repository getRepository(String name) throws Exception {
      File gitDir = FileKey.resolve(new File(REPOSITORIES, name), FS.DETECTED);
      Repository repository = new FileRepositoryBuilder().setGitDir(gitDir).build();
      return repository;
   private static Repository getRepository(String name) {
      try {
         File gitDir = FileKey.resolve(new File(REPOSITORIES, name), FS.DETECTED);
         Repository repository = new FileRepositoryBuilder().setGitDir(gitDir).build();
         return repository;
      } catch (Exception e) {
         e.printStackTrace();
      }
      return null;
   }
   public static boolean startGitblit() throws Exception {
@@ -180,7 +187,7 @@
   private static void showRemoteBranches(String repositoryName) {
      try {
         IRepositoryManager repositoryManager = GitBlit.getManager(IRepositoryManager.class);
         IRepositoryManager repositoryManager = GitblitContext.getManager(IRepositoryManager.class);
         RepositoryModel model = repositoryManager.getRepositoryModel(repositoryName);
         model.showRemoteBranches = true;
         repositoryManager.updateRepositoryModel(model.name, model, false);
@@ -191,7 +198,7 @@
   private static void automaticallyTagBranchTips(String repositoryName) {
      try {
         IRepositoryManager repositoryManager = GitBlit.getManager(IRepositoryManager.class);
         IRepositoryManager repositoryManager = GitblitContext.getManager(IRepositoryManager.class);
         RepositoryModel model = repositoryManager.getRepositoryModel(repositoryName);
         model.useIncrementalPushTags = true;
         repositoryManager.updateRepositoryModel(model.name, model, false);