Search in sources :

Example 1 with StrMatcher

use of org.apache.commons.lang3.text.StrMatcher in project commons-text by apache.

the class StringSubstitutorTest method testReplaceInTakingTwoAndThreeIntsReturningFalse.

@Test
public void testReplaceInTakingTwoAndThreeIntsReturningFalse() {
    final Map<String, Object> hashMap = new HashMap<>();
    final StringLookup mapStringLookup = StringLookupFactory.INSTANCE.mapStringLookup(hashMap);
    final StringMatcher strMatcher = StringMatcherFactory.INSTANCE.tabMatcher();
    final StringSubstitutor strSubstitutor = new StringSubstitutor(mapStringLookup, strMatcher, strMatcher, 'b', strMatcher);
    assertFalse(strSubstitutor.replaceIn((StringBuilder) null, 1315, (-1369)));
    assertEquals('b', strSubstitutor.getEscapeChar());
    assertFalse(strSubstitutor.isPreserveEscapes());
}
Also used : HashMap(java.util.HashMap) StringLookup(org.apache.commons.text.lookup.StringLookup) StringMatcher(org.apache.commons.text.matcher.StringMatcher) MutableObject(org.apache.commons.lang3.mutable.MutableObject) Test(org.junit.Test)

Aggregations

HashMap (java.util.HashMap)1 MutableObject (org.apache.commons.lang3.mutable.MutableObject)1 StringLookup (org.apache.commons.text.lookup.StringLookup)1 StringMatcher (org.apache.commons.text.matcher.StringMatcher)1 Test (org.junit.Test)1