Package org.apache.maven.scm.manager
Class ScmManagerStub
- java.lang.Object
-
- 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- Author:
- Carlos Sanchez
-
-
Constructor Summary
Constructors Constructor Description ScmManagerStub()
Creates a new stub with stub repository and provider, and empty list of messages
-
Method Summary
-
-
-
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 interfaceScmManager
-
setScmProviderImplementation
public void setScmProviderImplementation(String providerType, String providerImplementation)
- Specified by:
setScmProviderImplementation
in interfaceScmManager
-
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
ofString
objects
-
getMessages
public List<String> getMessages()
Get the messages to return in validateScmRepository- Returns:
List
ofString
objects
-
makeScmRepository
public ScmRepository makeScmRepository(String scmUrl) throws ScmRepositoryException, NoSuchScmProviderException
- Specified by:
makeScmRepository
in interfaceScmManager
- Throws:
ScmRepositoryException
NoSuchScmProviderException
-
makeProviderScmRepository
public ScmRepository makeProviderScmRepository(String providerType, File path) throws ScmRepositoryException, UnknownRepositoryStructure, NoSuchScmProviderException
- Specified by:
makeProviderScmRepository
in interfaceScmManager
- Throws:
ScmRepositoryException
UnknownRepositoryStructure
NoSuchScmProviderException
-
validateScmRepository
public List<String> validateScmRepository(String scmUrl)
Returns the same list as getMessages()- Specified by:
validateScmRepository
in interfaceScmManager
- Parameters:
scmUrl
- ignored- Returns:
List
ofString
objects, the same list returned by getMessages()
-
getProviderByUrl
public ScmProvider getProviderByUrl(String scmUrl) throws ScmRepositoryException, NoSuchScmProviderException
- Specified by:
getProviderByUrl
in interfaceScmManager
- Throws:
ScmRepositoryException
NoSuchScmProviderException
-
getProviderByType
public ScmProvider getProviderByType(String providerType) throws NoSuchScmProviderException
- Specified by:
getProviderByType
in interfaceScmManager
- Throws:
NoSuchScmProviderException
-
getProviderByRepository
public ScmProvider getProviderByRepository(ScmRepository repository) throws NoSuchScmProviderException
- Specified by:
getProviderByRepository
in interfaceScmManager
- Throws:
NoSuchScmProviderException
-
add
public AddScmResult add(ScmRepository repository, ScmFileSet fileSet) throws ScmException
- Specified by:
add
in interfaceScmManager
- Throws:
ScmException
-
add
public AddScmResult add(ScmRepository repository, ScmFileSet fileSet, String message) throws ScmException
- Specified by:
add
in interfaceScmManager
- Throws:
ScmException
-
branch
public BranchScmResult branch(ScmRepository repository, ScmFileSet fileSet, String branchName) throws ScmException
- Specified by:
branch
in interfaceScmManager
- Throws:
ScmException
-
branch
public BranchScmResult branch(ScmRepository repository, ScmFileSet fileSet, String branchName, String message) throws ScmException
- Specified by:
branch
in interfaceScmManager
- Throws:
ScmException
-
changeLog
public ChangeLogScmResult changeLog(ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, ScmBranch branch) throws ScmException
- Specified by:
changeLog
in interfaceScmManager
- 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 interfaceScmManager
- Throws:
ScmException
-
changeLog
public ChangeLogScmResult changeLog(ChangeLogScmRequest request) throws ScmException
- Specified by:
changeLog
in interfaceScmManager
- Throws:
ScmException
-
changeLog
public ChangeLogScmResult changeLog(ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion) throws ScmException
- Specified by:
changeLog
in interfaceScmManager
- Throws:
ScmException
-
changeLog
public ChangeLogScmResult changeLog(ScmRepository repository, ScmFileSet fileSet, ScmVersion startRevision, ScmVersion endRevision, String datePattern) throws ScmException
- Specified by:
changeLog
in interfaceScmManager
- Throws:
ScmException
-
checkIn
public CheckInScmResult checkIn(ScmRepository repository, ScmFileSet fileSet, String message) throws ScmException
- Specified by:
checkIn
in interfaceScmManager
- Throws:
ScmException
-
checkIn
public CheckInScmResult checkIn(ScmRepository repository, ScmFileSet fileSet, ScmVersion revision, String message) throws ScmException
- Specified by:
checkIn
in interfaceScmManager
- Throws:
ScmException
-
checkIn
public CheckInScmResult checkIn(ScmRepository repository, ScmFileSet fileSet, CommandParameters commandParameters) throws ScmException
- Specified by:
checkIn
in interfaceScmManager
- Throws:
ScmException
-
checkOut
public CheckOutScmResult checkOut(ScmRepository repository, ScmFileSet fileSet) throws ScmException
- Specified by:
checkOut
in interfaceScmManager
- Throws:
ScmException
-
checkOut
public CheckOutScmResult checkOut(ScmRepository repository, ScmFileSet fileSet, ScmVersion version) throws ScmException
- Specified by:
checkOut
in interfaceScmManager
- Throws:
ScmException
-
checkOut
public CheckOutScmResult checkOut(ScmRepository repository, ScmFileSet fileSet, boolean recursive) throws ScmException
- Specified by:
checkOut
in interfaceScmManager
- Throws:
ScmException
-
checkOut
public CheckOutScmResult checkOut(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, boolean recursive) throws ScmException
- Specified by:
checkOut
in interfaceScmManager
- Throws:
ScmException
-
diff
public DiffScmResult diff(ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion) throws ScmException
- Specified by:
diff
in interfaceScmManager
- Throws:
ScmException
-
edit
public EditScmResult edit(ScmRepository repository, ScmFileSet fileSet) throws ScmException
- Specified by:
edit
in interfaceScmManager
- Throws:
ScmException
-
export
public ExportScmResult export(ScmRepository repository, ScmFileSet fileSet) throws ScmException
- Specified by:
export
in interfaceScmManager
- Throws:
ScmException
-
export
public ExportScmResult export(ScmRepository repository, ScmFileSet fileSet, ScmVersion version) throws ScmException
- Specified by:
export
in interfaceScmManager
- Throws:
ScmException
-
export
public ExportScmResult export(ScmRepository repository, ScmFileSet fileSet, String outputDirectory) throws ScmException
- Specified by:
export
in interfaceScmManager
- Throws:
ScmException
-
export
public ExportScmResult export(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String outputDirectory) throws ScmException
- Specified by:
export
in interfaceScmManager
- Throws:
ScmException
-
list
public ListScmResult list(ScmRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion version) throws ScmException
- Specified by:
list
in interfaceScmManager
- Throws:
ScmException
-
remove
public RemoveScmResult remove(ScmRepository repository, ScmFileSet fileSet, String message) throws ScmException
- Specified by:
remove
in interfaceScmManager
- Throws:
ScmException
-
status
public StatusScmResult status(ScmRepository repository, ScmFileSet fileSet) throws ScmException
- Specified by:
status
in interfaceScmManager
- Throws:
ScmException
-
tag
public TagScmResult tag(ScmRepository repository, ScmFileSet fileSet, String tagName) throws ScmException
- Specified by:
tag
in interfaceScmManager
- Throws:
ScmException
-
tag
public TagScmResult tag(ScmRepository repository, ScmFileSet fileSet, String tagName, String message) throws ScmException
- Specified by:
tag
in interfaceScmManager
- Throws:
ScmException
-
unedit
public UnEditScmResult unedit(ScmRepository repository, ScmFileSet fileSet) throws ScmException
- Specified by:
unedit
in interfaceScmManager
- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet) throws ScmException
- Specified by:
update
in interfaceScmManager
- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version) throws ScmException
- Specified by:
update
in interfaceScmManager
- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, boolean runChangelog) throws ScmException
- Specified by:
update
in interfaceScmManager
- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, boolean runChangelog) throws ScmException
- Specified by:
update
in interfaceScmManager
- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, String datePattern) throws ScmException
- Specified by:
update
in interfaceScmManager
- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String datePattern) throws ScmException
- Specified by:
update
in interfaceScmManager
- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, Date lastUpdate) throws ScmException
- Specified by:
update
in interfaceScmManager
- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate) throws ScmException
- Specified by:
update
in interfaceScmManager
- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, Date lastUpdate, String datePattern) throws ScmException
- Specified by:
update
in interfaceScmManager
- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate, String datePattern) throws ScmException
- Specified by:
update
in interfaceScmManager
- Throws:
ScmException
-
blame
public BlameScmResult blame(ScmRepository repository, ScmFileSet fileSet, String filename) throws ScmException
- Specified by:
blame
in interfaceScmManager
- Throws:
ScmException
-
blame
public BlameScmResult blame(BlameScmRequest blameScmRequest) throws ScmException
- Specified by:
blame
in interfaceScmManager
- Throws:
ScmException
-
mkdir
public MkdirScmResult mkdir(ScmRepository repository, ScmFileSet fileSet, String message, boolean createInLocal) throws ScmException
- Specified by:
mkdir
in interfaceScmManager
- Throws:
ScmException
-
-