Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0045839
TypeCategorySeverityReproducibilityDate SubmittedLast Update
design defect[Openbravo ERP] A. Platformminorhave not tried2021-02-03 16:052022-02-01 14:44
ReporteralostaleView Statuspublic 
Assigned ToTriage Platform Base 
PrioritynormalResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0045839: disabled jUnit tests execute @After method but not @Before

DescriptionWhen 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 ReproduceFind here [1] a simplified stack that reproduces the problem.

[1] https://gitlab.com/alo-issues/openbravo/-/snippets/2070275 [^]
Proposed SolutionTo be consistent with how tests are disabled programmatically with assumptions, both should be executed.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0045840 newTriage Platform Base Openbravo ERP MisfirePolicyTest fails when it's disabled by configuration 
related to defect 0048493 closedTriage Omni WMS Modules NPE executing tests if OBDOReservationTest is disabled 

-  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
Powered by Mantis Bugtracker