java - how to use parameterized junit when input is from several files? -
i used use parameterized
junit.
i have 2 files long list in each of them.
say
file_a file_b
i loaded 2 big lists memory , compared each line in different test.
unfortunately list grew big , had memory problem parse parse json before saving file.
that's why split each long list smaller files. say
file_a_1 file_a_2 file_a_3
and
file_b_1 file_b_2 file_b_3
how can still use parameterized junit
infra , syntax compare each corresponding list items, when each list distributed few files?
i have tried:
@test public void comparenewresponsetobaselinereturnsnolargedifferences() throws ioexception { e2eresultshort baselinelist = routingresponseshortrepository.getbaseline(chunkid); e2eresultshort freshrunlist = routingresponseshortrepository.getlatestresponse(chunkid); ??? how iterate on differet `i` each test ?? list<string> testfailuremessages = alternativeshorttotalchecker.checkallalternativesshort(baseline.get(i), freshrun.get(i)); assertthat("testfailuremessages should empty", string.join("", testfailuremessages), equalto("")); assertthat("error messages should null", freshroutingresponse.regression_error, is(nullvalue())); }
unfortunately can't, because parameterized
runner needs know parameters @ beginning of test.
Comments
Post a Comment