|
|
-
Including specific tests in the latest pom.xml
Ramakrishna S Vasudevan 0... 2011-10-06, 17:13
Hi
How should i add specific test case names that needs to be executed while running mvn tests. In the latest pom.xml we have <unittest.include>**/Test**.java</unittest.include>
Now if i try to add some 3 or 4 testcase name like stated below then only the last one in the list gets executed. <unittest.include>**/TestLogRolling*.java</unittest.include> <unittest.include>**/TestOpenRegionHandler*.java</unittest.include> <unittest.include>**/TestSplitTransaction*.java</unittest.include>
This is running only TestSplitTransaction.java
Previously <include>**/TestHLog.java</include> <include>**/TestMaster*.java</include> It was running only TestHLog and all testcases starting with TestMaster.
Am i missing something here? Any help is greatly appreciated.
Regards Ram
-
Re: Including specific tests in the latest pom.xml
Jesse Yates 2011-10-06, 18:00
Why are you attempting to add them to the pom? If you just put them in the right folder (src/test/java) and name them Test*.java (which you already have) then they will run fine - no pom mods necessary.
I think what you are doing just keeps overwriting the same maven variable (unittests.include) so when it goes to run the tests, the only pattern it knows to check is the bottom one.
You really should only be messing with pons for unit tests when there are tests that are failing that we want to exclude from the build. This is a super super rare case, so in general you don't need to worry about it.
Does that help?
- Jesse Yates
Sent from my iPhone.
On Oct 6, 2011, at 10:13 AM, Ramakrishna S Vasudevan 00902313 <[EMAIL PROTECTED]> wrote:
> Hi > > How should i add specific test case names that needs to be executed while running mvn tests. > In the latest pom.xml we have > <unittest.include>**/Test**.java</unittest.include> > > Now if i try to add some 3 or 4 testcase name like stated below then only the last one in the list gets executed. > <unittest.include>**/TestLogRolling*.java</unittest.include> > <unittest.include>**/TestOpenRegionHandler*.java</unittest.include> > <unittest.include>**/TestSplitTransaction*.java</unittest.include> > > This is running only TestSplitTransaction.java > > Previously <include>**/TestHLog.java</include> > <include>**/TestMaster*.java</include> > It was running only TestHLog and all testcases starting with TestMaster. > > Am i missing something here? Any help is greatly appreciated. > > Regards > Ram
-
Re: Including specific tests in the latest pom.xml
Ramakrishna S Vasudevan 0... 2011-10-06, 18:08
Hi Jesse Thanks for your immediate response. I could get what you are saying. But what i thought was few complex and important testcases i used to run as a set to see if they pass. So i used to do like that in the earlier pom.xml.
Any way to add only specified tests? May be am messing things around.
Ideally here we use that way to exclude tests. :)
Regards Ram
----- Original Message ----- From: Jesse Yates <[EMAIL PROTECTED]> Date: Thursday, October 6, 2011 11:30 pm Subject: Re: Including specific tests in the latest pom.xml To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> Why are you attempting to add them to the pom? If you just put them > in the right folder (src/test/java) and name them Test*.java (which > you already have) then they will run fine - no pom mods necessary. > > I think what you are doing just keeps overwriting the same maven > variable (unittests.include) so when it goes to run the tests, the > only pattern it knows to check is the bottom one. > > You really should only be messing with pons for unit tests when > there are tests that are failing that we want to exclude from the > build. This is a super super rare case, so in general you don't > need to worry about it. > > Does that help? > > - Jesse Yates > > Sent from my iPhone. > > On Oct 6, 2011, at 10:13 AM, Ramakrishna S Vasudevan 00902313 > <[EMAIL PROTECTED]> wrote: > > > Hi > > > > How should i add specific test case names that needs to be > executed while running mvn tests. > > In the latest pom.xml we have > > <unittest.include>**/Test**.java</unittest.include> > > > > Now if i try to add some 3 or 4 testcase name like stated below > then only the last one in the list gets executed. > > <unittest.include>**/TestLogRolling*.java</unittest.include> > > > <unittest.include>**/TestOpenRegionHandler*.java</unittest.include>> <unittest.include>**/TestSplitTransaction*.java</unittest.include> > > > > This is running only TestSplitTransaction.java > > > > Previously <include>**/TestHLog.java</include> > > <include>**/TestMaster*.java</include> > > It was running only TestHLog and all testcases starting with > TestMaster.> > > Am i missing something here? Any help is greatly appreciated. > > > > Regards > > Ram >
-
Re: Including specific tests in the latest pom.xml
Gary Helmling 2011-10-06, 18:16
Ram,
If you just want to run a set of tests together, I think you can do that from the command line:
mvn test -Dtest=TestLogRolling,TestOpenRegionHandler,TestSplitTransaction
Does that get you what you're after?
--gh On Thu, Oct 6, 2011 at 11:08 AM, Ramakrishna S Vasudevan 00902313 < [EMAIL PROTECTED]> wrote:
> Hi Jesse > Thanks for your immediate response. I could get what you are saying. But > what i thought was few complex and important testcases i used to run as a > set to see if they pass. So i used to do like that in the earlier pom.xml. > > Any way to add only specified tests? May be am messing things around. > > Ideally here we use that way to exclude tests. :) > > Regards > Ram > > ----- Original Message ----- > From: Jesse Yates <[EMAIL PROTECTED]> > Date: Thursday, October 6, 2011 11:30 pm > Subject: Re: Including specific tests in the latest pom.xml > To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > > Why are you attempting to add them to the pom? If you just put them > > in the right folder (src/test/java) and name them Test*.java (which > > you already have) then they will run fine - no pom mods necessary. > > > > I think what you are doing just keeps overwriting the same maven > > variable (unittests.include) so when it goes to run the tests, the > > only pattern it knows to check is the bottom one. > > > > You really should only be messing with pons for unit tests when > > there are tests that are failing that we want to exclude from the > > build. This is a super super rare case, so in general you don't > > need to worry about it. > > > > Does that help? > > > > - Jesse Yates > > > > Sent from my iPhone. > > > > On Oct 6, 2011, at 10:13 AM, Ramakrishna S Vasudevan 00902313 > > <[EMAIL PROTECTED]> wrote: > > > > > Hi > > > > > > How should i add specific test case names that needs to be > > executed while running mvn tests. > > > In the latest pom.xml we have > > > <unittest.include>**/Test**.java</unittest.include> > > > > > > Now if i try to add some 3 or 4 testcase name like stated below > > then only the last one in the list gets executed. > > > <unittest.include>**/TestLogRolling*.java</unittest.include> > > > > > <unittest.include>**/TestOpenRegionHandler*.java</unittest.include>> > <unittest.include>**/TestSplitTransaction*.java</unittest.include> > > > > > > This is running only TestSplitTransaction.java > > > > > > Previously <include>**/TestHLog.java</include> > > > <include>**/TestMaster*.java</include> > > > It was running only TestHLog and all testcases starting with > > TestMaster.> > > > Am i missing something here? Any help is greatly appreciated. > > > > > > Regards > > > Ram > > >
|
|