Browse Source

cleanup: Prefer assertEquals over assertTrue(....equals(...))

That is the common style and yields better diagnostics on failure.

Change-Id: I831a55615a812734af0912a5d6bbfd1edc75308e
stable-2.1
Robin Rosenberg 12 years ago committed by Matthias Sohn
parent
commit
476e1d2ff1
  1. 4
      org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandWithRebaseTest.java
  2. 14
      org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ResetCommandTest.java
  3. 4
      org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashCreateCommandTest.java
  4. 16
      org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/EditListTest.java
  5. 6
      org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/EditTest.java
  6. 8
      org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/AbbreviatedObjectIdTest.java
  7. 2
      org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
  8. 2
      org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdTest.java
  9. 10
      org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/ResolveMergerTest.java
  10. 2
      org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevFlagSetTest.java
  11. 6
      org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefUpdateTest.java
  12. 11
      org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PacketLineInTest.java
  13. 2
      org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RefMapTest.java

4
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandWithRebaseTest.java

@ -149,7 +149,7 @@ public class PullCommandWithRebaseTest extends RepositoryTestCase {
PullResult res = target.pull().call(); PullResult res = target.pull().call();
// nothing to update since we don't have different data yet // nothing to update since we don't have different data yet
assertTrue(res.getFetchResult().getTrackingRefUpdates().isEmpty()); assertTrue(res.getFetchResult().getTrackingRefUpdates().isEmpty());
assertTrue(res.getRebaseResult().getStatus().equals(Status.UP_TO_DATE)); assertEquals(Status.UP_TO_DATE, res.getRebaseResult().getStatus());
assertFileContentsEqual(targetFile, "Hello world"); assertFileContentsEqual(targetFile, "Hello world");
@ -172,7 +172,7 @@ public class PullCommandWithRebaseTest extends RepositoryTestCase {
ConfigConstants.CONFIG_KEY_URL); ConfigConstants.CONFIG_KEY_URL);
assertFalse(res.getFetchResult().getTrackingRefUpdates().isEmpty()); assertFalse(res.getFetchResult().getTrackingRefUpdates().isEmpty());
assertTrue(res.getRebaseResult().getStatus().equals(Status.STOPPED)); assertEquals(Status.STOPPED, res.getRebaseResult().getStatus());
String result = "<<<<<<< Upstream, based on branch 'master' of " String result = "<<<<<<< Upstream, based on branch 'master' of "
+ remoteUri + remoteUri
+ "\nSource change\n=======\nTarget change\n>>>>>>> 42453fd Target change in local\n"; + "\nSource change\n=======\nTarget change\n>>>>>>> 42453fd Target change in local\n";

14
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ResetCommandTest.java

