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) void
setMessages
(List<String> messages) Set the messages to return in validateScmRepositoryvoid
setScmProvider
(String providerType, ScmProvider provider) void
setScmProvider
(ScmProvider scmProvider) void
setScmProviderImplementation
(String providerType, String providerImplementation) void
setScmRepository
(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:
setScmProvider
in interfaceScmManager
-
setScmProviderImplementation
- Specified by:
setScmProviderImplementation
in interfaceScmManager
-
setScmRepository
-
getScmRepository
-
setMessages
Set the messages to return in validateScmRepository- Parameters:
messages
-List
ofString
objects
-
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
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
- Specified by:
getProviderByType
in interfaceScmManager
- Throws:
NoSuchScmProviderException
-
getProviderByRepository
public ScmProvider getProviderByRepository(ScmRepository repository) throws NoSuchScmProviderException - Specified by:
getProviderByRepository
in interfaceScmManager
- Throws:
NoSuchScmProviderException
-
add
- 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
- 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
-
checkOut
- 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
- Specified by:
edit
in interfaceScmManager
- Throws:
ScmException
-
export
- 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
- 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
- Specified by:
unedit
in interfaceScmManager
- Throws:
ScmException
-
update
- 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
- 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
-