org.apache.maven.scm.manager
Class ScmManagerStub

java.lang.Object
  extended by org.apache.maven.scm.manager.ScmManagerStub
All Implemented Interfaces:
ScmManager

public class ScmManagerStub
extends Object
implements ScmManager

Stub implementation of ScmManager for unit testing purposes. It allows setting the expected results that the different methods will return. More information about Stubs on Martin Fowler's TestDouble

Version:
$Id: ScmManagerStub.java 1354687 2012-06-27 19:38:56Z olamy $
Author:
Carlos Sanchez

Field Summary
 
Fields inherited from interface org.apache.maven.scm.manager.ScmManager
ROLE
 
Constructor Summary
ScmManagerStub()
          Creates a new stub with stub repository and provider, and empty list of messages
 
Method Summary
 AddScmResult add(ScmRepository repository, ScmFileSet fileSet)
          
 AddScmResult add(ScmRepository repository, ScmFileSet fileSet, String message)
          
 BlameScmResult blame(BlameScmRequest blameScmRequest)
           
 BlameScmResult blame(ScmRepository repository, ScmFileSet fileSet, String filename)
          
 BranchScmResult branch(ScmRepository repository, ScmFileSet fileSet, String branchName)
          
 BranchScmResult branch(ScmRepository repository, ScmFileSet fileSet, String branchName, String message)
          
 ChangeLogScmResult changeLog(ChangeLogScmRequest request)
          
 ChangeLogScmResult changeLog(ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, ScmBranch branch)
          
 ChangeLogScmResult changeLog(ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, ScmBranch branch, String datePattern)
          
 ChangeLogScmResult changeLog(ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion)
          
 ChangeLogScmResult changeLog(ScmRepository repository, ScmFileSet fileSet, ScmVersion startRevision, ScmVersion endRevision, String datePattern)
          
 CheckInScmResult checkIn(ScmRepository repository, ScmFileSet fileSet, ScmVersion revision, String message)
          
 CheckInScmResult checkIn(ScmRepository repository, ScmFileSet fileSet, String message)
          
 CheckOutScmResult checkOut(ScmRepository repository, ScmFileSet fileSet)
          
 CheckOutScmResult checkOut(ScmRepository repository, ScmFileSet fileSet, boolean recursive)
          
 CheckOutScmResult checkOut(ScmRepository repository, ScmFileSet fileSet, ScmVersion version)
          
 CheckOutScmResult checkOut(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, boolean recursive)
          
 DiffScmResult diff(ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion)
          
 EditScmResult edit(ScmRepository repository, ScmFileSet fileSet)
          
 ExportScmResult export(ScmRepository repository, ScmFileSet fileSet)
          
 ExportScmResult export(ScmRepository repository, ScmFileSet fileSet, ScmVersion version)
          
 ExportScmResult export(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String outputDirectory)
          
 ExportScmResult export(ScmRepository repository, ScmFileSet fileSet, String outputDirectory)
          
 List<String> getMessages()
          Get the messages to return in validateScmRepository
 ScmProvider getProviderByRepository(ScmRepository repository)
          
 ScmProvider getProviderByType(String providerType)
          
 ScmProvider getProviderByUrl(String scmUrl)
          
 ScmProvider getScmProvider()
           
 ScmRepository getScmRepository()
           
 ListScmResult list(ScmRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion version)
          
 ScmRepository makeProviderScmRepository(String providerType, File path)
          
 ScmRepository makeScmRepository(String scmUrl)
          
 MkdirScmResult mkdir(ScmRepository repository, ScmFileSet fileSet, String message, boolean createInLocal)
          
 RemoveScmResult remove(ScmRepository repository, ScmFileSet fileSet, String message)
          
 void setMessages(List<String> messages)
          Set the messages to return in validateScmRepository
 void setScmProvider(ScmProvider scmProvider)
           
 void setScmProvider(String providerType, ScmProvider provider)
          
 void setScmProviderImplementation(String providerType, String providerImplementation)
          
 void setScmRepository(ScmRepository scmRepository)
           
 StatusScmResult status(ScmRepository repository, ScmFileSet fileSet)
          
 TagScmResult tag(ScmRepository repository, ScmFileSet fileSet, String tagName)
          
 TagScmResult tag(ScmRepository repository, ScmFileSet fileSet, String tagName, String message)
          
 UnEditScmResult unedit(ScmRepository repository, ScmFileSet fileSet)
          
 UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet)
          
 UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, boolean runChangelog)
          
 UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, Date lastUpdate)
          
 UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, Date lastUpdate, String datePattern)
          
 UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version)
          
 UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, boolean runChangelog)
          
 UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate)
          
 UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate, String datePattern)
          
 UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String datePattern)
          
 UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, String datePattern)
          
 List<String> validateScmRepository(String scmUrl)
          Returns the same list as getMessages()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScmManagerStub

