The code is as follows:
Dbcount=vars. GetObject (" dbcoins "). The size ();//database query to the total number of article
Actual_results=vars. The get (" coin_ALL ");//get all the coin in the corresponding to the field
String [] actualResults=actual_results;//will be the value of the array by comma split into
The info (actualResults length + "");//print from the response of the total number of values
If (dbcount==actualResults. Length) {//to assess the total number of database query results and whether the total response results, as well as continue item by item comparison
for(int i=0; i
If (db_name. Equals (actualResults [I])) {
Pool_raise_if_allocation_failure=false;//say assert success
} else {
Pool_raise_if_allocation_failure=true;
Results: FailureMessage="interface" + actualResult [I] + "and the database result:" + db_name + "inconsistent";
break;
}
}
} else {//quantity is not the same as the direct failure
Pool_raise_if_allocation_failure=true;
FailureMessage="interface results number" + actualResults. Length + "and the number of database results" + dbcount + "inconsistent"
}
CodePudding user response:
The database connection is configured?