Skip to content
Permalink
Browse files

Improved: Remove useless ‘GroovyScriptTestCase’

(OFBIZ-11165)

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
  • Loading branch information
mthl committed Aug 23, 2019
1 parent 9b68a55 commit 9bc8ebb864f62f60561237bc6e7805f70130a4e9
Showing with 80 additions and 156 deletions.
  1. +6 −2 applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgBudgetTests.groovy
  2. +6 −2 applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgInvoiceTests.groovy
  3. +6 −2 applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgLedgerTests.groovy
  4. +6 −2 ...ations/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgPaymentGatewayTests.groovy
  5. +6 −2 applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgPaymentTests.groovy
  6. +6 −2 applications/content/src/main/groovy/org/apache/ofbiz/content/ContentTests.groovy
  7. +6 −2 applications/order/src/main/groovy/org/apache/ofbiz/order/OrderTests.groovy
  8. +5 −2 applications/order/src/main/groovy/org/apache/ofbiz/order/QuoteTests.groovy
  9. +6 −2 applications/order/src/main/groovy/org/apache/ofbiz/order/TestCustRequestPermissionCheck.groovy
  10. +5 −2 applications/party/src/main/groovy/org/apache/ofbiz/party/ContactMechWorkerTests.groovy
  11. +6 −2 applications/product/src/main/groovy/org/apache/ofbiz/product/ProductFeatureTypeTests.groovy
  12. +5 −2 applications/product/src/main/groovy/org/apache/ofbiz/product/ProductPromoActionTests.groovy
  13. +5 −2 applications/product/src/main/groovy/org/apache/ofbiz/product/ProductPromoCondTests.groovy
  14. +6 −2 applications/product/src/main/groovy/org/apache/ofbiz/product/ProductTests.groovy
  15. +0 −43 framework/base/src/main/groovy/org/apache/ofbiz/base/SimpleTests.groovy
  16. +0 −22 framework/testtools/dtd/test-suite.xsd
  17. +0 −51 framework/testtools/src/main/java/org/apache/ofbiz/testtools/GroovyScriptTestCase.java
  18. +0 −12 framework/testtools/src/main/java/org/apache/ofbiz/testtools/ModelTestSuite.java
@@ -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'
@@ -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')
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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',
@@ -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) {
@@ -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'
@@ -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
@@ -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'
@@ -27,15 +27,18 @@ 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

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()
@@ -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)
@@ -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'

This file was deleted.

@@ -84,28 +84,6 @@ under the License.
</xs:attribute>
</xs:attributeGroup>

<xs:element name="groovy-test-suite" substitutionGroup="TestCaseTypes">
<xs:annotation>
<xs:documentation>
Used for JUnit test suites written as a Groovy class. See http://groovy-lang.org/testing.html
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="attlist.groovy-test-suite"/>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="attlist.groovy-test-suite">
<xs:attribute type="xs:string" name="name"/>
<xs:attribute type="xs:string" name="location" use="required">
<xs:annotation>
<xs:documentation>
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
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>

<xs:element name="service-test" substitutionGroup="TestCaseTypes">
<xs:complexType>
<xs:attributeGroup ref="attlist.service-test"/>

This file was deleted.

@@ -106,14 +106,6 @@ private void parseTestElement(String caseName, Element testElement) {
String errMsg = "Unable to load test suite class : " + className;
Debug.logError(e, errMsg, module);
}
} else if ("groovy-test-suite".equals(nodeName)) {
try {
Class<? extends TestCase> 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 @@ private void prepareTest(Test test)
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());
}
}
}

0 comments on commit 9bc8ebb

Please sign in to comment.
You can’t perform that action at this time.