Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0045217Openbravo ERPY. DBSourceManagerpublic2020-10-14 08:482020-10-23 09:56
alostale 
alostale 
normalminorhave not tried
closedfixed 
5
 
 
Core
No
0045217: org.openbravo.dbsm.test.model.Functions.invalidFunctionIsIgnored fails in cli
When DBSM org.openbravo.dbsm.test.model.Functions.invalidFunctionIsIgnored() test is executed from cli it fails.

Note it works fine when executed from eclipse.
1. Execute org.openbravo.dbsm.test.model.Functions.invalidFunctionIsIgnored() from eclipse
  -> It works fine

2. Execute ant run.tests
ERROR:
    [junit] Testcase: invalidFunctionIsIgnored[DB: pg-10] took 0.024 sec
    [junit] FAILED
    [junit]
    [junit] Expected: not an empty collection
    [junit] but: was <[]>
    [junit] junit.framework.AssertionFailedError:
    [junit] Expected: not an empty collection
    [junit] but: was <[]>
    [junit] at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
    [junit] at org.openbravo.dbsm.test.model.Functions.invalidFunctionIsIgnored(Functions.java:105)
It might be related to incorrect TestLogAppender configuration when it's run in cli.
No tags attached.
related to defect 0045216 closed alostale dbsm tests have hardcoded super user 
related to feature request 0045222 closed alostale execute single dbsm test 
Issue History
2020-10-14 08:48alostaleNew Issue
2020-10-14 08:48alostaleAssigned To => platform
2020-10-14 08:48alostaleModules => Core
2020-10-14 08:48alostaleTriggers an Emergency Pack => No
2020-10-14 08:48alostaleRelationship addedrelated to 0045216
2020-10-14 10:18alostaleRelationship addedrelated to 0045222
2020-10-14 13:04shuehnerIssue Monitored: shuehner
2020-10-20 07:44hgbotNote Added: 0123787
2020-10-20 07:44alostaleAssigned Toplatform => alostale
2020-10-23 09:56hgbotNote Added: 0123900
2020-10-23 09:56hgbotResolutionopen => fixed
2020-10-23 09:56hgbotStatusnew => closed
2020-10-23 09:56hgbotNote Added: 0123901

Notes
(0123787)
hgbot   
2020-10-20 07:44   
Merge Request created: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/17 [^]
(0123900)
hgbot   
2020-10-23 09:56   
Merge request merged: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/17 [^]
(0123901)
hgbot   
2020-10-23 09:56   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/dbsm [^]
Changeset: 9557f35d0acf3b9bed18963bfb8e961f24de910c
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 2020-10-20T07:35:04+02:00
URL: https://gitlab.com/openbravo/product/dbsm/-/commit/9557f35d0acf3b9bed18963bfb8e961f24de910c [^]

fixed BUG-45217: Functions test fails in cli

When executing Functions test in cli it failed because the tests make
assertions on the log by using the appender defined in src-test/test/log4j2-test.xml.

This config file was not in the classpath therefore, the TestLogAppender
which is needed the test to properly run was not included.

To fix this:
 1. log4j2-test.xml is copied to the classpath at compile time
 2. Classpath for compilation and runtime has been split. Including in
    runtime OB classpath parts containing log4j config resulted in those
    overwriting dbsm test config. As those OB classpath parts are only
    needed to compile, 2 different classpaths can be used.

---
M src-test/build.xml
---