Skip to content
Permalink
Browse files

Improved: Compile groovy integration tests

(OFBIZ-11165)

Since there is no need for dynamic reload for integration tests,
it is better to compile Groovy tests.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1865786 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed Aug 23, 2019
1 parent b8e9d04 commit 9b68a55d642489f487c9c978f772c0d6e00380b9
Showing with 55 additions and 35 deletions.
  1. +2 −2 ...ng/{groovyScripts/test → src/main/groovy/org/apache/ofbiz/accounting}/AutoAcctgBudgetTests.groovy
  2. +20 −7 ...g/{groovyScripts/test → src/main/groovy/org/apache/ofbiz/accounting}/AutoAcctgInvoiceTests.groovy
  3. +1 −1 ...ng/{groovyScripts/test → src/main/groovy/org/apache/ofbiz/accounting}/AutoAcctgLedgerTests.groovy
  4. +1 −1 ...vyScripts/test → src/main/groovy/org/apache/ofbiz/accounting}/AutoAcctgPaymentGatewayTests.groovy
  5. +1 −1 ...g/{groovyScripts/test → src/main/groovy/org/apache/ofbiz/accounting}/AutoAcctgPaymentTests.groovy
  6. +5 −5 applications/accounting/testdef/accountingtests.xml
  7. +2 −2 ...tions/content/{groovyScripts/test → src/main/groovy/org/apache/ofbiz/content}/ContentTests.groovy
  8. +1 −1 applications/content/testdef/ContentTests.xml
  9. +2 −1 applications/order/{groovyScripts/test → src/main/groovy/org/apache/ofbiz/order}/OrderTests.groovy
  10. +1 −0 applications/order/{groovyScripts/test → src/main/groovy/org/apache/ofbiz/order}/QuoteTests.groovy
  11. +1 −1 ...cripts/order/test → src/main/groovy/org/apache/ofbiz/order}/TestCustRequestPermissionCheck.groovy
  12. +1 −1 applications/order/testdef/CustRequestTests.xml
  13. +1 −1 applications/order/testdef/OrderTest.xml
  14. +1 −1 applications/order/testdef/QuoteTests.xml
  15. +1 −0 ...party/{groovyScripts/test → src/main/groovy/org/apache/ofbiz/party}/ContactMechWorkerTests.groovy
  16. +1 −1 applications/party/testdef/PartyContactMechTests.xml
  17. +1 −1 ...vyScripts/product/test → src/main/groovy/org/apache/ofbiz/product}/ProductFeatureTypeTests.groovy
  18. +1 −0 ...vyScripts/product/test → src/main/groovy/org/apache/ofbiz/product}/ProductPromoActionTests.groovy
  19. +2 −0 ...oovyScripts/product/test → src/main/groovy/org/apache/ofbiz/product}/ProductPromoCondTests.groovy
  20. +1 −1 ...tions/product/{groovyScripts/test → src/main/groovy/org/apache/ofbiz/product}/ProductTests.groovy
  21. +2 −3 applications/product/testdef/ProductPromoTests.xml
  22. +3 −3 applications/product/testdef/ProductTest.xml
  23. +2 −0 framework/base/{groovyScripts/test → src/main/groovy/org/apache/ofbiz/base}/SimpleTests.groovy
  24. +1 −1 framework/base/testdef/basetests.xml
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*******************************************************************************/

package org.apache.ofbiz.accounting

import org.apache.ofbiz.entity.GenericValue
import org.apache.ofbiz.entity.util.EntityQuery
@@ -49,4 +49,4 @@ class AutoAcctgBudgetTests extends GroovyScriptTestCase {
assert ! budgetStatuses?.isEmpty()
assert budgetStatuses[0].statusId == 'BG_APPROVED'
}
}
}
@@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.ofbiz.accounting

