summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2011-03-17 13:45:52 -0400
committerCode Review <codereview-daemon@eclipse.org>2011-03-17 13:45:52 -0400
commit5aab335f45760dce16350d10c8788f204a032206 (patch)
treea274a2681ab7ca92250bc23803f41e8e97f41cb4 /org.eclipse.jgit.test
parentfd963a9180af73b6a05a5c1a2af6dd7168899170 (diff)
parent157a996e1d48b504df922f995bf1104dc2c57c7b (diff)
downloadjgit-5aab335f45760dce16350d10c8788f204a032206.tar.gz
jgit-5aab335f45760dce16350d10c8788f204a032206.zip
Merge "Expose if name or email is based on a guess"
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java
index d5da16ad80..b9f62177cc 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java
@@ -148,17 +148,21 @@ public class ConfigTest {
authorEmail = localConfig.get(UserConfig.KEY).getAuthorEmail();
assertEquals(Constants.UNKNOWN_USER_DEFAULT, authorName);
assertEquals(Constants.UNKNOWN_USER_DEFAULT + "@" + hostname, authorEmail);
+ assertTrue(localConfig.get(UserConfig.KEY).isAuthorNameImplicit());
+ assertTrue(localConfig.get(UserConfig.KEY).isAuthorEmailImplicit());
// the system user name is defined
mockSystemReader.setProperty(Constants.OS_USER_NAME_KEY, "os user name");
localConfig.uncache(UserConfig.KEY);
authorName = localConfig.get(UserConfig.KEY).getAuthorName();
assertEquals("os user name", authorName);
+ assertTrue(localConfig.get(UserConfig.KEY).isAuthorNameImplicit());
if (hostname != null && hostname.length() != 0) {
authorEmail = localConfig.get(UserConfig.KEY).getAuthorEmail();
assertEquals("os user name@" + hostname, authorEmail);
}
+ assertTrue(localConfig.get(UserConfig.KEY).isAuthorEmailImplicit());
// the git environment variables are defined
mockSystemReader.setProperty(Constants.GIT_AUTHOR_NAME_KEY, "git author name");
@@ -168,6 +172,8 @@ public class ConfigTest {
authorEmail = localConfig.get(UserConfig.KEY).getAuthorEmail();
assertEquals("git author name", authorName);
assertEquals("author@email", authorEmail);
+ assertFalse(localConfig.get(UserConfig.KEY).isAuthorNameImplicit());
+ assertFalse(localConfig.get(UserConfig.KEY).isAuthorEmailImplicit());
// the values are defined in the global configuration
userGitConfig.setString("user", null, "name", "global username");
@@ -176,6 +182,8 @@ public class ConfigTest {
authorEmail = localConfig.get(UserConfig.KEY).getAuthorEmail();
assertEquals("global username", authorName);
assertEquals("author@globalemail", authorEmail);
+ assertFalse(localConfig.get(UserConfig.KEY).isAuthorNameImplicit());
+ assertFalse(localConfig.get(UserConfig.KEY).isAuthorEmailImplicit());
// the values are defined in the local configuration
localConfig.setString("user", null, "name", "local username");
@@ -184,11 +192,15 @@ public class ConfigTest {
authorEmail = localConfig.get(UserConfig.KEY).getAuthorEmail();
assertEquals("local username", authorName);
assertEquals("author@localemail", authorEmail);
+ assertFalse(localConfig.get(UserConfig.KEY).isAuthorNameImplicit());
+ assertFalse(localConfig.get(UserConfig.KEY).isAuthorEmailImplicit());
authorName = localConfig.get(UserConfig.KEY).getCommitterName();
authorEmail = localConfig.get(UserConfig.KEY).getCommitterEmail();
assertEquals("local username", authorName);
assertEquals("author@localemail", authorEmail);
+ assertFalse(localConfig.get(UserConfig.KEY).isCommitterNameImplicit());
+ assertFalse(localConfig.get(UserConfig.KEY).isCommitterEmailImplicit());
}
@Test