/[Apache-SVN]
ViewVC logotype

Revision 1816335


Jump to revision: Previous Next
Author: nmalin
Date: Sat Nov 25 17:35:20 2017 UTC (6 years, 5 months ago)
Changed paths: 3
Log Message:
Implemented: Implement Groovy test in testtools (OFBIZ-9996)

With the minilang deprecation and the migration to groovy, I implemented on the ofbiz testtools the possibility to use groovy for write new integration test or convert current simple xml test.
Now you can define a new element as child of test-group on your xml test-suite file like
        <groovy-test-suite name=simple location=component://base/groovyScript/test/SimpleTests.groovy/>

To Write your test, you need to create a Groovy class that extends GroovyScriptTestCase class :
    import org.apache.ofbiz.testtools.GroovyScriptTestCase
    class BaseTest extends GroovyScriptTestCase {
        void testTrue() {
            assert 1, 1
        }
    }
All your function will execute as TestCase.

For more information on groovy specific testing language see http://groovy-lang.org/testing.html

At this time the OFBiz Groovy DSL isn't supported to write groovy test case but you have access to the delegator and the disphatcher as native class variable.

Changed paths

Path Details
Directoryofbiz/ofbiz-framework/trunk/framework/base/testdef/basetests.xml modified , text changed
Directoryofbiz/ofbiz-framework/trunk/framework/testtools/dtd/test-suite.xsd modified , text changed
Directoryofbiz/ofbiz-framework/trunk/framework/testtools/src/main/java/org/apache/ofbiz/testtools/ModelTestSuite.java modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26