11 Replies Latest reply on Jul 5, 2012 1:26 PM by Bartosz Majsak

    @ApplyScriptBefore("import.sql")

    Manolescu Sebastian Newbie

      Hello,

       

       

      I tried to add the @ApplyScriptBefore for the arquillian unit testing, but is not working,all tests seem to pass even if it they shouldnt, it's a sort of test skip.

       

      Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

       

      I added the depenency:

       

                <dependency>

                  <groupId>org.jboss.arquillian.extension</groupId>

                  <artifactId>arquillian-persistence-api</artifactId>

                  <version>1.0.0.Alpha4</version>

                  <scope>test</scope>

              </dependency>

              <dependency>

                  <groupId>org.jboss.arquillian.extension</groupId>

                  <artifactId>arquillian-persistence-impl</artifactId>

                  <version>1.0.0.Alpha4</version>

                  <scope>test</scope>

              </dependency>

       

      And the test look like this:

       

      public class CaseServiceTest extends Arquillian{

       

      @Deployment

      public static WebArchive createTestArchive() {

      return  ShrinkWrap.create( WebArchive.class,"test.war").addPackages(true,"org.joda.time")...........etc..(classes and other Resources)

      }

       

      @EJB

          private CaseService caseService;

       

       


      @BeforeTest

      @ApplyScriptBefore("import.sql")


      public void setUp()

      {}

       

       

      @Test

           public void Test(){

       

       

                Pen pen = new Pen();

                Pen = caseService.getAllPen();

       

               assertAllIPen(pen);

       

           }

      assertAllIPen(Pen pen){

       

      .......

      }

       

      The import.sql is in resources/import.sql

      INSERT INTO `PEN` (`ID_PEN`, `DATE_CREATE`, `DATE_UPDATE`, `NAME`) VALUES (1,NULL,NULL,'P');

       

       

      I looked on Mr. Bartosz Majsak blog http://arquillian.org/blog/tags/persistence/ but I didn't find a way that works for me

       

      Sorry for my bad english.

       

      Best Regards,

      Sebastian