Open gionn opened 9 years ago
I have same problem.
I have the same problem.
Sounds like a core DBUnit issue. Perhaps you can share some code that demonstrates the issue?
I´m having the same issue when migrating from 1.2.0 to 1.3.0. Has anyone been able to solve it?
I found a solution. When I use the annotation @DatabaseSetup on my test methods I get the error as reported in this issue (NoSuchColumnException). But this only occurs when I have an array of XML files in the 'value' annotation property.
When I tried to separate my XML builders into different @DatabaseSetup annotations, all of them inside a @DatabaseSetups it started to work again. I hope it helps, let me know if my explanation is blurry.
Yeah, we are plenty of @DatabaseSetup ( value = { "whatever.xml", "whenever.xml" } )
So this is probably a regression inside this project?
Unfortunately, it looks like so.
This was a core DBUnit issue as @philwebb mentioned. If you update to the latest version of DBUnit <version>2.5.3</version>
the problem is solved.
I updated DBUnit to 2.5.3, SpringTestDbUnit to 1.3.0, to workaround this issue; and used the @DatabaseSetups, and used (I'm on Java8) a series of repeatable @DatabaseSetup as mentioned by @djeisonselzlein; but at this point my XML datasets are not loaded anymore... I feel like having a too short blanket here... :|
@gvespucci according to @codeBud7 you wouldn't need to use multiple @DatabaseSetup anymore, @DatabaseSetup with multiple values should work. Still, what do you mean by "datasets are not loaded anymore"? Are you getting an exception or something? If not, check what you are using as DatabaseOperation.
Let me say that I'm using TestNG and not JUnit, because this could be important :)
I was meaning that the datasets are silently ignored... In any case, I've always used the default DatabaseOperation.CLEAN_INSERT
in my @DatabaseSetup
annotations.
I'm in the following bad situation here: if I use the single @DatabaseSetup
with an array of XML file paths, the datasets are loaded correctly but I receive the NoSuchColumnExpection
; if I use the series of @DatabaseSetup
, no data are uploaded in the database.
As additional details, I can add I'm using the @DatabaseSetup
annotations at class level, and I'm extending the org.springframework.test.context.testng.AbstractTestNGSpringContextTests
.
Thank you.
I would need your piece of code in order to understand your problem better. Could you post it to StackOverflow maybe?
@gionn @gvespucci did anyone got this resolved please am getting the same problem
still using v1.1.0 and actively looking for an alternative :skull:
Hello, I am facing the same problem. I have found an alternative to update the version to solve it.
@sherrif10 To be honest, this is not my core business anymore 😅 . I apologize. All the best.
I've upgraded spring-test-dbunit from 1.1.0 to 1.2.1, and I am getting this kind of errors for some datasets that doesn't contains all the fields of a specific table.
Any suggestions?