GitWorkflowRepository extends FileBasedWorkflowRepository implements WorkflowRepository, FileBasedWorkflowRepositoryMXBean { public synchronized void setGitRepositoryDir(File gitRepositoryDir) throws IOException, GitAPIException { if (isUp()) { deleteGitRepositoryDir(); } this.gitRepositoryDir = gitRepositoryDir; if (isUp()) { updateLocalGitRepositories(); } }  synchronized void setGitRepositoryDir(File gitRepositoryDir); synchronized void setGitRepositoryDir(String gitRepositoryDir); synchronized File getGitRepositoryDir(); synchronized String getOriginUri(); synchronized String getBranch(); synchronized void setOriginURI(String originUri); synchronized void setCredentials(String username, char[] password); synchronized void setBranch(String branch); @Override synchronized void setCheckIntervalMSec(int checkIntervalMSec); @Override synchronized void start(); @Override synchronized void shutdown(); synchronized boolean isUp(); static final String ORIGIN; static final String DEFAULT_BRANCH; }
@Test public void sameGitRepositoryDirTest() throws Exception { wfRepo.setGitRepositoryDir(WORK_DIR + "/wf-source"); defaultBranchTest(); }
@Test public void changeGitRepositoryRobustDirTest() throws Exception { wfRepo.setGitRepositoryDir(WORK_DIR + "/wf-source2"); LockSupport.parkNanos(1000000000 + CHECK_INTERVAL_M_SEC * 1000000); defaultBranchTest(); }
@Test public void changeGitRepositoryDirTest() throws Exception { wfRepo.setGitRepositoryDir(WORK_DIR + "/wf-source2"); String oldSourceDir = wfRepo.getSourceDirs().get(0); List<String> sourceDirs = new ArrayList<String>(1); sourceDirs.add(0, WORK_DIR + "/wf-source2"); wfRepo.setSourceDirs(sourceDirs); LockSupport.parkNanos(1000000000 + CHECK_INTERVAL_M_SEC * 1000000); change2BranchesTest(); }