|
RunThrough
A Quick Run Through for Gallio Users.
Featured IntroductionTo make use of the GTA, you must first add a new attribute to each TestFixture. This attribute, called TestLinkFixture takes parameters that tell the adapter where to find the test cases to record results to. Typically the tests are run as part of a build script or a batch file. The GTA is an extension to the command line runner. When the tests have been run, the extension is called with the test results. The extension parses the results, loads the test assemblies that have been run and extracts the test link fixture. It then contacts Testlink to look for test cases with the same name as they test methods in the unit test. If the test case does not exist, GTA will create them and assign them to the Testplan. It then records the test result against that test case. InstallationRun Time FilesThere are three DLLs that need to be copied into the bin directory of the Gallio folder:
InvocationThe exporter works with the console runner Gallio.Echo. Gallio v3.0.5 Gallio.Echo.exe /extension:TestLinkAddOn,TlGallioAddon.dll [unitTestAssembly] Gallio v3.0.6 Gallio.Echo.exe /re:TestLinkAddOn,TlGallioAddon.dll [unitTestAssembly] If you are using the Gallio NAnt or MSBuild tasks, the process is similar. Refer to the documentation of these tasks for details. (http://blog.bits-in-motion.com/2008/05/announcing-gallio-v30-alpha-3.html) TestLink SetupIn order for this to work you need to have in testlink:
Step 7 really is optionally because:
Unit Test setupWrite your test cases as you are used to. Then have the project reference TestLinkFixture.dll and add a Using Statement for it. Add the TestLinkFixture to your testfixture. The parameters are:
Example using MbUnit.Framework;
using TlGallioAddOn;
using Meyn.TestLink;
namespace gallioAddOnSampleTests
{
[TestFixture]
[TestLinkFixture(
Url = "http://localhost/testlink/lib/api/xmlrpc.php",
ProjectName = "TestLinkApi",
UserId = "admin",
TestPlan = "Automatic Testing",
TestSuite = "gallioAddOnSampleTests",
DevKey = "ae28ffa45712a041fa0b31dfacb75e29")]
public class SampleFixture
{
[Test]
public void Test2Succeed()
{
Assert.IsTrue(true);
}
}
}Voila. This will create a test case named Test2Succeed and record test case result against it. NotePlease make sure the fixture class is marked public. Gallio will run and execute classes no marked public but this adapter won't find the fixture. There is a new set of binaries for Gallio V3.0.6 LimitationsThis has been tested with Gallio & MBUnit V3.0.5 & V3.0.6, C# and Testlink V 1.8RC5. It should work with VB.NET. It may work with NUnit. You use this code at your own risk. |
Hi there,
The example needs to be updated with the namespace: using Meyn.TestLink;
Please note that this tool will ONLY work with Gallio v3.0.5 and not later versions.
trishkoo thanks for the advice. A new version of binaries is available. It looks I'll have to recompile a new one every time a new gallio version comes out.
Hi StephanMeyn?, Getting error message "XML-RPC server accepts POST request only" in browser. When I tried the above sample replacing the URL and other values I am getting the above error. Do you have any idea how to solve it.
Thanks in advance, Venkatesen
Hi Stephan, We are currently using testlink for our test case management and have a junit automation framework. So i was looking for an API that would allow me to report all the automation results to testlink. Do you have any API to do so? Any information on this is going to be highly appreciated. Thanks Manoj