Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035076Openbravo ERPA. Platformpublic2017-01-30 09:202017-03-15 20:18
alostale 
alostale 
normalminorhave not tried
closedfixed 
5
 
3.0PR17Q2 
caristu
Core
No
0035076: if test leaves admin mode, following test cases fail
If a test extending ObserverBaseTest leaves context as admin, it expectedly fails. But the subsequent test cases fail also if they don't handle this situation.



- Add attached test cases: AdminModeHandleInTest
- Execute them
  -> 1st one correctly fails
  -> 2nd one shouldn't fail but it does

Note this test case cannot be included in standard suite as there is no way to prevent 1st one to fail as exception is thrown by TestWatcher after test finalization.
Following test cases shouldn't fail.
No tags attached.
related to defect 0035075 closed alostale PersistanceObserver can fail if other observers for OrderLine are present 
? AdminModeHandleInTest.java (543) 2017-01-30 09:21
https://issues.openbravo.com/file_download.php?file_id=10353&type=bug
Issue History
2017-01-30 09:20alostaleNew Issue
2017-01-30 09:20alostaleAssigned To => platform
2017-01-30 09:20alostaleModules => Core
2017-01-30 09:20alostaleTriggers an Emergency Pack => No
2017-01-30 09:20alostaleRelationship addedrelated to 0035075
2017-01-30 09:20alostaleReview Assigned To => caristu
2017-01-30 09:20alostaleAssigned Toplatform => alostale
2017-01-30 09:21alostaleFile Added: AdminModeHandleInTest.java
2017-01-30 09:24hgbotCheckin
2017-01-30 09:24hgbotNote Added: 0093915
2017-01-30 09:24hgbotStatusnew => resolved
2017-01-30 09:24hgbotResolutionopen => fixed
2017-01-30 09:24hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/a9768873924713fa9ae1a2fd704c766a97f70b1d [^]
2017-01-30 11:03caristuNote Added: 0093923
2017-01-30 11:03caristuStatusresolved => closed
2017-01-30 11:03caristuFixed in Version => 3.0PR17Q2
2017-03-15 20:18hudsonbotCheckin
2017-03-15 20:18hudsonbotNote Added: 0095136

Notes
(0093915)
hgbot   
2017-01-30 09:24   
Repository: erp/devel/pi
Changeset: a9768873924713fa9ae1a2fd704c766a97f70b1d
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Jan 30 09:23:12 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/a9768873924713fa9ae1a2fd704c766a97f70b1d [^]

fixed bug 35076: if test leaves admin mode, following test cases fail

  Restore previous mode when this situation occurs so that following test cases
  start in a clean situation.

---
M src-test/src/org/openbravo/test/base/OBBaseTest.java
---
(0093923)
caristu   
2017-01-30 11:03   
Code reviewed + testing OK: admin mode is reset properly, therefore 2nd test case does not fail.
(0095136)
hudsonbot   
2017-03-15 20:18   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/54e102bef53e [^]
Maturity status: Test