Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0039614Openbravo ERPA. Platformpublic2018-11-13 08:592018-12-11 20:22
alostale 
alostale 
normalminorrandom
closedfixed 
5
 
3.0PR19Q1 
caristu
Core
No
0039614: random unique constraint violation message
When a database unique constraint is violated, Openbravo produces a user readable message indicating for the table where the constraint is which are the columns that must be unique.

This message can sometimes not be accurate because the names columns are randomly picked from any element (AD_Element) with that same column name.
1. Execute org.openbravo.test.system.ErrorTextParserIntegrationTest.testUniqueSingleField()
  -> Randomly it can fail with:
org.junit.ComparisonFailure: expected:<...lient with the same [Name.] Name must be unique...> but was:<...lient with the same [Commercial Name. Commercial] Name must be unique...>
    at org.junit.Assert.assertEquals(Assert.java:115)
    at org.junit.Assert.assertEquals(Assert.java:144)
    at org.openbravo.test.system.ErrorTextParserIntegrationTest.doErrorTextParserTest(ErrorTextParserIntegrationTest.java:196)
    at org.openbravo.test.system.ErrorTextParserIntegrationTest.testUniqueSingleField(ErrorTextParserIntegrationTest.java:70)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)


  
No tags attached.
Issue History
2018-11-13 08:59alostaleNew Issue
2018-11-13 08:59alostaleAssigned To => platform
2018-11-13 08:59alostaleModules => Core
2018-11-13 08:59alostaleTriggers an Emergency Pack => No
2018-11-13 09:44alostaleAssigned Toplatform => alostale
2018-11-13 09:44alostaleStatusnew => acknowledged
2018-11-13 09:44alostaleReview Assigned To => caristu
2018-11-13 09:54hgbotCheckin
2018-11-13 09:54hgbotNote Added: 0107870
2018-11-13 09:54hgbotStatusacknowledged => resolved
2018-11-13 09:54hgbotResolutionopen => fixed
2018-11-13 09:54hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/6323b569fcbb097b412b21ca26e8b8530434c1f0 [^]
2018-11-27 12:17caristuNote Added: 0108122
2018-11-27 12:17caristuStatusresolved => closed
2018-11-27 12:17caristuFixed in Version => 3.0PR19Q1
2018-12-11 20:22hudsonbotCheckin
2018-12-11 20:22hudsonbotNote Added: 0108462

Notes
(0107870)
hgbot   
2018-11-13 09:54   
Repository: erp/devel/pi
Changeset: 6323b569fcbb097b412b21ca26e8b8530434c1f0
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Nov 13 09:24:05 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/6323b569fcbb097b412b21ca26e8b8530434c1f0 [^]

fixed bug 39614: random unique constraint violation message

  Get name to generate error message from actual element associated to the column
  in the table we are looking for instead of getting it from any element with that
  same name assuming it is unique.

---
M src/org/openbravo/erpCommon/utility/ErrorTextParser.java
M src/org/openbravo/erpCommon/utility/ErrorTextParserORACLE.java
M src/org/openbravo/erpCommon/utility/ErrorTextParser_data.xsql
---
(0108122)
caristu   
2018-11-27 12:17   
Reviewed
(0108462)
hudsonbot   
2018-12-11 20:22   
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/470e3cd384c5 [^]
Maturity status: Test