arquillian / arquillian-extension-persistence

Arquillian Database / Persistence Extension

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NPE when committing the transaction

ruettimac opened this issue · comments

We changed from ALPHA-5 to the latest SNAPSHOT. The main reason was to have the orderBy functionality in the @ShouldMatchDataSet. We need the ordering by Primary Key with data type ordering and not the string value. The Primary Key is generated by a Sequence (Oracle) and starts with 1'000'000. Below this value, the test data takes place. The test are run with the embedded Glassfish

After switching to the SNAPSHOT, the IT-Tests fail because the transactions can not be commited anymore.

java.lang.RuntimeException: Unable to commit the transaction.
at org.jboss.arquillian.transaction.jta.provider.JtaTransactionProvider.commitTransaction(JtaTransactionProvider.java:79)
at org.jboss.arquillian.transaction.impl.lifecycle.TransactionHandler.endTransactionAfterTest(TransactionHandler.java:111)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.testenricher.cdi.CreationalContextDestroyer.destory(CreationalContextDestroyer.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.after(EventTestRunnerAdaptor.java:103)
at org.jboss.arquillian.junit.Arquillian$5$1.evaluate(Arquillian.java:245)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at org.junit.runner.JUnitCore.run(JUnitCore.java:136)
at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:65)
at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.executeTest(ServletTestRunner.java:160)
at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.execute(ServletTestRunner.java:126)
at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:90)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at org.jboss.arquillian.transaction.jta.provider.JtaTransactionProvider.isTransactionMarkedToRollback(JtaTransactionProvider.java:137)
at org.jboss.arquillian.transaction.jta.provider.JtaTransactionProvider.commitTransaction(JtaTransactionProvider.java:73)
... 89 more

Hey,

which version of GF are you using? I will have a look at this problem and open JIRA.

Cheers,
Bartosz

Hi Bartosz

We use 3.1.2 - the latest and the same version as you are using in the tests.

If I can help you, just provide me with the needed information.

Thanks,

Cyrill

Am 22.11.2012 um 09:19 schrieb Bartosz Majsak notifications@github.com:

Hey,

which version of GF are you using? I will have a look at this problem and open JIRA.

Cheers,
Bartosz


Reply to this email directly or view it on GitHub.

Sadly I don't have integration tests running on Oracle but if you could
share dataset and test it will at least point me in the right direction to
nail down the problem (can be over email or simply create JIRA if you have
JBoss account and add an attachment there). Thanks!

On Thu, Nov 22, 2012 at 10:13 AM, ruettimac notifications@github.comwrote:

Hi Bartosz

We use 3.1.2 - the latest and the same version as you are using in the
tests.

If I can help you, just provide me with the needed information.

Thanks,

Cyrill

Am 22.11.2012 um 09:19 schrieb Bartosz Majsak notifications@github.com:

Hey,

which version of GF are you using? I will have a look at this problem
and open JIRA.

Cheers,
Bartosz


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com//issues/22#issuecomment-10627829.

Hi Bartosz,

Please find enclosed a sample project which runs against Oracle. There is one failing test (SteuerauskunftKantonZuerich). But this is neglectable for now ...

What you have to do:

  1. Download the Oracle JDBC-Driver from http://download.oracle.com/otn/utilities_drivers/jdbc/11203/ojdbc6.jar
  2. Install the JDBC-Driver into the maven repository with the following information:
com.oracle ojdbc6 11.2.0.3
  1. Install Oracle Express 11g from http://www.oracle.com/technetwork/products/express-edition/overview/index.html
  2. Setup the Database-Schema with setupusers.sql
  3. Create the Schema with the flyway plugin flyway:clean, flyway:migrate in the jee6skeletonserver project
  4. Run the surefire tests

I have not the same behavior as in our commercial project. But at least it does not work after upgrading from Alpha4 to the latest snapshot. I will investigate over the weekend and provide ou with another sample IT-Test.

Regards,

Cyrill

Am 22.11.2012 um 10:49 schrieb Bartosz Majsak notifications@github.com:

Sadly I don't have integration tests running on Oracle but if you could
share dataset and test it will at least point me in the right direction to
nail down the problem (can be over email or simply create JIRA if you have
JBoss account and add an attachment there). Thanks!

On Thu, Nov 22, 2012 at 10:13 AM, ruettimac notifications@github.comwrote:

Hi Bartosz

We use 3.1.2 - the latest and the same version as you are using in the
tests.

If I can help you, just provide me with the needed information.

Thanks,

Cyrill

Am 22.11.2012 um 09:19 schrieb Bartosz Majsak notifications@github.com:

Hey,

which version of GF are you using? I will have a look at this problem
and open JIRA.

Cheers,
Bartosz


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com//issues/22#issuecomment-10627829.


Reply to this email directly or view it on GitHub.

Thanks a lot for such detailed bug report Cyrill!
The only problem is that I don't see any attachment :) Can you send me this stuff over gmail (if that's the easiest)?
I will work on that over the weekend and keep you updated.

Hi Bartosz,

I have included an updated project in this email. I have upgraded to the latest frameworks - the same versions we are using in the commercial application.
I have also fixed some issues - one was failing one test. I have also fixed the cleanup scripts so they work with Alpha5 or later.

Unfortunately, all tests are green when upgrading tot he latest snapshot. I have to figure out whats the difference between this project and the commercial one. At least, the arquillian.xml looks the same. I will keep you updated.

Regards,

Cyrill

Am 22.11.2012 um 23:48 schrieb Bartosz Majsak notifications@github.com:

Thanks a lot for such detailed bug report Cyrill! I will work on that over the weekend and keep you updated.


Reply to this email directly or view it on GitHub.

Hello Bartosz,

Right now, I was successfully with running the Arquillian-Tests in my commercial project. I was comparing the dependencies between the two projects. When I was approching org.jboss.arquillian.junit:arquillian-junit-container I recognized, that the version was fixed to 1.0.0-FINAL, but Arquillian was set to 1.0.3-FINAL. So I removed the overriding dependency to arquillian-junit-container which defined maybe an incompatible dependency and et voila, the tests run successfully.

But the bad thing is, that when I override the junit-container in the jee6skeleton, the tests run as well. So there must be some more dependencies which in combination produce the NPE. But I think this must be an uncommon situation and it is not worth to spend hours on it.

So wish you a relaxed sunday and thanks for the work on the arquillian persistence extension!

Regards,

Cyrill

Am 22.11.2012 um 23:48 schrieb Bartosz Majsak notifications@github.com:

Thanks a lot for such detailed bug report Cyrill! I will work on that over the weekend and keep you updated.


Reply to this email directly or view it on GitHub.

Interesting :) Thx anyway for putting time and effort to report the problem. I will anyway create a vm with oracle db (as I do with MS SQL express) to have better integration tests!

Cheers,
Bartosz

Hi Bartosz,

I played around today with the latest snapshot. I have modified the class DataSetComparator and have included a patch for it. It would be great to include the patch into the branch.

  1. Method existingColumnsForTable() --> When configuring the column "ID" to be used for sorting, Join-Tables have typically no "ID" but a combined primary key. With this method, non existing table columns will be filtered out and do not anymore fail the test.

  2. Added some more precise logging statements

  3. Method defineColumnsForSorting() --> Only add the additional columns when I have not defined any custom orderBy columns.

I have included the patch in the attachment. Some reformatting took place while re-integrating the Data on my Mac. Did not succeed to setup GIT on Windows.

