Added testcase for issue 13749
authorIván Perdomo <ivan.perdomo@openbravo.com>
Tue, 13 Jul 2010 17:43:42 +0200
changeset 7877 e12428e2fe3c
parent 7876 b69b2f8b29a3
child 7878 4a73659a9927
Added testcase for issue 13749
src-test/org/openbravo/test/dal/IssuesTest.java
--- a/src-test/org/openbravo/test/dal/IssuesTest.java	Tue Jul 13 16:48:14 2010 +0200
+++ b/src-test/org/openbravo/test/dal/IssuesTest.java	Tue Jul 13 17:43:42 2010 +0200
@@ -24,7 +24,10 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.log4j.Logger;
 import org.dom4j.Document;
@@ -44,6 +47,7 @@
 import org.openbravo.model.ad.access.Role;
 import org.openbravo.model.ad.access.User;
 import org.openbravo.model.ad.module.Module;
+import org.openbravo.model.ad.process.ProcessInstance;
 import org.openbravo.model.ad.system.Client;
 import org.openbravo.model.ad.system.Language;
 import org.openbravo.model.ad.ui.Form;
@@ -54,6 +58,7 @@
 import org.openbravo.model.common.invoice.InvoiceLine;
 import org.openbravo.model.common.order.Order;
 import org.openbravo.model.common.plm.Product;
+import org.openbravo.service.db.CallProcess;
 import org.openbravo.service.db.CallStoredProcedure;
 import org.openbravo.test.base.BaseTest;
 
@@ -112,6 +117,24 @@
   private static final Logger log = Logger.getLogger(IssuesTest.class);
 
   /**
+   * https://issues.openbravo.com/view.php?id=13749
+   */
+  public void test13749() {
+    setBigBazaarAdminContext();
+    try {
+      org.openbravo.model.ad.ui.Process process = OBDal.getInstance().get(
+          org.openbravo.model.ad.ui.Process.class, "1004400000"); // Has a Date parameter
+      Map<String, Date> params = new HashMap<String, Date>();
+      params.put("DateOrdered", new Date());
+      ProcessInstance pi = CallProcess.getInstance().callProcess(process, null, params);
+      log.info("Result: " + pi.getResult());
+      log.info("Error message: " + pi.getErrorMsg());
+    } catch (Exception e) {
+      log.error("Error testing CallProcess: " + e.getMessage(), e);
+    }
+  }
+
+  /**
    * https://issues.openbravo.com/view.php?id=12918
    */
   public void test12918() {