org.jboss.arquillian.persistence.metadata.provider
Class ResourceProvider<T extends ResourceDescriptor<?>>
java.lang.Object
org.jboss.arquillian.persistence.metadata.provider.ResourceProvider<T>
- Type Parameters:
T - Concrete implementation of ResourceDescriptor providing necessary information for given resource type.
- Direct Known Subclasses:
- DataSetProvider, ExpectedDataSetProvider, SqlScriptProvider
public abstract class ResourceProvider<T extends ResourceDescriptor<?>>
- extends Object
Handles metadata extraction from given test class or test method and provides
descriptors for resources defined in given annotation type
(such as UsingDataSet or ApplyScriptBefore).
- Author:
- Bartosz Majsak
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
metadataExtractor
protected final MetadataExtractor metadataExtractor
resourceAnnotation
protected final Class<? extends Annotation> resourceAnnotation
ResourceProvider
public ResourceProvider(Class<? extends Annotation> resourceAnnotation,
MetadataExtractor metadataExtractor)
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:
getDescriptorsDefinedFor
public Collection<T> getDescriptorsDefinedFor(Method testMethod)
getResourceFileNames
public abstract Collection<String> getResourceFileNames(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 file exists in the default location.
If that's not the case, file is looked up starting from the root.
- Returns:
- determined file location
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.