org.eclipse.emf.emfstore.fuzzy.emf
Class ESMutateUtil

java.lang.Object
  extended by org.eclipse.emf.emfstore.fuzzy.emf.ESMutateUtil
All Implemented Interfaces:
ESFuzzyUtil

public class ESMutateUtil
extends Object
implements ESFuzzyUtil

A ESFuzzyUtil class for tests using the ESEMFDataProvider.

Since:
2.0
Author:
Julian Sommerfeldt

Constructor Summary
ESMutateUtil(ESFuzzyEMFDataProvider dataProvider)
          For internal use.
 
Method Summary
 Collection<org.eclipse.emf.ecore.EClass> getEClassesToIgnore()
           
 Collection<org.eclipse.emf.ecore.EPackage> getEPackages()
           
 Collection<org.eclipse.emf.ecore.EStructuralFeature> getEStructuralFeaturesToIgnore()
           
 int getMinObjectsCount()
           
 Integer getMutationCount()
          Returns how many mutation should be performed, if set
 String getRunResourcePath(String suffix)
           
 org.eclipse.emf.common.util.URI getRunResourceURI(String suffix)
           
 long getSeed()
           
 int getSeedCount()
           
 void mutate()
          Mutate with the ESModelMutatorConfiguration from configuration file.
 void mutate(ESModelMutatorConfiguration mmc)
          Mutate with a ESModelMutatorConfiguration.
 void saveEObject(org.eclipse.emf.ecore.EObject obj)
           
 void saveEObject(org.eclipse.emf.ecore.EObject obj, String suffix, boolean discardDanglingHREF)
          Save an EObject in the folder: artifacts/runs/configID.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ESMutateUtil

public ESMutateUtil(ESFuzzyEMFDataProvider dataProvider)
For internal use.

Parameters:
dataProvider - The ESEMFDataProvider of the test.
Method Detail

getEPackages

public Collection<org.eclipse.emf.ecore.EPackage> getEPackages()
Returns:
The EPackage of the ESEMFDataProvider.

getMinObjectsCount

public int getMinObjectsCount()
Returns:
The minimum objects count of the current ESModelMutatorConfiguration of the ESEMFDataProvider .

getSeed

public long getSeed()
Returns:
The seed of the ESEMFDataProvider.

getSeedCount

public int getSeedCount()
Returns:
The current seed (run) of the ESEMFDataProvider.

getEClassesToIgnore

public Collection<org.eclipse.emf.ecore.EClass> getEClassesToIgnore()
Returns:
The EClasses to ignore in the current ESModelMutatorConfiguration.

getEStructuralFeaturesToIgnore

public Collection<org.eclipse.emf.ecore.EStructuralFeature> getEStructuralFeaturesToIgnore()
Returns:
The EStructuralFeatures to ignore in the current ESModelMutatorConfiguration.

mutate

public void mutate(ESModelMutatorConfiguration mmc)
Mutate with a ESModelMutatorConfiguration.

Parameters:
mmc - The ESModelMutatorConfiguration to use for mutation.

mutate

public void mutate()
Mutate with the ESModelMutatorConfiguration from configuration file.


saveEObject

public void saveEObject(org.eclipse.emf.ecore.EObject obj)
Parameters:
obj - The EObject to save.
See Also:
saveEObject(EObject, String, boolean)

saveEObject

public void saveEObject(org.eclipse.emf.ecore.EObject obj,
                        String suffix,
                        boolean discardDanglingHREF)
Save an EObject in the folder: artifacts/runs/configID. Use it for instance to save objects, when an error occurs. The file name is always: COUNT_SUFFIX.xml so e.g. 3_testFile.xml

Parameters:
obj - The EObject to save.
suffix - The suffix of the file: e.g. testFile. null permitted.
discardDanglingHREF - Should the save ignore dangling hrefs?

getRunResourcePath

public String getRunResourcePath(String suffix)
Parameters:
suffix - The suffix for the file: e.g. testFile. null permitted.
Returns:
A file path to the current run folder.

getRunResourceURI

public org.eclipse.emf.common.util.URI getRunResourceURI(String suffix)
Parameters:
suffix - The suffix for the file: e.g. testFile. null permitted.
Returns:
A file URI to the current run folder.

getMutationCount

public Integer getMutationCount()
Returns how many mutation should be performed, if set

Returns:
the number of mutations to be performed


Copyright © 2015. All Rights Reserved.