LogDataListPersistanceVer2 implements LogDataListPersistance { protected String escapedString(String string) { return string .replace("\\", "\\S") .replace("|", "\\P") .replace("\n", "\\n") .replace("\r", "\\r"); }  void saveLogsList(OutputStream out, List<LogData> list); List<LogData> loadLogsList(InputStream in); static final String HEADER_ID; static final String HEADER_TIMESTAMP; static final String HEADER_MESSAGE; static final String HEADER_CLASS; static final String HEADER_METHOD; static final String HEADER_LEVEL; static final String HEADER_LOGGER; static final String HEADER_THREAD; static final String HEADER_MDC; static final String HEADER_NDC; static final String HEADER_FILE; static final String HEADER_LINE; static final String HEADER_LOG_SOURCE; static final String HEADER_NOTE; static final String HEADER_MARKED; static final String HEADER_MARKED_COLOR; static final String FIELD_SEPERATOR; static final String FIELD_SEPERATOR_TO_SPLIT; }
@Test public void testEscpageStringPipes() { String escpageString = ver2.escapedString("String|with|pipe"); AssertJUnit.assertEquals("String\\Pwith\\Ppipe", escpageString); }
@Test public void testEscpageStringBackslash() { String escpageString = ver2.escapedString("String\\with\\backslash"); AssertJUnit.assertEquals("String\\Swith\\Sbackslash", escpageString); }
@Test public void testEscpageStringNewLine() { String escpageString = ver2.escapedString("String\nwith\nnewline"); AssertJUnit.assertEquals("String\\nwith\\nnewline", escpageString); }