public ScmManagerStub()
Creates a new stub with stub repository and provider, and empty list of messages

Method Detail

setScmProvider

public void setScmProvider(ScmProvider scmProvider)

getScmProvider

public ScmProvider getScmProvider()

setScmProvider

public void setScmProvider(String providerType,
                           ScmProvider provider)

Specified by:
setScmProvider in interface ScmManager

setScmProviderImplementation

public void setScmProviderImplementation(String providerType,
                                         String providerImplementation)

Specified by:
setScmProviderImplementation in interface ScmManager

setScmRepository

public void setScmRepository(ScmRepository scmRepository)

getScmRepository

public ScmRepository getScmRepository()

setMessages

public void setMessages(List<String> messages)
Set the messages to return in validateScmRepository

Parameters:
messages - List of String objects

getMessages

public List<String> getMessages()
Get the messages to return in validateScmRepository

Returns:
List of String objects

makeScmRepository

public ScmRepository makeScmRepository(String scmUrl)
                                throws ScmRepositoryException,
                                       NoSuchScmProviderException

Specified by:
makeScmRepository in interface ScmManager
Throws:
ScmRepositoryException
NoSuchScmProviderException

makeProviderScmRepository

public ScmRepository makeProviderScmRepository(String providerType,
                                               File path)
                                        throws ScmRepositoryException,
                                               UnknownRepositoryStructure,
                                               NoSuchScmProviderException

Specified by:
makeProviderScmRepository in interface ScmManager
Throws:
ScmRepositoryException
UnknownRepositoryStructure
NoSuchScmProviderException

validateScmRepository

public List<String> validateScmRepository(String scmUrl)
Returns the same list as getMessages()

Specified by:
validateScmRepository in interface ScmManager
Parameters:
scmUrl - ignored
Returns:
List of String objects, the same list returned by getMessages()

getProviderByUrl

public ScmProvider getProviderByUrl(String scmUrl)
                             throws ScmRepositoryException,
                                    NoSuchScmProviderException

Specified by:
getProviderByUrl in interface ScmManager
Throws:
ScmRepositoryException
NoSuchScmProviderException

getProviderByType

public ScmProvider getProviderByType(String providerType)
                              throws NoSuchScmProviderException

Specified by:
getProviderByType in interface ScmManager
Throws:
NoSuchScmProviderException

getProviderByRepository

public ScmProvider getProviderByRepository(ScmRepository repository)
                                    throws NoSuchScmProviderException

Specified by:
getProviderByRepository in interface ScmManager
Throws:
NoSuchScmProviderException

add

public AddScmResult add(ScmRepository repository,
                        ScmFileSet fileSet)
                 throws ScmException

Specified by:
add in interface ScmManager
Throws:
ScmException

add

public AddScmResult add(ScmRepository repository,
                        ScmFileSet fileSet,
                        String message)
                 throws ScmException

Specified by:
add in interface ScmManager
Throws:
ScmException

branch

public BranchScmResult branch(ScmRepository repository,
                              ScmFileSet fileSet,
                              String branchName)
                       throws ScmException

Specified by:
branch in interface ScmManager
Throws:
ScmException

branch

public BranchScmResult branch(ScmRepository repository,
                              ScmFileSet fileSet,
                              String branchName,
                              String message)
                       throws ScmException

Specified by:
branch in interface ScmManager
Throws:
ScmException

changeLog

