details:   https://code.openbravo.com/erp/devel/pi/rev/ba49b0115f33
changeset: 20692:ba49b0115f33
user:      Shankar Balachandran <shankar.balachandran <at> openbravo.com>
date:      Wed Jul 03 11:02:12 2013 +0530
summary:   Related to Issue 24174 : Added test case for checking message 
parsing in Oracle.

Added test case to check that only the error message is displayed and not the 
whole error stack.

diffstat:

 src-test/org/openbravo/test/system/ErrorTextParserTest.java |  32 +++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diffs (42 lines):

diff -r 3758cd466f44 -r ba49b0115f33 
src-test/org/openbravo/test/system/ErrorTextParserTest.java
--- a/src-test/org/openbravo/test/system/ErrorTextParserTest.java       Wed Jul 
03 10:37:43 2013 +0530
+++ b/src-test/org/openbravo/test/system/ErrorTextParserTest.java       Wed Jul 
03 11:02:12 2013 +0530
@@ -79,6 +79,38 @@
     }
   }
 
+  public void testErrorMessageParse() {
+    String message = null, expectedMessage = null;
+    OBError result = null;
+    ConnectionProvider conn = getConnectionProvider();
+    VariablesSecureApp vars = new VariablesSecureApp("", "", "");
+    try {
+
+      // checking in case of single delimiter \n
+      message = "ORA-20000: @LineAmountNotCorrect@"
+          + "\nORA-06512: at \"TAD.GL_JOURNAL_TRG\", line 30"
+          + "\nORA-04088: error during execution of trigger 
'TAD.GL_JOURNAL_TRG'"
+          + "\nORA-06512: at \"TAD.GL_JOURNALLINE_TRG\", line 49"
+          + "\nORA-04088: error during execution of trigger 
'TAD.GL_JOURNALLINE_TRG'";
+      expectedMessage = "Line Amount Is Not Correct";
+      result = Utility.translateError(conn, vars, vars.getLanguage(), message);
+      assertEquals(result.getMessage(), expectedMessage);
+
+      // checking in case of delimiter with double slash \\n
+      message = "ORA-20000: @LineAmountNotCorrect@"
+          + "\\\nORA-06512: at \"TAD.GL_JOURNAL_TRG\", line 30"
+          + "\\\nORA-04088: error during execution of trigger 
'TAD.GL_JOURNAL_TRG'"
+          + "\\\nORA-06512: at \"TAD.GL_JOURNALLINE_TRG\", line 49"
+          + "\\\nORA-04088: error during execution of trigger 
'TAD.GL_JOURNALLINE_TRG'";
+      expectedMessage = "Line Amount Is Not Correct";
+      result = Utility.translateError(conn, vars, vars.getLanguage(), message);
+      assertEquals(result.getMessage(), expectedMessage);
+
+    } catch (Exception e) {
+      assertTrue(false);
+    }
+  }
+
   private void doErrorTextParserTest(int testCase) throws Exception {
     ConnectionProvider conn = getConnectionProvider();
     VariablesSecureApp vars = new VariablesSecureApp("", "", "");

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to