Search in sources :

Example 11 with SearchingPatternBuilder

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());
}
Also used : SearchingResult(com.att.aro.core.searching.pojo.SearchingResult) SearchingContent(com.att.aro.core.searching.pojo.SearchingContent) SearchingPatternBuilder(com.att.aro.core.searching.pojo.SearchingPatternBuilder) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 12 with SearchingPatternBuilder

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());
}
Also used : SearchingResult(com.att.aro.core.searching.pojo.SearchingResult) SearchingContent(com.att.aro.core.searching.pojo.SearchingContent) SearchingPatternBuilder(com.att.aro.core.searching.pojo.SearchingPatternBuilder) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 13 with SearchingPatternBuilder

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();
}
Also used : SearchingPatternBuilder(com.att.aro.core.searching.pojo.SearchingPatternBuilder)

Aggregations

SearchingPatternBuilder (com.att.aro.core.searching.pojo.SearchingPatternBuilder)13 BaseTest (com.att.aro.core.BaseTest)11 SearchingContent (com.att.aro.core.searching.pojo.SearchingContent)11 SearchingResult (com.att.aro.core.searching.pojo.SearchingResult)11 Test (org.junit.Test)11