Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0024505Openbravo ERP00. Application dictionarypublic2013-08-07 13:412013-08-27 15:39
gorkaion 
AugustoMauch 
normalminorhave not tried
closedfixed 
20Gentoo
 
3.0MP27 
shankarb
Core
No
0024505: testADataAccessLevel fails with datasource based tables
The junit test testADataAccessLevel throws an error when there is an ad_table whose data origin is defined as DataSource.

    [junit] Testcase: testADataAccessLevel took 1.972 sec
    [junit] Caused an ERROR
    [junit] Exception when creating query from ManageVariants where (client = ?) and organization.id in ('0') and client.id in ('0') and active='Y'
    [junit] org.openbravo.base.exception.OBException: Exception when creating query from ManageVariants where (client = ?) and organization.id in ('0') and client.id in ('0') and active='Y'
    [junit] at org.openbravo.dal.service.OBQuery.createQuery(OBQuery.java:243)
    [junit] at org.openbravo.dal.service.OBQuery.list(OBQuery.java:115)
    [junit] at org.openbravo.test.security.AccessLevelTest.testADataAccessLevel(AccessLevelTest.java:168)
    [junit] at org.openbravo.test.base.BaseTest.runTest(BaseTest.java:306)
    [junit] Caused by: org.hibernate.hql.ast.QuerySyntaxException: ManageVariants is not mapped [from ManageVariants where (client = ?) and organization.id in ('0') and client.id in ('0') and active='Y' ]
    [junit] at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:180)
    [junit] at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:111)
    [junit] at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:93)
    [junit] at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:327)
    [junit] at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3441)
    [junit] at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3325)
    [junit] at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:733)
    [junit] at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:584)
    [junit] at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:301)
    [junit] at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:244)
    [junit] at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:254)
    [junit] at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:185)
    [junit] at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
    [junit] at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
    [junit] at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
    [junit] at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:124)
    [junit] at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
    [junit] at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
    [junit] at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1770)
    [junit] at org.openbravo.dal.service.OBQuery.createQuery(OBQuery.java:230)
Create a table based on a DataSource.

run the testADataAccessLevel test.
Attached a possible patch that ignores these entities. It has to be considered if an analogue test needs to be created to support this new type of tables.
No tags attached.
related to defect 00245143.0MP27 closed alostale Delete Client fails when the AD has Datasource based tables 
patch AccessLevelTestFix.patch (703) 2013-08-07 13:41
https://issues.openbravo.com/file_download.php?file_id=6318&type=bug
Issue History
2013-08-07 13:41gorkaionNew Issue
2013-08-07 13:41gorkaionAssigned To => AugustoMauch
2013-08-07 13:41gorkaionFile Added: AccessLevelTestFix.patch
2013-08-07 13:41gorkaionModules => Core
2013-08-07 13:41gorkaionTriggers an Emergency Pack => No
2013-08-07 13:46hgbotCheckin
2013-08-07 13:46hgbotNote Added: 0060529
2013-08-08 14:41alostaleRelationship addedrelated to 0024514
2013-08-16 20:31hudsonbotCheckin
2013-08-16 20:31hudsonbotNote Added: 0060631
2013-08-22 10:38AugustoMauchIssue Monitored: dbaz
2013-08-22 10:39AugustoMauchReview Assigned To => dbaz
2013-08-22 10:52hgbotCheckin
2013-08-22 10:52hgbotNote Added: 0060726
2013-08-22 10:55hgbotCheckin
2013-08-22 10:55hgbotNote Added: 0060727
2013-08-22 10:55hgbotStatusnew => resolved
2013-08-22 10:55hgbotResolutionopen => fixed
2013-08-22 10:55hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/63599aca768e315d6ba83b7811a12452784f3ed5 [^]
2013-08-22 18:17hudsonbotCheckin
2013-08-22 18:17hudsonbotNote Added: 0060735
2013-08-22 18:17hudsonbotCheckin
2013-08-22 18:17hudsonbotNote Added: 0060736
2013-08-27 08:46AugustoMauchReview Assigned Todbaz => shankarb
2013-08-27 15:39shankarbNote Added: 0060791
2013-08-27 15:39shankarbStatusresolved => closed
2013-08-27 15:39shankarbFixed in Version => 3.0MP27

Notes
(0060529)
hgbot   
2013-08-07 13:46   
Repository: erp/devel/pi
Changeset: be6378d2dd4a75927f37cb71fe217045494e57a9
Author: Gorka Ion Damián <gorkaion.damian <at> openbravo.com>
Date: Wed Aug 07 13:44:37 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/be6378d2dd4a75927f37cb71fe217045494e57a9 [^]

Related to issue 24505.Temporarily disable test.

---
M src-test/org/openbravo/test/security/AccessLevelTest.java
---
(0060631)
hudsonbot   
2013-08-16 20:31   
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/59a1180e7f4f [^]

Maturity status: Test
(0060726)
hgbot   
2013-08-22 10:52   
Repository: erp/devel/pi
Changeset: efc3e16e81164a55a7f3127d51cc13b933499912
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Aug 22 10:51:09 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/efc3e16e81164a55a7f3127d51cc13b933499912 [^]

Related to issue 24505: Fixes testADataAccessLevel test

The test testADataAccessLevel does not apply to entities based on datasources, because they are not associated with a database table.

---
M src-test/org/openbravo/test/security/AccessLevelTest.java
---
(0060727)
hgbot   
2013-08-22 10:55   
Repository: erp/devel/pi
Changeset: 63599aca768e315d6ba83b7811a12452784f3ed5
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Aug 22 10:55:03 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/63599aca768e315d6ba83b7811a12452784f3ed5 [^]

Fixes issue 24505: Enables testADataAccessLevel test

---
M src-test/org/openbravo/test/security/AccessLevelTest.java
---
(0060735)
hudsonbot   
2013-08-22 18:17   
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/7535642cd9cf [^]

Maturity status: Test
(0060736)
hudsonbot   
2013-08-22 18:17   
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/7535642cd9cf [^]

Maturity status: Test
(0060791)
shankarb   
2013-08-27 15:39   
Code reviewed and verified in pi changeset 327ce5aac264