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:
setScmProviderin interfaceScmManager
-
setScmProviderImplementation
public void setScmProviderImplementation(String providerType, String providerImplementation)
- Specified by:
setScmProviderImplementationin 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-ListofStringobjects
-
getMessages
public List<String> getMessages()
Get the messages to return in validateScmRepository.- Returns:
ListofStringobjects
-
makeScmRepository
public ScmRepository makeScmRepository(String scmUrl) throws ScmRepositoryException, NoSuchScmProviderException
- Specified by:
makeScmRepositoryin interfaceScmManager- Throws:
ScmRepositoryExceptionNoSuchScmProviderException
-
makeProviderScmRepository
public ScmRepository makeProviderScmRepository(String providerType, File path) throws ScmRepositoryException, UnknownRepositoryStructure, NoSuchScmProviderException
- Specified by:
makeProviderScmRepositoryin interfaceScmManager- Throws:
ScmRepositoryExceptionUnknownRepositoryStructureNoSuchScmProviderException
-
makeProviderScmRepository
public Optional<ScmRepository> makeProviderScmRepository(File path)
- Specified by:
makeProviderScmRepositoryin interfaceScmManager
-
validateScmRepository
public List<String> validateScmRepository(String scmUrl)
Returns the same list as getMessages()- Specified by:
validateScmRepositoryin interfaceScmManager- Parameters:
scmUrl- ignored- Returns:
ListofStringobjects, the same list returned by getMessages()
-
getProviderByUrl
public ScmProvider getProviderByUrl(String scmUrl) throws ScmRepositoryException, NoSuchScmProviderException
- Specified by:
getProviderByUrlin interfaceScmManager- Throws:
ScmRepositoryExceptionNoSuchScmProviderException
-
getProviderByType
public ScmProvider getProviderByType(String providerType) throws NoSuchScmProviderException
- Specified by:
getProviderByTypein interfaceScmManager- Throws:
NoSuchScmProviderException
-
getProviderByRepository
public ScmProvider getProviderByRepository(ScmRepository repository) throws NoSuchScmProviderException
- Specified by:
getProviderByRepositoryin interfaceScmManager- Throws:
NoSuchScmProviderException
-
add
public AddScmResult add(ScmRepository repository, ScmFileSet fileSet) throws ScmException
- Specified by:
addin interfaceScmManager- Throws:
ScmException
-
add
public AddScmResult add(ScmRepository repository, ScmFileSet fileSet, String message) throws ScmException
- Specified by:
addin interfaceScmManager- Throws:
ScmException
-
branch
public BranchScmResult branch(ScmRepository repository, ScmFileSet fileSet, String branchName) throws ScmException
- Specified by:
branchin interfaceScmManager- Throws:
ScmException
-
branch
public BranchScmResult branch(ScmRepository repository, ScmFileSet fileSet, String branchName, String message) throws ScmException
- Specified by:
branchin interfaceScmManager- Throws:
ScmException
-
changeLog
public ChangeLogScmResult changeLog(ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, ScmBranch branch) throws ScmException
- Specified by:
changeLogin 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:
changeLogin interfaceScmManager- Throws:
ScmException
-
changeLog
public ChangeLogScmResult changeLog(ChangeLogScmRequest request) throws ScmException
- Specified by:
changeLogin interfaceScmManager- Throws:
ScmException
-
changeLog
public ChangeLogScmResult changeLog(ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion) throws ScmException
- Specified by:
changeLogin interfaceScmManager- Throws:
ScmException
-
changeLog
public ChangeLogScmResult changeLog(ScmRepository repository, ScmFileSet fileSet, ScmVersion startRevision, ScmVersion endRevision, String datePattern) throws ScmException
- Specified by:
changeLogin interfaceScmManager- Throws:
ScmException
-
checkIn
public CheckInScmResult checkIn(ScmRepository repository, ScmFileSet fileSet, String message) throws ScmException
- Specified by:
checkInin interfaceScmManager- Throws:
ScmException
-
checkIn
public CheckInScmResult checkIn(ScmRepository repository, ScmFileSet fileSet, ScmVersion revision, String message) throws ScmException
- Specified by:
checkInin interfaceScmManager- Throws:
ScmException
-
checkIn
public CheckInScmResult checkIn(ScmRepository repository, ScmFileSet fileSet, CommandParameters commandParameters) throws ScmException
- Specified by:
checkInin interfaceScmManager- Throws:
ScmException
-
checkOut
public CheckOutScmResult checkOut(ScmRepository repository, ScmFileSet fileSet) throws ScmException
- Specified by:
checkOutin interfaceScmManager- Throws:
ScmException
-
checkOut
public CheckOutScmResult checkOut(ScmRepository repository, ScmFileSet fileSet, ScmVersion version) throws ScmException
- Specified by:
checkOutin interfaceScmManager- Throws:
ScmException
-
checkOut
public CheckOutScmResult checkOut(ScmRepository repository, ScmFileSet fileSet, boolean recursive) throws ScmException
- Specified by:
checkOutin interfaceScmManager- Throws:
ScmException
-
checkOut
public CheckOutScmResult checkOut(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, boolean recursive) throws ScmException
- Specified by:
checkOutin interfaceScmManager- Throws:
ScmException
-
diff
public DiffScmResult diff(ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion) throws ScmException
- Specified by:
diffin interfaceScmManager- Throws:
ScmException
-
edit
public EditScmResult edit(ScmRepository repository, ScmFileSet fileSet) throws ScmException
- Specified by:
editin interfaceScmManager- Throws:
ScmException
-
export
public ExportScmResult export(ScmRepository repository, ScmFileSet fileSet) throws ScmException
- Specified by:
exportin interfaceScmManager- Throws:
ScmException
-
export
public ExportScmResult export(ScmRepository repository, ScmFileSet fileSet, ScmVersion version) throws ScmException
- Specified by:
exportin interfaceScmManager- Throws:
ScmException
-
export
public ExportScmResult export(ScmRepository repository, ScmFileSet fileSet, String outputDirectory) throws ScmException
- Specified by:
exportin interfaceScmManager- Throws:
ScmException
-
export
public ExportScmResult export(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String outputDirectory) throws ScmException
- Specified by:
exportin interfaceScmManager- Throws:
ScmException
-
list
public ListScmResult list(ScmRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion version) throws ScmException
- Specified by:
listin interfaceScmManager- Throws:
ScmException
-
remove
public RemoveScmResult remove(ScmRepository repository, ScmFileSet fileSet, String message) throws ScmException
- Specified by:
removein interfaceScmManager- Throws:
ScmException
-
status
public StatusScmResult status(ScmRepository repository, ScmFileSet fileSet) throws ScmException
- Specified by:
statusin interfaceScmManager- Throws:
ScmException
-
tag
public TagScmResult tag(ScmRepository repository, ScmFileSet fileSet, String tagName) throws ScmException
- Specified by:
tagin interfaceScmManager- Throws:
ScmException
-
tag
public TagScmResult tag(ScmRepository repository, ScmFileSet fileSet, String tagName, String message) throws ScmException
- Specified by:
tagin interfaceScmManager- Throws:
ScmException
-
unedit
public UnEditScmResult unedit(ScmRepository repository, ScmFileSet fileSet) throws ScmException
- Specified by:
uneditin interfaceScmManager- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet) throws ScmException
- Specified by:
updatein interfaceScmManager- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version) throws ScmException
- Specified by:
updatein interfaceScmManager- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, boolean runChangelog) throws ScmException
- Specified by:
updatein interfaceScmManager- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, boolean runChangelog) throws ScmException
- Specified by:
updatein interfaceScmManager- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, String datePattern) throws ScmException
- Specified by:
updatein interfaceScmManager- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String datePattern) throws ScmException
- Specified by:
updatein interfaceScmManager- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, Date lastUpdate) throws ScmException
- Specified by:
updatein interfaceScmManager- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate) throws ScmException
- Specified by:
updatein interfaceScmManager- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, Date lastUpdate, String datePattern) throws ScmException
- Specified by:
updatein interfaceScmManager- Throws:
ScmException
-
update
public UpdateScmResult update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate, String datePattern) throws ScmException
- Specified by:
updatein interfaceScmManager- Throws:
ScmException
-
blame
public BlameScmResult blame(ScmRepository repository, ScmFileSet fileSet, String filename) throws ScmException
- Specified by:
blamein interfaceScmManager- Throws:
ScmException
-
blame
public BlameScmResult blame(BlameScmRequest blameScmRequest) throws ScmException
- Specified by:
blamein interfaceScmManager- Throws:
ScmException
-
mkdir
public MkdirScmResult mkdir(ScmRepository repository, ScmFileSet fileSet, String message, boolean createInLocal) throws ScmException
- Specified by:
mkdirin interfaceScmManager- Throws:
ScmException
-
-