@ -141,7 +141,7 @@ public class ResetCommandTest extends RepositoryTestCase {
.call(); .call();
// check if HEAD points to initial commit now // check if HEAD points to initial commit now
ObjectId head = db.resolve(Constants.HEAD); ObjectId head = db.resolve(Constants.HEAD);
assertTrue(head.equals(initialCommit)); assertEquals(initialCommit, head);
// check if files were removed // check if files were removed
assertFalse(indexFile.exists()); assertFalse(indexFile.exists());
assertTrue(untrackedFile.exists()); assertTrue(untrackedFile.exists());
@ -178,7 +178,7 @@ public class ResetCommandTest extends RepositoryTestCase {
.call(); .call();
// check if HEAD points to initial commit now // check if HEAD points to initial commit now
ObjectId head = db.resolve(Constants.HEAD); ObjectId head = db.resolve(Constants.HEAD);
assertTrue(head.equals(initialCommit)); assertEquals(initialCommit, head);
// check if files still exist // check if files still exist
assertTrue(untrackedFile.exists()); assertTrue(untrackedFile.exists());
assertTrue(indexFile.exists()); assertTrue(indexFile.exists());
@ -199,7 +199,7 @@ public class ResetCommandTest extends RepositoryTestCase {
.call(); .call();
// check if HEAD points to initial commit now // check if HEAD points to initial commit now
ObjectId head = db.resolve(Constants.HEAD); ObjectId head = db.resolve(Constants.HEAD);
assertTrue(head.equals(initialCommit)); assertEquals(initialCommit, head);
// check if files still exist // check if files still exist
assertTrue(untrackedFile.exists()); assertTrue(untrackedFile.exists());
assertTrue(indexFile.exists()); assertTrue(indexFile.exists());
@ -277,7 +277,7 @@ public class ResetCommandTest extends RepositoryTestCase {
// check that HEAD hasn't moved // check that HEAD hasn't moved
ObjectId head = db.resolve(Constants.HEAD); ObjectId head = db.resolve(Constants.HEAD);
assertTrue(head.equals(secondCommit)); assertEquals(secondCommit, head);
// check if files still exist // check if files still exist
assertTrue(untrackedFile.exists()); assertTrue(untrackedFile.exists());
assertTrue(indexFile.exists()); assertTrue(indexFile.exists());
@ -306,7 +306,7 @@ public class ResetCommandTest extends RepositoryTestCase {
// check that HEAD hasn't moved // check that HEAD hasn't moved
ObjectId head = db.resolve(Constants.HEAD); ObjectId head = db.resolve(Constants.HEAD);
assertTrue(head.equals(secondCommit)); assertEquals(secondCommit, head);
// check if files still exist // check if files still exist
assertTrue(untrackedFile.exists()); assertTrue(untrackedFile.exists());
assertTrue(inHead("dir/b.txt")); assertTrue(inHead("dir/b.txt"));
@ -332,7 +332,7 @@ public class ResetCommandTest extends RepositoryTestCase {
// check that HEAD hasn't moved // check that HEAD hasn't moved
ObjectId head = db.resolve(Constants.HEAD); ObjectId head = db.resolve(Constants.HEAD);
assertTrue(head.equals(secondCommit)); assertEquals(secondCommit, head);
// check if files still exist // check if files still exist
assertTrue(untrackedFile.exists()); assertTrue(untrackedFile.exists());
assertTrue(indexFile.exists()); assertTrue(indexFile.exists());
@ -357,7 +357,7 @@ public class ResetCommandTest extends RepositoryTestCase {
git.reset().setRef(tagName).setMode(HARD).call(); git.reset().setRef(tagName).setMode(HARD).call();
ObjectId head = db.resolve(Constants.HEAD); ObjectId head = db.resolve(Constants.HEAD);
assertTrue(head.equals(secondCommit)); assertEquals(secondCommit, head);
} }
@Test @Test

4
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashCreateCommandTest.java

@ -291,7 +291,7 @@ public class StashCreateCommandTest extends RepositoryTestCase {
assertEquals("content", read(committedFile)); assertEquals("content", read(committedFile));
validateStashedCommit(stashed); validateStashedCommit(stashed);
assertTrue(stashed.getTree().equals(stashed.getParent(1).getTree())); assertEquals(stashed.getParent(1).getTree(), stashed.getTree());
List<DiffEntry> workingDiffs = diffWorkingAgainstHead(stashed); List<DiffEntry> workingDiffs = diffWorkingAgainstHead(stashed);
assertEquals(1, workingDiffs.size()); assertEquals(1, workingDiffs.size());
@ -326,7 +326,7 @@ public class StashCreateCommandTest extends RepositoryTestCase {
validateStashedCommit(stashed); validateStashedCommit(stashed);
assertTrue(stashed.getTree().equals(stashed.getParent(1).getTree())); assertEquals(stashed.getParent(1).getTree(), stashed.getTree());
List<DiffEntry> workingDiffs = diffWorkingAgainstHead(stashed); List<DiffEntry> workingDiffs = diffWorkingAgainstHead(stashed);
assertEquals(1, workingDiffs.size()); assertEquals(1, workingDiffs.size());

16
org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/EditListTest.java

@ -60,8 +60,8 @@ public class EditListTest {
assertTrue(l.isEmpty()); assertTrue(l.isEmpty());
assertEquals("EditList[]", l.toString()); assertEquals("EditList[]", l.toString());
assertTrue(l.equals(l)); assertEquals(l, l);
assertTrue(l.equals(new EditList())); assertEquals(new EditList(), l);
assertFalse(l.equals("")); assertFalse(l.equals(""));
assertEquals(l.hashCode(), new EditList().hashCode()); assertEquals(l.hashCode(), new EditList().hashCode());
} }
@ -76,13 +76,13 @@ public class EditListTest {
assertSame(e, l.get(0)); assertSame(e, l.get(0));
assertSame(e, l.iterator().next()); assertSame(e, l.iterator().next());
assertTrue(l.equals(l)); assertEquals(l, l);
assertFalse(l.equals(new EditList())); assertFalse(l.equals(new EditList()));
final EditList l2 = new EditList(); final EditList l2 = new EditList();
l2.add(e); l2.add(e);
assertTrue(l.equals(l2)); assertEquals(l2, l);
assertTrue(l2.equals(l)); assertEquals(l, l2);
assertEquals(l.hashCode(), l2.hashCode()); assertEquals(l.hashCode(), l2.hashCode());
} }
@ -101,14 +101,14 @@ public class EditListTest {
assertSame(e1, i.next()); assertSame(e1, i.next());
assertSame(e2, i.next()); assertSame(e2, i.next());
assertTrue(l.equals(l)); assertEquals(l, l);
assertFalse(l.equals(new EditList())); assertFalse(l.equals(new EditList()));
final EditList l2 = new EditList(); final EditList l2 = new EditList();
l2.add(e1); l2.add(e1);
l2.add(e2); l2.add(e2);
assertTrue(l.equals(l2)); assertEquals(l2, l);
assertTrue(l2.equals(l)); assertEquals(l, l2);
assertEquals(l.hashCode(), l2.hashCode()); assertEquals(l.hashCode(), l2.hashCode());
} }

6
org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/EditTest.java

@ -130,9 +130,9 @@ public class EditTest {
final Edit e1 = new Edit(1, 2, 3, 4); final Edit e1 = new Edit(1, 2, 3, 4);
final Edit e2 = new Edit(1, 2, 3, 4); final Edit e2 = new Edit(1, 2, 3, 4);
assertTrue(e1.equals(e1)); assertEquals(e1, e1);
assertTrue(e1.equals(e2)); assertEquals(e2, e1);
assertTrue(e2.equals(e1)); assertEquals(e1, e2);
assertEquals(e1.hashCode(), e2.hashCode()); assertEquals(e1.hashCode(), e2.hashCode());
assertFalse(e1.equals("")); assertFalse(e1.equals(""));
} }

8
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/AbbreviatedObjectIdTest.java

@ -221,8 +221,8 @@ public class AbbreviatedObjectIdTest {
final AbbreviatedObjectId b = AbbreviatedObjectId.fromString(s); final AbbreviatedObjectId b = AbbreviatedObjectId.fromString(s);
assertNotSame(a, b); assertNotSame(a, b);
assertTrue(a.hashCode() == b.hashCode()); assertTrue(a.hashCode() == b.hashCode());
assertTrue(a.equals(b)); assertEquals(b, a);
assertTrue(b.equals(a)); assertEquals(a, b);
} }
@Test @Test
@ -232,8 +232,8 @@ public class AbbreviatedObjectIdTest {
final AbbreviatedObjectId b = AbbreviatedObjectId.fromString(s); final AbbreviatedObjectId b = AbbreviatedObjectId.fromString(s);
assertNotSame(a, b); assertNotSame(a, b);
assertTrue(a.hashCode() == b.hashCode()); assertTrue(a.hashCode() == b.hashCode());
assertTrue(a.equals(b)); assertEquals(b, a);
assertTrue(b.equals(a)); assertEquals(a, b);
} }
@Test @Test

2
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java

@ -935,7 +935,7 @@ public class DirCacheCheckoutTest extends RepositoryTestCase {
} catch (CheckoutConflictException e) { } catch (CheckoutConflictException e) {
assertIndex(mk("foo")); assertIndex(mk("foo"));
assertWorkDir(mkmap("foo", "different")); assertWorkDir(mkmap("foo", "different"));
assertTrue(getConflicts().equals(Arrays.asList("foo"))); assertEquals(Arrays.asList("foo"), getConflicts());
assertTrue(new File(trash, "foo").isFile()); assertTrue(new File(trash, "foo").isFile());
} }
} }

2
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdTest.java

@ -72,7 +72,7 @@ public class ObjectIdTest {
final ObjectId a = ObjectId.fromString(x); final ObjectId a = ObjectId.fromString(x);
final ObjectId b = ObjectId.fromString(x); final ObjectId b = ObjectId.fromString(x);
assertEquals(a.hashCode(), b.hashCode()); assertEquals(a.hashCode(), b.hashCode());
assertTrue("a and b are same", a.equals(b)); assertEquals("a and b are same", b, a);
} }
@Test @Test

10
org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/ResolveMergerTest.java

@ -131,7 +131,7 @@ public class ResolveMergerTest extends RepositoryTestCase {
git.rm().addFilepattern("d/1").call(); git.rm().addFilepattern("d/1").call();
git.rm().addFilepattern("d").call(); git.rm().addFilepattern("d").call();
MergeResult mergeRes = git.merge().include(masterCommit).call(); MergeResult mergeRes = git.merge().include(masterCommit).call();
assertTrue(MergeStatus.CONFLICTING.equals(mergeRes.getMergeStatus())); assertEquals(MergeStatus.CONFLICTING, mergeRes.getMergeStatus());
assertEquals( assertEquals(
"[d/1, mode:100644, stage:1, content:orig][d/1, mode:100644, stage:2, content:side][d/1, mode:100644, stage:3, content:master]", "[d/1, mode:100644, stage:1, content:orig][d/1, mode:100644, stage:2, content:side][d/1, mode:100644, stage:3, content:master]",
indexState(CONTENT)); indexState(CONTENT));
@ -163,7 +163,7 @@ public class ResolveMergerTest extends RepositoryTestCase {
git.rm().addFilepattern("d/1").call(); git.rm().addFilepattern("d/1").call();
git.rm().addFilepattern("d").call(); git.rm().addFilepattern("d").call();
MergeResult mergeRes = git.merge().include(masterCommit).call(); MergeResult mergeRes = git.merge().include(masterCommit).call();
assertTrue(MergeStatus.MERGED.equals(mergeRes.getMergeStatus())); assertEquals(MergeStatus.MERGED, mergeRes.getMergeStatus());
assertEquals("[d/1, mode:100644, content:1master\n2\n3side\n]", assertEquals("[d/1, mode:100644, content:1master\n2\n3side\n]",
indexState(CONTENT)); indexState(CONTENT));
} }
@ -194,7 +194,7 @@ public class ResolveMergerTest extends RepositoryTestCase {
git.rm().addFilepattern("d/1").call(); git.rm().addFilepattern("d/1").call();
git.rm().addFilepattern("d").call(); git.rm().addFilepattern("d").call();
MergeResult mergeRes = git.merge().include(masterCommit).call(); MergeResult mergeRes = git.merge().include(masterCommit).call();
assertTrue(MergeStatus.MERGED.equals(mergeRes.getMergeStatus())); assertEquals(MergeStatus.MERGED, mergeRes.getMergeStatus());
assertEquals("[d/1, mode:100644, content:modified]", assertEquals("[d/1, mode:100644, content:modified]",
indexState(CONTENT)); indexState(CONTENT));
} }
@ -260,7 +260,7 @@ public class ResolveMergerTest extends RepositoryTestCase {
git.rm().addFilepattern("d/1").call(); git.rm().addFilepattern("d/1").call();
git.rm().addFilepattern("d").call(); git.rm().addFilepattern("d").call();
MergeResult mergeRes = git.merge().include(masterCommit).call(); MergeResult mergeRes = git.merge().include(masterCommit).call();
assertTrue(MergeStatus.MERGED.equals(mergeRes.getMergeStatus())); assertEquals(MergeStatus.MERGED, mergeRes.getMergeStatus());
assertEquals( assertEquals(
"[2, mode:100644, content:orig][d/1, mode:100644, content:orig]", "[2, mode:100644, content:orig][d/1, mode:100644, content:orig]",
indexState(CONTENT)); indexState(CONTENT));
@ -294,7 +294,7 @@ public class ResolveMergerTest extends RepositoryTestCase {
git.rm().addFilepattern("d/1").call(); git.rm().addFilepattern("d/1").call();
git.rm().addFilepattern("d").call(); git.rm().addFilepattern("d").call();
MergeResult mergeRes = git.merge().include(masterCommit).call(); MergeResult mergeRes = git.merge().include(masterCommit).call();
assertTrue(MergeStatus.CONFLICTING.equals(mergeRes.getMergeStatus())); assertEquals(MergeStatus.CONFLICTING, mergeRes.getMergeStatus());
assertEquals( assertEquals(
"[2, mode:100644, content:orig][d/1, mode:100644, stage:2, content:side][d/1, mode:100644, stage:3, content:master]", "[2, mode:100644, content:orig][d/1, mode:100644, stage:2, content:side][d/1, mode:100644, stage:3, content:master]",
indexState(CONTENT)); indexState(CONTENT));

2
org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevFlagSetTest.java

@ -120,7 +120,7 @@ public class RevFlagSetTest extends RevWalkTestCase {
assertTrue(set.add(flag1)); assertTrue(set.add(flag1));
assertTrue(set.add(flag2)); assertTrue(set.add(flag2));
assertTrue(new RevFlagSet(set).equals(set)); assertEquals(set, new RevFlagSet(set));
assertTrue(new RevFlagSet(Arrays.asList(new RevFlag[] { flag1, flag2 })) assertTrue(new RevFlagSet(Arrays.asList(new RevFlag[] { flag1, flag2 }))
.equals(set)); .equals(set));
} }

6
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefUpdateTest.java

@ -639,7 +639,7 @@ public class RefUpdateTest extends SampleDataRepositoryTestCase {
ObjectId rb = db.resolve("refs/heads/b"); ObjectId rb = db.resolve("refs/heads/b");
writeSymref(Constants.HEAD, "refs/heads/b"); writeSymref(Constants.HEAD, "refs/heads/b");
ObjectId oldHead = db.resolve(Constants.HEAD); ObjectId oldHead = db.resolve(Constants.HEAD);
assertTrue("internal test condition, b == HEAD", rb.equals(oldHead)); assertEquals("internal test condition, b == HEAD", oldHead, rb);
writeReflog(db, rb, "Just a message", "refs/heads/b"); writeReflog(db, rb, "Just a message", "refs/heads/b");
assertTrue("log on old branch", new File(db.getDirectory(), assertTrue("log on old branch", new File(db.getDirectory(),
"logs/refs/heads/b").exists()); "logs/refs/heads/b").exists());
@ -804,7 +804,7 @@ public class RefUpdateTest extends SampleDataRepositoryTestCase {
updateRef.setRefLogMessage("Setup", false); updateRef.setRefLogMessage("Setup", false);
assertEquals(Result.FAST_FORWARD, updateRef.update()); assertEquals(Result.FAST_FORWARD, updateRef.update());
ObjectId oldHead = db.resolve(Constants.HEAD); ObjectId oldHead = db.resolve(Constants.HEAD);
assertTrue(rb.equals(oldHead)); // assumption for this test assertEquals(oldHead, rb); // assumption for this test
writeReflog(db, rb, "Just a message", "refs/heads/a"); writeReflog(db, rb, "Just a message", "refs/heads/a");
assertTrue("internal check, we have a log", new File(db.getDirectory(), assertTrue("internal check, we have a log", new File(db.getDirectory(),
"logs/refs/heads/a").exists()); "logs/refs/heads/a").exists());
@ -838,7 +838,7 @@ public class RefUpdateTest extends SampleDataRepositoryTestCase {
updateRef.setForceUpdate(true); updateRef.setForceUpdate(true);
assertEquals(Result.FORCED, updateRef.update()); assertEquals(Result.FORCED, updateRef.update());
ObjectId oldHead = db.resolve(Constants.HEAD); ObjectId oldHead = db.resolve(Constants.HEAD);
assertTrue(rb.equals(oldHead)); // assumption for this test assertEquals(oldHead, rb); // assumption for this test
writeReflog(db, rb, "Just a message", "refs/heads/prefix/a"); writeReflog(db, rb, "Just a message", "refs/heads/prefix/a");
assertTrue("internal check, we have a log", new File(db.getDirectory(), assertTrue("internal check, we have a log", new File(db.getDirectory(),
"logs/refs/heads/prefix/a").exists()); "logs/refs/heads/prefix/a").exists());

11
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PacketLineInTest.java

@ -46,7 +46,6 @@ package org.eclipse.jgit.transport;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame; import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
@ -221,7 +220,7 @@ public class PacketLineInTest {
init("0008NAK\n"); init("0008NAK\n");
assertSame(PacketLineIn.AckNackResult.NAK, in.readACK(actid)); assertSame(PacketLineIn.AckNackResult.NAK, in.readACK(actid));
assertTrue(actid.equals(expid)); assertEquals(expid, actid);
assertEOF(); assertEOF();
} }
@ -233,7 +232,7 @@ public class PacketLineInTest {
init("0031ACK fcfcfb1fd94829c1a1704f894fc111d14770d34e\n"); init("0031ACK fcfcfb1fd94829c1a1704f894fc111d14770d34e\n");
assertSame(PacketLineIn.AckNackResult.ACK, in.readACK(actid)); assertSame(PacketLineIn.AckNackResult.ACK, in.readACK(actid));
assertTrue(actid.equals(expid)); assertEquals(expid, actid);
assertEOF(); assertEOF();
} }
@ -245,7 +244,7 @@ public class PacketLineInTest {
init("003aACK fcfcfb1fd94829c1a1704f894fc111d14770d34e continue\n"); init("003aACK fcfcfb1fd94829c1a1704f894fc111d14770d34e continue\n");
assertSame(PacketLineIn.AckNackResult.ACK_CONTINUE, in.readACK(actid)); assertSame(PacketLineIn.AckNackResult.ACK_CONTINUE, in.readACK(actid));
assertTrue(actid.equals(expid)); assertEquals(expid, actid);
assertEOF(); assertEOF();
} }
@ -257,7 +256,7 @@ public class PacketLineInTest {
init("0038ACK fcfcfb1fd94829c1a1704f894fc111d14770d34e common\n"); init("0038ACK fcfcfb1fd94829c1a1704f894fc111d14770d34e common\n");
assertSame(PacketLineIn.AckNackResult.ACK_COMMON, in.readACK(actid)); assertSame(PacketLineIn.AckNackResult.ACK_COMMON, in.readACK(actid));
assertTrue(actid.equals(expid)); assertEquals(expid, actid);
assertEOF(); assertEOF();
} }
@ -269,7 +268,7 @@ public class PacketLineInTest {
init("0037ACK fcfcfb1fd94829c1a1704f894fc111d14770d34e ready\n"); init("0037ACK fcfcfb1fd94829c1a1704f894fc111d14770d34e ready\n");
assertSame(PacketLineIn.AckNackResult.ACK_READY, in.readACK(actid)); assertSame(PacketLineIn.AckNackResult.ACK_READY, in.readACK(actid));
assertTrue(actid.equals(expid)); assertEquals(expid, actid);
assertEOF(); assertEOF();
} }

2
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RefMapTest.java

@ -454,7 +454,7 @@ public class RefMapTest {
Map.Entry<String, Ref> ent_b = itr.next(); Map.Entry<String, Ref> ent_b = itr.next();
assertEquals(ent_a.hashCode(), "A".hashCode()); assertEquals(ent_a.hashCode(), "A".hashCode());
assertTrue(ent_a.equals(ent_a)); assertEquals(ent_a, ent_a);
assertFalse(ent_a.equals(ent_b)); assertFalse(ent_a.equals(ent_b));
assertEquals(a.toString(), ent_a.toString()); assertEquals(a.toString(), ent_a.toString());

Loading…
Cancel
Save