From 9bc8ebb864f62f60561237bc6e7805f70130a4e9 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Fri, 23 Aug 2019 18:02:42 +0000 Subject: [PATCH] =?UTF-8?q?Improved:=20Remove=20useless=20=E2=80=98GroovyS?= =?UTF-8?q?criptTestCase=E2=80=99=20(OFBIZ-11165)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This class was useless since ‘GroovyScriptTestCase’ provides the same interesting feature as ‘OFBizTestCase’ meaning a delegator and a dispatcher. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1865787 13f79535-47bb-0310-9956-ffa450edef68 --- .../accounting/AutoAcctgBudgetTests.groovy | 8 ++- .../accounting/AutoAcctgInvoiceTests.groovy | 8 ++- .../accounting/AutoAcctgLedgerTests.groovy | 8 ++- .../AutoAcctgPaymentGatewayTests.groovy | 8 ++- .../accounting/AutoAcctgPaymentTests.groovy | 8 ++- .../apache/ofbiz/content/ContentTests.groovy | 8 ++- .../org/apache/ofbiz/order/OrderTests.groovy | 8 ++- .../org/apache/ofbiz/order/QuoteTests.groovy | 7 ++- .../TestCustRequestPermissionCheck.groovy | 8 ++- .../ofbiz/party/ContactMechWorkerTests.groovy | 7 ++- .../product/ProductFeatureTypeTests.groovy | 8 ++- .../product/ProductPromoActionTests.groovy | 7 ++- .../product/ProductPromoCondTests.groovy | 7 ++- .../apache/ofbiz/product/ProductTests.groovy | 8 ++- .../org/apache/ofbiz/base/SimpleTests.groovy | 43 ---------------- framework/testtools/dtd/test-suite.xsd | 22 -------- .../ofbiz/testtools/GroovyScriptTestCase.java | 51 ------------------- .../ofbiz/testtools/ModelTestSuite.java | 12 ----- 18 files changed, 80 insertions(+), 156 deletions(-) delete mode 100644 framework/base/src/main/groovy/org/apache/ofbiz/base/SimpleTests.groovy delete mode 100644 framework/testtools/src/main/java/org/apache/ofbiz/testtools/GroovyScriptTestCase.java diff --git a/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgBudgetTests.groovy b/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgBudgetTests.groovy index 79249b446e..fb7f7013da 100644 --- a/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgBudgetTests.groovy +++ b/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgBudgetTests.groovy @@ -21,9 +21,13 @@ package org.apache.ofbiz.accounting import org.apache.ofbiz.entity.GenericValue import org.apache.ofbiz.entity.util.EntityQuery import org.apache.ofbiz.service.ServiceUtil -import org.apache.ofbiz.testtools.GroovyScriptTestCase +import org.apache.ofbiz.service.testtools.OFBizTestCase + +class AutoAcctgBudgetTests extends OFBizTestCase { + public AutoAcctgBudgetTests(String name) { + super(name) + } -class AutoAcctgBudgetTests extends GroovyScriptTestCase { void testCreateBudget() { Map serviceCtx = [:] serviceCtx.budgetTypeId = 'CAPITAL_BUDGET' diff --git a/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgInvoiceTests.groovy b/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgInvoiceTests.groovy index bd68059457..c828df9273 100644 --- a/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgInvoiceTests.groovy +++ b/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgInvoiceTests.groovy @@ -22,8 +22,12 @@ import org.apache.ofbiz.base.util.UtilDateTime import org.apache.ofbiz.entity.GenericValue import org.apache.ofbiz.entity.util.EntityQuery import org.apache.ofbiz.service.ServiceUtil -import org.apache.ofbiz.testtools.GroovyScriptTestCase -class AutoAcctgInvoiceTests extends GroovyScriptTestCase { +import org.apache.ofbiz.service.testtools.OFBizTestCase +class AutoAcctgInvoiceTests extends OFBizTestCase { + public AutoAcctgInvoiceTests(String name) { + super(name) + } + void testCreateInvoiceContent() { def userLogin = EntityQuery.use(delegator).from('UserLogin') .where('userLoginId', 'system') diff --git a/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgLedgerTests.groovy b/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgLedgerTests.groovy index dd6781b767..eacc1d58d6 100644 --- a/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgLedgerTests.groovy +++ b/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgLedgerTests.groovy @@ -22,9 +22,13 @@ import org.apache.ofbiz.base.util.UtilDateTime import org.apache.ofbiz.entity.GenericValue import org.apache.ofbiz.entity.util.EntityQuery import org.apache.ofbiz.service.ServiceUtil -import org.apache.ofbiz.testtools.GroovyScriptTestCase +import org.apache.ofbiz.service.testtools.OFBizTestCase + +class AutoAcctgLedgerTests extends OFBizTestCase { + public AutoAcctgLedgerTests(String name) { + super(name) + } -class AutoAcctgLedgerTests extends GroovyScriptTestCase { void testCreateAcctgTrans() { Map serviceCtx = [:] serviceCtx.acctgTransTypeId = 'CREDIT_MEMO' diff --git a/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgPaymentGatewayTests.groovy b/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgPaymentGatewayTests.groovy index 1bf413364b..4c319911ad 100644 --- a/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgPaymentGatewayTests.groovy +++ b/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgPaymentGatewayTests.groovy @@ -21,9 +21,13 @@ package org.apache.ofbiz.accounting import org.apache.ofbiz.entity.GenericValue import org.apache.ofbiz.entity.util.EntityQuery import org.apache.ofbiz.service.ServiceUtil -import org.apache.ofbiz.testtools.GroovyScriptTestCase +import org.apache.ofbiz.service.testtools.OFBizTestCase + +class AutoAcctgPaymentGatewayTests extends OFBizTestCase { + public AutoAcctgPaymentGatewayTests(String name) { + super(name) + } -class AutoAcctgPaymentGatewayTests extends GroovyScriptTestCase { void testUpdatePaymentGatewayConfig() { Map serviceCtx = [:] serviceCtx.paymentGatewayConfigId = 'SAGEPAY_CONFIG' diff --git a/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgPaymentTests.groovy b/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgPaymentTests.groovy index 09e422c3f8..9ebf148276 100644 --- a/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgPaymentTests.groovy +++ b/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgPaymentTests.groovy @@ -21,9 +21,13 @@ package org.apache.ofbiz.accounting import org.apache.ofbiz.entity.GenericValue import org.apache.ofbiz.entity.util.EntityQuery import org.apache.ofbiz.service.ServiceUtil -import org.apache.ofbiz.testtools.GroovyScriptTestCase +import org.apache.ofbiz.service.testtools.OFBizTestCase + +class AutoAcctgPaymentTests extends OFBizTestCase { + public AutoAcctgPaymentTests(String name) { + super(name) + } -class AutoAcctgPaymentTests extends GroovyScriptTestCase { void testCreatePayment() { Map serviceCtx = [:] serviceCtx.paymentTypeId = 'CUSTOMER_PAYMENT' diff --git a/applications/content/src/main/groovy/org/apache/ofbiz/content/ContentTests.groovy b/applications/content/src/main/groovy/org/apache/ofbiz/content/ContentTests.groovy index 9f18e2bd02..aaa5ef64d6 100644 --- a/applications/content/src/main/groovy/org/apache/ofbiz/content/ContentTests.groovy +++ b/applications/content/src/main/groovy/org/apache/ofbiz/content/ContentTests.groovy @@ -22,9 +22,13 @@ import org.apache.ofbiz.base.util.UtilDateTime import org.apache.ofbiz.entity.GenericValue import org.apache.ofbiz.entity.util.EntityQuery import org.apache.ofbiz.service.ServiceUtil -import org.apache.ofbiz.testtools.GroovyScriptTestCase +import org.apache.ofbiz.service.testtools.OFBizTestCase + +class ContentTests extends OFBizTestCase { + public ContentTests(String name) { + super(name) + } -class ContentTests extends GroovyScriptTestCase { void testGetDataResource() { Map serviceCtx = [:] serviceCtx.dataResourceId = 'TEST_RESOURCE' diff --git a/applications/order/src/main/groovy/org/apache/ofbiz/order/OrderTests.groovy b/applications/order/src/main/groovy/org/apache/ofbiz/order/OrderTests.groovy index 8be892223a..c34c7ec9b2 100644 --- a/applications/order/src/main/groovy/org/apache/ofbiz/order/OrderTests.groovy +++ b/applications/order/src/main/groovy/org/apache/ofbiz/order/OrderTests.groovy @@ -20,9 +20,13 @@ package org.apache.ofbiz.order import org.apache.ofbiz.entity.util.EntityQuery import org.apache.ofbiz.service.ServiceUtil -import org.apache.ofbiz.testtools.GroovyScriptTestCase +import org.apache.ofbiz.service.testtools.OFBizTestCase + +class OrderTests extends OFBizTestCase { + public OrderTests(String name) { + super(name) + } -class OrderTests extends GroovyScriptTestCase { void testAddRequirementTask() { Map serviceCtx = [ requirementId: '1000', diff --git a/applications/order/src/main/groovy/org/apache/ofbiz/order/QuoteTests.groovy b/applications/order/src/main/groovy/org/apache/ofbiz/order/QuoteTests.groovy index a4d3678cbc..34d0caba1e 100644 --- a/applications/order/src/main/groovy/org/apache/ofbiz/order/QuoteTests.groovy +++ b/applications/order/src/main/groovy/org/apache/ofbiz/order/QuoteTests.groovy @@ -18,7 +18,7 @@ */ package org.apache.ofbiz.order -import org.apache.ofbiz.testtools.GroovyScriptTestCase +import org.apache.ofbiz.service.testtools.OFBizTestCase import org.apache.ofbiz.order.shoppingcart.ShoppingCart import org.apache.ofbiz.entity.util.EntityQuery import org.apache.ofbiz.entity.GenericValue @@ -31,7 +31,10 @@ import static org.apache.ofbiz.base.util.UtilDateTime.nowTimestamp import static org.apache.ofbiz.entity.condition.EntityCondition.makeCondition import static org.apache.ofbiz.entity.condition.EntityComparisonOperator.GREATER_THAN_EQUAL_TO -class QuoteTests extends GroovyScriptTestCase { +class QuoteTests extends OFBizTestCase { + public QuoteTests(String name) { + super(name) + } // Retrieves a particular login record. private GenericValue getUserLogin(String userLoginId) { diff --git a/applications/order/src/main/groovy/org/apache/ofbiz/order/TestCustRequestPermissionCheck.groovy b/applications/order/src/main/groovy/org/apache/ofbiz/order/TestCustRequestPermissionCheck.groovy index 52f6eae88e..0a6c0bf3c8 100644 --- a/applications/order/src/main/groovy/org/apache/ofbiz/order/TestCustRequestPermissionCheck.groovy +++ b/applications/order/src/main/groovy/org/apache/ofbiz/order/TestCustRequestPermissionCheck.groovy @@ -21,9 +21,13 @@ package org.apache.ofbiz.order import org.apache.ofbiz.entity.GenericValue import org.apache.ofbiz.entity.util.EntityQuery import org.apache.ofbiz.service.ServiceUtil -import org.apache.ofbiz.testtools.GroovyScriptTestCase +import org.apache.ofbiz.service.testtools.OFBizTestCase + +class TestCustRequestPermissionCheck extends OFBizTestCase { + public TestCustRequestPermissionCheck(String name) { + super(name) + } -class TestCustRequestPermissionCheck extends GroovyScriptTestCase { void testCustRequestPermission() { Map serviceCtx = [:] serviceCtx.fromPartyId = 'Company' diff --git a/applications/party/src/main/groovy/org/apache/ofbiz/party/ContactMechWorkerTests.groovy b/applications/party/src/main/groovy/org/apache/ofbiz/party/ContactMechWorkerTests.groovy index dd7147cc9e..3912f69a1c 100644 --- a/applications/party/src/main/groovy/org/apache/ofbiz/party/ContactMechWorkerTests.groovy +++ b/applications/party/src/main/groovy/org/apache/ofbiz/party/ContactMechWorkerTests.groovy @@ -20,9 +20,12 @@ package org.apache.ofbiz.party import org.apache.ofbiz.base.util.UtilDateTime import org.apache.ofbiz.party.contact.ContactMechWorker -import org.apache.ofbiz.testtools.GroovyScriptTestCase +import org.apache.ofbiz.service.testtools.OFBizTestCase -class ContactMechWorkerTests extends GroovyScriptTestCase { +class ContactMechWorkerTests extends OFBizTestCase { + public ContactMechWorkerTests(String name) { + super(name) + } void testPartyContactMechResolution() { //control for the DemoCustomer that postal, email, telecom and ftp contact are present and return correct information diff --git a/applications/product/src/main/groovy/org/apache/ofbiz/product/ProductFeatureTypeTests.groovy b/applications/product/src/main/groovy/org/apache/ofbiz/product/ProductFeatureTypeTests.groovy index fb7b430154..ad3c061a77 100644 --- a/applications/product/src/main/groovy/org/apache/ofbiz/product/ProductFeatureTypeTests.groovy +++ b/applications/product/src/main/groovy/org/apache/ofbiz/product/ProductFeatureTypeTests.groovy @@ -21,9 +21,13 @@ package org.apache.ofbiz.product import org.apache.ofbiz.entity.GenericValue import org.apache.ofbiz.entity.util.EntityQuery import org.apache.ofbiz.service.ServiceUtil -import org.apache.ofbiz.testtools.GroovyScriptTestCase +import org.apache.ofbiz.service.testtools.OFBizTestCase + +class ProductFeatureTypeTests extends OFBizTestCase { + public ProductFeatureTypeTests(String name) { + super(name) + } -class ProductFeatureTypeTests extends GroovyScriptTestCase { void testCreateProductFeatureType() { Map serviceCtx = [:] serviceCtx.productFeatureTypeId = 'testProdFeat' diff --git a/applications/product/src/main/groovy/org/apache/ofbiz/product/ProductPromoActionTests.groovy b/applications/product/src/main/groovy/org/apache/ofbiz/product/ProductPromoActionTests.groovy index ac0dd23eb9..72cbf8fdaf 100644 --- a/applications/product/src/main/groovy/org/apache/ofbiz/product/ProductPromoActionTests.groovy +++ b/applications/product/src/main/groovy/org/apache/ofbiz/product/ProductPromoActionTests.groovy @@ -27,7 +27,7 @@ import org.apache.ofbiz.entity.util.EntityQuery import org.apache.ofbiz.order.shoppingcart.CheckOutHelper import org.apache.ofbiz.order.shoppingcart.ShoppingCart import org.apache.ofbiz.order.shoppingcart.ShoppingCartItem -import org.apache.ofbiz.testtools.GroovyScriptTestCase +import org.apache.ofbiz.service.testtools.OFBizTestCase import org.apache.ofbiz.order.shoppingcart.product.ProductPromoWorker import org.apache.ofbiz.order.shoppingcart.product.ProductPromoWorker.ActionResultInfo import org.apache.ofbiz.service.ServiceUtil @@ -35,7 +35,10 @@ import org.apache.ofbiz.service.ServiceUtil import java.sql.Timestamp import java.util.Map -class ProductPromoActionTest extends GroovyScriptTestCase { +class ProductPromoActionTest extends OFBizTestCase { + public ProductPromoActionTest(String name) { + super(name) + } ShoppingCart loadOrder(String orderId) { GenericValue permUserLogin = EntityQuery.use(delegator).from("UserLogin").where("userLoginId", "system").cache().queryOne() diff --git a/applications/product/src/main/groovy/org/apache/ofbiz/product/ProductPromoCondTests.groovy b/applications/product/src/main/groovy/org/apache/ofbiz/product/ProductPromoCondTests.groovy index 4f63dddcc9..d463530804 100644 --- a/applications/product/src/main/groovy/org/apache/ofbiz/product/ProductPromoCondTests.groovy +++ b/applications/product/src/main/groovy/org/apache/ofbiz/product/ProductPromoCondTests.groovy @@ -24,10 +24,13 @@ import org.apache.ofbiz.base.util.UtilMisc import org.apache.ofbiz.entity.GenericValue import org.apache.ofbiz.entity.util.EntityQuery import org.apache.ofbiz.order.shoppingcart.ShoppingCart -import org.apache.ofbiz.testtools.GroovyScriptTestCase +import org.apache.ofbiz.service.testtools.OFBizTestCase import org.apache.ofbiz.service.ServiceUtil -class ProductPromoCondTest extends GroovyScriptTestCase { +class ProductPromoCondTest extends OFBizTestCase { + public ProductPromoCondTest(String name) { + super(name) + } Map prepareConditionMap(ShoppingCart cart, String condValue) { return prepareConditionMap(cart, condValue, false) diff --git a/applications/product/src/main/groovy/org/apache/ofbiz/product/ProductTests.groovy b/applications/product/src/main/groovy/org/apache/ofbiz/product/ProductTests.groovy index 00acb0abcb..6931b439e1 100644 --- a/applications/product/src/main/groovy/org/apache/ofbiz/product/ProductTests.groovy +++ b/applications/product/src/main/groovy/org/apache/ofbiz/product/ProductTests.groovy @@ -22,9 +22,13 @@ import org.apache.ofbiz.base.util.UtilDateTime import org.apache.ofbiz.entity.GenericValue import org.apache.ofbiz.entity.util.EntityQuery import org.apache.ofbiz.service.ServiceUtil -import org.apache.ofbiz.testtools.GroovyScriptTestCase +import org.apache.ofbiz.service.testtools.OFBizTestCase + +class ProductTests extends OFBizTestCase { + public ProductTests(String name) { + super(name) + } -class ProductTests extends GroovyScriptTestCase { void testUpdateProductCategory() { Map serviceCtx = [:] serviceCtx.categoryName = 'Updated Test Product Category' diff --git a/framework/base/src/main/groovy/org/apache/ofbiz/base/SimpleTests.groovy b/framework/base/src/main/groovy/org/apache/ofbiz/base/SimpleTests.groovy deleted file mode 100644 index ac0f212f43..0000000000 --- a/framework/base/src/main/groovy/org/apache/ofbiz/base/SimpleTests.groovy +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - *******************************************************************************/ -package org.apache.ofbiz.base - -import org.apache.ofbiz.testtools.GroovyScriptTestCase - -class BaseTest extends GroovyScriptTestCase { - void testTrue() { - assert 1, 1 - } - - void testFalse() { - assertNotSame 1, 0 - } - - void testDelegator() { - assert delegator - } - - void testDispatcher() { - assert dispatcher - } - - void testSecurity() { - assert security - } -} diff --git a/framework/testtools/dtd/test-suite.xsd b/framework/testtools/dtd/test-suite.xsd index e9ee0e2372..04ffbf1d18 100644 --- a/framework/testtools/dtd/test-suite.xsd +++ b/framework/testtools/dtd/test-suite.xsd @@ -84,28 +84,6 @@ under the License. - - - - Used for JUnit test suites written as a Groovy class. See http://groovy-lang.org/testing.html - - - - - - - - - - - - Give the location where is groovy file that contaions the test suite. - You can use a flexible url location like component://mycomponent/groovyScripts/test/MySuiteTest.groovy - - - - - diff --git a/framework/testtools/src/main/java/org/apache/ofbiz/testtools/GroovyScriptTestCase.java b/framework/testtools/src/main/java/org/apache/ofbiz/testtools/GroovyScriptTestCase.java deleted file mode 100644 index 27d8d364e4..0000000000 --- a/framework/testtools/src/main/java/org/apache/ofbiz/testtools/GroovyScriptTestCase.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - *******************************************************************************/ -package org.apache.ofbiz.testtools; - -import groovy.util.GroovyTestCase; -import org.apache.ofbiz.entity.Delegator; -import org.apache.ofbiz.security.Security; -import org.apache.ofbiz.service.LocalDispatcher; - -public class GroovyScriptTestCase extends GroovyTestCase { - - public Delegator delegator; - public LocalDispatcher dispatcher; - public Security security; - - public void setDelegator(Delegator delegator) { - this.delegator = delegator; - } - public Delegator getDelegator() { - return delegator; - } - - public LocalDispatcher getDispatcher() { - return dispatcher; - } - public void setDispatcher(LocalDispatcher dispatcher) { - this.dispatcher = dispatcher; - } - public void setSecurity(Security security) { - this.security = security; - } - public Security getSecurity() { - return security; - } -} diff --git a/framework/testtools/src/main/java/org/apache/ofbiz/testtools/ModelTestSuite.java b/framework/testtools/src/main/java/org/apache/ofbiz/testtools/ModelTestSuite.java index 04bef6925c..718b5086fe 100644 --- a/framework/testtools/src/main/java/org/apache/ofbiz/testtools/ModelTestSuite.java +++ b/framework/testtools/src/main/java/org/apache/ofbiz/testtools/ModelTestSuite.java @@ -106,14 +106,6 @@ public class ModelTestSuite { String errMsg = "Unable to load test suite class : " + className; Debug.logError(e, errMsg, module); } - } else if ("groovy-test-suite".equals(nodeName)) { - try { - Class testClass = - UtilGenerics.cast(GroovyUtil.getScriptClassFromLocation(testElement.getAttribute("location"))); - this.testList.add(new TestSuite(testClass, testElement.getAttribute("name"))); - } catch (GeneralException e) { - Debug.logError(e, module); - } } else if ("service-test".equals(nodeName)) { this.testList.add(new ServiceTest(caseName, testElement)); } else if ("simple-method-test".equals(nodeName)) { @@ -188,10 +180,6 @@ public class ModelTestSuite { if (test instanceof OFBizTestCase) { ((OFBizTestCase)test).setDispatcher(dispatcher); } - } else if (test instanceof GroovyScriptTestCase) { - ((GroovyScriptTestCase)test).setDelegator(delegator); - ((GroovyScriptTestCase)test).setDispatcher(dispatcher); - ((GroovyScriptTestCase)test).setSecurity(dispatcher.getSecurity()); } } }