From derby-dev-return-97696-apmail-db-derby-dev-archive=db.apache.org@db.apache.org Wed Sep 5 21:29:05 2012 Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 634E9D6D9 for ; Wed, 5 Sep 2012 21:29:05 +0000 (UTC) Received: (qmail 49067 invoked by uid 500); 5 Sep 2012 21:29:05 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 49034 invoked by uid 500); 5 Sep 2012 21:29:05 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 49027 invoked by uid 99); 5 Sep 2012 21:29:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2012 21:29:05 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of david.myers.scibearspace@gmail.com designates 209.85.215.172 as permitted sender) Received: from [209.85.215.172] (HELO mail-ey0-f172.google.com) (209.85.215.172) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2012 21:28:57 +0000 Received: by eaai11 with SMTP id i11so355669eaa.31 for ; Wed, 05 Sep 2012 14:28:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=zhYYI0mcidQ/nH5lFtQuAzUgFTScJWjbY0xDaubbvXM=; b=0tNw0ipFQp1iKeuOP7+297TTYznAfyCFchc9jSWzmS2vpg6pbvUbckeuJMl2haqmUE OVUAjZHU/mZXyBsGGDWxeXTFKBYY/qQ/x/Mp+LPPVWFGj5iVwRWGFd/jXBBirCXZNfjA iwkt92c6SpVDDWWFmBjZ3dTXtKBAFKouZdKjz0CviQTiwY/G0LYWfRjEtQil6EJvul+8 +9vi8HdpntufyorFlGNRsBm/lVw03++KfY0SORqP7Vw604ASksSEVE4eW84lCTKItn7j 1n7JJmJpCNQqPIR+HjhaVr+gyr1kBuFdMytq97GanqWXbuC67N1tw/JS7yhdqpSyro4y R/IQ== Received: by 10.14.209.129 with SMTP id s1mr32735141eeo.24.1346880515818; Wed, 05 Sep 2012 14:28:35 -0700 (PDT) Received: from [192.168.1.10] (ALagny-153-1-46-134.w86-212.abo.wanadoo.fr. [86.212.253.134]) by mx.google.com with ESMTPS id u8sm350758eel.11.2012.09.05.14.28.33 (version=SSLv3 cipher=OTHER); Wed, 05 Sep 2012 14:28:34 -0700 (PDT) Message-ID: <5047C3FE.2000202@gmail.com> Date: Wed, 05 Sep 2012 23:28:30 +0200 From: david myers User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: derby-dev@db.apache.org Subject: Re: Derby Key Words References: <503EA7DA.8080804@gmail.com> <503F625B.7050009@oracle.com> <503F8E07.1020600@oracle.com> <5040B576.8040105@oracle.com> <50466AA7.2070309@gmail.com> <5046BC92.8010003@gmail.com> <5046D439.3030305@sbcglobal.net> In-Reply-To: <5046D439.3030305@sbcglobal.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 05/09/12 06:25, Katherine Marsden wrote: > On 9/4/2012 7:44 PM, Bryan Pendleton wrote: >>> I've had success in pointing Eclipse to the source code that I have >>> built. I have had a nice look around for the file that I am >>> interested in, which from the previously mentioned JIRA issues etc >>> suggest a file called sqlgrammar.jj >>> only problem is I can't find it! >> >> It's possible that Eclipse doesn't grok '.jj' files in its normal >> configuration. >> >> The file should be in your source tree as: >> >> ./java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj >> >> There is a compiler-generation tool that processes this file during >> the Ant build of Derby and generates Java source from the grammar. >> > The tool that generates the java code for the parser from > sqlgrammar.jj is Javacc. The generated code is in > generated/java/org/apache/derby/impl/sql/compile which is fun to look > at but shouldn't be changed. > I think there may be an exclipse plugin for javacc but I have never > used one. > > Kathey > > Hello again all, Sorry I hate to pollute the thread, but I want to ensure that I do things 'the apache way' and not just my way! So I need a little advice. First some info. The file as mentioned by Bryan has been located. Thanks to Kathey's pointer I have found the actual java file that is going to be of interest to me. The files that I think are going to be informative are: SQLParserConstants.java ~ this is the interface SQLParser ~ a class file that implements this interface is This file is found in Source Folder: generated/java/ package: org.apache.derby.impl.sql.compile So now it is a question of testing out my idea ! The interface has no methods, only static final "int" members. This leads me to a potential solution as follows: Create a method that has an inner class that implements the SQLParserConstants.java interface This inner class has a single method that grabs all of the members and inserts them into a arrayList - for "equal time access" to the values. We can then access this arrayList and compare a passed in value to determine if the value exists in the list. My first idea is to test the method within a test class, a good candidate for its location is the following I think. TestDbMetaData located in source folder java/test package ~ org.apache.derbyTesting.functionTests.tests.jdbc4 Or alternatively I can create a separate test class to test the idea (which would probably be my preference to start with, then once it works as I would like it to everything can be copied into a more sensible location. Once I have the method functioning I could add it into a specific package (probably databaseMetaData), then test it in situ. Does the above seem like a valid process? I have a few queries about the test suite. I have been using Junit4 from within eclipse, and I'm aware that you use Junit 3.8. I notice that with your test files you don't use annotations for the methods. With the exception of the setup and tear down methods, how do you control the flow through the test? In Junit 4 you place a <@Test> token on the line before the method if you want the method to run, along with annotations like <@before> if there are any that need to come before other stuff. Also my test classes have only really had 1 method I want to run at a time, so I just comment out the <@Test> annotation to effectively turn off the method. Please add your comments. David