public ChangeLogScmResult changeLog(ScmRepository repository,
                                    ScmFileSet fileSet,
                                    Date startDate,
                                    Date endDate,
                                    int numDays,
                                    ScmBranch branch)
                             throws ScmException

Specified by:
changeLog in interface ScmManager
Throws:
ScmException

changeLog

public ChangeLogScmResult changeLog(ScmRepository repository,
                                    ScmFileSet fileSet,
                                    Date startDate,
                                    Date endDate,
                                    int numDays,
                                    ScmBranch branch,
                                    String datePattern)
                             throws ScmException

Specified by:
changeLog in interface ScmManager
Throws:
ScmException

changeLog

public ChangeLogScmResult changeLog(ChangeLogScmRequest request)
                             throws ScmException

Specified by:
changeLog in interface ScmManager
Throws:
ScmException

changeLog

public ChangeLogScmResult changeLog(ScmRepository repository,
                                    ScmFileSet fileSet,
                                    ScmVersion startVersion,
                                    ScmVersion endVersion)
                             throws ScmException

Specified by:
changeLog in interface ScmManager
Throws:
ScmException

changeLog

public ChangeLogScmResult changeLog(ScmRepository repository,
                                    ScmFileSet fileSet,
                                    ScmVersion startRevision,
                                    ScmVersion endRevision,
                                    String datePattern)
                             throws ScmException

Specified by:
changeLog in interface ScmManager
Throws:
ScmException

checkIn

public CheckInScmResult checkIn(ScmRepository repository,
                                ScmFileSet fileSet,
                                String message)
                         throws ScmException

Specified by:
checkIn in interface ScmManager
Throws:
ScmException

checkIn

public CheckInScmResult checkIn(ScmRepository repository,
                                ScmFileSet fileSet,
                                ScmVersion revision,
                                String message)
                         throws ScmException

Specified by:
checkIn in interface ScmManager
Throws:
ScmException

checkOut

public CheckOutScmResult checkOut(ScmRepository repository,
                                  ScmFileSet fileSet)
                           throws ScmException

Specified by:
checkOut in interface ScmManager
Throws:
ScmException

checkOut

public CheckOutScmResult checkOut(ScmRepository repository,
                                  ScmFileSet fileSet,
                                  ScmVersion version)
                           throws ScmException

Specified by:
checkOut in interface ScmManager
Throws:
ScmException

checkOut

public CheckOutScmResult checkOut(ScmRepository repository,
                                  ScmFileSet fileSet,
                                  boolean recursive)
                           throws ScmException

Specified by:
checkOut in interface ScmManager
Throws:
ScmException

checkOut

public CheckOutScmResult checkOut(ScmRepository repository,
                                  ScmFileSet fileSet,
                                  ScmVersion version,
                                  boolean recursive)
                           throws ScmException

Specified by:
checkOut in interface ScmManager
Throws:
ScmException

diff

public DiffScmResult diff(ScmRepository repository,
                          ScmFileSet fileSet,
                          ScmVersion startVersion,
                          ScmVersion endVersion)
                   throws ScmException

Specified by:
diff in interface ScmManager
Throws:
ScmException

edit

public EditScmResult edit(ScmRepository repository,
                          ScmFileSet fileSet)
                   throws ScmException

Specified by:
edit in interface ScmManager
Throws:
ScmException

export

public ExportScmResult export(ScmRepository repository,
                              ScmFileSet fileSet)
                       throws ScmException

Specified by:
export in interface ScmManager
Throws:
ScmException

export

public ExportScmResult export(ScmRepository repository,
                              ScmFileSet fileSet,
                              ScmVersion version)
                       throws ScmException

Specified by:
export in interface ScmManager
Throws:
ScmException

export

public ExportScmResult export(ScmRepository repository,
                              ScmFileSet fileSet,
                              String outputDirectory)
                       throws ScmException

Specified by:
export in interface ScmManager
Throws:
ScmException

export

public ExportScmResult export(ScmRepository repository,
                              ScmFileSet fileSet,
                              ScmVersion version,
                              String outputDirectory)
                       throws ScmException

Specified by:
export in interface ScmManager
Throws:
ScmException

