details:   https://code.openbravo.com/erp/devel/pi/rev/d3d16bc3e4bb
changeset: 34247:d3d16bc3e4bb
user:      Carlos Aristu <carlos.aristu <at> openbravo.com>
date:      Thu Jun 28 12:30:20 2018 +0200
summary:   related to issue 38827: added test case

diffstat:

 src-test/src/org/openbravo/test/system/ErrorTextParserTest.java |  17 ++++++++-
 src/org/openbravo/test/system/ErrorTextParserTest_data.xsql     |  10 +++++-
 2 files changed, 23 insertions(+), 4 deletions(-)

diffs (74 lines):

diff -r ed73bce3ae3b -r d3d16bc3e4bb 
src-test/src/org/openbravo/test/system/ErrorTextParserTest.java
--- a/src-test/src/org/openbravo/test/system/ErrorTextParserTest.java   Thu Jun 
28 12:23:51 2018 +0200
+++ b/src-test/src/org/openbravo/test/system/ErrorTextParserTest.java   Thu Jun 
28 12:30:20 2018 +0200
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2017 Openbravo SLU
+ * All portions are Copyright (C) 2010-2018 Openbravo SLU
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -90,6 +90,11 @@
   }
 
   @Test
+  public void testTriggerError() throws Exception {
+    doErrorTextParserTest(9);
+  }
+
+  @Test
   public void testPGSpanish() throws Exception {
     // only test on pgsql, as specifically testing against es_ES/pgsql error 
messsage
     if (getConnectionProvider().getRDBMS().equals("POSTGRE")) {
@@ -136,8 +141,10 @@
     VariablesSecureApp vars = new VariablesSecureApp("", "", "");
     Connection con = conn.getTransactionConnection();
 
-    // set core to development to avoid the _mod_ trigger restrictions
-    ErrorTextParserTestData.setCoreInDevelopment(con, conn);
+    if (testCase != 9) {
+      // set core to development to avoid the _mod_ trigger restrictions
+      ErrorTextParserTestData.setCoreInDevelopment(con, conn);
+    }
 
     String errorMessage = "";
     String expectedErrorMessage = "";
@@ -175,6 +182,10 @@
         expectedErrorMessage = "There is a constraint defined that was not 
satisfied. Please check the data entered";
         ErrorTextParserTestData.insertProcess(con, conn, "value", "name", 
"test");
         break;
+      case 9:
+        expectedErrorMessage = "Cannot update an object in a module not in 
development and without an active template";
+        ErrorTextParserTestData.updateTableDescription(con, conn, 
"description", "146");
+        break;
       }
 
     } catch (ServletException se) {
diff -r ed73bce3ae3b -r d3d16bc3e4bb 
src/org/openbravo/test/system/ErrorTextParserTest_data.xsql
--- a/src/org/openbravo/test/system/ErrorTextParserTest_data.xsql       Thu Jun 
28 12:23:51 2018 +0200
+++ b/src/org/openbravo/test/system/ErrorTextParserTest_data.xsql       Thu Jun 
28 12:30:20 2018 +0200
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010 Openbravo SLU
+ * All portions are Copyright (C) 2010-2018 Openbravo SLU
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -94,5 +94,13 @@
         VALUES (get_uuid(), '100', 'en_US', '0', '0', 'Y', now(), '0', now(), 
'0', 'a')
       </Sql>
    </SqlMethod>
+   
+   <SqlMethod name="updateTableDescription" type="preparedStatement" 
connection="true" return="rowCount">
+      <Sql>
+        UPDATE AD_TABLE SET DESCRIPTION = ? WHERE AD_TABLE_ID = ?
+      </Sql>
+      <Parameter name="description"/>
+      <Parameter name="adTableId"/>
+   </SqlMethod>
 
 </SqlClass>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to