REST API for Calling Specific Test Groups
It is possible to call special URLs to execute tests by their annotations or all test in current extensions set.
|
URL |
tests group |
|---|---|
|
/test/run/all |
all tests |
|
/test/run/unit |
@UnitTest annotated tests |
|
/test/run/integration |
@IntegrationTest annotated tests |
|
/test/run/manual |
@ManualTest annotated tests |
|
/test/run/performance |
@PerformanceTest annotated tests |
|
/test/run/demo |
@DemoTest annotated tests |
To each of the above URLs, you can always pass the extensions parameter in which you can specify comma-separated extension names to narrow down the search results. Sample URL calls can look as follows:
// run all tests http://localhost:9001/test/run/all // run all tests but from extensions core and ldap http://localhost:9001/test/run/all?extensions=core,ldap
Additionally, there is another URL to execute specific test suites by their fully qualified names by using parameter names as follows: http://localhost:9001/test/run/suites?names=de.hybris.platform.catalog.jalo.classification.ClassificationTest,de.hybris.platform.catalog.jalo.CatalogTest
A sample call to URL above executes tests for two test suites: ClassificationTest and CatalogTest.
The result is generated in the XML form. Below you can find an example of a generated xml file:
<?xml version="1.0" encoding="UTF-8" ?>
<testsuites>
<testsuite name="HybrisJmxIntegrationTest" package="de.hybris.platform.jmx" tests="1" time="778" failures="0" errors="0" >
<testcase name="testJMXAPI" time="778" ></testcase>
</testsuite>
<testsuite name="SecureMediaFolderTest" package="de.hybris.platform.test" tests="1" time="160" failures="0" errors="0" >
<testcase name="testSecureFolder" time="160" ></testcase>
</testsuite>
<testsuite name="RestartSlaveTenantTest" package="de.hybris.platform.core" tests="5" time="4308" failures="1" errors="1" >
<testcase name="testCanQueryFlexibleSearchAfterRestart" time="0" >
<error message="" type="java.lang.NullPointerException">
<![CDATA[java.lang.NullPointerException
at de.hybris.platform.jalo.Item.getCacheBoundItem(Item.java:3762)
at de.hybris.platform.jalo.type.TypeManager.getComposedType(TypeManager.java:400)
at de.hybris.platform.servicelayer.interceptor.impl.DefaultInterceptorRegistry.getAssignableTypes(DefaultInterceptorRegistry.java:307)
.....
]]>
</error>
</testcase>
</testuite>
</testsuites>