Skip to content

Commit

Permalink
Merge branch 'master' of gitlabhq:github/pretested-integration-plugin…
Browse files Browse the repository at this point in the history
… into JENKINS-24754
  • Loading branch information
MadsNielsen committed Sep 18, 2014
2 parents 6d8873b + ae374f4 commit a025975
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
Expand Up @@ -48,6 +48,13 @@ public class AccumulatedCommitStrategyIT {

private String readmeFileContents_fromDevBranch;

@After
public void tearDown() throws Exception {
repository.close();
if (GIT_PARENT_DIR.exists())
FileUtils.deleteDirectory(GIT_PARENT_DIR);
}

public void createValidRepository() throws IOException, GitAPIException {
if (GIT_PARENT_DIR.exists())
FileUtils.deleteDirectory(GIT_PARENT_DIR);
Expand Down Expand Up @@ -102,10 +109,6 @@ public void createValidRepository() throws IOException, GitAPIException {
git.checkout().setName("master").call();

readmeFileContents_fromDevBranch = FileUtils.readFileToString(new File(README_FILE_PATH));

repository.close();
if (GIT_PARENT_DIR.exists())
FileUtils.deleteDirectory(GIT_PARENT_DIR);
}

private void createRepositoryWithMergeConflict() throws IOException, GitAPIException {
Expand Down Expand Up @@ -170,11 +173,6 @@ private void createRepositoryWithMergeConflict() throws IOException, GitAPIExcep
commitCommand.call();

readmeFileContents_fromDevBranch = FileUtils.readFileToString(new File(README_FILE_PATH));

repository.close();

if (GIT_PARENT_DIR.exists())
FileUtils.deleteDirectory(GIT_PARENT_DIR);
}

private int countCommits() {
Expand Down
Expand Up @@ -46,6 +46,13 @@ public class SquashCommitStrategyIT {

private String readmeFileContents_fromDevBranch;

@After
public void tearDown() throws Exception {
repository.close();
if (GIT_PARENT_DIR.exists())
FileUtils.deleteDirectory(GIT_PARENT_DIR);
}

public void createValidRepository() throws IOException, GitAPIException {
if (GIT_PARENT_DIR.exists())
FileUtils.deleteDirectory(GIT_PARENT_DIR);
Expand Down Expand Up @@ -102,10 +109,6 @@ public void createValidRepository() throws IOException, GitAPIException {
git.checkout().setName("master").call();

readmeFileContents_fromDevBranch = FileUtils.readFileToString(new File(README_FILE_PATH));

repository.close();
if (GIT_PARENT_DIR.exists())
FileUtils.deleteDirectory(GIT_PARENT_DIR);
}

private void createRepositoryWithMergeConflict() throws IOException, GitAPIException {
Expand Down Expand Up @@ -172,10 +175,6 @@ private void createRepositoryWithMergeConflict() throws IOException, GitAPIExcep
commitCommand.call();

readmeFileContents_fromDevBranch = FileUtils.readFileToString(new File(README_FILE_PATH));

repository.close();
if (GIT_PARENT_DIR.exists())
FileUtils.deleteDirectory(GIT_PARENT_DIR);
}

private int countCommits() {
Expand All @@ -184,8 +183,6 @@ private int countCommits() {
try {
Iterator<RevCommit> iterator = git.log().call().iterator();
for ( ; iterator.hasNext() ; ++commitCount ) iterator.next();


} catch (GitAPIException e) {
e.printStackTrace();
}
Expand Down

0 comments on commit a025975

Please sign in to comment.