Use higher level Config types when possible

We don't have to assume/depend on RepositoryConfig here, these
two tests can use higher level versions of the class and still
come up with the same test.  That frees us up to do some changes
to the RepositoryConfig API.

Change-Id: Ia7b263c8c5efa3fae1054416d39c546867288132
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
Shawn O. Pearce 2010-06-23 10:09:27 -07:00
parent dc10dd6fc8
commit 8e396bcddc
3 changed files with 5 additions and 5 deletions

View File

@ -283,7 +283,7 @@ public void test003_WriteShouldBeEmptyTree() throws IOException {
}
public void test005_ReadSimpleConfig() {
final RepositoryConfig c = db.getConfig();
final Config c = db.getConfig();
assertNotNull(c);
assertEquals("0", c.getString("core", null, "repositoryformatversion"));
assertEquals("0", c.getString("CoRe", null, "REPOSITORYFoRmAtVeRsIoN"));
@ -294,8 +294,8 @@ public void test005_ReadSimpleConfig() {
public void test006_ReadUglyConfig() throws IOException,
ConfigInvalidException {
final RepositoryConfig c = db.getConfig();
final File cfg = new File(db.getDirectory(), "config");
final FileBasedConfig c = new FileBasedConfig(cfg);
final FileWriter pw = new FileWriter(cfg);
final String configStr = " [core];comment\n\tfilemode = yes\n"
+ "[user]\n"

View File

@ -48,7 +48,7 @@
import java.util.Collection;
import java.util.Collections;
import org.eclipse.jgit.lib.RepositoryConfig;
import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.lib.SampleDataRepositoryTestCase;
public class TransportTest extends SampleDataRepositoryTestCase {
@ -59,7 +59,7 @@ public class TransportTest extends SampleDataRepositoryTestCase {
@Override
public void setUp() throws Exception {
super.setUp();
final RepositoryConfig config = db.getConfig();
final Config config = db.getConfig();
remoteConfig = new RemoteConfig(config, "test");
remoteConfig.addURI(new URIish("http://everyones.loves.git/u/2"));
transport = null;

View File

@ -352,7 +352,7 @@ private boolean config_filemode() {
// to change this for testing.
if (filemode != null)
return filemode.booleanValue();
RepositoryConfig config = db.getConfig();
Config config = db.getConfig();
filemode = Boolean.valueOf(config.getBoolean("core", null, "filemode", true));
return filemode.booleanValue();
}