*/
package org.eclipse.jgit.api;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
status = git.status().call();
files = status.getUntracked();
- assertTrue(files.size() == 0);
+ assertEquals(0, files.size());
assertTrue(cleanedFiles.contains("File2.txt"));
assertTrue(cleanedFiles.contains("File3.txt"));
}
status = git.status().call();
files = status.getUntracked();
- assertTrue(files.size() == 1);
+ assertEquals(1, files.size());
assertTrue(cleanedFiles.contains("File3.txt"));
assertFalse(cleanedFiles.contains("File2.txt"));
}
status = git.status().call();
files = status.getUntracked();
- assertTrue(files.size() == 2);
+ assertEquals(2, files.size());
assertTrue(cleanedFiles.contains("File2.txt"));
assertTrue(cleanedFiles.contains("File3.txt"));
}
RevCommit[] parents = commit.getParents();
assertEquals(parents[0], firstSide);
assertEquals(parents[1], second);
- assertTrue(parents.length==2);
+ assertEquals(2, parents.length);
}
@Test
assertEquals(null, result.getConflicts());
- assertTrue(2 == result.getMergedCommits().length);
+ assertEquals(2, result.getMergedCommits().length);
assertEquals(thirdCommit, result.getMergedCommits()[0]);
assertEquals(secondCommit, result.getMergedCommits()[1]);
assertEquals(null, result.getConflicts());
- assertTrue(2 == result.getMergedCommits().length);
+ assertEquals(2, result.getMergedCommits().length);
assertEquals(thirdCommit, result.getMergedCommits()[0]);
assertEquals(secondCommit, result.getMergedCommits()[1]);
package org.eclipse.jgit.api;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
import java.util.List;
import org.eclipse.jgit.lib.RepositoryTestCase;
@Test
public void testListNotes() throws Exception {
List<Note> notes = git.notesList().call();
- assertTrue(notes.size() == 1);
+ assertEquals(1, notes.size());
}
@Test
git.notesRemove().setObjectId(commit2).call();
List<Note> notes = git.notesList().call();
- assertTrue(notes.size() == 1);
+ assertEquals(1, notes.size());
}
}
assertTrue("no name", t.getName() == null);
assertTrue("no nameUTF8", t.getNameUTF8() == null);
assertTrue("has entries array", t.members() != null);
- assertTrue("entries is empty", t.members().length == 0);
+ assertEquals("entries is empty", 0, t.members().length);
assertEquals("full name is empty", "", t.getFullName());
assertTrue("no id", t.getId() == null);
assertTrue("database is r", t.getRepository() == db);
final TreeEntry[] i = t.members();
assertTrue("iterator is not empty", i.length > 0);
assertTrue("iterator returns file", i[0] == f);
- assertTrue("iterator is empty", i.length == 1);
+ assertEquals("iterator is empty", 1, i.length);
}
@Test
public void testAddTwo() {
final RevFlag flag1 = rw.newFlag("flag_1");
final RevFlag flag2 = rw.newFlag("flag_2");
- assertTrue((flag1.mask & flag2.mask) == 0);
+ assertEquals(0, (flag1.mask & flag2.mask));
final RevFlagSet set = new RevFlagSet();
assertTrue(set.add(flag1));
try {
assertEquals(0x78, xis.readUInt8());
assertEquals(0x9c, xis.readUInt8());
- assertTrue(0x789c % 31 == 0);
+ assertEquals(0, 0x789c % 31);
} finally {
xis.close();
}