Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 56241 invoked from network); 10 Jul 2007 00:56:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jul 2007 00:56:29 -0000 Received: (qmail 92443 invoked by uid 500); 10 Jul 2007 00:56:28 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 92407 invoked by uid 99); 10 Jul 2007 00:56:28 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jul 2007 17:56:28 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jul 2007 17:56:24 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 81D42714159 for ; Mon, 9 Jul 2007 17:56:04 -0700 (PDT) Message-ID: <26590284.1184028964498.JavaMail.jira@brutus> Date: Mon, 9 Jul 2007 17:56:04 -0700 (PDT) From: "Craig Russell (JIRA)" To: jdo-dev@db.apache.org Subject: [jira] Commented: (JDO-507) Completeness test for persistent interface fails with annotations In-Reply-To: <8373241.1183420870553.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/JDO-507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12511304 ] Craig Russell commented on JDO-507: ----------------------------------- Here's a sample of the code needed to reflectively invoke methods: protected void setAddrid(Object obj, long addrid) { set (obj, addrid, "setAddrid"); } protected void set(Object obj, long value, String methodName) { Method method = getMethod(obj, methodName, long.class); invokeMethod(method, obj, value); } protected Map> classMethodMap = new HashMap>(); protected Method getMethod(Object obj, String methodName, Class parameterClass) { Class clazz = obj.getClass(); Map methodMap = classMethodMap.get(clazz); if (methodMap == null) { methodMap = new HashMap(); classMethodMap.put(clazz, methodMap); } Method result = methodMap.get(methodName); if (result == null) { try { result = clazz.getMethod(methodName, parameterClass); methodMap.put(methodName, result); } catch (NoSuchMethodException ex) { throw new RuntimeException("Unable to find method " + methodName + "in class " + clazz.getName(), ex); } } return result; } private void invokeMethod(Method method, Object obj, Object value) { try { method.invoke(obj, value); } catch (IllegalArgumentException ex) { throw ex; } catch (IllegalAccessException ex) { throw new RuntimeException("Illegal Access", ex); } catch (InvocationTargetException ex) { throw new RuntimeException("Invocation Target", ex); } } > Completeness test for persistent interface fails with annotations > ------------------------------------------------------------------ > > Key: JDO-507 > URL: https://issues.apache.org/jira/browse/JDO-507 > Project: JDO > Issue Type: Task > Components: tck2 > Affects Versions: JDO 2 maintenance release 1 > Reporter: Michelle Caisse > Attachments: jdo-507.patch > > > Annotations on persistent interfaces have not yet been implemented by jpox. I have added the test to configurations.list, so it gets run on any complete test run, but I have not yet added the classes to the list of jdo metadata files in project.properties because that causes enhancement to fail. Therefore, the test currently gives the following error: > [java] Class org.apache.jdo.tck.pc.companyAnnotatedDS.PICompany has field org.apache.jdo.tck.pc.companyAnnotatedDS.PICompany.address declared in MetaData, but this field doesnt exist in the class! > [java] org.jpox.metadata.InvalidMetaDataException: Class org.apache.jdo.tck.pc.companyAnnotatedDS.PICompany has field org.apache.jdo.tck.pc.companyAnnotatedDS.PICompany.address declared in MetaData, but this field doesnt exist in the cl > ass! > ... > When the feature is implemented, project.properties must be edited to include PI*.class in the list for enhancement. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.