Package org.apache.maven.scm.manager
Class ScmManagerStub
java.lang.Object
org.apache.maven.scm.manager.ScmManagerStub
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionCreates a new stub with stub repository and provider, and empty list of messages -
Method Summary
Modifier and TypeMethodDescriptionadd(ScmRepository repository, ScmFileSet fileSet) add(ScmRepository repository, ScmFileSet fileSet, String message) blame(BlameScmRequest blameScmRequest) blame(ScmRepository repository, ScmFileSet fileSet, String filename) branch(ScmRepository repository, ScmFileSet fileSet, String branchName) branch(ScmRepository repository, ScmFileSet fileSet, String branchName, String message) changeLog(ChangeLogScmRequest request) changeLog(ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, ScmBranch branch) changeLog(ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, ScmBranch branch, String datePattern) changeLog(ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion) changeLog(ScmRepository repository, ScmFileSet fileSet, ScmVersion startRevision, ScmVersion endRevision, String datePattern) checkIn(ScmRepository repository, ScmFileSet fileSet, String message) checkIn(ScmRepository repository, ScmFileSet fileSet, ScmVersion revision, String message) checkOut(ScmRepository repository, ScmFileSet fileSet) checkOut(ScmRepository repository, ScmFileSet fileSet, boolean recursive) checkOut(ScmRepository repository, ScmFileSet fileSet, ScmVersion version) checkOut(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, boolean recursive) diff(ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion) edit(ScmRepository repository, ScmFileSet fileSet) export(ScmRepository repository, ScmFileSet fileSet) export(ScmRepository repository, ScmFileSet fileSet, String outputDirectory) export(ScmRepository repository, ScmFileSet fileSet, ScmVersion version) export(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String outputDirectory) Get the messages to return in validateScmRepositorygetProviderByRepository(ScmRepository repository) getProviderByType(String providerType) getProviderByUrl(String scmUrl) list(ScmRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion version) makeProviderScmRepository(String providerType, File path) makeScmRepository(String scmUrl) mkdir(ScmRepository repository, ScmFileSet fileSet, String message, boolean createInLocal) remove(ScmRepository repository, ScmFileSet fileSet, String message) voidsetMessages(List<String> messages) Set the messages to return in validateScmRepositoryvoidsetScmProvider(String providerType, ScmProvider provider) voidsetScmProvider(ScmProvider scmProvider) voidsetScmProviderImplementation(String providerType, String providerImplementation) voidsetScmRepository(ScmRepository scmRepository) status(ScmRepository repository, ScmFileSet fileSet) tag(ScmRepository repository, ScmFileSet fileSet, String tagName) tag(ScmRepository repository, ScmFileSet fileSet, String tagName, String message) unedit(ScmRepository repository, ScmFileSet fileSet) update(ScmRepository repository, ScmFileSet fileSet) update(ScmRepository repository, ScmFileSet fileSet, boolean runChangelog) update(ScmRepository repository, ScmFileSet fileSet, String datePattern) update(ScmRepository repository, ScmFileSet fileSet, Date lastUpdate) update(ScmRepository repository, ScmFileSet fileSet, Date lastUpdate, String datePattern) update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version) update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, boolean runChangelog) update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String datePattern) update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate) update(ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate, String datePattern) validateScmRepository(String scmUrl) Returns the same list as getMessages()
-
Constructor Details
-
ScmManagerStub
public ScmManagerStub()Creates a new stub with stub repository and provider, and empty list of messages
-
-
Method Details
-
setScmProvider
-
getScmProvider
-
setScmProvider
- Specified by:
setScmProviderin interfaceScmManager
-
setScmProviderImplementation
- Specified by:
setScmProviderImplementationin interfaceScmManager
-
setScmRepository
-
getScmRepository
-
setMessages
Set the messages to return in validateScmRepository- Parameters:
messages-ListofStringobjects
-
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
-
validateScmRepository
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
- Specified by:
getProviderByTypein interfaceScmManager- Throws:
NoSuchScmProviderException
-
getProviderByRepository
public ScmProvider getProviderByRepository(ScmRepository repository) throws NoSuchScmProviderException - Specified by:
getProviderByRepositoryin interfaceScmManager- Throws:
NoSuchScmProviderException
-
add
- 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
- 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
-
checkOut
- 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
- Specified by:
editin interfaceScmManager- Throws:
ScmException
-
export
- 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
- 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
- Specified by:
uneditin interfaceScmManager- Throws:
ScmException
-
update
- 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
- 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
-