[ 
https://issues.apache.org/jira/browse/OFBIZ-12985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17833144#comment-17833144
 ] 

Jacques Le Roux commented on OFBIZ-12985:
-----------------------------------------

I'm still working on it. I want to note here that I have also tried to not move 
the accounting Groovy test files but rather rename the location of 
InvoicePerShipmentTests.groovy in both build.gradle (after adding the file in 
sourceSets/test/groovy) and invoicetests.xml. The same issue arise than in 
comment above. Somehow we always get this error so far:

{noformat}
org.apache.ofbiz.base.start.StartupException: Cannot init() testtools-container 
(No tests found (accounting / invoicetests / invoice-per-shipment-tests))
        at 
org.apache.ofbiz.base.container.ContainerLoader.loadContainer(ContainerLoader.java:142)
        at 
org.apache.ofbiz.base.container.ContainerLoader.loadContainersFromConfigurations(ContainerLoader.java:104)
        at 
org.apache.ofbiz.base.container.ContainerLoader.load(ContainerLoader.java:74)
        at 
org.apache.ofbiz.base.start.StartupControlPanel.loadContainers(StartupControlPanel.java:146)
        at 
org.apache.ofbiz.base.start.StartupControlPanel.start(StartupControlPanel.java:70)
        at org.apache.ofbiz.base.start.Start.main(Start.java:89)
Caused by: org.apache.ofbiz.base.container.ContainerException: No tests found 
(accounting / invoicetests / invoice-per-shipment-tests)
        at 
org.apache.ofbiz.testtools.TestRunContainer.prepareJunitSuiteWrapper(TestRunContainer.java:133)
        at 
org.apache.ofbiz.testtools.TestRunContainer.init(TestRunContainer.java:72)
        at 
org.apache.ofbiz.base.container.ContainerLoader.loadContainer(ContainerLoader.java:140)
        ... 5 more

> Task :ofbiz --test component=accounting --test suitename=invoicetests --test 
> case=invoice-per-shipment-tests FAILED
{noformat}

It seems related to org.apache.xerces.parsers.DOMParser class but I'm not 
totally sure yet.
I don't think it's the reason but we call 
http://apache.org/xml/properties/dom/current-element-node in 
UtilXml::readXmlDocument (exactly in DOMParser creation). There is still a 
documentation referring to this URL at 
https://xerces.apache.org/xerces2-j/properties.html#dom.current-element-node.
But then why reading other XML documents works? Troubling and hard to debug.

> Groovy tests fail
> -----------------
>
>                 Key: OFBIZ-12985
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-12985
>             Project: OFBiz
>          Issue Type: Bug
>          Components: ALL APPLICATIONS, ALL PLUGINS
>    Affects Versions: Upcoming Branch
>            Reporter: Jacques Le Roux
>            Priority: Blocker
>             Fix For: Upcoming Branch
>
>
> Groovy testIntegration, tests suites and tests cases no longer work
> It seems testIntegrations work but when you look at the log you find a lot of 
> (46, barely same than number of files: 44, did not digg more) "Unable to load 
> test suite class" errors like this 1st one:
> {quote}
> |ModelTestSuite|E|Unable to load test suite class : 
> org.apache.ofbiz.party.PartyTests|
> {quote}
> You can find that in last ofbizTrunkFrameworkPlugins BB build: 
> [https://ci2.apache.org/#/builders/46/builds/777]
> The result seems successful. It's a misleading testIntegration result (not 
> sure what does that) and an already old one. TestIntegrations still work in 
> 18.12 and the issue is somehow related to OFBIZ-12813.
> It's a really confusing situation. Several issues prevent Groovy tests to 
> work.
> It has somehow already been commented in build.gradle by 
> [https://s.apache.org/7xsza]
> {quote}// Groovy tests often fail, because JUNIT does not have access to the 
> ofbiz enviroment.
> // If a groovy test is supposed to be tested this way, it can be added here.
> {quote}
> But has been neglected, certainly because of the misleading testIntegration 
> result .
> Moreover, do we really need to put all Groovy tests files there by hand (44) 
> as included, maybe similarly to excludedJavaSources in build.gradle (9 files)?
> The 1st reason is due to wrong Groovy tests package names and locations due 
> to OFBIZ-12813
> If we refer to our way of naming packages they are correctly referenced in 
> testdef (eg org.apache.ofbiz.accounting vs org.apache.accounting.accounting)
> So it's only a simple packages names and locations changes.
> After fixing the names and location of accounting Groovy tests, I have solely 
> added InvoicePerShipmentTests.groovy in sourceSets/test/groovy as suggested 
> by the comment in build.gradle referred above.
> {noformat}
> groovy {
>             srcDirs = 
> getDirectoryInActiveComponentsIfExists('src/test/groovy')
>             include 'org/apache/ofbiz/service/ModelServiceTest.groovy'
>             include 'org/apache/ofbiz/test/TestServices.groovy'
>             include 'org/apache/ofbiz/base/util/FileUtilTests.groovy'
>             include 
> 'org/apache/ofbiz/accounting/InvoicePerShipmentTests.groovy'
>         }
> {noformat} 
> But InvoicePerShipmentTests does not pass, yet....



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to