Search in sources :

Example 6 with LogCatMessage

use of com.android.ddmlib.logcat.LogCatMessage in project android by JetBrains.

the class AndroidLogcatFormatterTest method formatMessageToParseMessageKeepsAllInformation.

@Test
public void formatMessageToParseMessageKeepsAllInformation() {
    LogCatHeader header = new LogCatHeader(LogLevel.DEBUG, 13, 123, "system_process", "ConnectivityService", LogCatTimestamp.fromString("02-12 14:32:46.526"));
    String output = AndroidLogcatFormatter.formatMessageFull(header, "xyz");
    LogCatMessage message = AndroidLogcatFormatter.parseMessage(output);
    LogCatHeader header2 = message.getHeader();
    assertEquals(header.getTimestamp(), header2.getTimestamp());
    assertEquals(header.getLogLevel(), header2.getLogLevel());
    assertEquals(header.getPid(), header2.getPid());
    assertEquals(header.getTid(), header2.getTid());
    assertEquals(header.getAppName(), header2.getAppName());
    assertEquals(header.getTag(), header2.getTag());
    assertEquals("xyz", message.getMessage());
}
Also used : LogCatHeader(com.android.ddmlib.logcat.LogCatHeader) LogCatMessage(com.android.ddmlib.logcat.LogCatMessage) Test(org.junit.Test)

Aggregations

LogCatMessage (com.android.ddmlib.logcat.LogCatMessage)6 LogCatHeader (com.android.ddmlib.logcat.LogCatHeader)2 Key (com.intellij.openapi.util.Key)1 HashSet (com.intellij.util.containers.HashSet)1 Matcher (java.util.regex.Matcher)1 NotNull (org.jetbrains.annotations.NotNull)1 Nullable (org.jetbrains.annotations.Nullable)1 Test (org.junit.Test)1