Skip to content

Commit

Permalink
LPS-118542 Can you fix any that I did wrong? Thx.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianchandotcom committed Feb 1, 2021
1 parent 0ccde72 commit 6fbc79b
Showing 1 changed file with 10 additions and 10 deletions.
Expand Up @@ -262,15 +262,15 @@ private void _assertXmlLog(
"The log output should have at least 1 line",
outputLines.length > 0);

// log4j:event
// <log4j:event />

String log4JEventLine = outputLines[0];

String log4JEvent = log4JEventLine.substring(
log4JEventLine.indexOf(StringPool.SPACE),
log4JEventLine.indexOf(StringPool.GREATER_THAN));

// log4j:event logger
// <log4j:event logger="..." />

String expectedLog4JEventLogger = StringBundler.concat(
StringPool.SPACE, "logger=", StringPool.QUOTE,
Expand All @@ -281,7 +281,7 @@ private void _assertXmlLog(
expectedLog4JEventLogger,
log4JEvent.substring(0, expectedLog4JEventLogger.length()));

// log4j:event timestamp
// <log4j:event timestamp="..." />

log4JEvent = log4JEvent.substring(expectedLog4JEventLogger.length());

Expand All @@ -291,7 +291,7 @@ private void _assertXmlLog(

Long.valueOf(actualLog4JEventTimestamp);

// log4j:event level
// <log4j:event level="..." />

log4JEvent = log4JEvent.substring(
"timestamp=".length() + actualLog4JEventTimestamp.length() + 2);
Expand All @@ -304,7 +304,7 @@ private void _assertXmlLog(
expectedLog4JEventLevel,
log4JEvent.substring(0, expectedLog4JEventLevel.length()));

// log4j:event thread
// <log4j:event thread="..." />

log4JEvent = log4JEvent.substring(expectedLog4JEventLevel.length());

Expand All @@ -318,7 +318,7 @@ private void _assertXmlLog(
expectedLog4JEventThread,
log4JEvent.substring(0, expectedLog4JEventThread.length()));

// log4j:message
// <log4j:message>...</log4j:message>

if (expectedThrowable != null) {
if (expectedMessage == null) {
Expand All @@ -332,7 +332,7 @@ private void _assertXmlLog(
outputLines[1]);
}

// log4j:throwable
// <log4j:throwable>...</log4j:throwable>

if (expectedThrowable != null) {
Class<?> expectedThrowableClass = expectedThrowable.getClass();
Expand All @@ -352,15 +352,15 @@ private void _assertXmlLog(
"at " + PortalLog4jTest.class.getName()));
}

// log4j:locationInfo
// <log4j:locationInfo />

String log4JLocationInfoLine = outputLines[outputLines.length - 2];

String log4JLocationInfo = log4JLocationInfoLine.substring(
log4JLocationInfoLine.indexOf(StringPool.SPACE),
log4JLocationInfoLine.indexOf(StringPool.FORWARD_SLASH));

// log4j:locationInfo class name
// <log4j:locationInfo class="..." />

String expectedLog4JLocationInfoClassName = StringBundler.concat(
StringPool.SPACE, "class=", StringPool.QUOTE,
Expand All @@ -372,7 +372,7 @@ private void _assertXmlLog(
log4JLocationInfo.substring(
0, expectedLog4JLocationInfoClassName.length()));

// log4j:locationInfo file
// <log4j:locationInfo file="..." />

log4JLocationInfo = log4JLocationInfo.substring(
expectedLog4JLocationInfoClassName.length());
Expand Down

0 comments on commit 6fbc79b

Please sign in to comment.