Arquillian Persistence Extension Implementation 1.0.0.Alpha3

org.jboss.arquillian.persistence.metadata
Class ResourceProvider<T extends ResourceDescriptor<?>>

java.lang.Object
  extended by org.jboss.arquillian.persistence.metadata.ResourceProvider<T>
Direct Known Subclasses:
DataSetProvider, ExpectedDataSetProvider, SqlScriptProvider

public abstract class ResourceProvider<T extends ResourceDescriptor<?>>
extends Object


Field Summary
protected  PersistenceConfiguration configuration
           
protected  MetadataExtractor metadataExtractor
           
protected  Class<? extends Annotation> resourceAnnotation
           
 
Constructor Summary
ResourceProvider(Class<? extends Annotation> resourceAnnotation, PersistenceConfiguration configuration, MetadataExtractor metadataExtractor)
           
 
Method Summary
protected abstract  T createDescriptor(String dataFileName)
           
protected abstract  String defaultFileName()
           
protected  String defaultFolder()
           
protected abstract  String defaultLocation()
           
protected  String determineLocation(String location)
          Checks if data set file exists in the default location.
 List<T> getDescriptors(Method testMethod)
           
 Set<T> getDescriptors(org.jboss.arquillian.test.spi.TestClass testClass)
          Returns all resources defined for this test class including those defined on the test method level.
protected  List<T> obtainClassLevelDataSet(Annotation classLevelAnnotation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configuration

protected final PersistenceConfiguration configuration

metadataExtractor

protected final MetadataExtractor metadataExtractor

resourceAnnotation

protected final Class<? extends Annotation> resourceAnnotation
Constructor Detail

ResourceProvider

public ResourceProvider(Class<? extends Annotation> resourceAnnotation,
                        PersistenceConfiguration configuration,
                        MetadataExtractor metadataExtractor)
Method Detail

getDescriptors

public Set<T> getDescriptors(org.jboss.arquillian.test.spi.TestClass testClass)
Returns all resources defined for this test class including those defined on the test method level.

Parameters:
testClass -
Returns:

getDescriptors

public List<T> getDescriptors(Method testMethod)

createDescriptor

protected abstract T createDescriptor(String dataFileName)

defaultLocation

protected abstract String defaultLocation()

defaultFileName

protected abstract String defaultFileName()

obtainClassLevelDataSet

protected List<T> obtainClassLevelDataSet(Annotation classLevelAnnotation)

defaultFolder

protected String defaultFolder()

determineLocation

protected String determineLocation(String location)
Checks if data set file exists in the default location. If that's not the case, file is looked up starting from the root.

Returns:
determined file location

Arquillian Persistence Extension Implementation 1.0.0.Alpha3

Copyright © 2011 JBoss by Red Hat. All Rights Reserved.