You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See the API for {@link grails.test.mixin.services.ServiceUnitTestMixin} for usage instructions
*/ @testfor(ParamsService) @RunWith(DataProviderRunner.class)
class ParamsServiceTests {
@dataProvider
public static Object[][] dataProviderSnumberNotValids() {
def array = new Object[1][]
array[0] = ["R09090909"] as Object[];
return array;
}
/**
method checkValidSNumber
when SNumberIsNotValid
should returnFalse
*/ @test
@UseDataProvider("dataProviderSnumberNotValids")
public void checkValidSNumber_SNumberIsNotValid_returnFalse(String SNumber) {
//String sNumber = "def array = new Object[3][]
Boolean actual = service.checkValidSNumber(SNumber)
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.
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 [...].
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() {
}
/**
method checkValidSNumber
when SNumberIsNotValid
should returnFalse
*/
@test
@UseDataProvider("dataProviderSnumberNotValids")
public void checkValidSNumber_SNumberIsNotValid_returnFalse(String SNumber) {
//String sNumber = "def array = new Object[3][]
Boolean actual = service.checkValidSNumber(SNumber)
assert (actual instanceof Boolean) //Guard Assertion
assert !actual
}
}
The text was updated successfully, but these errors were encountered: