Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-71925

Service Builder generates wrong integration tests if a column has "db-name" set

    Details

      Description

      Steps to reproduce the problem:

      1. unzip the attached hello-world.zip
      2. run ../gradlew deploy in hello-world-api and hello-world-service
      3. run ../gradlew testIntegration in hello-world-test

      FooPersistenceTest will fail with these stacktrace:

      java.lang.IllegalArgumentException: Unknown column name fooId_
      	at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.getColumnName(BasePersistenceImpl.java:459)
      	at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.appendOrderByComparator(BasePersistenceImpl.java:410)
      	at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.appendOrderByComparator(BasePersistenceImpl.java:389)
      	at hello.world.service.persistence.impl.FooPersistenceImpl.findAll(FooPersistenceImpl.java:2613)
      	at hello.world.service.persistence.impl.FooPersistenceImpl.findAll(FooPersistenceImpl.java:2563)
      	at hello.world.service.persistence.test.FooPersistenceTest.testFindAll(FooPersistenceTest.java:229)
      	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:50)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      	at org.jboss.arquillian.junit.Arquillian$8$1.invoke(Arquillian.java:370)
      	at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:60)
      	at sun.reflect.GeneratedMethodAccessor541.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
      ...
      

        Attachments

        1. ee-7.0.x.html
          3 kB
        2. hello-world.zip
          122 kB
        3. LPS-79215-failed on ee-7.0.x.png
          LPS-79215-failed on ee-7.0.x.png
          149 kB

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  2 years, 15 weeks ago

                  Packages

                  Version Package
                  7.0.0 DXP FP14
                  7.0.0 DXP SP3
                  7.0.3 CE GA4
                  7.0.X EE
                  7.1.X
                  Master