import org.apache.ofbiz.base.util.UtilDateTime
import org.apache.ofbiz.entity.GenericValue
@@ -24,15 +25,27 @@ import org.apache.ofbiz.service.ServiceUtil
import org.apache.ofbiz.testtools.GroovyScriptTestCase
class AutoAcctgInvoiceTests extends GroovyScriptTestCase {
void testCreateInvoiceContent() {
Map serviceCtx = [:]
serviceCtx.invoiceId = '1008'
serviceCtx.contentId = '1000'
serviceCtx.invoiceContentTypeId = 'COMMENTS'
serviceCtx.fromDate = UtilDateTime.nowTimestamp()
serviceCtx.userLogin = EntityQuery.use(delegator).from('UserLogin').where('userLoginId', 'system').cache().queryOne()
def userLogin = EntityQuery.use(delegator).from('UserLogin')
.where('userLoginId', 'system')
.cache()
.queryOne()

Map serviceCtx = [
invoiceId: '1008',
contentId: '1000',
invoiceContentTypeId: 'COMMENTS',
fromDate: UtilDateTime.nowTimestamp(),
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync('createInvoiceContent', serviceCtx)
assert ServiceUtil.isSuccess(serviceResult)
GenericValue InvoiceContent = EntityQuery.use(delegator).from('InvoiceContent').where('invoiceId', serviceResult.invoiceId, 'contentId', serviceResult.contentId, 'invoiceContentTypeId', serviceResult.invoiceContentTypeId, 'fromDate',UtilDateTime.nowTimestamp()).queryList()

GenericValue invoiceContent = EntityQuery.use(delegator).from('InvoiceContent')
.where('invoiceId', serviceResult.invoiceId,
'contentId', serviceResult.contentId,
'invoiceContentTypeId', serviceResult.invoiceContentTypeId)
.queryFirst()

assert invoiceContent.contentId == serviceResult.contentId
}
}
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*******************************************************************************/

package org.apache.ofbiz.accounting

import org.apache.ofbiz.base.util.UtilDateTime
import org.apache.ofbiz.entity.GenericValue
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*******************************************************************************/

package org.apache.ofbiz.accounting

import org.apache.ofbiz.entity.GenericValue
import org.apache.ofbiz.entity.util.EntityQuery
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*******************************************************************************/

package org.apache.ofbiz.accounting

import org.apache.ofbiz.entity.GenericValue
import org.apache.ofbiz.entity.util.EntityQuery
@@ -43,7 +43,7 @@
<simple-method-test location="component://accounting/minilang/test/AutoAcctgAgreementTests.xml"/>
</test-case>
<test-case case-name="auto-accounting-budget-tests">
<groovy-test-suite location="component://accounting/groovyScripts/test/AutoAcctgBudgetTests.groovy"/>
<junit-test-suite class-name="org.apache.ofbiz.accounting.AutoAcctgBudgetTests"/>
</test-case>
<test-case case-name="auto-accounting-cost-tests">
<simple-method-test location="component://accounting/minilang/test/AutoAcctgCostTests.xml"/>
@@ -58,15 +58,15 @@
<simple-method-test location="component://accounting/minilang/test/AutoAcctgInvoiceTests.xml"/>
</test-case>
<test-case case-name="auto-accounting-invoice-tests">
<simple-method-test location="component://accounting/groovyScripts/test/AutoAcctgInvoiceTests.groovy"/>
<junit-test-suite class-name="org.apache.ofbiz.accounting.AutoAcctgInvoiceTests"/>
</test-case>
<test-case case-name="auto-accounting-payment-tests">
<groovy-test-suite location="component://accounting/groovyScripts/test/AutoAcctgPaymentTests.groovy"/>
<junit-test-suite class-name="org.apache.ofbiz.accounting.AutoAcctgPaymentTests"/>
</test-case>
<test-case case-name="auto-accounting-paymentgateway-tests">
<groovy-test-suite location="component://accounting/groovyScripts/test/AutoAcctgPaymentGatewayTests.groovy"/>
<junit-test-suite class-name="org.apache.ofbiz.accounting.AutoAcctgPaymentGatewayTests"/>
</test-case>
<test-case case-name="auto-accounting-ledger-tests">
<groovy-test-suite location="component://accounting/groovyScripts/test/AutoAcctgLedgerTests.groovy"/>
<junit-test-suite class-name="org.apache.ofbiz.accounting.AutoAcctgLedgerTests"/>
</test-case>
</test-suite>
@@ -16,15 +16,15 @@
* specific language governing permissions and limitations
* under the License.
*******************************************************************************/

package org.apache.ofbiz.content

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 ProductTests extends GroovyScriptTestCase {
class ContentTests extends GroovyScriptTestCase {
void testGetDataResource() {
Map serviceCtx = [:]
serviceCtx.dataResourceId = 'TEST_RESOURCE'
@@ -26,7 +26,7 @@
</test-case>

<test-case case-name="content-tests">
<groovy-test-suite location="component://content/groovyScripts/test/ContentTests.groovy"/>
<junit-test-suite class-name="org.apache.ofbiz.content.ContentTests"/>
</test-case>
</test-suite>

@@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.ofbiz.order

import org.apache.ofbiz.entity.util.EntityQuery
import org.apache.ofbiz.service.ServiceUtil
@@ -136,4 +137,4 @@ class OrderTests extends GroovyScriptTestCase {
Map serviceResult = dispatcher.runSync('checkCreateStockRequirementQoh', serviceCtx)
assert ServiceUtil.isSuccess(serviceResult)
}
}
}
@@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.ofbiz.order

import org.apache.ofbiz.testtools.GroovyScriptTestCase
import org.apache.ofbiz.order.shoppingcart.ShoppingCart
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*******************************************************************************/

package org.apache.ofbiz.order

import org.apache.ofbiz.entity.GenericValue
import org.apache.ofbiz.entity.util.EntityQuery
@@ -27,6 +27,6 @@ under the License.
</test-case>

<test-case case-name="test-cust-request-permission-check">
<groovy-test-suite location="component://order/groovyScripts/order/test/TestCustRequestPermissionCheck.groovy"/>
<junit-test-suite class-name="org.apache.ofbiz.order.TestCustRequestPermissionCheck"/>
</test-case>
</test-suite>
@@ -34,6 +34,6 @@ under the License.
<simple-method-test location="component://order/minilang/test/OrderTests.xml"/>
</test-case>
<test-case case-name="order-tests">
<groovy-test-suite location="component://order/groovyScripts/test/OrderTests.groovy"/>
<junit-test-suite class-name="org.apache.ofbiz.order.OrderTests"/>
</test-case>
</test-suite>
@@ -28,6 +28,6 @@ under the License.
<!-- <test-case case-name="quote-tests"> <simple-method-test location="component://order/minilang/test/QuoteTests.xml"/>
</test-case> -->
<test-case case-name="quoteTests">
<groovy-test-suite name="quoteTests" location="component://order/groovyScripts/test/QuoteTests.groovy"/>
<junit-test-suite class-name="org.apache.ofbiz.order.QuoteTests"/>
</test-case>
</test-suite>
@@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*******************************************************************************/
package org.apache.ofbiz.party

import org.apache.ofbiz.base.util.UtilDateTime
import org.apache.ofbiz.party.contact.ContactMechWorker
@@ -25,7 +25,7 @@
<entity-xml action="load" entity-xml-url="component://party/testdef/data/PartyContactMechTestData.xml"/>
</test-case>
<test-case case-name="ContactMechWorker-tests">
<groovy-test-suite name="contactMechWorker" location="component://party/groovyScripts/test/ContactMechWorkerTests.groovy"/>
<junit-test-suite className="org.apache.ofbiz.party.ContactMechWorkerTests"/>
</test-case>
<test-case case-name="partyContactMech-tests">
<simple-method-test location="component://party/minilang/test/PartyContactMechTests.xml"/>
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*******************************************************************************/

package org.apache.ofbiz.product

import org.apache.ofbiz.entity.GenericValue
import org.apache.ofbiz.entity.util.EntityQuery
@@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.ofbiz.product

import org.apache.ofbiz.base.util.Debug
import org.apache.ofbiz.base.util.UtilDateTime
@@ -16,6 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.ofbiz.product

import java.sql.Timestamp
import org.apache.ofbiz.base.util.UtilDateTime
import org.apache.ofbiz.base.util.UtilMisc
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*******************************************************************************/

package org.apache.ofbiz.product

import org.apache.ofbiz.base.util.UtilDateTime
import org.apache.ofbiz.entity.GenericValue
@@ -23,10 +23,9 @@
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">

<test-group case-name="product-Conditions-tests">
<groovy-test-suite name="prodCond" location="component://product/groovyScripts/product/test/ProductPromoCondTests.groovy"/>
<!--groovy-test-suite name="productPromoCondTests" location="component://product/groovyScripts/product/test/ProductPromoCondTests.groovy"/-->
<junit-test-suite class-name="org.apache.ofbiz.product.ProductPromoCondTests"/>
</test-group>
<test-group case-name="product-Action-tests">
<groovy-test-suite name="productPromoActionTests" location="component://product/groovyScripts/product/test/ProductPromoActionTests.groovy"/>
<junit-test-suite class-name="org.apache.ofbiz.product.ProductPromoActionTests"/>
</test-group>
</test-suite>
@@ -31,9 +31,9 @@ under the License.
</test-case>

<test-case case-name="product-tests">
<groovy-test-suite location="component://product/groovyScripts/test/ProductTests.groovy"/>
<junit-test-suite class-name="org.apache.ofbiz.product.ProductTests"/>
</test-case>
</test-suite> <test-case case-name="testCreateProductFeatureType">
<groovy-test-suite location="component://product/groovyScripts/product/test/ProductFeatureTypeTests.groovy"/>
<test-case case-name="testCreateProductFeatureType">
<junit-test-suite class-name="org.apache.ofbiz.product.ProductFeatureTypeTests"/>
</test-case>
</test-suite>
@@ -16,6 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*******************************************************************************/
package org.apache.ofbiz.base

import org.apache.ofbiz.testtools.GroovyScriptTestCase

class BaseTest extends GroovyScriptTestCase {
@@ -25,6 +25,6 @@
<junit-test-suite class-name="org.apache.ofbiz.base.util.test.UtilObjectTests"/>
<junit-test-suite class-name="org.apache.ofbiz.base.util.string.test.FlexibleStringExpanderTests"/>
<junit-test-suite class-name="org.apache.ofbiz.base.util.collections.test.FlexibleMapAccessorTests"/>
<groovy-test-suite name="simple" location="component://base/groovyScripts/test/SimpleTests.groovy"/>
<junit-test-suite class-name="org.apache.ofbiz.base.SimpleTests"/>
</test-group>
</test-suite>

0 comments on commit 9b68a55

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