Skip to content

Commit

Permalink
cast to Number
Browse files Browse the repository at this point in the history
  • Loading branch information
balsarori committed Jan 11, 2017
1 parent 98309df commit a8f2262
Showing 1 changed file with 4 additions and 11 deletions.
@@ -1,6 +1,5 @@
package org.activiti.standalone.cfg;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -81,16 +80,10 @@ public List<Map<String, Object>> execute(MyTestMapper customMapper) {
List<Map<String, Object>> results = managementService.executeCustomSql(customSqlExecution);
assertEquals(5, results.size());
for (int i=0; i<5; i++) {
Map<String, Object> result = results.get(i);
Long id = Long.valueOf((String) getResultObject("TASKID", result));
Long variableValue = null;
Object variableObjectValue = getResultObject("VARIABLEVALUE", result);
if (variableObjectValue instanceof BigDecimal) { // in oracle it's BigDecimal
variableValue = ((BigDecimal)variableObjectValue).longValue();
} else {
variableValue = (Long) variableObjectValue;
}
assertEquals(id * 2, variableValue.longValue());
Map<String, Object> result = results.get(i);
Long id = Long.valueOf((String) getResultObject("TASKID", result));
Long variableValue = ((Number) getResultObject("VARIABLEVALUE", result)).longValue();
assertEquals(id * 2, variableValue.longValue());
}

// Cleanup
Expand Down

0 comments on commit a8f2262

Please sign in to comment.