[
https://issues.apache.org/jira/browse/SLING-3708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14046075#comment-14046075
]
Bertrand Delacretaz commented on SLING-3708:
--------------------------------------------
I have committed a first version at http://svn.apache.org/r1606131 - including
an example test:
{code}
public class OutputMetadataTest {
@Test
public void addMetadata() {
final SlingTestContext c = SlingTestContextProvider.getContext();
assertNotNull("Expecting a SlingTestContext", c);
c.output().put("the_quick", "brown fox!");
c.output().put("the_answer", 42);
}
}
{code}
The resulting output (only supported by the JSON renderer so far) is
{code}
curl -X POST
http://localhost:8080/system/sling/junit/org.apache.sling.testing.samples.sampletests.OutputMetadataTest.json
[{
"INFO_TYPE": "test",
"description":
"addMetadata(org.apache.sling.testing.samples.sampletests.OutputMetadataTest)",
"test_metadata": {
"test_execution_time_msec": 0,
"the_answer": 42,
"the_quick": "brown fox!"
}
}
]
{code}
> Let server-side JUnit tests provide optional output metadata
> ------------------------------------------------------------
>
> Key: SLING-3708
> URL: https://issues.apache.org/jira/browse/SLING-3708
> Project: Sling
> Issue Type: Improvement
> Components: Testing
> Affects Versions: JUnit Core 1.0.8, Sample Integration Tests 1.0.6, Sample
> Server-Side Tests 1.0.6
> Reporter: Bertrand Delacretaz
> Assignee: Bertrand Delacretaz
> Priority: Minor
> Fix For: JUnit Core 1.0.10, Sample Integration Tests 1.0.8,
> Sample Server-Side Tests 1.0.8
>
>
> I'd like to combine our server-side JUnit tests with the performance testing
> utilities from performance/base. A first step is to allow tests to provide
> more output than just pass or fail, using a Map where tests can write any
> relevant information.
--
This message was sent by Atlassian JIRA
(v6.2#6252)