Announcement Announcement Module
Collapse
No announcement yet.
Integration Test - Data on demand issue with 2 attributes of same type Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Integration Test - Data on demand issue with 2 attributes of same type

    I'm trying to generate an Integration test for my object where I have 2 attributes of same custom data type CurrencyAmount, 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> field string --fieldName testField
    Cannot present nested annotations unless created by this classObject of class [org.springframework.roo.classpath.details.annotati ons.DefaultAnnotationMetadata] must be an instance of class org.springframework.roo.classpath.javaparser.detai ls.JavaParserAnnotationMetadataBuilder
    ~.domain.ccti.CreditTransferTxnInfo roo> field string --fieldName testField
    Cannot present nested annotations unless created by this classObject of class [org.springframework.roo.classpath.details.annotati ons.DefaultAnnotationMetadata] must be an instance of class org.springframework.roo.classpath.javaparser.detai ls.JavaParserAnnotationMetadataBuilder
    ~.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 is as follows
    import com.acps.app.payments.core.domain.embed.CurrencyAm ount;

    @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
    @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?

  • #2
    attaching the aj and java file for the object in this code

    Comment


    • #3
      Do I have to remove Roo due to its limitation on how it generates integration tests? Can someone advice if this is a roo limitation or something wrong in my usage of Roo?

      Comment


      • #4
        Your zip does not have the enums package and code so I can't test it. Use the Roo backup command and attach the zip

        Comment


        • #5
          complete project source is attached to re-create the issue

          roo> Updated SRC_MAIN_JAVA\com\acps\app\payments\core\domain\cc ti\CreditTransferTxnInfo_Roo_ToString.aj
          Updated SRC_MAIN_JAVA\com\acps\app\payments\core\domain\cc ti\CreditTransferTxnInfo_Roo_JavaBean.aj
          Method 'setAmount' already defined in ITD (ITD target 'com.acps.app.payments.core.domain.ccti.CreditTran sferTxnInfoDataOnDemand_Roo_DataOnDemand'

          Tried to delete and re-create the entity with roo entity command using -testAutomatically, so how adding the new Amount field results in an ITD error since the DataOnDemand is failing

          I could not attach the entire Project even from the Roo backup command as it was 271Kb size and the limitation on this forum is 97kb so I have attached all the Java sources and dropped the webapp since this is a problem with Java entity and integration test you should be able to re create the issue

          Thanks for your help, Please let me know at your earliest convenience since I'm stuck at the moment with this limitation

          Comment


          • #6
            This zip just has files with src\main\java\etc.. as part of the file names - no directories

            Please use the Roo backup command and attach that zip to a new Jira issue

            Comment


            • #7
              Do I need a separate account for jira to create a ROO jira issue?

              https://jira.springsource.org/browse/ROO

              this URL only lets me browse the existing issues as I don't have permission to create a new JIRA issue for Roo project

              Comment


              • #8
                I have created a jira issue for this problem and I have attached the roo backup copy of my project to the jira

                https://jira.springsource.org/browse/ROO-2947

                Comment

                Working...
                X