Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0035062 | Openbravo ERP | A. Platform | public | 2017-01-26 17:45 | 2017-03-15 20:18 |
|
Reporter | shuehner | |
Assigned To | alostale | |
Priority | urgent | Severity | major | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | 3.0PR17Q2 | |
Merge Request Status | |
Review Assigned To | caristu |
OBNetwork customer | |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0035062: junit Weld tests not firing first 'begin transaction' event to DAL EventHandlers |
Description | Having an event Handler in DAL using onBeginTransaction & onCommitTransaction developer expects to always get alerted to both events in obivous order:
1.) begin
2.) end.
Which works fine in the application.
However when running junit tests extending WeldBaseTest the very first onBeginTransction event is missing causing functional errors if some custom EventHandler depends on this.
As EventHandler technically run on every flush that bug can be very visible like breaking 1.9k junit tests (indirectly).
Attached demo EventHandler is enough to show the problem.
|
Steps To Reproduce | - Add attached demo code to show the bug
- Run junit test 'CdiInfrastructure' in eclipse
- Check log4j output and see that very first begin event is missing
|
Proposed Solution | |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | defect | 0035060 | | closed | alostale | EntityPersistanceEventObservers are executed twice on commitAndClose |
|
Attached Files | InterceptorBugTest.java (1,924) 2017-01-26 17:45 https://issues.openbravo.com/file_download.php?file_id=10351&type=bug |
|
Issue History |
Date Modified | Username | Field | Change |
2017-01-26 17:45 | shuehner | New Issue | |
2017-01-26 17:45 | shuehner | Assigned To | => platform |
2017-01-26 17:45 | shuehner | Modules | => Core |
2017-01-26 17:45 | shuehner | Triggers an Emergency Pack | => No |
2017-01-26 17:45 | shuehner | File Added: InterceptorBugTest.java | |
2017-01-26 17:46 | shuehner | Note Added: 0093850 | |
2017-01-27 07:42 | alostale | Status | new => acknowledged |
2017-01-27 12:17 | alostale | Relationship added | related to 0035060 |
2017-01-27 12:18 | alostale | Status | acknowledged => scheduled |
2017-01-27 12:18 | alostale | Assigned To | platform => alostale |
2017-01-27 12:55 | alostale | Review Assigned To | => caristu |
2017-01-27 12:58 | hgbot | Checkin | |
2017-01-27 12:58 | hgbot | Note Added: 0093888 | |
2017-01-27 12:58 | hgbot | Status | scheduled => resolved |
2017-01-27 12:58 | hgbot | Resolution | open => fixed |
2017-01-27 12:58 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/d4172df7143364ddce691d43fe5bc083244e95a2 [^] |
2017-01-27 12:58 | hgbot | Checkin | |
2017-01-27 12:58 | hgbot | Note Added: 0093889 | |
2017-01-30 11:19 | hgbot | Checkin | |
2017-01-30 11:19 | hgbot | Note Added: 0093924 | |
2017-01-30 11:20 | caristu | Note Added: 0093925 | |
2017-01-30 11:20 | caristu | Status | resolved => closed |
2017-01-30 11:20 | caristu | Fixed in Version | => 3.0PR17Q2 |
2017-03-15 20:18 | hudsonbot | Checkin | |
2017-03-15 20:18 | hudsonbot | Note Added: 0095129 | |
2017-03-15 20:18 | hudsonbot | Checkin | |
2017-03-15 20:18 | hudsonbot | Note Added: 0095130 | |
2017-03-15 20:18 | hudsonbot | Checkin | |
2017-03-15 20:18 | hudsonbot | Note Added: 0095138 | |
Notes |
|
|
Possible cause: Interceptors are not setup or working properly at moment that very transaction is started. |
|
|
(0093888)
|
hgbot
|
2017-01-27 12:58
|
|
Repository: erp/devel/pi
Changeset: d4172df7143364ddce691d43fe5bc083244e95a2
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Jan 27 12:21:43 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/d4172df7143364ddce691d43fe5bc083244e95a2 [^]
fixed bug 35062: junit Weld tests not firing first 'begin transaction' event
This occurred in the 1st test case executed for each class because method
OBBaseTest.setUp was invoked before WeldBaseTest @Before method (because of
inheritance tree), this setUp method creates Dal transaction before WeldBaseTest
configured observers.
Fixed by enforcing correct execution order: 1st WeldBaseTest then OBBaseTest.
---
M modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/WeldBaseTest.java
---
|
|
|
(0093889)
|
hgbot
|
2017-01-27 12:58
|
|
Repository: erp/devel/pi
Changeset: 9faeff1d4b25469b52067d393e2d2ec23b691867
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Jan 27 12:22:42 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/9faeff1d4b25469b52067d393e2d2ec23b691867 [^]
realted to bug 35062: added test cases
---
M modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/testinfrastructure/DalPersistanceEventTest.java
M modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/event/ObserverBaseTest.java
M modules/org.openbravo.client.application/src-test/org/openbravo/client/application/test/event/OrderLineTestObserver.java
---
|
|
|
(0093924)
|
hgbot
|
2017-01-30 11:19
|
|
Repository: erp/devel/pi
Changeset: c2c0957f23d30f2356c8252f13f2ead617d5e6b7
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Mon Jan 30 11:18:40 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/c2c0957f23d30f2356c8252f13f2ead617d5e6b7 [^]
related to issue 35062: fix typo
---
M modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/testinfrastructure/DalPersistanceEventTest.java
---
|
|
|
|
Code review + testing OK: first 'begin transaction' event is now fired for classes extending WeldBaseTest. |
|
|
|
|
|
|
|
|
|
|