From user-return-54478-archive-asf-public=cust-asf.ponee.io@ofbiz.apache.org Sun Oct 28 22:57:57 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 0B671180671 for ; Sun, 28 Oct 2018 22:57:56 +0100 (CET) Received: (qmail 16673 invoked by uid 500); 28 Oct 2018 21:57:51 -0000 Mailing-List: contact user-help@ofbiz.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ofbiz.apache.org Delivered-To: mailing list user@ofbiz.apache.org Received: (qmail 16661 invoked by uid 99); 28 Oct 2018 21:57:50 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Oct 2018 21:57:50 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id E3FF9D4B94 for ; Sun, 28 Oct 2018 21:57:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.02 X-Spam-Level: X-Spam-Status: No, score=-4.02 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id aOk1NCqnmHV5 for ; Sun, 28 Oct 2018 21:57:48 +0000 (UTC) Received: from eggs.gnu.org (eggs.gnu.org [208.118.235.92]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 7C5365F1ED for ; Sun, 28 Oct 2018 21:57:47 +0000 (UTC) Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGt40-0007pA-GO for user@ofbiz.apache.org; Sun, 28 Oct 2018 17:57:46 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54031) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGt2A-0006cH-Oq for user@ofbiz.apache.org; Sun, 28 Oct 2018 17:57:40 -0400 Received: from 85.63.10.109.rev.sfr.net ([109.10.63.85]:53462 helo=token) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gGt28-0004zf-U4 for user@ofbiz.apache.org; Sun, 28 Oct 2018 17:55:45 -0400 From: Mathieu Lirzin To: OFBiz user mailing list Subject: Removing support alternate dispatcher and delegator for integration tests Date: Sun, 28 Oct 2018 22:55:35 +0100 Message-ID: <87sh0p7n3c.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e Hello, We are considering removing the support for setting an alternate dispatcher and delegator when running integration tests. This mechanism adds complexity to the way OFBiz handles those tests [1]. it isn't used anywhere in the framework but maybe some users relies on it elsewhere. If you are concerned it is time to step up and discuss the rationale of its usage, and maybe consider alternatives. Here is the precise change which is considered to be applied in OFBiz: --8<---------------cut here---------------start------------->8--- From 66150cc98d2b7b84ee5aa4dee1e25f60556577e6 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Sun, 21 Oct 2018 16:02:38 +0200 Subject: [PATCH] Disallow using alternate dispatcher and delegator for integration tests --- framework/testtools/dtd/test-suite.xsd | 2 -- .../ofbiz/testtools/ModelTestSuite.java | 23 +++++-------------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git framework/testtools/dtd/test-suite.xsd framework/testtools/dtd/test-suite.xsd index ee1767aa2f..76cdf1a523 100644 --- framework/testtools/dtd/test-suite.xsd +++ framework/testtools/dtd/test-suite.xsd @@ -45,8 +45,6 @@ under the License. - - diff --git framework/testtools/src/main/java/org/apache/ofbiz/testtools/ModelTestSuite.java framework/testtools/src/main/java/org/apache/ofbiz/testtools/ModelTestSuite.java index 5c166beb5d..e666e4451a 100644 --- framework/testtools/src/main/java/org/apache/ofbiz/testtools/ModelTestSuite.java +++ framework/testtools/src/main/java/org/apache/ofbiz/testtools/ModelTestSuite.java @@ -50,31 +50,20 @@ import junit.framework.TestSuite; * Use this class in a JUnit test runner to bootstrap the Test Suite runner. */ public class ModelTestSuite { - public static final String module = ModelTestSuite.class.getName(); + public static final String DELEGATOR_NAME = "test"; + public static final String DISPATCHER_NAME = "test-dispatcher"; protected String suiteName; - protected String originalDelegatorName; - protected String originalDispatcherName; - protected Delegator delegator; protected LocalDispatcher dispatcher; - - protected List testList = new ArrayList(); + protected List testList = new ArrayList<>(); public ModelTestSuite(Element mainElement, String testCase) { - this.suiteName = mainElement.getAttribute("suite-name"); - - this.originalDelegatorName = mainElement.getAttribute("delegator-name"); - if (UtilValidate.isEmpty(this.originalDelegatorName)) this.originalDelegatorName = "test"; - - this.originalDispatcherName = mainElement.getAttribute("dispatcher-name"); - if (UtilValidate.isEmpty(this.originalDispatcherName)) this.originalDispatcherName = "test-dispatcher"; - String uniqueSuffix = "-" + RandomStringUtils.randomAlphanumeric(10); - - this.delegator = DelegatorFactory.getDelegator(this.originalDelegatorName).makeTestDelegator(this.originalDelegatorName + uniqueSuffix); - this.dispatcher = ServiceContainer.getLocalDispatcher(originalDispatcherName + uniqueSuffix, delegator); + this.suiteName = mainElement.getAttribute("suite-name"); + this.delegator = DelegatorFactory.getDelegator(DELEGATOR_NAME).makeTestDelegator(DELEGATOR_NAME + uniqueSuffix); + this.dispatcher = ServiceContainer.getLocalDispatcher(DISPATCHER_NAME+ uniqueSuffix, delegator); for (Element testCaseElement : UtilXml.childElementList(mainElement, UtilMisc.toSet("test-case", "test-group"))) { String caseName = testCaseElement.getAttribute("case-name"); -- 2.19.1 --8<---------------cut here---------------end--------------->8--- Thanks. [1] https://lists.apache.org/thread.html/638e88265971cfb47ee03b87c6705206d8369c8d1d94fe8c8decfb74@%3Cdev.ofbiz.apache.org%3E -- Mathieu Lirzin GPG: F2A3 8D7E EB2B 6640 5761 070D 0ADE E100 9460 4D37