Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 92258 invoked from network); 2 May 2008 19:58:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 May 2008 19:58:47 -0000 Received: (qmail 62223 invoked by uid 500); 2 May 2008 19:58:49 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 62203 invoked by uid 500); 2 May 2008 19:58:48 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 62191 invoked by uid 99); 2 May 2008 19:58:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 May 2008 12:58:48 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 May 2008 19:58:03 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D772E234C10E for ; Fri, 2 May 2008 12:54:55 -0700 (PDT) Message-ID: <1118355523.1209758095880.JavaMail.jira@brutus> Date: Fri, 2 May 2008 12:54:55 -0700 (PDT) From: "Sandeep Shrivastava (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Updated: (OPENJPA-588) Test for checking the absolute index of field metadata fails In-Reply-To: <351745397.1209757975577.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-588?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sandeep Shrivastava updated OPENJPA-588: ---------------------------------------- Attachment: openjpa-1.1.0-SNAPSHOT-r422266-650703.patch Patch to set the index value on the FieldMetadata when reinitializing the fields array in the ClassMetaData class. > Test for checking the absolute index of field metadata fails > ------------------------------------------------------------ > > Key: OPENJPA-588 > URL: https://issues.apache.org/jira/browse/OPENJPA-588 > Project: OpenJPA > Issue Type: Bug > Reporter: Sandeep Shrivastava > Attachments: openjpa-1.1.0-SNAPSHOT-r422266-650703.patch > > Original Estimate: 24h > Remaining Estimate: 24h > > We have a JDO metadata test which checks for the absolute index positions for the entity fields that are returned by the getIndex method of the FieldMetaData. > In this test ,we have an entity class MetaTest1 > public class MetaTest1 { > // these should not be persistent > private static int staticField; > private final String finalField = null; > private transient char transientField; > private MetaTest4 metaTest4Field; > private MetaTest4[] metaTest4ArrayField; > private Object objectField; > private Long longWrapperField; > private double doubleField; > // persistent fields -- see metadata > private String stringField; > private Integer intWrapperField; > private int intField; > private MetaTest2 metaTest2Field; > private MetaTest2[] metaTest2ArrayField; > private int[] intArrayField; > public static class Inner { > private long longField; > } > } > In the test, we get the MetaDataRepository and from it the ClassMetaData, > then the FieldMetaData and so on. > The test fails at the line: > assertEquals(6, _metaTest1.getField('stringField').getIndex()); > Failure is : > [testlogic] junit.framework.AssertionFailedError: expected:<6> but was:<8> > [testlogic] at kodo.meta.TestClassMetaData.testAbsoluteFieldNumbering(TestClassMetaData.java:217) > [testlogic] at com.solarmetric.test.AbstractTestCase.run(AbstractTestCase.java:132) > The persistence mapping is defined in the JDO file > > > > > > > > > > > > > > > > > > > There is no metadata mapping available for the MetaTest2 class. Initially the metadata is populated using reflection and assigns index positions to metaTest2Field and metaTest4ArrayField fields. During resolution the FieldMetaData[] _fields is reset and when ClassMetadata.getDeclaredIndex() is called later it is reinitialized but we dont set the index value on the FieldMetadata once assigned and this fails the test as it does not get the expected value for the index for the stringField. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.