org.eclipse.emf.emfstore.fuzzy.emf
Class ESEMFDataProvider

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

public class ESEMFDataProvider
extends Object
implements ESFuzzyEMFDataProvider

This implementation of a ESFuzzyDataProvider provides generated models using the functionality of an ESAbstractModelMutator.

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 MUTATOR_EDITINGDOMAIN
          Options constant for the EditingDomain for the ESAbstractModelMutator.
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 ESEMFDataProvider.
static String PROP_EMFDATAPROVIDER
          Prefix of the properties concerning the ESEMFDataProvider.
 
Constructor Summary
ESEMFDataProvider()
           
 
Method Summary
 void finish()
          Call finish as last action of the ESEMFDataProvider.
 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()
          Init the ESEMFDataProvider.
 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 ESEMFDataProvider.
 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

PROP_EMFDATAPROVIDER

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

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 ESEMFDataProvider.

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 ESAbstractModelMutator.

See Also:
Constant Field Values
Constructor Detail

ESEMFDataProvider

public ESEMFDataProvider()
Method Detail

init

public void init()
Init the ESEMFDataProvider.

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 ESEMFDataProvider. 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 ESEMFDataProvider.

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()
Returns the current seed that is used to generate the model.

Specified by:
getCurrentSeedCount in interface ESFuzzyEMFDataProvider
Returns:
the current seed that is used to generate the model.
See Also:
ESFuzzyEMFDataProvider.getCurrentSeedCount()

getSeed

public long getSeed()
Returns the current seed for this data provider.

Specified by:
getSeed in interface ESFuzzyEMFDataProvider
Returns:
the current seed for this data provider
See Also:
ESFuzzyEMFDataProvider.getSeed()

getEPackages

public Collection<org.eclipse.emf.ecore.EPackage> getEPackages()
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.
See Also:
ESFuzzyEMFDataProvider.getEPackages()

getUtil

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

getConfig

public ESTestConfig getConfig()
Returns the config specifying this run of this provider.

Specified by:
getConfig in interface ESFuzzyEMFDataProvider
Returns:
the config specifying this run of this provider
See Also:
ESFuzzyEMFDataProvider.getConfig()

setOptions

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

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

getModelMutatorConfiguration

public ESModelMutatorConfiguration getModelMutatorConfiguration()
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
See Also:
ESFuzzyEMFDataProvider.getModelMutatorConfiguration()

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.