ingwarsw / arquillian-suite-extension

Arquillian extension that will force single deployment for all tests
Apache License 2.0
67 stars 20 forks source link

Doesn't work with arquillian-persistence-extension #10

Closed PeterProbst closed 10 years ago

PeterProbst commented 10 years ago

Hi, this is more a question than an issue. I've tested arquillian-suite-extension. This extension would be a great performance acceleration for our tests. But it doesn't work as expected. We are using arquillian bom 1.1.4.Final, persistence extension 1.0.0.Alpha7, shrinkwrap resolver bom 2.1.1 and wildfly 8.1.0.Final When using one Testclass with @ArquillianSuiteDeployment and deployment method, the suite extension packs all Testclasses in the deployment, the local testrunner (in idea) runs all tests, but in the server container only one testclass is running, all other testclasses are ignored. Each Testclass has its own Deployment method - but it makes no difference, when the deployment methods are deleted. I have tested with @OperateOnDeployment, but this either makes no difference. Now the question - should the extension work in this configuration and is this a bug or is this a versioning problem with newer arquillian? Thanks for your work, best, Peter

ingwarsw commented 10 years ago

When you change from many classes with own @Deployment to one class with @ArquillianSuiteDeployment everything should work in the same manner as before.

-@Deployment must consists of all classes (test classes too) needed for all tests.

It would be easiest if you could put somewhere test with is not working as intended so I could look at it.

PeterProbst commented 10 years ago

Thank you for reply. I found the problem in the @UsingDataSet annotation. When the annotation is removed, the Testclass is running in the container. So the suite-extension do not run Testclasses with persistence-extension activated. Is this a bug or is the persistence-extension not supported?

PeterProbst commented 10 years ago

grrrrr, arquillian core is eating up the framework exceptions. After debugging for a while i have seen a framework exception deep in a core manager class: org.jboss.arquillian.persistence.core.exception.PersistenceExtensionInitializationException: Unable to load Arquillian properties in container. Missing file arquillian.extension.persistence.dbunit.properties I think that suite-extension is not compatible with perstistence-extension. That is very sad because our main test cases are running with persistence extension.

ingwarsw commented 10 years ago

I can try making them compatible..

If you can provide me with simple test case..

Enough should be two test classes with own deployment methods.. I will try running them with extension..

PeterProbst commented 10 years ago

Hi Karol, you find a maven sample project here: https://dl.dropboxusercontent.com/u/27838682/axon-arquillian-test.zip

the main project is axon-arquillian-test-main

Infrastructure needed:

Configuration needed in axon-arquillian-test-main.pom:

When running the Tests in axon-arquillian-test-access:

Thank you for your effort. Peter

ingwarsw commented 10 years ago

I didnt have time to test your project but I used arquillian-showcase to test it.

Below are changes needed to run it:

And should work.

Full commit: https://github.com/ingwarsw/arquillian-showcase/commit/55bc72a77b0fb6d448968a030313dd31b4c6b1f5

PeterProbst commented 10 years ago

Hi Karol, I have testet my test project with 1.1.2-SNAPSHOT, enriched the archive with dataset but no luck. Problem is not the dataset.

When annotated a test method with @usingDataset, exception is: org.jboss.arquillian.persistence.core.exception.PersistenceExtensionInitializationException: Unable to load Arquillian properties in container. Missing file arquillian.extension.persistence.dbunit.properties

When annotated test class with @usingDataset, exception is: org.jboss.arquillian.persistence.core.exception.PersistenceExtensionInitializationException: Unable to load Arquillian properties in container. Missing file arquillian.extension.persistence.jpacacheeviction.properties

I'm not able to find these files, they seem to be generated from arquillian.xml - but not present in archive - or arquillian.xml is not present, don't know. The showcase is years behind the actual versions, persistence-extension has been refactored in main parts - so can you please check with actual version of persistence-extension 1.0.0.Alpha7 I have actualized arquillian to 1.1.5.Final, which solved the problem of the suppressed exceptions- now all exceptions are coming up... Thanks, Peter

ingwarsw commented 10 years ago

Mayby you could try putting @UsingDataest on @Deployment method.. Then it should erich deployment with all needed files itself.

It that will not work I will try with your project.

PeterProbst commented 10 years ago

Hi Karol - it works! Thanks! All our tests are now running with two deployments. This is a big perfomance gain. Thank you for this extension.

ingwarsw commented 10 years ago

You also need to enrich archive with datasets?

PeterProbst commented 10 years ago

no, is not neccessary. Only annotate @Deployment with @usingDataSet. This fetches the datasets...

ingwarsw commented 10 years ago

Cool... closing comment..

You need stable version? Or SNAPSHOT is ok so far?

PeterProbst commented 10 years ago

Snapshot is ok, we can wait for next stable version.

perabello commented 10 years ago

Hello,

I use Persistence and DBUnit extension defaultDataSource, defaultDataSeedStrategy, datatypeFactory, defaultDataSetLocation, etc) . I do not find how to configure it integrated with ArquillianSuiteExtension. Do you know how to us it? Could I set a @UsingDataSet annotation for every test method?

Thanks Pere

dyorgio commented 10 years ago

Hi, lets put it on a release? :smile: My nexus don´t download SNAPSHOTs.. :cry: