From: Robin Rosenberg <robin.rosenberg@dewire.com>
To: spearce@sparce.org
Cc: git@vger.kernel.org, Robin Rosenberg <robin.rosenberg@dewire.com>
Subject: [EGIT PATCH 05/10] Rename fields to avoid hiding of field names in ReadTreeTest
Date: Mon, 16 Mar 2009 21:14:38 +0100 [thread overview]
Message-ID: <1237234483-3405-6-git-send-email-robin.rosenberg@dewire.com> (raw)
In-Reply-To: <1237234483-3405-5-git-send-email-robin.rosenberg@dewire.com>
---
.../tst/org/spearce/jgit/lib/ReadTreeTest.java | 118 ++++++++++----------
1 files changed, 59 insertions(+), 59 deletions(-)
diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/ReadTreeTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/ReadTreeTest.java
index 6318633..c9d0565 100644
--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/ReadTreeTest.java
+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/ReadTreeTest.java
@@ -49,10 +49,10 @@
public class ReadTreeTest extends RepositoryTestCase {
- private Tree head;
- private Tree merge;
- private GitIndex index;
- private WorkDirCheckout readTree;
+ private Tree theHead;
+ private Tree theMerge;
+ private GitIndex theIndex;
+ private WorkDirCheckout theReadTree;
// Each of these rules are from the read-tree manpage
// go there to see what they mean.
// Rule 0 is left out for obvious reasons :)
@@ -87,9 +87,9 @@ public void testRules1thru3_NoIndexEntry() throws IOException {
void setupCase(HashMap<String, String> headEntries,
HashMap<String, String> mergeEntries,
HashMap<String, String> indexEntries) throws IOException {
- head = buildTree(headEntries);
- merge = buildTree(mergeEntries);
- index = buildIndex(indexEntries);
+ theHead = buildTree(headEntries);
+ theMerge = buildTree(mergeEntries);
+ theIndex = buildIndex(indexEntries);
}
private GitIndex buildIndex(HashMap<String, String> indexEntries) throws IOException {
@@ -129,9 +129,9 @@ ObjectId genSha1(String data) {
}
private WorkDirCheckout go() throws IOException {
- readTree = new WorkDirCheckout(db, trash, head, index, merge);
- readTree.prescanTwoTrees();
- return readTree;
+ theReadTree = new WorkDirCheckout(db, trash, theHead, theIndex, theMerge);
+ theReadTree.prescanTwoTrees();
+ return theReadTree;
}
// for these rules, they all have clean yes/no options
@@ -144,17 +144,17 @@ public void testRules4thru13_IndexEntryNotInHead() throws IOException {
idxMap = new HashMap<String, String>();
idxMap.put("foo", "foo");
setupCase(null, null, idxMap);
- readTree = go();
+ theReadTree = go();
- assertTrue(readTree.updated.isEmpty());
- assertTrue(readTree.removed.isEmpty());
- assertTrue(readTree.conflicts.isEmpty());
+ assertTrue(theReadTree.updated.isEmpty());
+ assertTrue(theReadTree.removed.isEmpty());
+ assertTrue(theReadTree.conflicts.isEmpty());
// rules 6 and 7
idxMap = new HashMap<String, String>();
idxMap.put("foo", "foo");
setupCase(null, idxMap, idxMap);
- readTree = go();
+ theReadTree = go();
assertAllEmpty();
@@ -166,9 +166,9 @@ public void testRules4thru13_IndexEntryNotInHead() throws IOException {
setupCase(null, mergeMap, idxMap);
go();
- assertTrue(readTree.updated.isEmpty());
- assertTrue(readTree.removed.isEmpty());
- assertTrue(readTree.conflicts.contains("foo"));
+ assertTrue(theReadTree.updated.isEmpty());
+ assertTrue(theReadTree.removed.isEmpty());
+ assertTrue(theReadTree.conflicts.contains("foo"));
// rule 10
@@ -177,29 +177,29 @@ public void testRules4thru13_IndexEntryNotInHead() throws IOException {
setupCase(headMap, null, idxMap);
go();
- assertTrue(readTree.removed.contains("foo"));
- assertTrue(readTree.updated.isEmpty());
- assertTrue(readTree.conflicts.isEmpty());
+ assertTrue(theReadTree.removed.contains("foo"));
+ assertTrue(theReadTree.updated.isEmpty());
+ assertTrue(theReadTree.conflicts.isEmpty());
// rule 11
setupCase(headMap, null, idxMap);
new File(trash, "foo").delete();
writeTrashFile("foo", "bar");
- index.getMembers()[0].forceRecheck();
+ theIndex.getMembers()[0].forceRecheck();
go();
- assertTrue(readTree.removed.isEmpty());
- assertTrue(readTree.updated.isEmpty());
- assertTrue(readTree.conflicts.contains("foo"));
+ assertTrue(theReadTree.removed.isEmpty());
+ assertTrue(theReadTree.updated.isEmpty());
+ assertTrue(theReadTree.conflicts.contains("foo"));
// rule 12 & 13
headMap.put("foo", "head");
setupCase(headMap, null, idxMap);
go();
- assertTrue(readTree.removed.isEmpty());
- assertTrue(readTree.updated.isEmpty());
- assertTrue(readTree.conflicts.contains("foo"));
+ assertTrue(theReadTree.removed.isEmpty());
+ assertTrue(theReadTree.updated.isEmpty());
+ assertTrue(theReadTree.conflicts.contains("foo"));
// rules 14 & 15
setupCase(headMap, headMap, idxMap);
@@ -209,7 +209,7 @@ public void testRules4thru13_IndexEntryNotInHead() throws IOException {
// rules 16 & 17
setupCase(headMap, mergeMap, idxMap); go();
- assertTrue(readTree.conflicts.contains("foo"));
+ assertTrue(theReadTree.conflicts.contains("foo"));
// rules 18 & 19
setupCase(headMap, idxMap, idxMap); go();
@@ -217,51 +217,51 @@ public void testRules4thru13_IndexEntryNotInHead() throws IOException {
// rule 20
setupCase(idxMap, mergeMap, idxMap); go();
- assertTrue(readTree.updated.containsKey("foo"));
+ assertTrue(theReadTree.updated.containsKey("foo"));
// rules 21
setupCase(idxMap, mergeMap, idxMap);
new File(trash, "foo").delete();
writeTrashFile("foo", "bar");
- index.getMembers()[0].forceRecheck();
+ theIndex.getMembers()[0].forceRecheck();
go();
- assertTrue(readTree.conflicts.contains("foo"));
+ assertTrue(theReadTree.conflicts.contains("foo"));
}
private void assertAllEmpty() {
- assertTrue(readTree.removed.isEmpty());
- assertTrue(readTree.updated.isEmpty());
- assertTrue(readTree.conflicts.isEmpty());
+ assertTrue(theReadTree.removed.isEmpty());
+ assertTrue(theReadTree.updated.isEmpty());
+ assertTrue(theReadTree.conflicts.isEmpty());
}
public void testDirectoryFileSimple() throws IOException {
- index = new GitIndex(db);
- index.add(trash, writeTrashFile("DF", "DF"));
- Tree treeDF = db.mapTree(index.writeTree());
+ theIndex = new GitIndex(db);
+ theIndex.add(trash, writeTrashFile("DF", "DF"));
+ Tree treeDF = db.mapTree(theIndex.writeTree());
recursiveDelete(new File(trash, "DF"));
- index = new GitIndex(db);
- index.add(trash, writeTrashFile("DF/DF", "DF/DF"));
- Tree treeDFDF = db.mapTree(index.writeTree());
+ theIndex = new GitIndex(db);
+ theIndex.add(trash, writeTrashFile("DF/DF", "DF/DF"));
+ Tree treeDFDF = db.mapTree(theIndex.writeTree());
- index = new GitIndex(db);
+ theIndex = new GitIndex(db);
recursiveDelete(new File(trash, "DF"));
- index.add(trash, writeTrashFile("DF", "DF"));
- readTree = new WorkDirCheckout(db, trash, treeDF, index, treeDFDF);
- readTree.prescanTwoTrees();
+ theIndex.add(trash, writeTrashFile("DF", "DF"));
+ theReadTree = new WorkDirCheckout(db, trash, treeDF, theIndex, treeDFDF);
+ theReadTree.prescanTwoTrees();
- assertTrue(readTree.removed.contains("DF"));
- assertTrue(readTree.updated.containsKey("DF/DF"));
+ assertTrue(theReadTree.removed.contains("DF"));
+ assertTrue(theReadTree.updated.containsKey("DF/DF"));
recursiveDelete(new File(trash, "DF"));
- index = new GitIndex(db);
- index.add(trash, writeTrashFile("DF/DF", "DF/DF"));
+ theIndex = new GitIndex(db);
+ theIndex.add(trash, writeTrashFile("DF/DF", "DF/DF"));
- readTree = new WorkDirCheckout(db, trash, treeDFDF, index, treeDF);
- readTree.prescanTwoTrees();
- assertTrue(readTree.removed.contains("DF/DF"));
- assertTrue(readTree.updated.containsKey("DF"));
+ theReadTree = new WorkDirCheckout(db, trash, treeDFDF, theIndex, treeDF);
+ theReadTree.prescanTwoTrees();
+ assertTrue(theReadTree.removed.contains("DF/DF"));
+ assertTrue(theReadTree.updated.containsKey("DF"));
}
/*
@@ -467,19 +467,19 @@ private void cleanUpDF() throws Exception {
}
private void assertConflict(String s) {
- assertTrue(readTree.conflicts.contains(s));
+ assertTrue(theReadTree.conflicts.contains(s));
}
private void assertUpdated(String s) {
- assertTrue(readTree.updated.containsKey(s));
+ assertTrue(theReadTree.updated.containsKey(s));
}
private void assertRemoved(String s) {
- assertTrue(readTree.removed.contains(s));
+ assertTrue(theReadTree.removed.contains(s));
}
private void assertNoConflicts() {
- assertTrue(readTree.conflicts.isEmpty());
+ assertTrue(theReadTree.conflicts.isEmpty());
}
private void doit(HashMap<String, String> h, HashMap<String, String>m,
@@ -545,8 +545,8 @@ public void testCloseNameConflicts1() throws IOException {
}
private void checkout() throws IOException {
- readTree = new WorkDirCheckout(db, trash, head, index, merge);
- readTree.checkout();
+ theReadTree = new WorkDirCheckout(db, trash, theHead, theIndex, theMerge);
+ theReadTree.checkout();
}
public void testCheckoutOutChanges() throws IOException {
--
1.6.1.285.g35d8b
next prev parent reply other threads:[~2009-03-16 20:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-16 20:14 [EGIT PATCH 00/10] JGit cleanups Robin Rosenberg
2009-03-16 20:14 ` [EGIT PATCH 01/10] Require javadoc on protected methods in jgit core Robin Rosenberg
2009-03-16 20:14 ` [EGIT PATCH 02/10] Rename the objectsUrl in the nested HttpObjectDB to Robin Rosenberg
2009-03-16 20:14 ` [EGIT PATCH 03/10] Rename variables that hides others with different content in FetchProcess Robin Rosenberg
2009-03-16 20:14 ` [EGIT PATCH 04/10] Rename a parameter i PackWriter that hides another with the same name Robin Rosenberg
2009-03-16 20:14 ` Robin Rosenberg [this message]
2009-03-16 20:14 ` [EGIT PATCH 06/10] Rename the gitDir fields to indicate they refer to another dir than the default Robin Rosenberg
2009-03-16 20:14 ` [EGIT PATCH 07/10] Rename a parameter in PushProcessTest that hides another Robin Rosenberg
2009-03-16 20:14 ` [EGIT PATCH 08/10] Drop unused end parameters in hunk parsing code Robin Rosenberg
2009-03-16 20:14 ` [EGIT PATCH 09/10] Drop unused File arguments in IndexTreeWalker and WorkdirCheckout Robin Rosenberg
2009-03-16 20:14 ` [EGIT PATCH 10/10] Drop an effectively unused parameter in IndexTreeWalker Robin Rosenberg
2009-03-16 20:39 ` [EGIT PATCH 08/10] Drop unused end parameters in hunk parsing code Shawn O. Pearce
2009-03-16 20:25 ` [EGIT PATCH 02/10] Rename the objectsUrl in the nested HttpObjectDB to Shawn O. Pearce
2009-03-16 21:25 ` Robin Rosenberg
2009-03-16 21:28 ` Shawn O. Pearce
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1237234483-3405-6-git-send-email-robin.rosenberg@dewire.com \
--to=robin.rosenberg@dewire.com \
--cc=git@vger.kernel.org \
--cc=spearce@sparce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).