java - data provider with arraylist of array in Test NG -
i have send array list of arrays test case using dataprovider annotation. have below code giving illegal argument exception. arraylist size 4096. need give such many arguments in test method.
@test(dataprovider="combination_list") public void checkbox_combination(list<int[]> obj) { /*for(int i=0;i<=4095;i++) { }*/ } @dataprovider(name="combination_list") public static object[][] get_combination_list() { list<int[]> combinations_with_int_array = new arraylist<int[]>(); int size_combination; for(int i=0;i<=4095;i++) { string checkbox_combination =combination_list.inttostring(i,12); int[] single_combination = new int[12]; (int j=0;j<=11;j++) { if(j<11) { single_combination[j]=integer.parseint(checkbox_combination.substring(j, j+1)); } else { single_combination[j]=integer.parseint(checkbox_combination.substring(j)); } } combinations_with_int_array.add(single_combination); } size_combination=combinations_with_int_array.size(); system.out.println("no of combinations : "+size_combination); object objarray[][] = new object[size_combination][]; for(int i=0;i<size_combination;i++){ objarray[i] = new object[1]; objarray[i][0] = combinations_with_int_array.get(i); } return objarray; }
combinations_with_int_array arraylist of int[].
objarray[i][0] = combinations_with_int_array.get(i);
when on list, give int[] type of argument, adding object[][]. test method should have same argument.
Comments
Post a Comment