diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2010-04-14 18:39:19 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-04-14 18:39:19 -0700 |
commit | 5c780b387f5d2da42885907a58b6829f0f825263 (patch) | |
tree | 791325d6ea6e016754c89f4491aabcb578ad866a /org.eclipse.jgit.junit | |
parent | 6da38b9474f943b66c6594c58510aec234742669 (diff) | |
download | jgit-5c780b387f5d2da42885907a58b6829f0f825263.tar.gz jgit-5c780b387f5d2da42885907a58b6829f0f825263.zip |
Fix unit tests using MockSystemReader with user configuation
Since cc905e7d4be "Make Repository.getConfig aware of changed config"
its invalid to have a null result from FileBasedConfig.getFile(), as
the path is used to stat the location on disk before returning the
Config object from Repository.getConfig().
Mock out the isOutdated() method to return false all of the time
in the mock test environment, so we don't crash with an NPE when
this mock user configuration is being called.
Change-Id: I0b4d9cbd346d5dc225ec12674da905c35457fa7c
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.junit')
-rw-r--r-- | org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java index 306d432e63..b4f0b7e909 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java @@ -70,7 +70,13 @@ public class MockSystemReader extends SystemReader { @Override public void load() throws IOException, ConfigInvalidException { // Do nothing - }}; + } + + @Override + public boolean isOutdated() { + return false; + } + }; } private void init(final String n) { |