Skip to content

Commit

Permalink
LPS-57905 Only do this for sybase
Browse files Browse the repository at this point in the history
  • Loading branch information
mtambara authored and brianchandotcom committed Aug 26, 2015
1 parent 230f1aa commit 700bdb8
Showing 1 changed file with 42 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

package com.liferay.portlet.messageboards.service;

import com.liferay.portal.kernel.dao.db.DB;
import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
import com.liferay.portal.kernel.messaging.DestinationNames;
import com.liferay.portal.kernel.messaging.SynchronousDestination;
import com.liferay.portal.kernel.test.rule.AggregateTestRule;
Expand Down Expand Up @@ -148,49 +150,56 @@ public void testAddMessagesConcurrently() throws Exception {
doAsUserThread.join();
}

for (LoggingEvent loggingEvent :
captureAppender1.getLoggingEvents()) {
DB db = DBFactoryUtil.getDB();

Assert.assertEquals(
"Application exception overridden by commit exception",
loggingEvent.getMessage());
}
String dbType = db.getType();

for (LoggingEvent loggingEvent :
captureAppender2.getLoggingEvents()) {
if (dbType.equals(DB.TYPE_SYBASE)) {
for (LoggingEvent loggingEvent :
captureAppender1.getLoggingEvents()) {

String message = loggingEvent.getRenderedMessage();
Assert.assertEquals(
"Application exception overridden by commit exception",
loggingEvent.getMessage());
}

Assert.assertTrue(
message.startsWith(
"Unable to process message {destinationName=" +
DestinationNames.ASYNC_SERVICE)
);
}
for (LoggingEvent loggingEvent :
captureAppender2.getLoggingEvents()) {

for (LoggingEvent loggingEvent :
captureAppender3.getLoggingEvents()) {
String message = loggingEvent.getRenderedMessage();

String message = loggingEvent.getRenderedMessage();
Assert.assertTrue(
message.startsWith(
"Unable to process message {destinationName=" +
DestinationNames.ASYNC_SERVICE)
);
}

Assert.assertTrue(
message.startsWith(
"com.liferay.portal.kernel.exception.SystemException:" +
" com.liferay.portal.kernel.dao.orm.ORMException:" +
" org.hibernate.exception." +
"GenericJDBCException: Could not execute"));
}
for (LoggingEvent loggingEvent :
captureAppender3.getLoggingEvents()) {

String message = loggingEvent.getRenderedMessage();

Assert.assertTrue(
message.startsWith(
"com.liferay.portal.kernel.exception." +
"SystemException: com.liferay.portal.kernel." +
"dao.orm.ORMException: org.hibernate." +
"exception.GenericJDBCException: " +
"Could not execute"));
}

for (LoggingEvent loggingEvent :
captureAppender4.getLoggingEvents()) {
for (LoggingEvent loggingEvent :
captureAppender4.getLoggingEvents()) {

String message = loggingEvent.getRenderedMessage();
String message = loggingEvent.getRenderedMessage();

Assert.assertTrue(message.contains("Your server command"));
Assert.assertTrue(
message.contains(
"encountered a deadlock situation. Please re-run " +
"your command."));
Assert.assertTrue(message.contains("Your server command"));
Assert.assertTrue(
message.contains(
"encountered a deadlock situation. Please re-run " +
"your command."));
}
}
}

Expand Down

0 comments on commit 700bdb8

Please sign in to comment.