NoSuchColumnException when using testdata with different amount of columns

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

NoSuchColumnException when using testdata with different amount of columns

Sven Raddatz
Hi,

there is a very old Bug (https://unitils.atlassian.net/browse/UNI-186) still exisiting in the current version (2.5.3) in dbunit. Since this is breaking some major BEST-PRACTICES (use minimum data for testing, split datasets, datasets must be maintainable) of unit testing that is actually a showstopper. Why has that not been fixed, its around for some years now? Is there any workaround (except adding non-sense NULL values to my datasets, as sugested in the linked bug) I could not find in the docs?


Best regards,
Sven


------------------------------------------------------------------------------

_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: NoSuchColumnException when using testdata with different amount of columns

Jeff Jensen-2
Because that's a unitils bug, dbUnit has a feature (column sensing) one can use to not specify [NULL] in datasets, and only the first row in a dataset needs all columns when not using column sensing.


On Wed, Nov 30, 2016 at 2:53 AM, Sven Raddatz <[hidden email]> wrote:
Hi,

there is a very old Bug (https://unitils.atlassian.net/browse/UNI-186) still exisiting in the current version (2.5.3) in dbunit. Since this is breaking some major BEST-PRACTICES (use minimum data for testing, split datasets, datasets must be maintainable) of unit testing that is actually a showstopper. Why has that not been fixed, its around for some years now? Is there any workaround (except adding non-sense NULL values to my datasets, as sugested in the linked bug) I could not find in the docs?


Best regards,
Sven


------------------------------------------------------------------------------

_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user



------------------------------------------------------------------------------

_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: NoSuchColumnException when using testdata with different amount of columns

Sven Raddatz
But Unitil is using db-unit? And the exception still occurs in the current db-unit version.
So in terms of testing what do you mean by "all columns"? I thought "all columns" is all the data I need for my unit test, not all data the table can store?

I have an entity "company" with about 20 attributes.
I want to split up my datasets in order to have maintainable testdata.
So I was planning to have a "base" dataset with some test companies with only their mandatory data (<10 columns) filled. Those will be fine for 90% of the tests. However there will be some tests needing companies with more data setup. Those I was planning to handle in a TestCase specific dataset (testcaseXy.xml). Doing so, and using different columns than in my base dataset I am getting the same exception as the one referred in the Unitil bug.

I am using SpringTestDbUnit which is setting column-sensing to "true" by default.



Am 30.11.2016 um 14:56 schrieb Jeff Jensen:
Because that's a unitils bug, dbUnit has a feature (column sensing) one can use to not specify [NULL] in datasets, and only the first row in a dataset needs all columns when not using column sensing.


On Wed, Nov 30, 2016 at 2:53 AM, Sven Raddatz <[hidden email]> wrote:
Hi,

there is a very old Bug (https://unitils.atlassian.net/browse/UNI-186) still exisiting in the current version (2.5.3) in dbunit. Since this is breaking some major BEST-PRACTICES (use minimum data for testing, split datasets, datasets must be maintainable) of unit testing that is actually a showstopper. Why has that not been fixed, its around for some years now? Is there any workaround (except adding non-sense NULL values to my datasets, as sugested in the linked bug) I could not find in the docs?


Best regards,
Sven


------------------------------------------------------------------------------

_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user




------------------------------------------------------------------------------


_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user



------------------------------------------------------------------------------

_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: NoSuchColumnException when using testdata with different amount of columns

Jeff Jensen-2
I don't know or use unitil and I won't use SpringTestDbUnit due to its transaction flaw/lack of ability to no rollback, so I can't comment further on their behaviors, and dbUnit does not use them.

When specifying the multiple dataset files, list the dataset file with the first row having the most columns first so dbUnit uses that one as the reference list of columns for the table.  Let me know how that works.



On Wed, Nov 30, 2016 at 8:29 AM, Sven Raddatz <[hidden email]> wrote:
But Unitil is using db-unit? And the exception still occurs in the current db-unit version.
So in terms of testing what do you mean by "all columns"? I thought "all columns" is all the data I need for my unit test, not all data the table can store?

I have an entity "company" with about 20 attributes.
I want to split up my datasets in order to have maintainable testdata.
So I was planning to have a "base" dataset with some test companies with only their mandatory data (<10 columns) filled. Those will be fine for 90% of the tests. However there will be some tests needing companies with more data setup. Those I was planning to handle in a TestCase specific dataset (testcaseXy.xml). Doing so, and using different columns than in my base dataset I am getting the same exception as the one referred in the Unitil bug.

I am using SpringTestDbUnit which is setting column-sensing to "true" by default.



Am 30.11.2016 um 14:56 schrieb Jeff Jensen:
Because that's a unitils bug, dbUnit has a feature (column sensing) one can use to not specify [NULL] in datasets, and only the first row in a dataset needs all columns when not using column sensing.


On Wed, Nov 30, 2016 at 2:53 AM, Sven Raddatz <[hidden email]> wrote:
Hi,

there is a very old Bug (https://unitils.atlassian.net/browse/UNI-186) still exisiting in the current version (2.5.3) in dbunit. Since this is breaking some major BEST-PRACTICES (use minimum data for testing, split datasets, datasets must be maintainable) of unit testing that is actually a showstopper. Why has that not been fixed, its around for some years now? Is there any workaround (except adding non-sense NULL values to my datasets, as sugested in the linked bug) I could not find in the docs?


Best regards,
Sven


------------------------------------------------------------------------------

_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user




------------------------------------------------------------------------------


_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user



------------------------------------------------------------------------------

_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user



------------------------------------------------------------------------------

_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: NoSuchColumnException when using testdata with different amount of columns

Sven Raddatz
Since starting a transaction in a test is never a good idea (will change TX behaviour and hide exceptions caused by a commit), I dont do that and so there is no problem using SpringTestDbUnit for me. Setting up and tearing down the test data is being done somewhere else.

Coming back to the root problem, this has nothing to do with unitil nor  SpringTestDbUnit. It is a DbUnit error. Using a given order of datasets is not really an option. When changing testdata in some months it might happen the changed dataset is now the one with "the most columns" and therefore I would have to change the order again? In large projects thats not a good idea in aspects of maintainabilty. 

Using different size (number of columns) tableentries within one dataset is working fine. The exception just occurs when using the same table in different datasets. Maybe it is a caching problem? Is there any bug tracker where I can file the issue and attach a small test case?

Am 30.11.2016 um 16:37 schrieb Jeff Jensen:
I don't know or use unitil and I won't use SpringTestDbUnit due to its transaction flaw/lack of ability to no rollback, so I can't comment further on their behaviors, and dbUnit does not use them.

When specifying the multiple dataset files, list the dataset file with the first row having the most columns first so dbUnit uses that one as the reference list of columns for the table.  Let me know how that works.



On Wed, Nov 30, 2016 at 8:29 AM, Sven Raddatz <[hidden email]> wrote:
But Unitil is using db-unit? And the exception still occurs in the current db-unit version.
So in terms of testing what do you mean by "all columns"? I thought "all columns" is all the data I need for my unit test, not all data the table can store?

I have an entity "company" with about 20 attributes.
I want to split up my datasets in order to have maintainable testdata.
So I was planning to have a "base" dataset with some test companies with only their mandatory data (<10 columns) filled. Those will be fine for 90% of the tests. However there will be some tests needing companies with more data setup. Those I was planning to handle in a TestCase specific dataset (testcaseXy.xml). Doing so, and using different columns than in my base dataset I am getting the same exception as the one referred in the Unitil bug.

I am using SpringTestDbUnit which is setting column-sensing to "true" by default.



Am 30.11.2016 um 14:56 schrieb Jeff Jensen:
Because that's a unitils bug, dbUnit has a feature (column sensing) one can use to not specify [NULL] in datasets, and only the first row in a dataset needs all columns when not using column sensing.


On Wed, Nov 30, 2016 at 2:53 AM, Sven Raddatz <[hidden email]> wrote:
Hi,

there is a very old Bug (https://unitils.atlassian.net/browse/UNI-186) still exisiting in the current version (2.5.3) in dbunit. Since this is breaking some major BEST-PRACTICES (use minimum data for testing, split datasets, datasets must be maintainable) of unit testing that is actually a showstopper. Why has that not been fixed, its around for some years now? Is there any workaround (except adding non-sense NULL values to my datasets, as sugested in the linked bug) I could not find in the docs?


Best regards,
Sven


------------------------------------------------------------------------------

_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user




------------------------------------------------------------------------------


_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user



------------------------------------------------------------------------------

_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user




------------------------------------------------------------------------------


_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user

--
News und vieles mehr bei Facebook & Twitter!

COMINTO GmbH
Klosterstraße 49
40211 Düsseldorf
www.cominto.de

eMail: [hidden email]
Tel: 0211 / 60 00 16 - 86
Fax: 0211 / 60 00 16 - 89
Blätterkatalog
HTML 5  *  Apple iOS  *  Android  
www.blaetterkatalog.de

-------------------------------------------------------
Geschäftsführer: Tobias Demuth, Berthold Giese, Torsten Kruse
Amtsgericht Düsseldorf HRB 37889

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user