Class SessionStub
java.lang.Object
org.apache.maven.api.plugin.testing.stubs.SessionStub
- All Implemented Interfaces:
ProtoSession
,Session
A stub implementation of
Session
for basic testing scenarios.
Provides minimal implementation of session methods without mock dependencies.
For more comprehensive session mocking, consider using SessionMock
instead.
- Since:
- 4.0.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.maven.api.ProtoSession
ProtoSession.Builder
-
Constructor Summary
ConstructorsConstructorDescriptionSessionStub
(Map<String, String> userProperties) SessionStub
(Map<String, String> systemProperties, Map<String, String> userProperties, org.apache.maven.api.settings.Settings settings) SessionStub
(org.apache.maven.api.settings.Settings settings) -
Method Summary
Modifier and TypeMethodDescriptioncollectDependencies
(Artifact artifact, PathScope scope) collectDependencies
(DependencyCoordinates dependencyCoordinates, PathScope scope) collectDependencies
(Project project, PathScope scope) createArtifact
(String groupId, String artifactId, String version, String extension) createArtifact
(String groupId, String artifactId, String version, String classifier, String extension, String type) createArtifactCoordinates
(String coordString) createArtifactCoordinates
(String groupId, String artifactId, String version, String extension) createArtifactCoordinates
(String groupId, String artifactId, String version, String classifier, String extension, String type) createArtifactCoordinates
(Artifact artifact) createDependencyCoordinates
(ArtifactCoordinates artifactCoordinates) createDependencyCoordinates
(Dependency dependency) createLocalRepository
(Path path) createProducedArtifact
(String groupId, String artifactId, String version, String extension) createProducedArtifact
(String groupId, String artifactId, String version, String classifier, String extension, String type) createRemoteRepository
(String id, String url) createRemoteRepository
(Repository repository) void
deployArtifact
(RemoteRepository repository, ProducedArtifact... artifacts) flattenDependencies
(Node node, PathScope scope) getArtifactPath
(Artifact artifact) getData()
int
getEffectiveProperties
(Project project) getPathForLocalArtifact
(Artifact artifact) getPathForRemoteArtifact
(RemoteRepository remote, Artifact artifact) getPluginContext
(Project project) <T extends Service>
TgetService
(Class<T> clazz) org.apache.maven.api.settings.Settings
Collection
<org.apache.maven.api.toolchain.ToolchainModel> void
installArtifacts
(Collection<ProducedArtifact> artifacts) void
installArtifacts
(ProducedArtifact... artifacts) boolean
isVersionSnapshot
(String version) parseVersion
(String version) parseVersionRange
(String versionRange) void
registerListener
(Listener listener) requireType
(String id) resolveArtifact
(Artifact artifact) resolveArtifact
(ArtifactCoordinates coordinate) resolveArtifact
(ArtifactCoordinates coordinates, List<RemoteRepository> repositories) resolveArtifact
(Artifact artifact, List<RemoteRepository> repositories) resolveArtifacts
(Collection<? extends ArtifactCoordinates> collection) resolveArtifacts
(Collection<? extends ArtifactCoordinates> coordinates, List<RemoteRepository> repositories) resolveArtifacts
(Artifact... artifacts) resolveArtifacts
(ArtifactCoordinates... artifactCoordinates) resolveDependencies
(List<DependencyCoordinates> dependencyCoordinatess) resolveDependencies
(DependencyCoordinates dependencyCoordinates) resolveDependencies
(DependencyCoordinates dependencyCoordinates, PathScope scope, Collection<PathType> desiredTypes) resolveDependencies
(Project project, PathScope scope) resolveDependencies
(Project project, PathScope scope, Collection<PathType> desiredTypes) resolveHighestVersion
(ArtifactCoordinates artifact, List<RemoteRepository> repositories) resolveVersion
(ArtifactCoordinates artifact) resolveVersionRange
(ArtifactCoordinates artifact) resolveVersionRange
(ArtifactCoordinates artifact, List<RemoteRepository> repositories) void
setArtifactPath
(ProducedArtifact artifact, Path path) void
unregisterListener
(Listener listener) withLocalRepository
(LocalRepository localRepository) withRemoteRepositories
(List<RemoteRepository> repositories) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.maven.api.ProtoSession
toBuilder
-
Constructor Details
-
SessionStub
public SessionStub(org.apache.maven.api.settings.Settings settings) -
SessionStub
public SessionStub() -
SessionStub
-
SessionStub
-
-
Method Details
-
getSettings
public org.apache.maven.api.settings.Settings getSettings()- Specified by:
getSettings
in interfaceSession
-
getSystemProperties
- Specified by:
getSystemProperties
in interfaceProtoSession
-
getUserProperties
- Specified by:
getUserProperties
in interfaceProtoSession
-
getEffectiveProperties
-
getLocalRepository
- Specified by:
getLocalRepository
in interfaceSession
-
getTopDirectory
- Specified by:
getTopDirectory
in interfaceProtoSession
-
getRootDirectory
- Specified by:
getRootDirectory
in interfaceProtoSession
-
getRemoteRepositories
- Specified by:
getRemoteRepositories
in interfaceSession
-
getData
-
getMavenVersion
- Specified by:
getMavenVersion
in interfaceSession
-
getDegreeOfConcurrency
public int getDegreeOfConcurrency()- Specified by:
getDegreeOfConcurrency
in interfaceSession
-
getStartTime
- Specified by:
getStartTime
in interfaceProtoSession
-
getProjects
- Specified by:
getProjects
in interfaceSession
-
getPluginContext
-
getService
- Specified by:
getService
in interfaceSession
-
withLocalRepository
- Specified by:
withLocalRepository
in interfaceSession
-
withRemoteRepositories
- Specified by:
withRemoteRepositories
in interfaceSession
-
registerListener
- Specified by:
registerListener
in interfaceSession
-
unregisterListener
- Specified by:
unregisterListener
in interfaceSession
-
getListeners
- Specified by:
getListeners
in interfaceSession
-
createLocalRepository
- Specified by:
createLocalRepository
in interfaceSession
-
createRemoteRepository
- Specified by:
createRemoteRepository
in interfaceSession
-
createRemoteRepository
- Specified by:
createRemoteRepository
in interfaceSession
-
createArtifact
-
createArtifact
-
createProducedArtifact
public ProducedArtifact createProducedArtifact(String groupId, String artifactId, String version, String extension) - Specified by:
createProducedArtifact
in interfaceSession
-
createProducedArtifact
public ProducedArtifact createProducedArtifact(String groupId, String artifactId, String version, String classifier, String extension, String type) - Specified by:
createProducedArtifact
in interfaceSession
-
createArtifactCoordinates
public ArtifactCoordinates createArtifactCoordinates(String groupId, String artifactId, String version, String extension) - Specified by:
createArtifactCoordinates
in interfaceSession
-
createArtifactCoordinates
- Specified by:
createArtifactCoordinates
in interfaceSession
-
createArtifactCoordinates
public ArtifactCoordinates createArtifactCoordinates(String groupId, String artifactId, String version, String classifier, String extension, String type) - Specified by:
createArtifactCoordinates
in interfaceSession
-
createArtifactCoordinates
- Specified by:
createArtifactCoordinates
in interfaceSession
-
createDependencyCoordinates
- Specified by:
createDependencyCoordinates
in interfaceSession
-
createDependencyCoordinates
- Specified by:
createDependencyCoordinates
in interfaceSession
-
resolveArtifact
- Specified by:
resolveArtifact
in interfaceSession
-
resolveArtifact
- Specified by:
resolveArtifact
in interfaceSession
-
resolveArtifact
public DownloadedArtifact resolveArtifact(ArtifactCoordinates coordinates, List<RemoteRepository> repositories) - Specified by:
resolveArtifact
in interfaceSession
-
resolveArtifact
- Specified by:
resolveArtifact
in interfaceSession
-
resolveArtifacts
- Specified by:
resolveArtifacts
in interfaceSession
-
resolveArtifacts
public Collection<DownloadedArtifact> resolveArtifacts(Collection<? extends ArtifactCoordinates> collection) - Specified by:
resolveArtifacts
in interfaceSession
-
resolveArtifacts
- Specified by:
resolveArtifacts
in interfaceSession
-
resolveArtifacts
public Collection<DownloadedArtifact> resolveArtifacts(Collection<? extends ArtifactCoordinates> coordinates, List<RemoteRepository> repositories) - Specified by:
resolveArtifacts
in interfaceSession
-
flattenDependencies
-
resolveDependencies
- Specified by:
resolveDependencies
in interfaceSession
-
resolveDependencies
- Specified by:
resolveDependencies
in interfaceSession
-
resolveDependencies
-
resolveVersion
- Specified by:
resolveVersion
in interfaceSession
-
resolveVersionRange
- Specified by:
resolveVersionRange
in interfaceSession
-
resolveVersionRange
public List<Version> resolveVersionRange(ArtifactCoordinates artifact, List<RemoteRepository> repositories) - Specified by:
resolveVersionRange
in interfaceSession
-
installArtifacts
- Specified by:
installArtifacts
in interfaceSession
-
installArtifacts
- Specified by:
installArtifacts
in interfaceSession
-
deployArtifact
- Specified by:
deployArtifact
in interfaceSession
-
setArtifactPath
- Specified by:
setArtifactPath
in interfaceSession
-
getArtifactPath
- Specified by:
getArtifactPath
in interfaceSession
-
isVersionSnapshot
- Specified by:
isVersionSnapshot
in interfaceSession
-
collectDependencies
- Specified by:
collectDependencies
in interfaceSession
-
collectDependencies
- Specified by:
collectDependencies
in interfaceSession
-
collectDependencies
- Specified by:
collectDependencies
in interfaceSession
-
getPathForLocalArtifact
- Specified by:
getPathForLocalArtifact
in interfaceSession
-
getPathForRemoteArtifact
- Specified by:
getPathForRemoteArtifact
in interfaceSession
-
parseVersion
- Specified by:
parseVersion
in interfaceSession
-
parseVersionRange
- Specified by:
parseVersionRange
in interfaceSession
-
parseVersionConstraint
- Specified by:
parseVersionConstraint
in interfaceSession
-
resolveDependencies
public Map<PathType, List<Path>> resolveDependencies(DependencyCoordinates dependencyCoordinates, PathScope scope, Collection<PathType> desiredTypes) - Specified by:
resolveDependencies
in interfaceSession
-
resolveDependencies
public Map<PathType, List<Path>> resolveDependencies(Project project, PathScope scope, Collection<PathType> desiredTypes) - Specified by:
resolveDependencies
in interfaceSession
-
requireType
- Specified by:
requireType
in interfaceSession
-
requireLanguage
- Specified by:
requireLanguage
in interfaceSession
-
requirePackaging
- Specified by:
requirePackaging
in interfaceSession
-
requireProjectScope
- Specified by:
requireProjectScope
in interfaceSession
-
requireDependencyScope
- Specified by:
requireDependencyScope
in interfaceSession
-
requirePathScope
- Specified by:
requirePathScope
in interfaceSession
-
resolveHighestVersion
public Optional<Version> resolveHighestVersion(ArtifactCoordinates artifact, List<RemoteRepository> repositories) - Specified by:
resolveHighestVersion
in interfaceSession
-
getToolchains
- Specified by:
getToolchains
in interfaceSession
-