Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
ID | ||||||||||||
0045839 | ||||||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
design defect | [Openbravo ERP] A. Platform | minor | have not tried | 2021-02-03 16:05 | 2022-02-01 14:44 | |||||||
Reporter | alostale | View Status | public | |||||||||
Assigned To | Triage Platform Base | |||||||||||
Priority | normal | Resolution | open | Fixed in Version | ||||||||
Status | new | Fix in branch | Fixed in SCM revision | |||||||||
Projection | none | ETA | none | Target Version | ||||||||
OS | Any | Database | Any | Java version | ||||||||
OS Version | Database version | Ant version | ||||||||||
Product Version | SCM revision | |||||||||||
Review Assigned To | ||||||||||||
Web browser | ||||||||||||
Modules | Core | |||||||||||
Regression level | ||||||||||||
Regression date | ||||||||||||
Regression introduced in release | ||||||||||||
Regression introduced by commit | ||||||||||||
Triggers an Emergency Pack | No | |||||||||||
Summary | 0045839: disabled jUnit tests execute @After method but not @Before | |||||||||||
Description | When a jUnit test is disabled by config [1], its @After method is executed but not its @Before one. This can be problematic if @After assumes @Before was executed. The reason is the test is disabled in OBBaseTest @Before method execute assumeTrue(false), which causes the rest of @Before methods in the hierarchy not to be executed, but all @After methods are executed. [1] http://wiki.openbravo.com/wiki/How_to_create_JUnit_testcases#Skipping_test_cases [^] | |||||||||||
Steps To Reproduce | Find here [1] a simplified stack that reproduces the problem. [1] https://gitlab.com/alo-issues/openbravo/-/snippets/2070275 [^] | |||||||||||
Proposed Solution | To be consistent with how tests are disabled programmatically with assumptions, both should be executed. | |||||||||||
Tags | No tags attached. | |||||||||||
Attached Files | ||||||||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | |||||||||||||||||
|
Notes | |
(0134712) hgbot (developer) 2022-02-01 14:44 |
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.warehouse.advancedwarehouseoperations.distributionorders [^] Changeset: 2bda4a6c6accbebba0f5cd17b33c4fe733bbbfe3 Author: Asier Lostalé <asier.lostale@openbravo.com> Date: 27-01-2022 15:34:16 URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.warehouse.advancedwarehouseoperations.distributionorders/-/commit/2bda4a6c6accbebba0f5cd17b33c4fe733bbbfe3 [^] fixes BUG-48493: NPE executing tests if OBDOReservationTest is disabled Because of ISSUE-45839, @AfterClass is executed even if the test is disabled by configuration. Executing it without having executed the @Before caused a NPE. Now even the method is executed in case @Before was not executed, it does nothing preventing thus the NPE. --- M src-test/org/openbravo/warehouse/advancedwarehouseoperations/distributionorders/test/OBDOReservationTest.java --- |
Issue History | |||
Date Modified | Username | Field | Change |
2021-02-03 16:05 | alostale | New Issue | |
2021-02-03 16:05 | alostale | Assigned To | => platform |
2021-02-03 16:05 | alostale | Modules | => Core |
2021-02-03 16:05 | alostale | Triggers an Emergency Pack | => No |
2021-02-03 16:07 | shuehner | Issue Monitored: shuehner | |
2021-02-03 16:12 | alostale | Relationship added | related to 0045840 |
2022-01-25 11:47 | martinsdan | Issue Monitored: martinsdan | |
2022-01-27 14:57 | alostale | Relationship added | related to 0048493 |
2022-02-01 08:07 | alostale | Assigned To | platform => Triage Platform Base |
2022-02-01 14:44 | hgbot | Note Added: 0134712 |
Copyright © 2000 - 2009 MantisBT Group |