Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0032275 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
feature request | [Openbravo ERP] A. Platform | minor | N/A | 2016-02-18 14:50 | 2016-03-17 10:56 | |||
Reporter | alostale | View Status | public | |||||
Assigned To | alostale | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | 3.0PR16Q2 | |||
Status | closed | Fix in branch | Fixed in SCM revision | 06cd9c11c84e | ||||
Projection | none | ETA | none | Target Version | ||||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Merge Request Status | ||||||||
Review Assigned To | caristu | |||||||
OBNetwork customer | No | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0032275: jUnit: add capability to assert on logs | |||||||
Description | In some occasions, it is useful to create test cases to assert a concrete message is logged. Though this can be implemented by test, currently there is no a common API infrastructure to consume in order to achieve it. | |||||||
Steps To Reproduce | Suppose you want to test that some warn message is logged after doing some process. Ideally the test would look like: @Test public void unbalancedAdminModeShouldLogWarn() { setTestLogAppenderLevel(Level.WARN); OBContext.setAdminMode(true); OBContext.restorePreviousMode(); OBContext.restorePreviousMode(); // second restore is unbalanced assertThat(getTestLogAppender().getMessages(Level.WARN), hasItem(containsString("Unbalanced calls to setAdminMode"))); } Where 1st line sets the threshold for which messages are going to be tracked and the asset gets messages tracked since that point and checks there is a concrete one. | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
![]() |
|
![]() |
|
(0084323) hgbot (developer) 2016-02-18 14:55 |
Repository: erp/devel/pi Changeset: 06cd9c11c84e319330f31d8113426169b6da3e78 Author: Asier Lostalé <asier.lostale <at> openbravo.com> Date: Thu Feb 18 14:54:19 2016 +0100 URL: http://code.openbravo.com/erp/devel/pi/rev/06cd9c11c84e319330f31d8113426169b6da3e78 [^] fixed issue 32275: jUnit: add capability to assert on logs TestLogAppender can be used in test cases extending OBBaseTest to perform assertions on what is logged. --- M src-test/src/org/openbravo/test/base/OBBaseTest.java A src-test/src/org/openbravo/test/base/TestLogAppender.java --- |
(0084342) hgbot (developer) 2016-02-19 08:53 |
Repository: erp/devel/pi Changeset: 429009e5662e75381ad4ef7b5c645ac8a5bff1d9 Author: Carlos Aristu <carlos.aristu <at> openbravo.com> Date: Fri Feb 19 08:52:30 2016 +0100 URL: http://code.openbravo.com/erp/devel/pi/rev/429009e5662e75381ad4ef7b5c645ac8a5bff1d9 [^] related to issue 32275: fixes typo --- M src-test/src/org/openbravo/test/base/OBBaseTest.java --- |
(0084343) caristu (viewer) 2016-02-19 09:02 |
Verified |
(0085149) hudsonbot (viewer) 2016-03-17 10:56 |
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/b22fb0500156 [^] Maturity status: Test |
(0085150) hudsonbot (viewer) 2016-03-17 10:56 |
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/b22fb0500156 [^] Maturity status: Test |
![]() |
|||
Date Modified | Username | Field | Change |
2016-02-18 14:50 | alostale | New Issue | |
2016-02-18 14:50 | alostale | Assigned To | => alostale |
2016-02-18 14:50 | alostale | OBNetwork customer | => No |
2016-02-18 14:50 | alostale | Modules | => Core |
2016-02-18 14:50 | alostale | Triggers an Emergency Pack | => No |
2016-02-18 14:51 | alostale | Steps to Reproduce Updated | View Revisions |
2016-02-18 14:51 | alostale | Review Assigned To | => caristu |
2016-02-18 14:55 | hgbot | Checkin | |
2016-02-18 14:55 | hgbot | Note Added: 0084323 | |
2016-02-18 14:55 | hgbot | Status | new => resolved |
2016-02-18 14:55 | hgbot | Resolution | open => fixed |
2016-02-18 14:55 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/06cd9c11c84e319330f31d8113426169b6da3e78 [^] |
2016-02-19 08:53 | hgbot | Checkin | |
2016-02-19 08:53 | hgbot | Note Added: 0084342 | |
2016-02-19 09:02 | caristu | Note Added: 0084343 | |
2016-02-19 09:02 | caristu | Status | resolved => closed |
2016-02-19 09:02 | caristu | Fixed in Version | => 3.0PR16Q2 |
2016-03-17 10:56 | hudsonbot | Checkin | |
2016-03-17 10:56 | hudsonbot | Note Added: 0085149 | |
2016-03-17 10:56 | hudsonbot | Checkin | |
2016-03-17 10:56 | hudsonbot | Note Added: 0085150 |
Copyright © 2000 - 2009 MantisBT Group |