@ -50,15 +50,12 @@ import static org.junit.Assert.fail;
import java.io.File ;
import java.io.IOException ;
import java.io.PrintWriter ;
import org.eclipse.jgit.api.errors.ConcurrentRefUpdateException ;
import org.eclipse.jgit.api.errors.GitAPIException ;
import org.eclipse.jgit.api.errors.JGitInternalException ;
import org.eclipse.jgit.api.errors.NoFilepatternException ;
import org.eclipse.jgit.api.errors.NoHeadException ;
import org.eclipse.jgit.api.errors.NoMessageException ;
import org.eclipse.jgit.api.errors.WrongRepositoryStateException ;
import org.eclipse.jgit.errors.IncorrectObjectTypeException ;
import org.eclipse.jgit.errors.MissingObjectException ;
import org.eclipse.jgit.errors.UnmergedPathException ;
import org.eclipse.jgit.lib.Constants ;
import org.eclipse.jgit.lib.ObjectId ;
import org.eclipse.jgit.lib.PersonIdent ;
@ -77,9 +74,8 @@ import org.junit.Test;
* /
public class CommitAndLogCommandTests extends RepositoryTestCase {
@Test
public void testSomeCommits ( ) throws NoHeadException , NoMessageException ,
ConcurrentRefUpdateException , JGitInternalException ,
WrongRepositoryStateException , IOException {
public void testSomeCommits ( ) throws JGitInternalException , IOException ,
GitAPIException {
// do 4 commits
Git git = new Git ( db ) ;
@ -115,9 +111,8 @@ public class CommitAndLogCommandTests extends RepositoryTestCase {
}
@Test
public void testLogWithFilter ( ) throws IOException , NoFilepatternException ,
NoHeadException , NoMessageException , ConcurrentRefUpdateException ,
JGitInternalException , WrongRepositoryStateException {
public void testLogWithFilter ( ) throws IOException , JGitInternalException ,
GitAPIException {
Git git = new Git ( db ) ;
@ -170,9 +165,7 @@ public class CommitAndLogCommandTests extends RepositoryTestCase {
// try to do a commit without specifying a message. Should fail!
@Test
public void testWrongParams ( ) throws UnmergedPathException ,
NoHeadException , ConcurrentRefUpdateException ,
JGitInternalException , WrongRepositoryStateException {
public void testWrongParams ( ) throws GitAPIException {
Git git = new Git ( db ) ;
try {
git . commit ( ) . setAuthor ( author ) . call ( ) ;
@ -185,10 +178,7 @@ public class CommitAndLogCommandTests extends RepositoryTestCase {
// try to work with Commands after command has been invoked. Should throw
// exceptions
@Test
public void testMultipleInvocations ( ) throws NoHeadException ,
ConcurrentRefUpdateException , NoMessageException ,
UnmergedPathException , JGitInternalException ,
WrongRepositoryStateException {
public void testMultipleInvocations ( ) throws GitAPIException {
Git git = new Git ( db ) ;
CommitCommand commitCmd = git . commit ( ) ;
commitCmd . setMessage ( "initial commit" ) . call ( ) ;
@ -211,9 +201,8 @@ public class CommitAndLogCommandTests extends RepositoryTestCase {
}
@Test
public void testMergeEmptyBranches ( ) throws IOException , NoHeadException ,
NoMessageException , ConcurrentRefUpdateException ,
JGitInternalException , WrongRepositoryStateException {
public void testMergeEmptyBranches ( ) throws IOException ,
JGitInternalException , GitAPIException {
Git git = new Git ( db ) ;
git . commit ( ) . setMessage ( "initial commit" ) . call ( ) ;
RefUpdate r = db . updateRef ( "refs/heads/side" ) ;
@ -235,10 +224,8 @@ public class CommitAndLogCommandTests extends RepositoryTestCase {
}
@Test
public void testAddUnstagedChanges ( ) throws IOException , NoHeadException ,
NoMessageException , ConcurrentRefUpdateException ,
JGitInternalException , WrongRepositoryStateException ,
NoFilepatternException {
public void testAddUnstagedChanges ( ) throws IOException ,
JGitInternalException , GitAPIException {
File file = new File ( db . getWorkTree ( ) , "a.txt" ) ;
FileUtils . createNewFile ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
@ -268,9 +255,7 @@ public class CommitAndLogCommandTests extends RepositoryTestCase {
}
@Test
public void testModeChange ( ) throws IOException , NoFilepatternException ,
NoHeadException , NoMessageException , ConcurrentRefUpdateException ,
JGitInternalException , WrongRepositoryStateException {
public void testModeChange ( ) throws IOException , GitAPIException {
Git git = new Git ( db ) ;
// create file
@ -298,10 +283,9 @@ public class CommitAndLogCommandTests extends RepositoryTestCase {
}
@Test
public void testCommitRange ( ) throws NoHeadException , NoMessageException ,
UnmergedPathException , ConcurrentRefUpdateException ,
JGitInternalException , WrongRepositoryStateException ,
IncorrectObjectTypeException , MissingObjectException {
public void testCommitRange ( ) throws GitAPIException ,
JGitInternalException , MissingObjectException ,
IncorrectObjectTypeException {
// do 4 commits and set the range to the second and fourth one
Git git = new Git ( db ) ;
git . commit ( ) . setMessage ( "first commit" ) . call ( ) ;
@ -334,9 +318,8 @@ public class CommitAndLogCommandTests extends RepositoryTestCase {
}
@Test
public void testCommitAmend ( ) throws NoHeadException , NoMessageException ,
ConcurrentRefUpdateException , JGitInternalException ,
WrongRepositoryStateException , IOException {
public void testCommitAmend ( ) throws JGitInternalException , IOException ,
GitAPIException {
Git git = new Git ( db ) ;
git . commit ( ) . setMessage ( "first comit" ) . call ( ) ; // typo
git . commit ( ) . setAmend ( true ) . setMessage ( "first commit" ) . call ( ) ;
@ -357,10 +340,8 @@ public class CommitAndLogCommandTests extends RepositoryTestCase {
}
@Test
public void testInsertChangeId ( ) throws NoHeadException ,
NoMessageException ,
UnmergedPathException , ConcurrentRefUpdateException ,
JGitInternalException , WrongRepositoryStateException {
public void testInsertChangeId ( ) throws JGitInternalException ,
GitAPIException {
Git git = new Git ( db ) ;
String messageHeader = "Some header line\n\nSome detail explanation\n" ;
String changeIdTemplate = "\nChange-Id: I"