org.eclipse.emf.emfstore.fuzzy.emf
Class ESXMIResourceDataProvider

java.lang.Object
  extended by org.eclipse.emf.emfstore.fuzzy.emf.ESXMIResourceDataProvider
All Implemented Interfaces:
ESFuzzyEMFDataProvider, ESFuzzyDataProvider<org.eclipse.emf.ecore.EObject>

public class ESXMIResourceDataProvider
extends Object
implements ESFuzzyEMFDataProvider

This implementation of a ESFuzzyDataProvider provides models by reading them from a models folder.

The run of a test is based on a TestConfig, defining model etc.

During the run it records TestResults to create a test run for reporting purpose.

Since:
2.0
Author:
Julian Sommerfeldt

Field Summary
static String MODELS_FOLDER_NAME
          The name of the folder that contains the models.
static String MUTATOR_EDITINGDOMAIN
          Options constant for the EditingDomain for the mutator.
static String MUTATOR_EXC_LOG
          Options constant for the exception log set for the mutator.
static String PROP_CONFIGS_FILE
          Property specifying the path to the config file for the ESXMIResourceDataProvider.
static String PROP_EMFDATAPROVIDER
          Prefix of the properties concerning the ESXMIResourceDataProvider.
 
Constructor Summary
ESXMIResourceDataProvider()
           
 
Method Summary
 void finish()
          Call finish as last action of the ESXMIResourceDataProvider.
 org.eclipse.emf.ecore.EObject get(int count)
          See ESFuzzyDataProvider.
 ESTestConfig getConfig()
          Returns the config specifying this run of this provider.
 int getCurrentSeedCount()
          Returns the current seed that is used to generate the model.
 Collection<org.eclipse.emf.ecore.EPackage> getEPackages()
          Returns a collection of EPackages that are being considered to be generated/mutated.
 List<org.junit.runner.notification.RunListener> getListener()
           
 ESModelMutatorConfiguration getModelMutatorConfiguration()
          Returns the currently active ESModelMutatorConfiguration.
 long getSeed()
          Returns the current seed for this data provider.
 List<ESFuzzyTest> getTestsToRun()
           
 ESFuzzyUtil getUtil()
           
 void init()
          Initializes the ESXMIResourceDataProvider.
 void setMutator(ESAbstractModelMutator modelMutator)
          Sets the mutator to be used in order to generate and mutate data.
 void setOptions(Map<String,Object> options)
          Set the options for the ESXMIResourceDataProvider.
 void setTestClass(org.junit.runners.model.TestClass testClass)
           
 int size()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODELS_FOLDER_NAME

public static final String MODELS_FOLDER_NAME
The name of the folder that contains the models.

See Also:
Constant Field Values

PROP_EMFDATAPROVIDER

public static final String PROP_EMFDATAPROVIDER
Prefix of the properties concerning the ESXMIResourceDataProvider.

See Also:
Constant Field Values

PROP_CONFIGS_FILE

public static final String PROP_CONFIGS_FILE
Property specifying the path to the config file for the ESXMIResourceDataProvider.

See Also:
Constant Field Values

MUTATOR_EXC_LOG

public static final String MUTATOR_EXC_LOG
Options constant for the exception log set for the mutator. Has to be filled with a Set of RuntimeException.

See Also:
Constant Field Values

MUTATOR_EDITINGDOMAIN

public static final String MUTATOR_EDITINGDOMAIN
Options constant for the EditingDomain for the mutator.

See Also:
Constant Field Values
Constructor Detail

ESXMIResourceDataProvider

public ESXMIResourceDataProvider()
Method Detail

init

public void init()
Initializes the ESXMIResourceDataProvider.

Specified by:
init in interface ESFuzzyDataProvider<org.eclipse.emf.ecore.EObject>

get

public org.eclipse.emf.ecore.EObject get(int count)
See ESFuzzyDataProvider.

