public abstract class ESAbstractModelMutator extends Object
| Constructor and Description |
|---|
ESAbstractModelMutator()
Default constructor.
|
ESAbstractModelMutator(ESModelMutatorConfiguration config)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
changeCrossReferences()
Changes cross references of all
EObjects in the model. |
void |
changeCrossReferences(org.eclipse.emf.ecore.EObject obj)
Changes CrossReferences of an specific
EObject. |
List<org.eclipse.emf.ecore.EObject> |
createChildren(org.eclipse.emf.ecore.EObject root)
Creates/deletes direct children for the given
EObject. |
boolean |
createChildren(org.eclipse.emf.ecore.EObject root,
int depth)
Create recursively direct and indirect children for a given
EObject and its children. |
void |
createChildrenForRoot()
Create the children for the root object.
|
void |
deleteEObjects(org.eclipse.emf.ecore.EObject root)
Randomly deletes direct and indirect children of the given root
EObject. |
void |
generate()
Initial generation.
|
ESModelMutatorConfiguration |
getConfig() |
void |
mutate(Set<org.eclipse.emf.ecore.EStructuralFeature> ignoredFeatures)
Mutation after an initial generation.
|
void |
mutateAttributes(Set<org.eclipse.emf.ecore.EStructuralFeature> ignoredFeatures)
Randomly mutates all attributes.
|
void |
mutateUntil(com.google.common.base.Predicate<org.eclipse.emf.ecore.EObject> predicate)
Performs mutation until the given
Predicate is met. |
abstract void |
postMutate()
Called after generation and mutation.
|
abstract void |
preMutate()
Called before generation and mutation.
|
void |
setConfig(ESModelMutatorConfiguration config)
Sets the config to be used by the mutator.
|
public ESAbstractModelMutator()
public ESAbstractModelMutator(ESModelMutatorConfiguration config)
config - The ESModelMutatorConfiguration to use for mutation.public abstract void preMutate()
public abstract void postMutate()
public void generate()
public void mutate(Set<org.eclipse.emf.ecore.EStructuralFeature> ignoredFeatures)
ignoredFeatures - a set of features to be ignored while mutatingpublic void mutateUntil(com.google.common.base.Predicate<org.eclipse.emf.ecore.EObject> predicate)
Predicate is met.
The predicate input will be the the root object obtained by
calling getConfig().predicate - the predicate that must be fulfilled in order to stop mutationpublic void createChildrenForRoot()
public boolean createChildren(org.eclipse.emf.ecore.EObject root,
int depth)
EObject and its children.root - The EObject for which children should be generated.depth - The depth of the EObject in the total tree.true, if children have been created, false otherwisepublic List<org.eclipse.emf.ecore.EObject> createChildren(org.eclipse.emf.ecore.EObject root)
EObject.root - The EObject for which children should be created.public void deleteEObjects(org.eclipse.emf.ecore.EObject root)
EObject.root - The EObject from which children should be deleted.public void mutateAttributes(Set<org.eclipse.emf.ecore.EStructuralFeature> ignoredFeatures)
ignoredFeatures - a set of features to be ignored while mutatingpublic void changeCrossReferences()
EObjects in the model.public void changeCrossReferences(org.eclipse.emf.ecore.EObject obj)
EObject.obj - The EObject whose cross references should be changedpublic ESModelMutatorConfiguration getConfig()
public void setConfig(ESModelMutatorConfiguration config)
config - the config to be used by the mutatorCopyright © 2017. All rights reserved.