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) voiddeployArtifact(RemoteRepository repository, ProducedArtifact... artifacts) flattenDependencies(Node node, PathScope scope) getArtifactPath(Artifact artifact) getData()intgetEffectiveProperties(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.SettingsCollection<org.apache.maven.api.toolchain.ToolchainModel> voidinstallArtifacts(Collection<ProducedArtifact> artifacts) voidinstallArtifacts(ProducedArtifact... artifacts) booleanisVersionSnapshot(String version) parseVersion(String version) parseVersionRange(String versionRange) voidregisterListener(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) voidsetArtifactPath(ProducedArtifact artifact, Path path) voidunregisterListener(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, waitMethods 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:
getSettingsin interfaceSession
-
getSystemProperties
- Specified by:
getSystemPropertiesin interfaceProtoSession
-
getUserProperties
- Specified by:
getUserPropertiesin interfaceProtoSession
-
getEffectiveProperties
-
getLocalRepository
- Specified by:
getLocalRepositoryin interfaceSession
-
getTopDirectory
- Specified by:
getTopDirectoryin interfaceProtoSession
-
getRootDirectory
- Specified by:
getRootDirectoryin interfaceProtoSession
-
getRemoteRepositories
- Specified by:
getRemoteRepositoriesin interfaceSession
-
getData
-
getMavenVersion
- Specified by:
getMavenVersionin interfaceSession
-
getDegreeOfConcurrency
public int getDegreeOfConcurrency()- Specified by:
getDegreeOfConcurrencyin interfaceSession
-
getStartTime
- Specified by:
getStartTimein interfaceProtoSession
-
getProjects
- Specified by:
getProjectsin interfaceSession
-
getPluginContext
-
getService
- Specified by:
getServicein interfaceSession
-
withLocalRepository
- Specified by:
withLocalRepositoryin interfaceSession
-
withRemoteRepositories
- Specified by:
withRemoteRepositoriesin interfaceSession
-
registerListener
- Specified by:
registerListenerin interfaceSession
-
unregisterListener
- Specified by:
unregisterListenerin interfaceSession
-
getListeners
- Specified by:
getListenersin interfaceSession
-
createLocalRepository
- Specified by:
createLocalRepositoryin interfaceSession
-
createRemoteRepository
- Specified by:
createRemoteRepositoryin interfaceSession
-
createRemoteRepository
- Specified by:
createRemoteRepositoryin interfaceSession
-
createArtifact
-
createArtifact
-
createProducedArtifact
public ProducedArtifact createProducedArtifact(String groupId, String artifactId, String version, String extension) - Specified by:
createProducedArtifactin interfaceSession
-
createProducedArtifact
public ProducedArtifact createProducedArtifact(String groupId, String artifactId, String version, String classifier, String extension, String type) - Specified by:
createProducedArtifactin interfaceSession
-
createArtifactCoordinates
public ArtifactCoordinates createArtifactCoordinates(String groupId, String artifactId, String version, String extension) - Specified by:
createArtifactCoordinatesin interfaceSession
-
createArtifactCoordinates
- Specified by:
createArtifactCoordinatesin interfaceSession
-
createArtifactCoordinates
public ArtifactCoordinates createArtifactCoordinates(String groupId, String artifactId, String version, String classifier, String extension, String type) - Specified by:
createArtifactCoordinatesin interfaceSession
-
createArtifactCoordinates
- Specified by:
createArtifactCoordinatesin interfaceSession
-
createDependencyCoordinates
- Specified by:
createDependencyCoordinatesin interfaceSession
-
createDependencyCoordinates
- Specified by:
createDependencyCoordinatesin interfaceSession
-
resolveArtifact
- Specified by:
resolveArtifactin interfaceSession
-
resolveArtifact
- Specified by:
resolveArtifactin interfaceSession
-
resolveArtifact
public DownloadedArtifact resolveArtifact(ArtifactCoordinates coordinates, List<RemoteRepository> repositories) - Specified by:
resolveArtifactin interfaceSession
-
resolveArtifact
- Specified by:
resolveArtifactin interfaceSession
-
resolveArtifacts
- Specified by:
resolveArtifactsin interfaceSession
-
resolveArtifacts
public Collection<DownloadedArtifact> resolveArtifacts(Collection<? extends ArtifactCoordinates> collection) - Specified by:
resolveArtifactsin interfaceSession
-
resolveArtifacts
- Specified by:
resolveArtifactsin interfaceSession
-
resolveArtifacts
public Collection<DownloadedArtifact> resolveArtifacts(Collection<? extends ArtifactCoordinates> coordinates, List<RemoteRepository> repositories) - Specified by:
resolveArtifactsin interfaceSession
-
flattenDependencies
-
resolveDependencies
- Specified by:
resolveDependenciesin interfaceSession
-
resolveDependencies
- Specified by:
resolveDependenciesin interfaceSession
-
resolveDependencies
-
resolveVersion
- Specified by:
resolveVersionin interfaceSession
-
resolveVersionRange
- Specified by:
resolveVersionRangein interfaceSession
-
resolveVersionRange
public List<Version> resolveVersionRange(ArtifactCoordinates artifact, List<RemoteRepository> repositories) - Specified by:
resolveVersionRangein interfaceSession
-
installArtifacts
- Specified by:
installArtifactsin interfaceSession
-
installArtifacts
- Specified by:
installArtifactsin interfaceSession
-
deployArtifact
- Specified by:
deployArtifactin interfaceSession
-
setArtifactPath
- Specified by:
setArtifactPathin interfaceSession
-
getArtifactPath
- Specified by:
getArtifactPathin interfaceSession
-
isVersionSnapshot
- Specified by:
isVersionSnapshotin interfaceSession
-
collectDependencies
- Specified by:
collectDependenciesin interfaceSession
-
collectDependencies
- Specified by:
collectDependenciesin interfaceSession
-
collectDependencies
- Specified by:
collectDependenciesin interfaceSession
-
getPathForLocalArtifact
- Specified by:
getPathForLocalArtifactin interfaceSession
-
getPathForRemoteArtifact
- Specified by:
getPathForRemoteArtifactin interfaceSession
-
parseVersion
- Specified by:
parseVersionin interfaceSession
-
parseVersionRange
- Specified by:
parseVersionRangein interfaceSession
-
parseVersionConstraint
- Specified by:
parseVersionConstraintin interfaceSession
-
resolveDependencies
public Map<PathType, List<Path>> resolveDependencies(DependencyCoordinates dependencyCoordinates, PathScope scope, Collection<PathType> desiredTypes) - Specified by:
resolveDependenciesin interfaceSession
-
resolveDependencies
public Map<PathType, List<Path>> resolveDependencies(Project project, PathScope scope, Collection<PathType> desiredTypes) - Specified by:
resolveDependenciesin interfaceSession
-
requireType
- Specified by:
requireTypein interfaceSession
-
requireLanguage
- Specified by:
requireLanguagein interfaceSession
-
requirePackaging
- Specified by:
requirePackagingin interfaceSession
-
requireProjectScope
- Specified by:
requireProjectScopein interfaceSession
-
requireDependencyScope
- Specified by:
requireDependencyScopein interfaceSession
-
requirePathScope
- Specified by:
requirePathScopein interfaceSession
-
resolveHighestVersion
public Optional<Version> resolveHighestVersion(ArtifactCoordinates artifact, List<RemoteRepository> repositories) - Specified by:
resolveHighestVersionin interfaceSession
-
getToolchains
- Specified by:
getToolchainsin interfaceSession
-