use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class ImapVerification method checkRegexInAttachment.
/**
* Check that the nested IMAP message contains the specified regular expression in the given attachment part
*
* @param searchRegex the regular expression to search for
* @param attachmentIndex the index of the attachment in the MIME structure (regular parts are skipped)
* @param nestedPackagePath path to the nested message
*/
@PublicAtsApi
public void checkRegexInAttachment(String searchRegex, int attachmentIndex, int... nestedPackagePath) {
//create the rule
StringInMimePartRule stringInPartRule = new StringInMimePartRule(nestedPackagePath, searchRegex, true, attachmentIndex, true, "checkRegexgInAttachment" + getNestedMimePackagePathDescription(nestedPackagePath), true);
rootRule.addRule(stringInPartRule);
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class DbVerification method checkFieldValueEquals.
/**
* Add rule to check that the value of the given field is the same as the given one
*
* @param tableName the name of the table which the field is part of
* @param fieldName the field to check
* @param value the value expected (string)
*/
@PublicAtsApi
public void checkFieldValueEquals(String tableName, String fieldName, String value) {
DbStringFieldRule matchingRule = new DbStringFieldRule(tableName, fieldName, value, DbStringFieldRule.MatchRelation.EQUALS, "checkFieldValueEquals", true);
matchingRule.setDbEncryptor(dbEncryptor);
checkFieldValue(matchingRule);
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class DbVerification method checkFieldValueRegex.
/**
* Add rule to check that the value of the given field is matched by the given regular expressions
*
* @param tableName the name of the table which the field is part of
* @param fieldName the field to check
* @param regex
*/
@PublicAtsApi
public void checkFieldValueRegex(String tableName, String fieldName, String regex) {
DbStringFieldRule matchingRule = new DbStringFieldRule(tableName, fieldName, regex, DbStringFieldRule.MatchRelation.REGEX_MATCH, "checkFieldValueRegex", true);
matchingRule.setDbEncryptor(dbEncryptor);
checkFieldValue(matchingRule);
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class DbVerification method checkFieldValueContains.
/**
* Add rule to check that the value of the given field contains the given string
*
* @param tableName the name of the table which the field is part of
* @param fieldName the field to check
* @param value the string that should be contained in the field
*/
@PublicAtsApi
public void checkFieldValueContains(String tableName, String fieldName, String value) {
DbStringFieldRule matchingRule = new DbStringFieldRule(tableName, fieldName, value, DbStringFieldRule.MatchRelation.CONTAINS, "checkFieldValueContains", true);
matchingRule.setDbEncryptor(dbEncryptor);
checkFieldValue(matchingRule);
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class DbVerification method checkFieldValueDateBefore.
/**
* Add rule to check that the given timestamp is before the date contained in the given field
*
* @param tableName the name of the table which the field is part of
* @param fieldName the field to check
* @param timestamp the expected timestamp (UNIX timestamp format)
* @param datePattern the pattern in which the date is stored in the field - see <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html">Java date patterns</a>
*/
@PublicAtsApi
public void checkFieldValueDateBefore(String tableName, String fieldName, long timestamp, String datePattern) {
DbDateFieldRule matchingRule = new DbDateFieldRule(tableName, fieldName, Long.toString(timestamp), DbDateFieldRule.MatchRelation.BEFORE_DATE, datePattern, "checkFieldValueDateBefore", true);
checkFieldValue(matchingRule);
}
Aggregations