Closed neojoda closed 10 years ago
Using JUnit 4.10
I am using grails 2.0.3 It seems that I use eclipse Run as -> Junit Test is working properly, but no when I run grails test-app. It is where I am getting the error.
Thanks for this incredible plugin!
Hi @neojoda,
sorry for the long delay ... unfortunately, this was no problem within the junit-dataprovider. Though, Grails uses a special test runner, see GRAILS-6352. This issue is fixed in version 2.3.:
In order to support alternate JUnit4 test runners, Grails 2.3 no longer uses a special test runner to run tests [...].
(from http://grails.org/doc/2.3.1/guide/single.html#upgradingFromPreviousVersionsOfGrails, section "Dependency Injection for Integration Tests")
Cheers, Andreas
I am getting this error when running the dataprovider:
java.lang.Exception: Method checkValidSNumber_SNumberIsNotValid_returnFalse should have no parameters
I am trying to run it on a grails project.
Test class:
package utils
import org.junit.Before import org.junit.runner.RunWith import com.tngtech.java.junit.dataprovider.DataProvider import com.tngtech.java.junit.dataprovider.DataProviderRunner import com.tngtech.java.junit.dataprovider.UseDataProvider
/**
See the API for {@link grails.test.mixin.services.ServiceUnitTestMixin} for usage instructions */ @TestFor(ParamsService) @RunWith(DataProviderRunner.class) class ParamsServiceTests {
ParamsService service;
@Before void setUp() {
}
@DataProvider public static Object[][] dataProviderSnumberNotValids() {
}
/**
//String sNumber = "def array = new Object[3][]
Boolean actual = service.checkValidSNumber(SNumber)
assert (actual instanceof Boolean) //Guard Assertion assert !actual }
}