Search in sources :

Example 1 with SearchingContent

use of com.att.aro.core.searching.pojo.SearchingContent in project VideoOptimzer by attdevsupport.

the class KeywordSearchingHandlerTest method testMultiSearchingPattern.

@Test
public void testMultiSearchingPattern() {
    SearchingPatternBuilder patternBuilder = new SearchingPatternBuilder();
    patternBuilder.add("abc", PrivateDataType.regex_credit_card_number.name()).add("bcd", PrivateDataType.regex_credit_card_number.name()).add("def", PrivateDataType.regex_credit_card_number.name());
    SearchingContent content = new SearchingContent("abcde");
    SearchingResult result = searchingHandler.search(patternBuilder.build(), content);
    assertNotNull(result);
    assertEquals(2, 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 2 with SearchingContent

use of com.att.aro.core.searching.pojo.SearchingContent in project VideoOptimzer by attdevsupport.

the class KeywordSearchingHandlerTest method testUnknownSearchingPattern.

@Test
public void testUnknownSearchingPattern() {
    SearchingPattern pattern = null;
    SearchingContent content = new SearchingContent("abcde");
    SearchingResult result = searchingHandler.search(pattern, 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) SearchingPattern(com.att.aro.core.searching.pojo.SearchingPattern) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 3 with SearchingContent

use of com.att.aro.core.searching.pojo.SearchingContent in project VideoOptimzer by attdevsupport.

the class KeywordSearchingHandlerTest method testSingleSearchingPattern.

@Test
public void testSingleSearchingPattern() {
    SearchingPatternBuilder patternBuilder = new SearchingPatternBuilder();
    patternBuilder.add("abc", PrivateDataType.regex_credit_card_number.name());
    SearchingContent content = new SearchingContent("abcde");
    SearchingResult result = searchingHandler.search(patternBuilder.build(), content);
    assertNotNull(result);
    assertEquals("abc", result.getWords().get(0));
}
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 4 with SearchingContent

use of com.att.aro.core.searching.pojo.SearchingContent in project VideoOptimzer by attdevsupport.

the class PatternSearchingHandlerTest method testUnknownSearchingPattern.

@Test
public void testUnknownSearchingPattern() {
    SearchingPattern pattern = null;
    SearchingContent content = new SearchingContent("abcde");
    SearchingResult result = searchingHandler.search(pattern, 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) SearchingPattern(com.att.aro.core.searching.pojo.SearchingPattern) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 5 with SearchingContent

use of com.att.aro.core.searching.pojo.SearchingContent in project VideoOptimzer by attdevsupport.

the class PatternSearchingHandlerTest method testEmptyContent.

@Test
public void testEmptyContent() {
    SearchingPatternBuilder pattenBuilder = new SearchingPatternBuilder();
    pattenBuilder.add("\\d{3}[-\\.\\s]\\d{3}[-\\.\\s]\\d{4},-,3,8,-,7,4", PrivateDataType.regex_phone_number.name());
    SearchingContent content = new SearchingContent(null);
    SearchingResult result = searchingHandler.search(pattenBuilder.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)

Aggregations

SearchingContent (com.att.aro.core.searching.pojo.SearchingContent)15 SearchingResult (com.att.aro.core.searching.pojo.SearchingResult)14 BaseTest (com.att.aro.core.BaseTest)13 Test (org.junit.Test)13 SearchingPatternBuilder (com.att.aro.core.searching.pojo.SearchingPatternBuilder)11 SearchingPattern (com.att.aro.core.searching.pojo.SearchingPattern)3 TransmissionPrivateDataEntry (com.att.aro.core.bestpractice.pojo.TransmissionPrivateDataEntry)1 HttpRequestResponseInfo (com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo)1 Session (com.att.aro.core.packetanalysis.pojo.Session)1 BufferedOutputStream (java.io.BufferedOutputStream)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 IOException (java.io.IOException)1 LinkedList (java.util.LinkedList)1