Currently the contents of my “testng.xml” file are:
<suite name=”clTest”>
<test name=”clTest”>
<classes>
<class name=”org.familysearch.cds.acceptance.CollectionEndpointTest”>
<methods>
<include name=”getCollectionSummary” />
<include name=”updateCollection” />
</methods>
</class>
</classes>
</test>
</suite>
This lets me test these two test methods, which are both in the group I designate as “middle-phase”. Now I could just add to this the name of all the other test methods in this class that belong to group “middle-phase” (there are two more of them), but is there an easier way to tell “testng.xml” I want to test all test methods in a class that belong to a specific group?
Kevin Simonson
NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
Currently the contents of my “testng.xml” file are:
<suite name=”clTest”>
<test name=”clTest”>
<classes>
<class name=”org.familysearch.cds.acceptance.CollectionEndpointTest”>
<methods>
<include name=”getCollectionSummary” />
<include name=”updateCollection” />
</methods>
</class>
</classes>
</test>
</suite>
This lets me test these two test methods, which are both in the group I designate as “middle-phase”. Now I could just add to this the name of all the other test methods in this class that belong to group “middle-phase” (there are two more of them), but is there an easier way to tell “testng.xml” I want to test all test methods in a class that belong to a specific group?
class X {
@Test( group="middle-phase" )
public void getCollectionSummary() {
}
}
<suite name=”clTest”>
<test
name=”clTest”>
<package>
<package name="org.familysearch.cds.acceptance" />
</package>
<groups>
<run>
<include name="middle-phase"/>
</run>
</groups>
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/PQEzAbpTl7kJ.
This looks encouraging, but I have test methods in another class in my “org.familysearch.cds.acceptance” package that are in the “middle-phase” group. Won’t they be picked up by this XML? What do I do to get just the test methods in the one class that are in the “middle-phase” group?
Kevin Simonson
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
Is there something similar for when it starts?
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/9v9K9xaWdZEJ.
Okay, following Cedric’s advice (or at least I thought I was), I created “testng.xml” file:
<suite name=”clTest”>
<test name=”clTest”>
<classes>
<class name=”org.familysearch.cds.acceptance.CollectionEndpointTest”>
</class>
<groups>
<run>
<include name=”middle-phase” />
</run>
</groups>
</classes>
</test>
</suite>
When I right click in this file and select <Debug “C:/Sandbox/sourceCode4/cds2-root/cds-acceptance-tests/src/test/testng/testng.xml”>, execution begins in <getCollSummParms()>, the data provider of my test method <getCollectionSummary(). But this class has a method <setUp()> with the “@BeforeClass” annotation before it! Why isn’t <setup()> getting called? Anyone have any ideas?
Kevin S
From: testng...@googlegroups.com [mailto:testng...@googlegroups.com] On Behalf Of Cédric Beust ?
Sent: Friday, October 07, 2011 2:38 PM
To: testng...@googlegroups.com
Subject: Re: [testng-users] Telling TestNG I Want to Run all Test Methods in a Class
Then just include that class in your XML file.
--
Cédric
On Fri, Oct 7, 2011 at 1:14 PM, Kevin Simonson <simon...@familysearch.org> wrote:
This looks encouraging, but I have test methods in another class in my “org.familysearch.cds.acceptance” package that are in the “middle-phase” group. Won’t they be picked up by this XML? What do I do to get just the test methods in the one class that are in the “middle-phase” group?
Kevin Simonson