Search in sources :

Example 6 with SearchingResult

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

the class PatternSearchingHandlerTest method testResultNotFound.

@Test
public void testResultNotFound() {
    SearchingPatternBuilder pattenBuilder = new SearchingPatternBuilder();
    pattenBuilder.add("\\d{3}[-\\.\\s]\\d{3}[-\\.\\s]\\d{4},-,3,8,-,7,4", PrivateDataType.regex_phone_number.name());
    String text = "https://www.google.com/login/username=fakeName&password=1234&id=423456-7865";
    SearchingContent content = new SearchingContent(text);
    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)

Example 7 with SearchingResult

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

the class PatternSearchingHandlerTest method testResultFound.

@Test
public void testResultFound() {
    SearchingPatternBuilder pattenBuilder = new SearchingPatternBuilder();
    pattenBuilder.add("\\d{3}[-\\.\\s]\\d{3}[-\\.\\s]\\d{4},-,3,8,-,7,4", PrivateDataType.regex_phone_number.name());
    String text = "https://www.google.com/login/username=fakeName&password=1234&phone=443-237-7431";
    SearchingContent content = new SearchingContent(text);
    SearchingResult result = searchingHandler.search(pattenBuilder.build(), content);
    assertNotNull(result);
    assertEquals(1, result.getWords().size());
    assertEquals("443-237-7431", 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 8 with SearchingResult

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

the class SearchingStrategyTest method testSinglePatternMatchFound.

@Test
public void testSinglePatternMatchFound() {
    SearchingContent content = new SearchingContent("abcabeabd");
    SearchingPatternBuilder patternBuilder = new SearchingPatternBuilder();
    patternBuilder.add("abe", PrivateDataType.regex_credit_card_number.name());
    SearchingResult result = searchStrategy.applySearch(patternBuilder.build(), content);
    assertNotNull(result);
    assertEquals(1, result.getWords().size());
    assertEquals("abe", 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 9 with SearchingResult

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

the class SearchingStrategyTest method testEmptyContent.

@Test
public void testEmptyContent() {
    SearchingContent content = new SearchingContent("");
    SearchingPatternBuilder patternBuilder = new SearchingPatternBuilder();
    patternBuilder.add("abc", 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 10 with SearchingResult

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

the class SearchingStrategyTest method testSinglePatternMatchNotFound.

@Test
public void testSinglePatternMatchNotFound() {
    SearchingContent content = new SearchingContent("abcabeabd");
    SearchingPatternBuilder patternBuilder = new SearchingPatternBuilder();
    patternBuilder.add("abf", 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)

Aggregations

SearchingContent (com.att.aro.core.searching.pojo.SearchingContent)14 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 Session (com.att.aro.core.packetanalysis.pojo.Session)1 LinkedList (java.util.LinkedList)1