Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-5906

The <delete> action in <entity-engine-xml> definitions throw an error in tests

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Release Branch 12.04, Release Branch 13.07, Trunk
    • Fix Version/s: 14.12.01, 12.04.06, 13.07.02
    • Component/s: framework
    • Labels:
      None

      Description

      While running a test with test data defined with a <delete> inside I got thses errors:

      2014-10-28 15:21:22,155 |main                 |GenericDelegator              |E| Error getting entity definition from model
      org.ofbiz.entity.GenericModelException: Could not find definition for entity name delete
      	at org.ofbiz.entity.model.ModelReader.getModelEntity(ModelReader.java:489) ~[ofbiz-entity.jar:?]
      	at org.ofbiz.entity.GenericDelegator.getModelEntity(GenericDelegator.java:405) [ofbiz-entity.jar:?]
      	at org.ofbiz.entity.GenericDelegator.makeValue(GenericDelegator.java:600) [ofbiz-entity.jar:?]
      	at org.ofbiz.entity.GenericDelegator.makeValue(GenericDelegator.java:2397) [ofbiz-entity.jar:?]
      	at org.ofbiz.entity.GenericDelegator.makeValues(GenericDelegator.java:2356) [ofbiz-entity.jar:?]
      	at org.ofbiz.entity.GenericDelegator.readXmlDocument(GenericDelegator.java:2327) [ofbiz-entity.jar:?]
      	at org.ofbiz.testtools.EntityXmlAssertTest.countTestCases(EntityXmlAssertTest.java:61) [ofbiz-testtools.jar:?]
      	at junit.framework.TestResult.startTest(TestResult.java:150) [junit-dep-4.10.jar:?]
      	at org.ofbiz.testtools.EntityXmlAssertTest.run(EntityXmlAssertTest.java:71) [ofbiz-testtools.jar:?]
      	at junit.framework.TestSuite.runTest(TestSuite.java:243) [junit-dep-4.10.jar:?]
      	at junit.framework.TestSuite.run(TestSuite.java:238) [junit-dep-4.10.jar:?]
      	at org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:147) [ofbiz-testtools.jar:?]
      	at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:237) [ofbiz-base.jar:?]
      	at org.ofbiz.base.start.Start.startStartLoaders(Start.java:341) [ofbiz.jar:?]
      	at org.ofbiz.base.start.Start.start(Start.java:367) [ofbiz.jar:?]
      	at org.ofbiz.base.start.Start.main(Start.java:135) [ofbiz.jar:?]
      2014-10-28 15:21:22,156 |main                 |ServiceTest                   |E| Error getting test case count
      java.lang.IllegalArgumentException: [GenericDelegator.makeValue] could not find entity for entityName: delete
      	at org.ofbiz.entity.GenericDelegator.makeValue(GenericDelegator.java:602) ~[ofbiz-entity.jar:?]
      	at org.ofbiz.entity.GenericDelegator.makeValue(GenericDelegator.java:2397) ~[ofbiz-entity.jar:?]
      	at org.ofbiz.entity.GenericDelegator.makeValues(GenericDelegator.java:2356) ~[ofbiz-entity.jar:?]
      	at org.ofbiz.entity.GenericDelegator.readXmlDocument(GenericDelegator.java:2327) ~[ofbiz-entity.jar:?]
      	at org.ofbiz.testtools.EntityXmlAssertTest.countTestCases(EntityXmlAssertTest.java:61) [ofbiz-testtools.jar:?]
      	at junit.framework.TestResult.startTest(TestResult.java:150) [junit-dep-4.10.jar:?]
      	at org.ofbiz.testtools.EntityXmlAssertTest.run(EntityXmlAssertTest.java:71) [ofbiz-testtools.jar:?]
      	at junit.framework.TestSuite.runTest(TestSuite.java:243) [junit-dep-4.10.jar:?]
      	at junit.framework.TestSuite.run(TestSuite.java:238) [junit-dep-4.10.jar:?]
      	at org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:147) [ofbiz-testtools.jar:?]
      	at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:237) [ofbiz-base.jar:?]
      	at org.ofbiz.base.start.Start.startStartLoaders(Start.java:341) [ofbiz.jar:?]
      	at org.ofbiz.base.start.Start.start(Start.java:367) [ofbiz.jar:?]
      	at org.ofbiz.base.start.Start.main(Start.java:135) [ofbiz.jar:?]
      

      This has no consequences AFAIK, but is a bit annoying...

      1. OFBIZ-5906.patch
        0.9 kB
        Divesh Dutta

        Activity

        Hide
        lektran Scott Gray added a comment -

        Having delete actions inside an xml assert test seems a bit strange, what would you expect it to assert for those records?

        Show
        lektran Scott Gray added a comment - Having delete actions inside an xml assert test seems a bit strange, what would you expect it to assert for those records?
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        It's in the data test part, not in the xml assert test. For instance you need to remove some data in some situations.

        Show
        jacques.le.roux Jacques Le Roux added a comment - It's in the data test part, not in the xml assert test. For instance you need to remove some data in some situations.
        Hide
        lektran Scott Gray added a comment -

        Ah okay, I didn't realize the loading is done as a test as well.

        Show
        lektran Scott Gray added a comment - Ah okay, I didn't realize the loading is done as a test as well.
        Hide
        diveshdut Divesh Dutta added a comment -

        Attached is the patch to fix this issue. Fix is referenced from EntityDataLoader.java.

        Data loading for xml data was working fine when <delete>,<create>, <create-update> tag were used . But these tags were not working when data was loaded at the time of running J-unit tests. So after researched that how data loading was working fine for simple data load.

        So commented the old way of reading XML document and used new way used in EntityDataLoader.java to parse the XML file.

        Show
        diveshdut Divesh Dutta added a comment - Attached is the patch to fix this issue. Fix is referenced from EntityDataLoader.java. Data loading for xml data was working fine when <delete>,<create>, <create-update> tag were used . But these tags were not working when data was loaded at the time of running J-unit tests. So after researched that how data loading was working fine for simple data load. So commented the old way of reading XML document and used new way used in EntityDataLoader.java to parse the XML file.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Thanks Divesh,

        Your patch is in
        trunk r1648668
        R13.07 r1648669
        R12.04 r1648670

        Show
        jacques.le.roux Jacques Le Roux added a comment - Thanks Divesh, Your patch is in trunk r1648668 R13.07 r1648669 R12.04 r1648670

          People

          • Assignee:
            jacques.le.roux Jacques Le Roux
            Reporter:
            jacques.le.roux Jacques Le Roux
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development