-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to clean database due to Foreign Key Constraint Violation #20
Comments
Would it be possible to attach test case and used files in the forum community.jboss.org in arquillian space? thx! |
or ideally extracted project with failing test :) |
Of course. I will open a new thread there :) |
thank you, I will take care of the rest |
There : https://community.jboss.org/thread/213209 :) |
Hi, did you get a chance to see the topic? Is there something missing? Thanks |
Sorry, not yet. At Devoxx at the moment, but hopefully I will have time for that today :) |
The test itself is not that helpful. Could you provide entities as well? Also which version of Arquillian and Persistence Extension are you using? Which MySQL version and AS? |
Are you still facing the problem? Otherwise I would like to close this issue |
Hi, |
Hi, I'm having a problem with I suppose is with this extension, not the underlying DBUnit infrastructure. When the extension tries to clean the database after a test method, it fails to clean the database due to a foreign key constraint violation. The test method is as follows:
@test
@ShouldMatchDataSet("datasets/users-company.xml")
public void saveClientWithCompany(){
Client s = new Client();
s.setLogin("solicitante1");
s.setEmail("[email protected]");
s.setNome("paulo");
s.setSenha("123456");
s.setDepartamento("dep");
Company e = new Company();
e.setNome("empresa");
Set set = new HashSet();
set.add(s);
e.setListClient(set);
s.setCompany(e);
solMgt.saveClient(s);
}
As you can see, there is a ManyToOne relation between Client and Company, and there is a constraint in this relationship.
I tried to use @ApplyScriptBefore to deactivate the constraint check, but with no success. Apparently, the extension does not run the script, since if I run the command by hand it works as it should.
The text was updated successfully, but these errors were encountered: