-
1. Re: @ApplyScriptBefore("import.sql")
bmajsak Jun 29, 2012 10:28 AM (in response to mano_seba)1 of 1 people found this helpfulTry using this annotation either on class level (will be run for each test), or on the test method itself.
-
2. Re: @ApplyScriptBefore("import.sql")
mano_seba Jun 29, 2012 10:32 AM (in response to bmajsak)Hello,
Well that was fast,I didnt finished writing and I got the answer. I will try this right now. Thank you very much for such a quick answer.
-
3. Re: @ApplyScriptBefore("import.sql")
mano_seba Jun 29, 2012 12:41 PM (in response to bmajsak)Well I used the annotation on class level and on the method itself but It didnt work for me.
My arquillian.xml looks like this:
<defaultProtocol type="Servlet 3.0"></defaultProtocol> <engine> <property name="deploymentExportPath">/tmp</property> </engine> <container qualifier="jboss" default="true"> <configuration> <property name="managementAddress">localhost</property> <property name="managementPort">9999</property> <property name="javaVmArguments">-Xmx1024m -XX:MaxPermSize=256m</property> <property name="startupTimeoutInSeconds">6000</property> <property name="outputToConsole">true</property> <property name="serverConfig">standalone.xml</property> <!-- <property name="jbossHome">D:/jboss-as-7.1.0.Final-SNAPSHOT-2</property> <property name="javaHome">D:/software/JDK/jdk160_21-32x</property> </configuration> </container> And I added this:
<extension qualifier="persistence" default="true"> <property name="userTransactionJndi">java:jboss/datasources/prjtest</property> <property name="initStatement">import.sql</property> </extension> What else I m missing over here?
-
4. Re: @ApplyScriptBefore("import.sql")
bmajsak Jun 29, 2012 11:44 AM (in response to mano_seba)Not sure, but transaction jndi looks a bit strange to me shouldn't it be registered for "defaultDataSource"? And as of transactionJNDI in jboss it's java:jboss/UserTransaction
-
5. Re: @ApplyScriptBefore("import.sql")
mano_seba Jun 29, 2012 11:38 AM (in response to bmajsak)In my standalone.xml it is just like that. Do you know any other reason why the unit test are skipping when I add the @ApplyScriptBefore? Before the I was using the Alpha3 whit the @UsingScript and that was also a problem because it didnt find the inport.sql but at least the tests weren't skipped, it wouldnt find the find the insert from import.sql
-
6. Re: @ApplyScriptBefore("import.sql")
bmajsak Jun 29, 2012 11:46 AM (in response to mano_seba)Yes, but here you are saying that sivastest is jndi for user transaction. Shouldn't it be "defaultDataSource" parameter instead? And for userTransactionJndi java:jboss/UserTransaction ?
As fo the merit - where is import.sql located?
-
7. Re: @ApplyScriptBefore("import.sql")
mano_seba Jun 29, 2012 11:50 AM (in response to bmajsak)The import.sql is located in test/resources/import.sql...and I have a JBoss modified by someone in our team and I dont know why he did this.
-
8. Re: @ApplyScriptBefore("import.sql")
bmajsak Jun 29, 2012 11:56 AM (in response to bmajsak)Could you please attach standalone.xml? I will try to have a look at it today or tomorrow.
-
9. Re: @ApplyScriptBefore("import.sql")
mano_seba Jul 1, 2012 4:38 AM (in response to bmajsak)Thanks for your help:)
-
10. Re: @ApplyScriptBefore("import.sql")
mano_seba Jul 5, 2012 1:22 PM (in response to bmajsak)Hello,
I worked on the arquillian unit tests and for the moment I can read form the db some of the inserts, but if I have two unit test only one will pass the other one will just be skipped, but I will look that he passed.If I comment the test that works the other one will work to. Now I'm very confused.
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
arquillian.xml
<extension qualifier="persistence" default="true"> <property name="defaultDataSource">java:jboss/datasources/sivastest</property> <property name="initStatement">scripts/import.sql</property> <property name="cleanupStatement">scripts/clean.sql</property> </extension> It seems that I dont need the userTransaction it works this way (confusing...)
I used the annotaion on on the class
@ApplyScriptBefore("import.sql") public class FacSrvTest extends Arquillian{
}
added the resource : .addAsResource(new File("src/test/resources/scripts/import.sql")).addAsResource(new File("src/test/resources/scripts/clean.sql"))
But I still dont know why some of the tests are workins and some of them not.
Best Regards,
-
11. Re: @ApplyScriptBefore("import.sql")
bmajsak Jul 5, 2012 1:26 PM (in response to mano_seba)Would it be possible for you to isolate this problem and provide simple project with managed jboss and hsqldb?