test_class.declarator: formatterUnderTest
test_class.original_string: DefaultExceptionFormatter formatterUnderTest;
test_class.type: DefaultExceptionFormatter
test_class.var_name: formatterUnderTest
test_class.file: sql12/fw/src/test/java/net/sourceforge/squirrel_sql/fw/util/DefaultExceptionFormatterTest.java
test_class.identifier: DefaultExceptionFormatterTest
test_class.superclass: extends BaseSQuirreLJUnit4TestCase
test_case.body: @Test
      public final void testSetCustomExceptionFormatter() throws Exception {
          ExceptionFormatter formatter1 = createMock(ExceptionFormatter.class);
          SQLException ex = new SQLException("table does not exist");
          SQLExecutionException ee = new SQLExecutionException(ex, "");
          expect(formatter1.formatsException(isA(SQLException.class))).andReturn(true).anyTimes();
          expect(formatter1.format(ex)).andReturn("foo").anyTimes();
          replay(formatter1);
          formatterUnderTest.setCustomExceptionFormatter(formatter1);
          String formattedEx = formatterUnderTest.format(ee);
          verify(formatter1);
          Assert.assertEquals("foo", formattedEx);
      }
test_case.class_method_signature: DefaultExceptionFormatterTest.testSetCustomExceptionFormatter()
test_case.full_signature: @Test public final void testSetCustomExceptionFormatter()
test_case.identifier: testSetCustomExceptionFormatter
test_case.invocations: createMock anyTimes andReturn expect formatsException isA anyTimes andReturn expect format replay setCustomExceptionFormatter format verify assertEquals
test_case.modifiers: @Test public final
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSetCustomExceptionFormatter()
focal_class.declarator: s_log =
          LoggerController.createLogger(DefaultExceptionFormatter.class)
focal_class.modifier: private static final
focal_class.original_string: private static final ILogger s_log =
          LoggerController.createLogger(DefaultExceptionFormatter.class);
focal_class.type: ILogger
focal_class.var_name: s_log
focal_class.declarator: customFormatter = null
focal_class.modifier: private
focal_class.original_string: private ExceptionFormatter customFormatter = null;
focal_class.type: ExceptionFormatter
focal_class.var_name: customFormatter
focal_class.file: sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/util/DefaultExceptionFormatter.java
focal_class.identifier: DefaultExceptionFormatter
focal_class.interfaces: implements ExceptionFormatter
focal_class.class_method_signature: DefaultExceptionFormatter.format(Throwable th)
focal_class.full_signature: public String format(Throwable th)
focal_class.identifier: format
focal_class.modifiers: public
focal_class.parameters: (Throwable th)
focal_class.return: String
focal_class.signature: String format(Throwable th)
focal_class.class_method_signature: DefaultExceptionFormatter.defaultFormatSQLException(Throwable cause)
focal_class.full_signature: public String defaultFormatSQLException(Throwable cause)
focal_class.identifier: defaultFormatSQLException
focal_class.modifiers: public
focal_class.parameters: (Throwable cause)
focal_class.return: String
focal_class.signature: String defaultFormatSQLException(Throwable cause)
focal_class.class_method_signature: DefaultExceptionFormatter.formatsException(Throwable t)
focal_class.full_signature: public boolean formatsException(Throwable t)
focal_class.identifier: formatsException
focal_class.modifiers: public
focal_class.parameters: (Throwable t)
focal_class.return: boolean
focal_class.signature: boolean formatsException(Throwable t)
focal_class.class_method_signature: DefaultExceptionFormatter.setCustomExceptionFormatter(ExceptionFormatter customFormatter)
focal_class.full_signature: public void setCustomExceptionFormatter(ExceptionFormatter customFormatter)
focal_class.identifier: setCustomExceptionFormatter
focal_class.modifiers: public
focal_class.parameters: (ExceptionFormatter customFormatter)
focal_class.return: void
focal_class.signature: void setCustomExceptionFormatter(ExceptionFormatter customFormatter)
focal_class.class_method_signature: DefaultExceptionFormatter.getDataTruncationMessage(DataTruncation ex)
focal_class.full_signature: private String getDataTruncationMessage(DataTruncation ex)
focal_class.identifier: getDataTruncationMessage
focal_class.modifiers: private
focal_class.parameters: (DataTruncation ex)
focal_class.return: String
focal_class.signature: String getDataTruncationMessage(DataTruncation ex)
focal_class.class_method_signature: DefaultExceptionFormatter.getSQLWarningMessage(SQLWarning ex)
focal_class.full_signature: private String getSQLWarningMessage(SQLWarning ex)
focal_class.identifier: getSQLWarningMessage
focal_class.modifiers: private
focal_class.parameters: (SQLWarning ex)
focal_class.return: String
focal_class.signature: String getSQLWarningMessage(SQLWarning ex)
focal_class.class_method_signature: DefaultExceptionFormatter.getSQLExceptionMessage(SQLException ex)
focal_class.full_signature: private String getSQLExceptionMessage(SQLException ex)
focal_class.identifier: getSQLExceptionMessage
focal_class.modifiers: private
focal_class.parameters: (SQLException ex)
focal_class.return: String
focal_class.signature: String getSQLExceptionMessage(SQLException ex)
focal_class.class_method_signature: DefaultExceptionFormatter.buildMessage(String prefix, SQLException ex)
focal_class.full_signature: private String buildMessage(String prefix, SQLException ex)
focal_class.identifier: buildMessage
focal_class.modifiers: private
focal_class.parameters: (String prefix, SQLException ex)
focal_class.return: String
focal_class.signature: String buildMessage(String prefix, SQLException ex)
focal_method.body: public void setCustomExceptionFormatter(ExceptionFormatter customFormatter) {
          if (customFormatter == null) {
              throw new IllegalArgumentException("customFormatter cannot be null");
          }
          
          if (this.customFormatter == null) {
              this.customFormatter = customFormatter;
          } else {
              // Uh-oh!  We shouldn't have more than one plugin registering a 
              // custom exception handler for a given session.  The first one 
              // wins and all others get an error message.
              s_log.error(
                  "setCustomExceptionFormatter: An existing customFormatter ( "+
                  this.customFormatter.getClass().getName()+" )has already " +
                  "been set - ignoring "+customFormatter.getClass().getName());
          }
      }
focal_method.class_method_signature: DefaultExceptionFormatter.setCustomExceptionFormatter(ExceptionFormatter customFormatter)
focal_method.full_signature: public void setCustomExceptionFormatter(ExceptionFormatter customFormatter)
focal_method.identifier: setCustomExceptionFormatter
focal_method.invocations: error getName getClass getName getClass
focal_method.modifiers: public
focal_method.parameters: (ExceptionFormatter customFormatter)
focal_method.return: void
focal_method.signature: void setCustomExceptionFormatter(ExceptionFormatter customFormatter)