list

public ListScmResult list(ScmRepository repository,
                          ScmFileSet fileSet,
                          boolean recursive,
                          ScmVersion version)
                   throws ScmException

Specified by:
list in interface ScmManager
Throws:
ScmException

remove

public RemoveScmResult remove(ScmRepository repository,
                              ScmFileSet fileSet,
                              String message)
                       throws ScmException

Specified by:
remove in interface ScmManager
Throws:
ScmException

status

public StatusScmResult status(ScmRepository repository,
                              ScmFileSet fileSet)
                       throws ScmException

Specified by:
status in interface ScmManager
Throws:
ScmException

tag

public TagScmResult tag(ScmRepository repository,
                        ScmFileSet fileSet,
                        String tagName)
                 throws ScmException

Specified by:
tag in interface ScmManager
Throws:
ScmException

tag

public TagScmResult tag(ScmRepository repository,
                        ScmFileSet fileSet,
                        String tagName,
                        String message)
                 throws ScmException

Specified by:
tag in interface ScmManager
Throws:
ScmException

unedit

public UnEditScmResult unedit(ScmRepository repository,
                              ScmFileSet fileSet)
                       throws ScmException

Specified by:
unedit in interface ScmManager
Throws:
ScmException

update

public UpdateScmResult update(ScmRepository repository,
                              ScmFileSet fileSet)
                       throws ScmException

Specified by:
update in interface ScmManager
Throws:
ScmException

update

public UpdateScmResult update(ScmRepository repository,
                              ScmFileSet fileSet,
                              ScmVersion version)
                       throws ScmException

Specified by:
update in interface ScmManager
Throws:
ScmException

update

public UpdateScmResult update(ScmRepository repository,
                              ScmFileSet fileSet,
                              boolean runChangelog)
                       throws ScmException

Specified by:
update in interface ScmManager
Throws:
ScmException

update

public UpdateScmResult update(ScmRepository repository,
                              ScmFileSet fileSet,
                              ScmVersion version,
                              boolean runChangelog)
                       throws ScmException

Specified by:
update in interface ScmManager
Throws:
ScmException

update

public UpdateScmResult update(ScmRepository repository,
                              ScmFileSet fileSet,
                              String datePattern)
                       throws ScmException

Specified by:
update in interface ScmManager
Throws:
ScmException

update

public UpdateScmResult update(ScmRepository repository,
                              ScmFileSet fileSet,
                              ScmVersion version,
                              String datePattern)
                       throws ScmException

Specified by:
update in interface ScmManager
Throws:
ScmException

update

public UpdateScmResult update(ScmRepository repository,
                              ScmFileSet fileSet,
                              Date lastUpdate)
                       throws ScmException

Specified by:
update in interface ScmManager
Throws:
ScmException

update

public UpdateScmResult update(ScmRepository repository,
                              ScmFileSet fileSet,
                              ScmVersion version,
                              Date lastUpdate)
                       throws ScmException

Specified by:
update in interface ScmManager
Throws:
ScmException

update

public UpdateScmResult update(ScmRepository repository,
                              ScmFileSet fileSet,
                              Date lastUpdate,
                              String datePattern)
                       throws ScmException

Specified by:
update in interface ScmManager
Throws:
ScmException

update

public UpdateScmResult update(ScmRepository repository,
                              ScmFileSet fileSet,
                              ScmVersion version,
                              Date lastUpdate,
                              String datePattern)
                       throws ScmException

Specified by:
update in interface ScmManager
Throws:
ScmException

blame

public BlameScmResult blame(ScmRepository repository,
                            ScmFileSet fileSet,
                            String filename)
                     throws ScmException

Specified by:
blame in interface ScmManager
Throws:
ScmException

blame

public BlameScmResult blame(BlameScmRequest blameScmRequest)
                     throws ScmException
Specified by:
blame in interface ScmManager
Throws:
ScmException

mkdir

public MkdirScmResult mkdir(ScmRepository repository,
                            ScmFileSet fileSet,
                            String message,
                            boolean createInLocal)
                     throws ScmException

Specified by:
mkdir in interface ScmManager
Throws:
ScmException


Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.