Specified by:
get in interface ESFuzzyDataProvider<org.eclipse.emf.ecore.EObject>
Parameters:
count - Which run is it?
Returns:
The new EObject.

finish

public void finish()
Call finish as last action of the ESXMIResourceDataProvider. Used for saving the results.


size

public int size()
Specified by:
size in interface ESFuzzyDataProvider<org.eclipse.emf.ecore.EObject>
Returns:
How much objects will be created?

setTestClass

public void setTestClass(org.junit.runners.model.TestClass testClass)
Specified by:
setTestClass in interface ESFuzzyDataProvider<org.eclipse.emf.ecore.EObject>
Parameters:
testClass - The TestClass of this run.

getListener

public List<org.junit.runner.notification.RunListener> getListener()
Specified by:
getListener in interface ESFuzzyDataProvider<org.eclipse.emf.ecore.EObject>
Returns:
The RunListener of this ESXMIResourceDataProvider.

getTestsToRun

public List<ESFuzzyTest> getTestsToRun()
Specified by:
getTestsToRun in interface ESFuzzyDataProvider<org.eclipse.emf.ecore.EObject>
Returns:
all ESFuzzyTests to run or null if all tests should run.

getCurrentSeedCount

public int getCurrentSeedCount()
Description copied from interface: ESFuzzyEMFDataProvider
Returns the current seed that is used to generate the model.

Specified by:
getCurrentSeedCount in interface ESFuzzyEMFDataProvider
Returns:
The current seed used to create the model

getSeed

public long getSeed()
Description copied from interface: ESFuzzyEMFDataProvider
Returns the current seed for this data provider.

Specified by:
getSeed in interface ESFuzzyEMFDataProvider
Returns:
The current seed for this data provider.

getEPackages

public Collection<org.eclipse.emf.ecore.EPackage> getEPackages()
Description copied from interface: ESFuzzyEMFDataProvider
Returns a collection of EPackages that are being considered to be generated/mutated.

Specified by:
getEPackages in interface ESFuzzyEMFDataProvider
Returns:
The EPackage of the model to generate/mutate.

getUtil

public ESFuzzyUtil getUtil()
Specified by:
getUtil in interface ESFuzzyDataProvider<org.eclipse.emf.ecore.EObject>
Returns:
The a new ESMutateUtil for this ESXMIResourceDataProvider.

getConfig

public ESTestConfig getConfig()
Description copied from interface: ESFuzzyEMFDataProvider
Returns the config specifying this run of this provider.

Specified by:
getConfig in interface ESFuzzyEMFDataProvider
Returns:
The config specifying this run of the ESXMIResourceDataProvider.
Since:
2.0

setOptions

public void setOptions(Map<String,Object> options)
Set the options for the ESXMIResourceDataProvider.

Specified by:
setOptions in interface ESFuzzyDataProvider<org.eclipse.emf.ecore.EObject>
Parameters:
options - the options.

getModelMutatorConfiguration

public ESModelMutatorConfiguration getModelMutatorConfiguration()
Description copied from interface: ESFuzzyEMFDataProvider
Returns the currently active ESModelMutatorConfiguration.

Specified by:
getModelMutatorConfiguration in interface ESFuzzyEMFDataProvider
Specified by:
getModelMutatorConfiguration in interface ESFuzzyDataProvider<org.eclipse.emf.ecore.EObject>
Returns:
The currently active ESModelMutatorConfiguration.
Since:
2.0

setMutator

public void setMutator(ESAbstractModelMutator modelMutator)
Sets the mutator to be used in order to generate and mutate data.

Specified by:
setMutator in interface ESFuzzyDataProvider<org.eclipse.emf.ecore.EObject>
Parameters:
modelMutator - the ESAbstractModelMutator to be used
See Also:
ESFuzzyDataProvider.setMutator(org.eclipse.emf.emfstore.modelmutator.ESAbstractModelMutator)


Copyright © 2015. All Rights Reserved.