details:   https://code.openbravo.com/erp/devel/pi/rev/46f6eb5a22dc
changeset: 35334:46f6eb5a22dc
user:      Carlos Aristu <carlos.aristu <at> openbravo.com>
date:      Mon Jan 21 10:10:25 2019 +0100
summary:   related to issue 38516: revert unintended change

diffstat:

 
src-test/src/org/openbravo/test/views/ViewGenerationWithDifferentConfigLevelTest.java
 |  49 +---------
 1 files changed, 3 insertions(+), 46 deletions(-)

diffs (93 lines):

diff -r 9865035f0712 -r 46f6eb5a22dc 
src-test/src/org/openbravo/test/views/ViewGenerationWithDifferentConfigLevelTest.java
--- 
a/src-test/src/org/openbravo/test/views/ViewGenerationWithDifferentConfigLevelTest.java
     Mon Jan 21 10:03:30 2019 +0100
+++ 
b/src-test/src/org/openbravo/test/views/ViewGenerationWithDifferentConfigLevelTest.java
     Mon Jan 21 10:10:25 2019 +0100
@@ -24,18 +24,13 @@
 import static org.junit.Assert.assertThat;
 import static org.junit.Assume.assumeThat;
 
-import java.util.HashMap;
-import java.util.Map;
-
 import org.codehaus.jettison.json.JSONObject;
 import org.junit.Before;
 import org.junit.Test;
 import org.openbravo.base.provider.OBProvider;
-import org.openbravo.base.weld.WeldUtils;
 import org.openbravo.client.application.GCField;
 import org.openbravo.client.application.GCSystem;
 import org.openbravo.client.application.GCTab;
-import org.openbravo.client.application.ViewComponent;
 import org.openbravo.client.application.window.OBViewUtil;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBDal;
@@ -124,8 +119,7 @@
       OBDal.getInstance().flush();
 
       tab = OBDal.getInstance().get(Tab.class, BUSINESS_PARTNER_TAB_ID);
-      JSONObject tabConfig = 
OBViewUtil.getGridConfigurationSettings(getSystemGridConfig(),
-          getTabGridConfig(tab));
+      JSONObject tabConfig = 
OBViewUtil.getGridConfigurationSettings(getSystemGridConfig(), 
getTabGridConfig(tab));
 
       assertThat("Grid configuration at tab level with filtering disabled:", 
tabConfig.toString(),
           containsString(CAN_FILTER_FALSE));
@@ -171,8 +165,7 @@
 
       tab = OBDal.getInstance().get(Tab.class, BUSINESS_PARTNER_TAB_ID);
 
-      JSONObject tabConfig = 
OBViewUtil.getGridConfigurationSettings(getSystemGridConfig(),
-          getTabGridConfig(tab));
+      JSONObject tabConfig = 
OBViewUtil.getGridConfigurationSettings(getSystemGridConfig(), 
getTabGridConfig(tab));
 
       Field field = OBDal.getInstance().get(Field.class, 
BUSINESS_PARTNER_TAB_CURRENCY_FIELD_ID);
       JSONObject systemConfig = OBViewUtil.getGridConfigurationSettings(field,
@@ -326,8 +319,7 @@
       OBDal.getInstance().flush();
 
       tab = OBDal.getInstance().get(Tab.class, BUSINESS_PARTNER_TAB_ID);
-      JSONObject tabConfig = 
OBViewUtil.getGridConfigurationSettings(getSystemGridConfig(),
-          getTabGridConfig(tab));
+      JSONObject tabConfig = 
OBViewUtil.getGridConfigurationSettings(getSystemGridConfig(), 
getTabGridConfig(tab));
 
       Field field = OBDal.getInstance().get(Field.class, 
BUSINESS_PARTNER_CATEGORY_FIELD_ID);
       JSONObject fieldConfig = OBViewUtil.getGridConfigurationSettings(field,
@@ -344,39 +336,4 @@
       OBContext.restorePreviousMode();
     }
   }
-
-  /**
-   * Having a grid configuration at System level that disables the 
transactional filters , the
-   * expression "canFilter: true" must not be found.
-   */
-  @Test
-  public void disableTransactionalFilters() throws Exception {
-    GCSystem gcsystem = null;
-    OBContext.setAdminMode(false);
-    try {
-      gcsystem = OBProvider.getInstance().get(GCSystem.class);
-      gcsystem.setClient(OBDal.getInstance().get(Client.class, 
CLIENT_FOR_GC_SYSTEM_FIELD_TAB));
-      gcsystem.setOrganization(OBDal.getInstance().get(Organization.class, 
ZERO_ORGANIZATION));
-      gcsystem.setAllowTransactionalFilters(false);
-      // OBDal.getInstance().save(gcsystem);
-      // OBDal.getInstance().flush();
-
-      Map<String, Object> p = new HashMap<>(1);
-      p.put("viewId", "167");
-      getViewComponent().setParameters(p);
-
-      String viewDef = getViewComponent().generate();
-
-      assertThat("Grid configuration at system level with filtering enabled:", 
viewDef,
-          containsString("This grid is filtered using an implicit filter"));
-    } finally {
-      OBDal.getInstance().rollbackAndClose();
-      OBContext.restorePreviousMode();
-    }
-  }
-
-  private ViewComponent getViewComponent() {
-    return WeldUtils.getInstanceFromStaticBeanManager(ViewComponent.class);
-  }
-
 }
\ No newline at end of file


_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to