Skip to content

Commit

Permalink
test_addSubmodule() was deleted in GitAPITestCase.
Browse files Browse the repository at this point in the history
Implemented in GitClientTest by adding readme as a submodule.
  • Loading branch information
loghijiaha committed Feb 8, 2020
1 parent 9007920 commit 475ab79
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestCase.java
Expand Up @@ -2426,29 +2426,6 @@ public void assertFixSubmoduleUrlsThrows() throws InterruptedException {
}
}

public void test_addSubmodule() throws Exception {
String sub1 = "sub1-" + java.util.UUID.randomUUID().toString();
String readme1 = sub1 + File.separator + "README.adoc";
w.init();
assertFalse("submodule1 dir found too soon", w.file(sub1).exists());
assertFalse("submodule1 file found too soon", w.file(readme1).exists());

w.git.addSubmodule(localMirror(), sub1);
assertTrue("submodule1 dir not found after add", w.file(sub1).exists());
assertTrue("submodule1 file not found after add", w.file(readme1).exists());

w.igit().submoduleUpdate().recursive(false).execute();
assertTrue("submodule1 dir not found after add", w.file(sub1).exists());
assertTrue("submodule1 file not found after add", w.file(readme1).exists());

w.igit().submoduleUpdate().recursive(true).execute();
assertTrue("submodule1 dir not found after recursive update", w.file(sub1).exists());
assertTrue("submodule1 file found after recursive update", w.file(readme1).exists());

w.igit().submoduleSync();
assertFixSubmoduleUrlsThrows();
}

private File createTempDirectoryWithoutSpaces() throws IOException {
// JENKINS-56175 notes that the plugin does not support submodule URL's
// which contain a space character. Parent pom 3.36 and later use a
Expand Down Expand Up @@ -3837,27 +3814,6 @@ public void test_getHeadRev_returns_accurate_SHA1_values() throws Exception {
check_headRev(w.repoPath(), getMirrorHead());
}

private void check_changelog_sha1(final String sha1, final String branchName) throws InterruptedException
{
ChangelogCommand changelogCommand = w.git.changelog();
changelogCommand.max(1);
StringWriter writer = new StringWriter();
changelogCommand.to(writer);
changelogCommand.execute();
String splitLog[] = writer.toString().split("[\\n\\r]", 3); // Extract first line of changelog
assertEquals("Wrong changelog line 1 on branch " + branchName, "commit " + sha1, splitLog[0]);
}

public void test_changelog() throws Exception {
w = clone(localMirror());
String sha1Prev = w.git.revParse("HEAD").name();
w.touch("changelog-file", "changelog-file-content-" + sha1Prev);
w.git.add("changelog-file");
w.git.commit("changelog-commit-message");
String sha1 = w.git.revParse("HEAD").name();
check_changelog_sha1(sha1, "master");
}

public void test_show_revision_for_merge() throws Exception {
w = clone(localMirror());
ObjectId from = ObjectId.fromString("45e76942914664ee19f31d90e6f2edbfe0d13a46");
Expand Down

0 comments on commit 475ab79

Please sign in to comment.