Is it possible to have grails test-app execute JUnit tests written in java? -


with grails 2.5, possible write tests (unit , integration) in java , have them executed grails test runner (grails test-app)?

i'll provide little background on our situation. if had brand new app, we'd write our tests spock tests in groovy, , fine. however, have large application started out years ago spring mvc application written in java. ported grails 2.1 3 years ago. when ported grails, parts of converted groovy/grails, of remained in java, including lot of test code. since grails uses spring mvc under covers, able work without effort. grails 2.1, grails test runner (grails test-app) run our java tests without problems (they junit 4 tests). however, upgrading grails 2.5, , we run "grails test-app" grails 2.5, groovy tests executed--the java tests ignored. know how grails execute java tests in grails 2.5?

here example integration test runs under grails 2.1 ignored grails 2.5:

package com.finch.google.adwords.updaters;  import com.finch.domain.client.client; import com.finch.testing.domaincreatorutil; import com.finch.testing.testprofile; import org.springframework.beans.factory.annotation.autowired; import org.springframework.test.annotation.ifprofilevalue; import org.springframework.test.context.contextconfiguration; import org.springframework.test.context.junit4.abstractjunit4springcontexttests;  import static org.junit.assert.assertfalse; import static org.junit.assert.asserttrue;   @ifprofilevalue(name=testprofile.integration_ws, value=testprofile.run) @contextconfiguration(locations={"/config/applicationcontext.xml","/config/dblocalpoolcontext.xml","/config/testcontext.xml"}) public class accountupdatertest extends abstractjunit4springcontexttests {      @autowired     private domaincreatorutil mdcu;      @autowired     private accountupdater maccountupdater;      public void testdatapartitions() {         client client = mdcu.addnewtestclient();         assertfalse(maccountupdater.confirmpartitions(client));         maccountupdater.createpartitions(client);         asserttrue(maccountupdater.confirmpartitions(client));         maccountupdater.droppartitions(client);         assertfalse(maccountupdater.confirmpartitions(client));     } } 

this test located under test/integration directory of grails project (the standard place grails tests). know can't leverage lot of nice testing functionality grails provides sort of test, these legacy junit tests testing java code, that's fine--we want them run when execute "grails test-app" did under grails 2.1.


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -