Class MavenMock
java.lang.Object
net.ssehub.easy.instantiation.core.model.defaultInstantiators.AbstractFileInstantiator
net.ssehub.easy.producer.scenario_tests.mocks.MavenMock
- All Implemented Interfaces:
net.ssehub.easy.instantiation.core.model.vilTypes.IVilType
public class MavenMock
extends net.ssehub.easy.instantiation.core.model.defaultInstantiators.AbstractFileInstantiator
Simple manual mocking of the Maven instantiator, currently with .
- Author:
- Holger Eichelberger
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interfaceFunction interfaces for original Maven function to be mocked. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static booleanprivate static booleanprivate static List<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root) Executes a specific MAVEN build specification with "clean" and "install" targets.static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root, boolean updateSnapshots) Executes a specific MAVEN build specification with "clean" and "install" targets.static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root, boolean updateSnapshots, net.ssehub.easy.instantiation.core.model.vilTypes.Sequence<String> buildtargets) Executes a specific MAVEN build specification.static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> Executes a specific MAVEN build specification with "clean" and "install" targets.static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root, String buildFilePath, boolean updateSnapshots) Executes a specific MAVEN build specification with "clean" and "install" targets.static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root, String buildFilePath, boolean updateSnapshots, net.ssehub.easy.instantiation.core.model.vilTypes.Sequence<String> buildtargets) Executes a specific MAVEN build specification.static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root, String buildFilePath, net.ssehub.easy.instantiation.core.model.vilTypes.Sequence<String> buildtargets) Executes a specific MAVEN build specification.static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root, String buildFilePath, net.ssehub.easy.instantiation.core.model.vilTypes.Sequence<String> mvnArgs, boolean updateSnapshots) Executes a specific MAVEN build specification with "clean" and "install" targets.static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root, net.ssehub.easy.instantiation.core.model.vilTypes.Sequence<String> buildtargets) Executes a specific MAVEN build specification.static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root, net.ssehub.easy.instantiation.core.model.vilTypes.Sequence<String> mvnArgs, boolean updateSnapshots) Executes a specific MAVEN build specification with "clean" and "install" targets.static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root, net.ssehub.easy.instantiation.core.model.vilTypes.Sequence<String> mvnArgs, boolean updateSnapshots, net.ssehub.easy.instantiation.core.model.vilTypes.Sequence<String> buildtargets) Executes a specific MAVEN build specification.private static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> mock(MavenMock.MavenFunction original) Mocks an original function returning a set of file artifacts.static final voidregister()Registers the Java artifacts and instantiators.static booleansetPassThrough(boolean pass) Changes the pass-through state.static List<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> Changes the mocked result for the following calls.Methods inherited from class net.ssehub.easy.instantiation.core.model.defaultInstantiators.AbstractFileInstantiator
determineTargetPath, toString
-
Field Details
-
registered
private static boolean registered -
passThrough
private static boolean passThrough -
result
-
-
Constructor Details
-
MavenMock
public MavenMock()
-
-
Method Details
-
register
public static final void register()Registers the Java artifacts and instantiators. -
mock
private static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> mock(MavenMock.MavenFunction original) throws net.ssehub.easy.instantiation.core.model.common.VilException Mocks an original function returning a set of file artifacts.- Parameters:
original- the original function to be called if notpassThrough- Returns:
- the result, may be
result - Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- if the execution fails
-
maven
public static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root) throws net.ssehub.easy.instantiation.core.model.common.VilException Executes a specific MAVEN build specification with "clean" and "install" targets.- Parameters:
root- the root-path- Returns:
- the created artifacts
- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case of artifact / parameter problems
-
maven
public static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root, boolean updateSnapshots) throws net.ssehub.easy.instantiation.core.model.common.VilException Executes a specific MAVEN build specification with "clean" and "install" targets.- Parameters:
root- the root-pathupdateSnapshots- whether snapshots shall be updated- Returns:
- the created artifacts
- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case of artifact / parameter problems
-
maven
public static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root, net.ssehub.easy.instantiation.core.model.vilTypes.Sequence<String> mvnArgs, boolean updateSnapshots) throws net.ssehub.easy.instantiation.core.model.common.VilException Executes a specific MAVEN build specification with "clean" and "install" targets.- Parameters:
root- the root-pathmvnArgs- optional maven argumentsupdateSnapshots- whether snapshots shall be updated- Returns:
- the created artifacts
- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case of artifact / parameter problems
-
maven
public static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root, String buildFilePath) throws net.ssehub.easy.instantiation.core.model.common.VilException Executes a specific MAVEN build specification with "clean" and "install" targets.- Parameters:
root- the root-pathbuildFilePath- the path where the MAVEN file is located- Returns:
- the created artifacts
- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case of artifact / parameter problems
-
maven
public static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root, String buildFilePath, boolean updateSnapshots) throws net.ssehub.easy.instantiation.core.model.common.VilException Executes a specific MAVEN build specification with "clean" and "install" targets.- Parameters:
root- the root-pathbuildFilePath- the path where the MAVEN file is locatedupdateSnapshots- whether snapshots shall be updated- Returns:
- the created artifacts
- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case of artifact / parameter problems
-
maven
public static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root, String buildFilePath, net.ssehub.easy.instantiation.core.model.vilTypes.Sequence<String> mvnArgs, boolean updateSnapshots) throws net.ssehub.easy.instantiation.core.model.common.VilException Executes a specific MAVEN build specification with "clean" and "install" targets.- Parameters:
root- the root-pathbuildFilePath- the path where the MAVEN file is locatedmvnArgs- additional maven argumentsupdateSnapshots- whether snapshots shall be updated- Returns:
- the created artifacts
- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case of artifact / parameter problems
-
maven
public static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root, net.ssehub.easy.instantiation.core.model.vilTypes.Sequence<String> buildtargets) throws net.ssehub.easy.instantiation.core.model.common.VilException Executes a specific MAVEN build specification.- Parameters:
root- the root-pathbuildtargets- the targets to be executed- Returns:
- the created artifacts
- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case of artifact / parameter problems
-
maven
public static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root, boolean updateSnapshots, net.ssehub.easy.instantiation.core.model.vilTypes.Sequence<String> buildtargets) throws net.ssehub.easy.instantiation.core.model.common.VilException Executes a specific MAVEN build specification.- Parameters:
root- the root-pathupdateSnapshots- whether snapshots shall be updatedbuildtargets- the targets to be executed- Returns:
- the created artifacts
- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case of artifact / parameter problems
-
maven
public static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root, net.ssehub.easy.instantiation.core.model.vilTypes.Sequence<String> mvnArgs, boolean updateSnapshots, net.ssehub.easy.instantiation.core.model.vilTypes.Sequence<String> buildtargets) throws net.ssehub.easy.instantiation.core.model.common.VilException Executes a specific MAVEN build specification.- Parameters:
root- the root-pathmvnArgs- additional maven arguments, may be null for noneupdateSnapshots- whether snapshots shall be updatedbuildtargets- the targets to be executed- Returns:
- the created artifacts
- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case of artifact / parameter problems
-
maven
public static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root, String buildFilePath, net.ssehub.easy.instantiation.core.model.vilTypes.Sequence<String> buildtargets) throws net.ssehub.easy.instantiation.core.model.common.VilException Executes a specific MAVEN build specification.- Parameters:
root- the root-pathbuildFilePath- the path where the MAVEN file is locatedbuildtargets- the targets to be executed- Returns:
- the created artifacts
- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case of artifact / parameter problems
-
maven
public static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> maven(net.ssehub.easy.instantiation.core.model.artifactModel.Path root, String buildFilePath, boolean updateSnapshots, net.ssehub.easy.instantiation.core.model.vilTypes.Sequence<String> buildtargets) throws net.ssehub.easy.instantiation.core.model.common.VilException Executes a specific MAVEN build specification.- Parameters:
root- the root-pathbuildFilePath- the path where the MAVEN file is locatedupdateSnapshots- whether snapshots shall be updatedbuildtargets- the targets to be executed- Returns:
- the created artifacts
- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case of artifact / parameter problems
-
setPassThrough
public static boolean setPassThrough(boolean pass) Changes the pass-through state.- Parameters:
pass- shall calls be passed-through to the original implementation or mocked here- Returns:
- the original value of the flag before calling this method
-
setResult
public static List<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> setResult(List<net.ssehub.easy.instantiation.core.model.artifactModel.FileArtifact> res) Changes the mocked result for the following calls.- Parameters:
res- the result values- Returns:
- the original value before calling this method
-