private boolean isFieldDate() { return FieldTypeResolver.isDate(currentField.getFieldName(), factObject); }
private boolean isFieldDate() { return FieldTypeResolver.isDate(currentField.getFieldName(), factObject); }
private String getSuccessfulExplanation() { if (currentField.getOperator().equals("==")) { return "[" + factName + "] field [" + currentField.getFieldName() + "] was [" + currentField.getExpected() + "]."; } else if (currentField.getOperator().equals("!=")) { return "[" + factName + "] field [" + currentField.getFieldName() + "] was not [" + currentField.getExpected() + "]."; } return ""; }
private String getSuccesfulExplanation() { if ( currentField.getOperator().equals( "==" ) ) { return "[" + factName + "] field [" + currentField.getFieldName() + "] was [" + currentField.getExpected() + "]."; } else if ( currentField.getOperator().equals( "!=" ) ) { return "[" + factName + "] field [" + currentField.getFieldName() + "] was not [" + currentField.getExpected() + "]."; } return ""; }
private String getFailingExplanation() { if (currentField.getOperator().equals("==")) { return "[" + factName + "] field [" + currentField.getFieldName() + "] was [" + currentField.getActualResult() + "] expected [" + currentField.getExpected() + "]."; } else { return "[" + factName + "] field [" + currentField.getFieldName() + "] was not expected to be [" + currentField.getActualResult() + "]."; } } }
private String getSuccessfulExplanation() { if (currentField.getOperator().equals("==")) { return "[" + factName + "] field [" + currentField.getFieldName() + "] was [" + currentField.getExpected() + "]."; } else if (currentField.getOperator().equals("!=")) { return "[" + factName + "] field [" + currentField.getFieldName() + "] was not [" + currentField.getExpected() + "]."; } return ""; }
private String getSuccesfulExplanation() { if ( currentField.getOperator().equals( "==" ) ) { return "[" + factName + "] field [" + currentField.getFieldName() + "] was [" + currentField.getExpected() + "]."; } else if ( currentField.getOperator().equals( "!=" ) ) { return "[" + factName + "] field [" + currentField.getFieldName() + "] was not [" + currentField.getExpected() + "]."; } return ""; }
private String getFailingExplanation() { if ( currentField.getOperator().equals( "==" ) ) { return "[" + factName + "] field [" + currentField.getFieldName() + "] was [" + currentField.getActualResult() + "] expected [" + currentField.getExpected() + "]."; } else { return "[" + factName + "] field [" + currentField.getFieldName() + "] was not expected to be [" + currentField.getActualResult() + "]."; } } }
private String getFailingExplanation() { if ( currentField.getOperator().equals( "==" ) ) { return "[" + factName + "] field [" + currentField.getFieldName() + "] was [" + currentField.getActualResult() + "] expected [" + currentField.getExpected() + "]."; } else { return "[" + factName + "] field [" + currentField.getFieldName() + "] was not expected to be [" + currentField.getActualResult() + "]."; } } }
private String getFailingExplanation() { if (currentField.getOperator().equals("==")) { return "[" + factName + "] field [" + currentField.getFieldName() + "] was [" + currentField.getActualResult() + "] expected [" + currentField.getExpected() + "]."; } else { return "[" + factName + "] field [" + currentField.getFieldName() + "] was not expected to be [" + currentField.getActualResult() + "]."; } } }
protected String getActual(VerifyField currentField) { Object actualValue = MVEL.executeExpression( new ExpressionCompiler( "__fact__." + currentField.getFieldName() ).compile( parserContext ), variables ); return (actualValue != null) ? actualValue.toString() : ""; } }
protected String getActual(VerifyField currentField) { Object actualValue = MVEL.executeExpression(new ExpressionCompiler("__fact__." + currentField.getFieldName()).compile(parserContext), variables); return (actualValue != null) ? actualValue.toString() : ""; } }
protected String getActual(VerifyField currentField) { Object actualValue = MVEL.executeExpression(new ExpressionCompiler("__fact__." + currentField.getFieldName()).compile(parserContext), variables); return (actualValue != null) ? actualValue.toString() : ""; } }
protected String getActual(VerifyField currentField) { Object actualValue = MVEL.executeExpression( new ExpressionCompiler( "__fact__." + currentField.getFieldName() ).compile( parserContext ), variables ); return (actualValue != null) ? actualValue.toString() : ""; } }
protected Boolean isSuccess(VerifyField currentField) { String s = "__fact__." + currentField.getFieldName() + " " + currentField.getOperator() + " __expected__"; CompiledExpression expression = new ExpressionCompiler(s).compile(parserContext); return (Boolean) MVEL.executeExpression(expression, variables); }
protected Boolean isSuccess(VerifyField currentField) { String s = "__fact__." + currentField.getFieldName() + " " + currentField.getOperator() + " __expected__"; CompiledExpression expression = new ExpressionCompiler(s).compile(parserContext); return (Boolean) MVEL.executeExpression(expression, variables); }
protected Boolean isSuccess(VerifyField currentField) { CompiledExpression expression = new ExpressionCompiler( "__fact__." + currentField.getFieldName() + " " + currentField.getOperator() + " __expected__" ).compile( parserContext ); return (Boolean) MVEL.executeExpression( expression, variables ); }
protected Boolean isSuccess(VerifyField currentField) { CompiledExpression expression = new ExpressionCompiler( "__fact__." + currentField.getFieldName() + " " + currentField.getOperator() + " __expected__" ).compile( parserContext ); return (Boolean) MVEL.executeExpression( expression, variables ); }
private Object getExpectedResult() throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException { Object expectedResult = currentField.getExpected().trim(); if (currentField.getExpected().startsWith("=")) { expectedResult = eval(currentField.getExpected().substring(1), this.populatedData); } else if (currentField.getNature() == VerifyField.TYPE_ENUM) { try { // The string representation of enum value is using a // format like CheeseType.CHEDDAR String classNameOfEnum = currentField.getExpected().substring(0, currentField.getExpected().indexOf(".")); String valueOfEnum = currentField.getExpected().substring(currentField.getExpected().indexOf(".") + 1); String fullName = resolver.getFullTypeName(classNameOfEnum); if (fullName != null && !"".equals(fullName)) { valueOfEnum = fullName + "." + valueOfEnum; } Serializable compiled = MVEL.compileExpression(valueOfEnum, pctx); expectedResult = MVEL.executeExpression(compiled); } catch (ClassNotFoundException e) { //Do nothing. } } else if (isFieldDate()) { return DateObjectFactory.createTimeObject(FieldTypeResolver.getFieldType(currentField.getFieldName(), factObject), currentField.getExpected()); } return expectedResult; }
private Object getExpectedResult() throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException { Object expectedResult = currentField.getExpected().trim(); if (currentField.getExpected().startsWith("=")) { expectedResult = eval(currentField.getExpected().substring(1), this.populatedData); } else if (currentField.getNature() == VerifyField.TYPE_ENUM) { try { // The string representation of enum value is using a // format like CheeseType.CHEDDAR String classNameOfEnum = currentField.getExpected().substring(0, currentField.getExpected().indexOf(".")); String valueOfEnum = currentField.getExpected().substring(currentField.getExpected().indexOf(".") + 1); String fullName = resolver.getFullTypeName(classNameOfEnum); if (fullName != null && !"".equals(fullName)) { valueOfEnum = fullName + "." + valueOfEnum; } Serializable compiled = MVEL.compileExpression(valueOfEnum, pctx); expectedResult = MVEL.executeExpression(compiled); } catch (ClassNotFoundException e) { //Do nothing. } } else if (isFieldDate()) { return DateObjectFactory.createTimeObject(FieldTypeResolver.getFieldType(currentField.getFieldName(), factObject), currentField.getExpected()); } return expectedResult; }