Package org.jboss.arquillian.persistence.core.metadata

Examples of org.jboss.arquillian.persistence.core.metadata.MetadataExtractor


        private Instance<ScriptingConfiguration> scriptingConfigurationInstance;

        private final ThreadLocal<Boolean> active = new ThreadLocal<Boolean>();

        public void before(@Observes final BeforeStep event) {
            final MetadataExtractor extractor = new MetadataExtractor(event.getTestClass());
            final boolean isActive = new PersistenceExtensionEnabler(extractor).shouldPersistenceExtensionBeActivated();
            active.set(isActive);

            if (isActive) {
                final PersistenceConfiguration persistenceConfiguration = configurationInstance.get();
View Full Code Here


   private Set<ResourceDescriptor<?>> fetchAllDataResources(TestClass testClass)
   {
      final Set<ResourceDescriptor<?>> allDataSets = new HashSet<ResourceDescriptor<?>>();

      final DataSetProvider dataSetProvider = new DataSetProvider(new MetadataExtractor(testClass), dbunitConfigurationInstance.get());
      final ExpectedDataSetProvider expectedDataSetProvider = new ExpectedDataSetProvider(new MetadataExtractor(testClass), dbunitConfigurationInstance.get());

      allDataSets.addAll(dataSetProvider.getDescriptors(testClass));
      allDataSets.addAll(expectedDataSetProvider.getDescriptors(testClass));
      allDataSets.addAll(extractDtds(dataSetProvider.getDescriptors(testClass)));
      allDataSets.addAll(extractDtds(expectedDataSetProvider.getDescriptors(testClass)));
View Full Code Here

      PersistenceExtensionFeatureResolver persistenceExtensionFeatureResolver = persistenceExtensionFeatureResolverInstance.get();

      if (persistenceExtensionFeatureResolver.shouldVerifyDataAfterTest())
      {
         final MetadataExtractor metadataExtractor = metadataExtractorInstance.get();
         final ExpectedDataSetProvider dataSetProvider = new ExpectedDataSetProvider(metadataExtractor, configurationInstance.get());
         final Method testMethod = afterPersistenceTest.getTestMethod();
         final ShouldMatchDataSet dataSetsToVerify = metadataExtractor.shouldMatchDataSet()
                                                                      .fetchFrom(testMethod);
         final CustomColumnFilter customColumnFilter = metadataExtractor.using(CustomColumnFilter.class).fetchFrom(testMethod);
         final CompareDBUnitData compareDBUnitDataEvent = new CompareDBUnitData(dataSetProvider.getDescriptorsDefinedFor(testMethod), dataSetsToVerify.orderBy(), dataSetsToVerify.excludeColumns());
         if (customColumnFilter != null)
         {
               compareDBUnitDataEvent.add(customColumnFilter.value());
         }
View Full Code Here

      PersistenceExtensionFeatureResolver persistenceExtensionFeatureResolver = persistenceExtensionFeatureResolverInstance.get();

      if (persistenceExtensionFeatureResolver.shouldVerifyDataAfterTest())
      {
         final MetadataExtractor metadataExtractor = metadataExtractorInstance.get();
         final ExpectedDataSetProvider dataSetProvider = new ExpectedDataSetProvider(metadataExtractor, configurationInstance.get());
         final Method testMethod = afterPersistenceTest.getTestMethod();
         final ShouldMatchDataSet dataSetsToVerify = metadataExtractor.shouldMatchDataSet()
                                                                      .fetchFrom(testMethod);

         compareDataEvent.fire(new CompareData(dataSetProvider.getDescriptorsDefinedFor(testMethod), dataSetsToVerify.orderBy(), dataSetsToVerify.excludeColumns()));
      }
View Full Code Here

   public static SqlScriptProvider<CleanupUsingScript> createProviderForCleanupScripts(TestClass testClass, ScriptingConfiguration configuration)
   {
      return SqlScriptProvider.forAnnotation(CleanupUsingScript.class)
                              .usingConfiguration(configuration)
                              .extractingMetadataUsing(new MetadataExtractor(testClass))
                              .namingFollows(new PrefixedScriptFileNamingStrategy("cleanup-", "sql"))
                              .build(new ValueExtractor<CleanupUsingScript>()
                              {
                                 @Override
                                 public String[] extract(CleanupUsingScript toExtract)
View Full Code Here

   public static SqlScriptProvider<ApplyScriptAfter> createProviderForScriptsToBeAppliedAfterTest(TestClass testClass, ScriptingConfiguration configuration)
   {
      return SqlScriptProvider.forAnnotation(ApplyScriptAfter.class)
                              .usingConfiguration(configuration)
                              .extractingMetadataUsing(new MetadataExtractor(testClass))
                              .namingFollows(new PrefixedScriptFileNamingStrategy("after-", "sql"))
                              .build(new ValueExtractor<ApplyScriptAfter>()
                              {
                                 @Override
                                 public String[] extract(ApplyScriptAfter toExtract)
View Full Code Here

   public static  SqlScriptProvider<ApplyScriptBefore> createProviderForScriptsToBeAppliedBeforeTest(TestClass testClass, ScriptingConfiguration configuration)
   {
      return SqlScriptProvider.forAnnotation(ApplyScriptBefore.class)
                              .usingConfiguration(configuration)
                              .extractingMetadataUsing(new MetadataExtractor(testClass))
                              .namingFollows(new PrefixedScriptFileNamingStrategy("before-", "sql"))
                              .build(new ValueExtractor<ApplyScriptBefore>()
                              {
                                 @Override
                                 public String[] extract(ApplyScriptBefore toExtract)
View Full Code Here

   public static  SqlScriptProvider<CreateSchema> createProviderForCreateSchemaScripts(TestClass testClass, ScriptingConfiguration configuration)
   {
      return SqlScriptProvider.forAnnotation(CreateSchema.class)
            .usingConfiguration(configuration)
            .extractingMetadataUsing(new MetadataExtractor(testClass))
            .namingFollows(new FileNamingStrategy<String>("sql"){
               @Override
               public String getFileExtension()
               {
                  return extension;
View Full Code Here

   @Inject
   private Event<BeforePersistenceClass> beforePersistenceClassEvent;

   public void beforeClass(@Observes BeforeClass beforeClass)
   {
      metadataExtractorProducer.set(new MetadataExtractor(beforeClass.getTestClass()));
      persistenceExtensionEnabler.set(new PersistenceExtensionEnabler(metadataExtractorProducer.get()));
      if (persistenceExtensionEnabler.get().shouldPersistenceExtensionBeActivated())
      {
         initializeConfigurationEvent.fire(new InitializeConfiguration());
         beforePersistenceClassEvent.fire(new BeforePersistenceClass(beforeClass.getTestClass()));
View Full Code Here

   private Set<ResourceDescriptor<?>> fetchAllDataResources(TestClass testClass)
   {
      final Set<ResourceDescriptor<?>> allDataSets = new HashSet<ResourceDescriptor<?>>();

      final DataSetProvider dataSetProvider = new DataSetProvider(new MetadataExtractor(testClass), dbunitConfigurationInstance.get());
      final ExpectedDataSetProvider expectedDataSetProvider = new ExpectedDataSetProvider(new MetadataExtractor(testClass), dbunitConfigurationInstance.get());
      final SqlScriptProvider<ApplyScriptBefore> scriptsAppliedBeforeTestProvider = SqlScriptProvider.createProviderForScriptsToBeAppliedBeforeTest(testClass, scriptingConfigurationInstance.get());
      final SqlScriptProvider<ApplyScriptAfter> scriptsAppliedAfterTestProvider = SqlScriptProvider.createProviderForScriptsToBeAppliedAfterTest(testClass, scriptingConfigurationInstance.get());
      final SqlScriptProvider<CleanupUsingScript> cleanupScriptsProvider = SqlScriptProvider.createProviderForCleanupScripts(testClass, scriptingConfigurationInstance.get());
      final SqlScriptProvider<CreateSchema> createSchemaScripts = SqlScriptProvider.createProviderForCreateSchemaScripts(testClass, scriptingConfigurationInstance.get());
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.persistence.core.metadata.MetadataExtractor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.