use of com.att.aro.core.searching.pojo.SearchingPatternBuilder in project VideoOptimzer by attdevsupport.
the class SearchingStrategyTest method testMultiPatternMatchFound.
@Test
public void testMultiPatternMatchFound() {
SearchingContent content = new SearchingContent("abcde");
SearchingPatternBuilder patternBuilder = new SearchingPatternBuilder();
patternBuilder.add("abf", PrivateDataType.regex_credit_card_number.name()).add("bcd", PrivateDataType.regex_credit_card_number.name()).add("def", PrivateDataType.regex_credit_card_number.name());
SearchingResult result = searchStrategy.applySearch(patternBuilder.build(), content);
assertNotNull(result);
assertEquals(1, result.getWords().size());
}
use of com.att.aro.core.searching.pojo.SearchingPatternBuilder in project VideoOptimzer by attdevsupport.
the class SearchingStrategyTest method testMultiPatternMatchNotFound.
@Test
public void testMultiPatternMatchNotFound() {
SearchingContent content = new SearchingContent("abcde");
SearchingPatternBuilder patternBuilder = new SearchingPatternBuilder();
patternBuilder.add("abe", PrivateDataType.regex_credit_card_number.name()).add("bca", PrivateDataType.regex_credit_card_number.name()).add("def", PrivateDataType.regex_credit_card_number.name());
SearchingResult result = searchStrategy.applySearch(patternBuilder.build(), content);
assertNotNull(result);
assertEquals(0, result.getWords().size());
}
use of com.att.aro.core.searching.pojo.SearchingPatternBuilder in project VideoOptimzer by attdevsupport.
the class TransmissionPrivateDataImpl method getKeywords.
/**
* get keywords from trace folder, exact match keywords from device and user preference
* @return
*/
private SearchingPattern getKeywords(Map<String, String> keywords) {
SearchingPatternBuilder patternBuilder = new SearchingPatternBuilder();
getKeywordsFromPreference(patternBuilder);
if (keywords == null || keywords.isEmpty()) {
return patternBuilder.build();
}
Set<String> keySet = keywords.keySet();
for (String keyword : keySet) {
patternBuilder.add(keyword, keywords.get(keyword));
}
return patternBuilder.build();
}
Aggregations