Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 91621 invoked from network); 2 May 2008 19:56:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 May 2008 19:56:44 -0000 Received: (qmail 60662 invoked by uid 500); 2 May 2008 19:56:46 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 60639 invoked by uid 500); 2 May 2008 19:56:46 -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 60622 invoked by uid 99); 2 May 2008 19:56:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 May 2008 12:56:45 -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:56:09 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 908C1234C10E for ; Fri, 2 May 2008 12:52:55 -0700 (PDT) Message-ID: <351745397.1209757975577.JavaMail.jira@brutus> Date: Fri, 2 May 2008 12:52:55 -0700 (PDT) From: "Sandeep Shrivastava (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Created: (OPENJPA-588) Test for checking the absolute index of field metadata fails MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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 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.