openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpalache <ravi.palache...@oracle.com>
Subject Re: Running new test case after fixing src.
Date Fri, 10 Apr 2009 16:29:41 GMT

Hi Mike,

Both the suggestions are working.

Thanks again,
Ravi.


Hi Ravi,

That makes sense. When you do a maven build from the root directory maven
recurses into subdirectories. When you run a maven build from one of the
modules maven relies on the copy in your local repository-
(${user.home}/.m2/repository. Your changes won't be copied to the local
repository until you run mvn install.

So you could do something like this

# make changes
$ cd openjpa-kernel
$ mvn clean install   // repeat for each module that has changes
$ cd ..
$ cd openjpa-persistence-jdbc
$ mvn -Dtest=<<MyTest>> test

Or from the root directory run maven like this
$ mvn clean test -Dtest=<<MyTest>> -DfailIfNoTests=false

The first option will install just your changes to your local repository.
The second one will avoid the message from maven that stops the build if
there are no tests (and there wouldn't be any for openjpa-lib,
openjpa-kernel, etc.).

I use the second option. Actually I've enabled it by default by adding:
       <profile>
            <id>enable-no-tests</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <failIfNoTests>false</failIfNoTests>
            </properties>
        </profile>
in ${user.home}/.m2/settings.xml.

Either of the options above should work for you. If they don't I'll try to
be of more help.

-mike

On Fri, Apr 10, 2009 at 10:48 AM, rpalache <ravi.palacherla@oracle.com>wrote:

>
> Hi Mike,
>
> Thanks for your response.
>
> I ran mvn -o clean compile from "root directory" and
> mvn test -Dtest=<<new Test>> from openjpa-persistence-jdbc
>
> My changed source code (QueryCacheStoreQuery) is under openjpa-kernel.
>
> When I try to run mvn test -Dtest=<<new Test>> from  root (trunk) then it
> says "There are no tests to run."
>
> Thanks,
> Ravi.
>
>
> Hi Ravi,
>
> Short answer : no. You do not need to do mvn -o clean package every time.
>
> It sounds like the second time you ran mvn test -Dtest=<<newTest>> maven
> used the jars from your local repository instead of using your working
> copy.
> Did you run everything from the "root directory" of openjpa?
>
> -mike
>
> On Fri, Apr 10, 2009 at 10:19 AM, rpalache <ravi.palacherla@oracle.com
> >wrote:
>
> >
> > Hi All,
> >
> > I am working on a fix for openJPA issue.
> > I developed a test case to demonstrate the issue and I can break it with
> > downloaded trunk openJPA code.
> >
> > ran mvn test –Dtest=<<myNewTest>>
> >
> > I can see assertion failure, as expected.
> >
> > I modified the openjpa source code to fix the issue, added some debug
> > statements into it to see if my changed code is picked next time I run
> the
> > test case.
> >
> > I ran mvn –o clean compile
> >
> > Ran mvn test –Dtest=<<myNewTest>>
> >
> > I did not see the debug statement that I added in my class and also the
> > test case failed again with same assertion failures.
> >
> > Now I ran  mvn -o clean package (which takes almost 60mins+ ) and then
> ran
> > my test again , which ran successfully.
> >
> > Do I have to run the complete "mvn –o clean package" everytime I modified
> > source code ?
> >
> > Please help.
> >
> > Regards,
> > Ravi.
> > --
> > View this message in context:
> >
> http://n2.nabble.com/Running-new-test-case-after-fixing-src.-tp2616702p2616702.html
> > Sent from the OpenJPA Developers mailing list archive at Nabble.com.
> >
> >
>
>
>
> --
> View this message in context:
> http://n2.nabble.com/Running-new-test-case-after-fixing-src.-tp2616702p2616850.html
> Sent from the OpenJPA Developers mailing list archive at Nabble.com.
>
>



-- 
View this message in context: http://n2.nabble.com/Running-new-test-case-after-fixing-src.-tp2616702p2617034.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.


Mime
View raw message