I also discovered, that the orderBy does not work for me. I am interested in your experience. I have discovered this while migrating to the new version and failing tests. First I fixed some issues in the DataSetComparator. Please have a look at the following output - I am not sure If I can just iterator over the SortedTable by column index and get back the sorted table rows. But comparing with the differences produced this should be feasible. Apart from the output below, you will find the expected dataset where I have put the record with ID=155 at the top. So there has to be applied some sort of sorting. And I suspect that the sorting is based on the string value and not the data type of the primary key. I hope that this is not an Oracle issue. But 5 years ago I implemented already a SortedTable based on the "ID" and the main committer of DBUnit (GOMMA) was sitting next to me.

Regards,

Cyrill

SortedExpectedTable=ZB_BERECHTIGUNG, ID=1
SortedExpectedTable=ZB_BERECHTIGUNG, ID=10
SortedExpectedTable=ZB_BERECHTIGUNG, ID=11
SortedExpectedTable=ZB_BERECHTIGUNG, ID=12
SortedExpectedTable=ZB_BERECHTIGUNG, ID=13
SortedExpectedTable=ZB_BERECHTIGUNG, ID=14
SortedExpectedTable=ZB_BERECHTIGUNG, ID=15
SortedExpectedTable=ZB_BERECHTIGUNG, ID=155
SortedExpectedTable=ZB_BERECHTIGUNG, ID=2
SortedExpectedTable=ZB_BERECHTIGUNG, ID=3
SortedExpectedTable=ZB_BERECHTIGUNG, ID=4
SortedExpectedTable=ZB_BERECHTIGUNG, ID=5
SortedExpectedTable=ZB_BERECHTIGUNG, ID=6
SortedExpectedTable=ZB_BERECHTIGUNG, ID=7
SortedExpectedTable=ZB_BERECHTIGUNG, ID=8
SortedExpectedTable=ZB_BERECHTIGUNG, ID=9

SortedCurrentTable=ZB_BERECHTIGUNG, ID=1
SortedCurrentTable=ZB_BERECHTIGUNG, ID=2
SortedCurrentTable=ZB_BERECHTIGUNG, ID=3
SortedCurrentTable=ZB_BERECHTIGUNG, ID=4
SortedCurrentTable=ZB_BERECHTIGUNG, ID=5
SortedCurrentTable=ZB_BERECHTIGUNG, ID=6
SortedCurrentTable=ZB_BERECHTIGUNG, ID=7
SortedCurrentTable=ZB_BERECHTIGUNG, ID=8
SortedCurrentTable=ZB_BERECHTIGUNG, ID=9
SortedCurrentTable=ZB_BERECHTIGUNG, ID=10
SortedCurrentTable=ZB_BERECHTIGUNG, ID=11
SortedCurrentTable=ZB_BERECHTIGUNG, ID=12
SortedCurrentTable=ZB_BERECHTIGUNG, ID=13
SortedCurrentTable=ZB_BERECHTIGUNG, ID=14
SortedCurrentTable=ZB_BERECHTIGUNG, ID=15
SortedCurrentTable=ZB_BERECHTIGUNG, ID=155

