Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-2947

Roo Integration Test generation fails - Data on demand issue with 2 attributes of same type

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 1.2.0.M1
    • Fix Version/s: 1.2.0.RELEASE
    • Component/s: TESTING
    • Labels:
      None

      Description

      Failure to generate an Integration test for an entity object that has 2 attributes of same custom data type in my example CurrencyAmount is defined with @Embeddable with 2 fields amount and currency, I get the following errors when I try to do anything on my entity, it fails to add any new field or generate Integration tests for this entity

      ~.domain.ccti.CreditTransferTxnInfo roo> test integration
      Created SRC_TEST_JAVA\com\acps\app\payments\core\domain\cc ti\CreditTransferTxnInfoDataOnDemand.java
      Created SRC_TEST_JAVA\com\acps\app\payments\core\domain\cc ti\CreditTransferTxnInfoIntegrationTest.java
      Undo create SRC_TEST_JAVA\com\acps\app\payments\core\domain\cc ti\CreditTransferTxnInfoIntegrationTest.java
      Undo create SRC_TEST_JAVA\com\acps\app\payments\core\domain\cc ti\CreditTransferTxnInfoDataOnDemand.java

      java.lang.IllegalArgumentException: Method 'setAmount' already defined in ITD (ITD target 'com.acps.app.payments.core.domain.ccti.CreditTran sferTxnInfoDataOnDemand_Roo_DataOnDemand'
      ~.domain.ccti.CreditTransferTxnInfo roo>

      My Class CreditTransferTxnInfo is listed here

      import com.acps.app.payments.core.domain.embed.CurrencyAmount;

      @RooJavaBean
      @RooToString
      @RooJpaEntity
      public class CreditTransferTxnInfo {

      @Size(max = 35)
      private String instructionId;

      @Size(max = 35)
      private String endToEndId;

      @Embedded
      private PaymentTypeInfo paymentTypeInfo;

      @Embedded
      @AttributeOverrides( {
      @AttributeOverride(name="amount", column = @Column(name="instructedAmount") ),
      @AttributeOverride(name="currencyCode", column = @Column(name="instructedAmount_currency") )
      } )
      private CurrencyAmount instructedAmount;

      @Embedded
      @AttributeOverrides(

      { @AttributeOverride(name="amount", column = @Column(name="equivalentAmount") ), @AttributeOverride(name="currencyCode", column = @Column(name="equivalentAmount_currency") ) } ) private CurrencyAmount equivalentAmount; }

      Here is the Definition of CurrencyAmount.java that defines amount and CurrencyCode

      @RooJavaBean
      @RooToString
      @Embeddable
      public class CurrencyAmount {
      private BigDecimal amount;

      @Size(max = 3)
      private String currencyCode;
      }

      Does Roo not support Generating DataOnDemand when there are different properties of same Type?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                stewarta Alan Stewart
                Reporter:
                duderk Ritesh Kirad
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: