Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0032507Openbravo ERPA. Platformpublic2016-03-18 12:482016-06-17 19:36
alostale 
platform 
normaltrivialhave not tried
closedfixed 
5
 
3.0PR16Q2 
caristu
Core
No
0032507: NPE when executing GenerateComponentTest.testStaticResources test case
Whenever GenerateComponentTest.testStaticResources test case is executed a NPE is logged.
Run GenerateComponentTest.testStaticResources
  -> check log:

    [junit] 300809 [main] ERROR org.openbravo.client.kernel.StaticResourceComponent - Error generating component; null
    [junit] java.lang.NullPointerException
    [junit] at org.openbravo.client.kernel.StaticResourceComponent.generate(StaticResourceComponent.java:105)
    [junit] at org.openbravo.client.kernel.ComponentGenerator.generate(ComponentGenerator.java:65)
    [junit] at org.openbravo.client.kernel.freemarker.test.GenerateComponentTest.generateComponent(GenerateComponentTest.java:67)
    [junit] at org.openbravo.client.kernel.freemarker.test.GenerateComponentTest.testStaticResources(GenerateComponentTest.java:55)
No tags attached.
related to defect 0032506 closed platform GenerateComponentTest.testApplication test case is ignored 
Issue History
2016-03-18 12:48alostaleNew Issue
2016-03-18 12:48alostaleAssigned To => platform
2016-03-18 12:48alostaleModules => Core
2016-03-18 12:48alostaleTriggers an Emergency Pack => No
2016-03-18 12:48alostaleRelationship addedrelated to 0032506
2016-03-21 08:15hgbotCheckin
2016-03-21 08:15hgbotNote Added: 0085231
2016-03-21 08:15hgbotStatusnew => resolved
2016-03-21 08:15hgbotResolutionopen => fixed
2016-03-21 08:15hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/6406c7c2cfbeeeb675c7247648c655c10df80d80 [^]
2016-03-21 14:02hudsonbotCheckin
2016-03-21 14:02hudsonbotNote Added: 0085250
2016-03-22 19:32caristuReview Assigned To => caristu
2016-03-22 19:35caristuStatusresolved => closed
2016-03-22 19:35caristuFixed in Version => 3.0PR16Q2
2016-03-22 19:35caristuNote Added: 0085265
2016-04-13 08:39hgbotCheckin
2016-04-13 08:39hgbotNote Added: 0085581
2016-04-13 08:39hgbotStatusclosed => resolved
2016-04-13 08:39hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/6406c7c2cfbeeeb675c7247648c655c10df80d80 [^] => http://code.openbravo.com/erp/devel/pi/rev/05ad78bbb02e5a85cb378d5c8862ce7856494dac [^]
2016-04-13 08:40alostaleNote Added: 0085583
2016-04-13 08:40alostaleStatusresolved => closed
2016-06-17 19:36hudsonbotCheckin
2016-06-17 19:36hudsonbotNote Added: 0087441

Notes
(0085231)
hgbot   
2016-03-21 08:15   
Repository: erp/devel/pi
Changeset: 6406c7c2cfbeeeb675c7247648c655c10df80d80
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Mar 18 13:00:05 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/6406c7c2cfbeeeb675c7247648c655c10df80d80 [^]

fixed bug 32507: NPE when executing GenerateComponentTest.testStaticResources

  StaticResourcesComponent assumes there is a ServletContext to read templates
  based on it. As test is executed out of Tomcat there is no ServletContext,
  causing NPE.

  Fixed by mocking a ServletContext.

  Additionally ApplicationComponent assumes there is a session to get format values
  from causing also NPE when executing as test.

  Fixed by dealing with this case and returning an empty map.

---
M modules/org.openbravo.client.kernel/src-test/org/openbravo/client/kernel/freemarker/test/GenerateComponentTest.java
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/ApplicationComponent.java
---
(0085250)
hudsonbot   
2016-03-21 14:02   
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/ee80ac4a1a50 [^]
Maturity status: Test
(0085265)
caristu   
2016-03-22 19:35   
Verified
(0085581)
hgbot   
2016-04-13 08:39   
Repository: erp/devel/pi
Changeset: 05ad78bbb02e5a85cb378d5c8862ce7856494dac
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Mar 18 13:00:05 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/05ad78bbb02e5a85cb378d5c8862ce7856494dac [^]

fixed bug 32507: NPE when executing GenerateComponentTest.testStaticResources

  StaticResourcesComponent assumes there is a ServletContext to read templates
  based on it. As test is executed out of Tomcat there is no ServletContext,
  causing NPE.

  Fixed by mocking a ServletContext.

  Additionally ApplicationComponent assumes there is a session to get format values
  from causing also NPE when executing as test.

  Fixed by dealing with this case and returning an empty map.

---
M modules/org.openbravo.client.kernel/src-test/org/openbravo/client/kernel/freemarker/test/GenerateComponentTest.java
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/ApplicationComponent.java
---
(0085583)
alostale   
2016-04-13 08:40   
closing again: it was unintentionally reopened.
(0087441)
hudsonbot   
2016-06-17 19:36   
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/0dc7be081b1c [^]
Maturity status: Test