"ZB_BERECHTIGUNG":[
{
"ID":155,
"UUID":"0ef92206-51ae-46bf-a081-2f51f9f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"VERSUCH",
"BESCHREIBUNG":"VERSUCH",
"METHODEN":"zentraleberechtigungfacade.loadpermittednumberforregistrationsgrund,zentraleberechtigungfacade.isallowedtomodifyperson"
},
{
"ID":1,
"UUID":"0ef42206-51be-46bf-a081-2f56f9f599d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_READ_ORGUNIT",
"BESCHREIBUNG":"ZB Organisationseinheit lesen",
"METHODEN":"zentraleberechtigungfacade.loadkindorgeinheitenbyid,zentraleberechtigungfacade.loadapplikationenbyorgeinheitid,zentraleberechtigungfacade.loadelternorgeinheitenbyid,zentraleberechtigungfacade.loadorgeinheitenbyapplikationid,zentraleberechtigungfacade.loadorgeinheitenbybenutzerid,zentraleberechtigungfacade.loadelternorgeinheitenbyid,zentraleberechtigungfacade.loadorgeinheitbyid,zentraleberechtigungfacade.loadapplikationenbyorgeinheitid,zentraleberechtigungfacade.loadorgeinheitenbyapplikationid,zentraleberechtigungfacade.loadattributfilterbyrolleid,zentraleberechtigungfacade.loadallorgeinheiten,zentraleberechtigungfacade.loadteamsinorgeinheit,zentraleberechtigungfacade.loadteambyid"
},
{
"ID":2,
"UUID":"0ef42206-51be-46bf-a081-2f56f9f699d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_READ_USER",
"BESCHREIBUNG":"ZB Benutzer lesen",
"METHODEN":"zentraleberechtigungfacade.loadbenutzerbybenutzerid,zentraleberechtigungfacade.loadbenutzercompletebyidandorgeinheit,zentraleberechtigungfacade.loadallberechtigungenofbenutzerinorgeinheit,zentraleberechtigungfacade.loadallbenutzer,zentraleberechtigungfacade.loadbenutzerbyrolleid"
},
{
"ID":3,
"UUID":"0ef42206-51be-46bf-a081-2f56f9f799d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_READ_ROLE",
"BESCHREIBUNG":"ZB Rolle lesen",
"METHODEN":"zentraleberechtigungfacade.loadattributfiltern,zentraleberechtigungfacade.loadrollebyid,zentraleberechtigungfacade.loadattributfilternbyrolleid,zentraleberechtigungfacade.loadattributfiltern,zentraleberechtigungfacade.loadrollebyidentifikation"
},
{
"ID":4,
"UUID":"0ef42206-51be-46bf-a081-2f56f9f899d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_READ_UNION",
"BESCHREIBUNG":"ZB Verbund lesen",
"METHODEN":"zentraleberechtigungfacade.loadverbundbyid,zentraleberechtigungfacade.loadregistrationsgruende,zentraleberechtigungfacade.loadverbundset,zentraleberechtigungfacade.loadregistrationsregeln"
},
{
"ID":5,
"UUID":"0ef42206-51be-46bf-a081-2f56f9f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_READ_APPLICATION",
"BESCHREIBUNG":"ZB Anwendung lesen",
"METHODEN":"zentraleberechtigungfacade.loadapplikationbyid,zentraleberechtigungfacade.loadregistrationsgrundbyid,zentraleberechtigungfacade.loadapplikationen"
},
{
"ID":6,
"UUID":"0ef42206-51be-46bf-a081-2f56f1f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_SAVE_ROLE",
"BESCHREIBUNG":"ZB Rolle schreiben",
"METHODEN":"zentraleberechtigungfacade.savefachlicherolle,zentraleberechtigungfacade.saverolle,zentraleberechtigungfacade.deleterolle"
},
{
"ID":7,
"UUID":"0ef42206-51be-46bf-a081-2f56f2f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_SAVE_UNION",
"BESCHREIBUNG":"ZB Verbund schreiben",
"METHODEN":"zentraleberechtigungfacade.saveregistrationsgrundentity,zentraleberechtigungfacade.saveregistrationsgrundentity,zentraleberechtigungfacade.deleteregistrationsgrund,zentraleberechtigungfacade.saveregistrationsregel,zentraleberechtigungfacade.saveteam,zentraleberechtigungfacade.saveverbund,zentraleberechtigungfacade.deleteverbund"
},
{
"ID":8,
"UUID":"0ef42206-51be-46bf-a081-2f56f3f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_SAVE_ORGUNIT",
"BESCHREIBUNG":"ZB Organisationseinheit schreiben",
"METHODEN":"zentraleberechtigungfacade.saveorganisationseinheit,zentraleberechtigungfacade.deleteorganisationseinheit"
},
{
"ID":9,
"UUID":"0ef42206-51be-46bf-a081-2f56f4f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_SAVE_APPLIKATION",
"BESCHREIBUNG":"ZB Anwendung schreiben",
"METHODEN":"zentraleberechtigungfacade.saveapplication,zentraleberechtigungfacade.deleteapplikation"
},
{
"ID":10,
"UUID":"0ef42206-51be-46bf-a081-2f56f5f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_SAVE_USER",
"BESCHREIBUNG":"ZB Benutzer schreiben",
"METHODEN":"zentraleberechtigungfacade.savebenutzer"
},
{
"ID":11,
"UUID":"0ef42206-51be-46bf-a081-2f56f6f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_SAVE_TEAM",
"BESCHREIBUNG":"ZB Team schreiben",
"METHODEN":"zentraleberechtigungfacade.deleteteam,zentraleberechtigungfacade.saveteam "
},
{
"ID":12,
"UUID":"0ef42206-51be-46bf-a081-2f56f7f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_SAVE_KONTAKT",
"BESCHREIBUNG":"ZB Kontakt schreiben",
"METHODEN":"zentraleberechtigungfacade.savekontakt"
},
{
"ID":13,
"UUID":"0ef42206-51be-46bf-a081-2f56f8f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_SAVE_ATTRIBUTFILTER",
"BESCHREIBUNG":"ZB Attributfilter schreiben",
"METHODEN":"zentraleberechtigungfacade.saveattributfilter"
},
{
"ID":14,
"UUID":"0ef52206-51be-46bf-a081-2f56f9f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_SAVE_BERECHTIGUNG",
"BESCHREIBUNG":"ZB Berechtigung schreiben",
"METHODEN":"zentraleberechtigungfacade.saveberechtigung"
},
{
"ID":15,
"UUID":"0ef42206-51be-46bf-a081-2f51f9f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_CALL_REGISTRIERUNGSSERVICEMETHODS",
"BESCHREIBUNG":"ZB Registrierungsservice-Methoden aufrufen",
"METHODEN":"zentraleberechtigungfacade.loadpermittednumberforregistrationsgrund,zentraleberechtigungfacade.isallowedtomodifyperson"
}
],

Bartosz,

I have nailed down the problem to the class JsonDataSet and DataSetProducer. There is no data type information available and it will be set explicitly to Unknown.

DBUnit SortedTable checks the Datatype for sorting and interprets Unknown to String.

To include the type information into the JSON will have an impact on the existing code. I would like to implement a simple type guessing class which tries to detect the Datatype.

What dou you mean or propose?

Regards,

Cyrill

Am 26.11.2012 um 22:06 schrieb Cyrill Ruettimann ruettimac@me.com:

Hi Bartosz,

I played around today with the latest snapshot. I have modified the class DataSetComparator and have included a patch for it. It would be great to include the patch into the branch.

  1. Method existingColumnsForTable() --> When configuring the column "ID" to be used for sorting, Join-Tables have typically no "ID" but a combined primary key. With this method, non existing table columns will be filtered out and do not anymore fail the test.

  2. Added some more precise logging statements

  3. Method defineColumnsForSorting() --> Only add the additional columns when I have not defined any custom orderBy columns.

I have included the patch in the attachment. Some reformatting took place while re-integrating the Data on my Mac. Did not succeed to setup GIT on Windows.

I also discovered, that the orderBy does not work for me. I am interested in your experience. I have discovered this while migrating to the new version and failing tests. First I fixed some issues in the DataSetComparator. Please have a look at the following output - I am not sure If I can just iterator over the SortedTable by column index and get back the sorted table rows. But comparing with the differences produced this should be feasible. Apart from the output below, you will find the expected dataset where I have put the record with ID=155 at the top. So there has to be applied some sort of sorting. And I suspect that the sorting is based on the string value and not the data type of the primary key. I hope that this is not an Oracle issue. But 5 years ago I implemented already a SortedTable based on the "ID" and the main committer of DBUnit (GOMMA) was sitting next to me.

Regards,

Cyrill

SortedExpectedTable=ZB_BERECHTIGUNG, ID=1
SortedExpectedTable=ZB_BERECHTIGUNG, ID=10
SortedExpectedTable=ZB_BERECHTIGUNG, ID=11
SortedExpectedTable=ZB_BERECHTIGUNG, ID=12
SortedExpectedTable=ZB_BERECHTIGUNG, ID=13
SortedExpectedTable=ZB_BERECHTIGUNG, ID=14
SortedExpectedTable=ZB_BERECHTIGUNG, ID=15
SortedExpectedTable=ZB_BERECHTIGUNG, ID=155
SortedExpectedTable=ZB_BERECHTIGUNG, ID=2
SortedExpectedTable=ZB_BERECHTIGUNG, ID=3
SortedExpectedTable=ZB_BERECHTIGUNG, ID=4
SortedExpectedTable=ZB_BERECHTIGUNG, ID=5
SortedExpectedTable=ZB_BERECHTIGUNG, ID=6
SortedExpectedTable=ZB_BERECHTIGUNG, ID=7
SortedExpectedTable=ZB_BERECHTIGUNG, ID=8
SortedExpectedTable=ZB_BERECHTIGUNG, ID=9

SortedCurrentTable=ZB_BERECHTIGUNG, ID=1
SortedCurrentTable=ZB_BERECHTIGUNG, ID=2
SortedCurrentTable=ZB_BERECHTIGUNG, ID=3
SortedCurrentTable=ZB_BERECHTIGUNG, ID=4
SortedCurrentTable=ZB_BERECHTIGUNG, ID=5
SortedCurrentTable=ZB_BERECHTIGUNG, ID=6
SortedCurrentTable=ZB_BERECHTIGUNG, ID=7
SortedCurrentTable=ZB_BERECHTIGUNG, ID=8
SortedCurrentTable=ZB_BERECHTIGUNG, ID=9
SortedCurrentTable=ZB_BERECHTIGUNG, ID=10
SortedCurrentTable=ZB_BERECHTIGUNG, ID=11
SortedCurrentTable=ZB_BERECHTIGUNG, ID=12
SortedCurrentTable=ZB_BERECHTIGUNG, ID=13
SortedCurrentTable=ZB_BERECHTIGUNG, ID=14
SortedCurrentTable=ZB_BERECHTIGUNG, ID=15
SortedCurrentTable=ZB_BERECHTIGUNG, ID=155

"ZB_BERECHTIGUNG":[
{
"ID":155,
"UUID":"0ef92206-51ae-46bf-a081-2f51f9f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"VERSUCH",
"BESCHREIBUNG":"VERSUCH",
"METHODEN":"zentraleberechtigungfacade.loadpermittednumberforregistrationsgrund,zentraleberechtigungfacade.isallowedtomodifyperson"
},
{
"ID":1,
"UUID":"0ef42206-51be-46bf-a081-2f56f9f599d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_READ_ORGUNIT",
"BESCHREIBUNG":"ZB Organisationseinheit lesen",
"METHODEN":"zentraleberechtigungfacade.loadkindorgeinheitenbyid,zentraleberechtigungfacade.loadapplikationenbyorgeinheitid,zentraleberechtigungfacade.loadelternorgeinheitenbyid,zentraleberechtigungfacade.loadorgeinheitenbyapplikationid,zentraleberechtigungfacade.loadorgeinheitenbybenutzerid,zentraleberechtigungfacade.loadelternorgeinheitenbyid,zentraleberechtigungfacade.loadorgeinheitbyid,zentraleberechtigungfacade.loadapplikationenbyorgeinheitid,zentraleberechtigungfacade.loadorgeinheitenbyapplikationid,zentraleberechtigungfacade.loadattributfilterbyrolleid,zentraleberechtigungfacade.loadallorgeinheiten,zentraleberechtigungfacade.loadteamsinorgeinheit,zentraleberechtigungfacade.loadteambyid"
},
{
"ID":2,
"UUID":"0ef42206-51be-46bf-a081-2f56f9f699d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_READ_USER",
"BESCHREIBUNG":"ZB Benutzer lesen",
"METHODEN":"zentraleberechtigungfacade.loadbenutzerbybenutzerid,zentraleberechtigungfacade.loadbenutzercompletebyidandorgeinheit,zentraleberechtigungfacade.loadallberechtigungenofbenutzerinorgeinheit,zentraleberechtigungfacade.loadallbenutzer,zentraleberechtigungfacade.loadbenutzerbyrolleid"
},
{
"ID":3,
"UUID":"0ef42206-51be-46bf-a081-2f56f9f799d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_READ_ROLE",
"BESCHREIBUNG":"ZB Rolle lesen",
"METHODEN":"zentraleberechtigungfacade.loadattributfiltern,zentraleberechtigungfacade.loadrollebyid,zentraleberechtigungfacade.loadattributfilternbyrolleid,zentraleberechtigungfacade.loadattributfiltern,zentraleberechtigungfacade.loadrollebyidentifikation"
},
{
"ID":4,
"UUID":"0ef42206-51be-46bf-a081-2f56f9f899d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_READ_UNION",
"BESCHREIBUNG":"ZB Verbund lesen",
"METHODEN":"zentraleberechtigungfacade.loadverbundbyid,zentraleberechtigungfacade.loadregistrationsgruende,zentraleberechtigungfacade.loadverbundset,zentraleberechtigungfacade.loadregistrationsregeln"
},
{
"ID":5,
"UUID":"0ef42206-51be-46bf-a081-2f56f9f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_READ_APPLICATION",
"BESCHREIBUNG":"ZB Anwendung lesen",
"METHODEN":"zentraleberechtigungfacade.loadapplikationbyid,zentraleberechtigungfacade.loadregistrationsgrundbyid,zentraleberechtigungfacade.loadapplikationen"
},
{
"ID":6,
"UUID":"0ef42206-51be-46bf-a081-2f56f1f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_SAVE_ROLE",
"BESCHREIBUNG":"ZB Rolle schreiben",
"METHODEN":"zentraleberechtigungfacade.savefachlicherolle,zentraleberechtigungfacade.saverolle,zentraleberechtigungfacade.deleterolle"
},
{
"ID":7,
"UUID":"0ef42206-51be-46bf-a081-2f56f2f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_SAVE_UNION",
"BESCHREIBUNG":"ZB Verbund schreiben",
"METHODEN":"zentraleberechtigungfacade.saveregistrationsgrundentity,zentraleberechtigungfacade.saveregistrationsgrundentity,zentraleberechtigungfacade.deleteregistrationsgrund,zentraleberechtigungfacade.saveregistrationsregel,zentraleberechtigungfacade.saveteam,zentraleberechtigungfacade.saveverbund,zentraleberechtigungfacade.deleteverbund"
},
{
"ID":8,
"UUID":"0ef42206-51be-46bf-a081-2f56f3f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_SAVE_ORGUNIT",
"BESCHREIBUNG":"ZB Organisationseinheit schreiben",
"METHODEN":"zentraleberechtigungfacade.saveorganisationseinheit,zentraleberechtigungfacade.deleteorganisationseinheit"
},
{
"ID":9,
"UUID":"0ef42206-51be-46bf-a081-2f56f4f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_SAVE_APPLIKATION",
"BESCHREIBUNG":"ZB Anwendung schreiben",
"METHODEN":"zentraleberechtigungfacade.saveapplication,zentraleberechtigungfacade.deleteapplikation"
},
{
"ID":10,
"UUID":"0ef42206-51be-46bf-a081-2f56f5f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_SAVE_USER",
"BESCHREIBUNG":"ZB Benutzer schreiben",
"METHODEN":"zentraleberechtigungfacade.savebenutzer"
},
{
"ID":11,
"UUID":"0ef42206-51be-46bf-a081-2f56f6f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_SAVE_TEAM",
"BESCHREIBUNG":"ZB Team schreiben",
"METHODEN":"zentraleberechtigungfacade.deleteteam,zentraleberechtigungfacade.saveteam "
},
{
"ID":12,
"UUID":"0ef42206-51be-46bf-a081-2f56f7f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_SAVE_KONTAKT",
"BESCHREIBUNG":"ZB Kontakt schreiben",
"METHODEN":"zentraleberechtigungfacade.savekontakt"
},
{
"ID":13,
"UUID":"0ef42206-51be-46bf-a081-2f56f8f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_SAVE_ATTRIBUTFILTER",
"BESCHREIBUNG":"ZB Attributfilter schreiben",
"METHODEN":"zentraleberechtigungfacade.saveattributfilter"
},
{
"ID":14,
"UUID":"0ef52206-51be-46bf-a081-2f56f9f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_SAVE_BERECHTIGUNG",
"BESCHREIBUNG":"ZB Berechtigung schreiben",
"METHODEN":"zentraleberechtigungfacade.saveberechtigung"
},
{
"ID":15,
"UUID":"0ef42206-51be-46bf-a081-2f51f9f999d9",
"VERSION":0,
"BERECHTIGUNG_ID":"ZB_CALL_REGISTRIERUNGSSERVICEMETHODS",
"BESCHREIBUNG":"ZB Registrierungsservice-Methoden aufrufen",
"METHODEN":"zentraleberechtigungfacade.loadpermittednumberforregistrationsgrund,zentraleberechtigungfacade.isallowedtomodifyperson"
}
],

<OrderByModifications.patch>

Hi Cyrill,

thank you very much for spending time on this problem! That's the true community spirit!

For the issue you have figured out how about creating a JIRA ticket. Please create jboss account (if you don't have one already) and file a ticket for arquillian project, persistence extension component.

For the patch I would simply suggest to fork the repository and make a pull request with the improvements (you can also create JIRA for that).

Please refer to the issue in the commit message for easier traceability :)

Again, many thanks!

If you need anything else just drop me a line.

I will need some time in the evening to look at json stuff. But will be back shortly!

Maybe I have a solution by then, whatever evening means ...

Keep you updated

Cyrill

Am 27.11.2012 um 13:42 schrieb Bartosz Majsak notifications@github.com:

I will need some time in the evening to look at json stuff. But will be back shortly!


Reply to this email directly or view it on GitHub.

I think we are in the same timezone if not a city ;)

Maybe you have time for a call to synchronise the solution and who will do what?

Regards Cyrill

Am 27.11.2012 um 15:29 schrieb Bartosz Majsak notifications@github.com:

I think we are in the same timezone if not a city ;)


Reply to this email directly or view it on GitHub.

Hello, i have this same issue but using the Alpha6 release, jboss-as-remote as container. The stack trace is the same.

I ran my tests against Arquillian 1.0.2FINAL and persistence-extension Alpha5 and all it was ok.
also, ran my test with Arquillian 1.0.3FINAL and persistence-extension Alpha5 and again, everything was ok

I'm using PostgresSQL as my db engine

UPDATE
I had some problems related to Testable class, so i override the version of my protocol-servlet, my junit container, i i tried to ran my test with persistence-extencion ALPHA6 but this error persists.

Hi Xiumeteo,

would it be possible for you to share the project so I can analyze the root cause?

Hi i think i can´t do that, but i will try to reproduce the issue in another project...

Also, i have some issues about the Testable class in arquillian, its an intermitet issue, that maybe concern with my current config. This issue says me that can't see the Impl for the Testable class and therefore the test fail

I would suggest to open thread on arquillian forum :)