[
http://jira.magnolia-cms.com/browse/MAGNOLIA-3575?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Grégory Joseph updated MAGNOLIA-3575:
-------------------------------------
Description:
Here's a patch that should allow this (pending classloader issues - to be
validated with tests running in forked mode)
The method - before and after patch - can appear a little unnecessary. In a
regular junit3 test, one can simply do {{getName()}} to get the test method
name. In Junit4, one can add the following to her test class {code}
@Rule
public final TestName testName = new TestName();{code} and consequently do
{{testName.getMethodName()}} when necessary.
However the util method allows to know the current test method in "external"
classes (i.e where we'd have additional assertFoo() type of methods).
Additionally, the patch provides a {{desc()}} method, which can be used to
provide a default assertion description ({{assertTrue(desc(),
some.boolean())}}), thus avoiding unnecessary typing/test description
duplication.
was:
Here's a patch that should allow this (pending classloader issues - to be
validated with tests running in forked mode)
> Support jUnit 4 in info.magnolia.test.TestUtil#getCurrentTestMethodName
> -----------------------------------------------------------------------
>
> Key: MAGNOLIA-3575
> URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-3575
> Project: Magnolia
> Issue Type: Improvement
> Components: testing
> Reporter: Grégory Joseph
> Assignee: Boris Kraft
> Fix For: 4.4.3, 5.0
>
> Attachments: MAGNOLIA-3575.patch
>
>
> Here's a patch that should allow this (pending classloader issues - to be
> validated with tests running in forked mode)
> The method - before and after patch - can appear a little unnecessary. In a
> regular junit3 test, one can simply do {{getName()}} to get the test method
> name. In Junit4, one can add the following to her test class {code}
> @Rule
> public final TestName testName = new TestName();{code} and consequently
> do {{testName.getMethodName()}} when necessary.
> However the util method allows to know the current test method in "external"
> classes (i.e where we'd have additional assertFoo() type of methods).
> Additionally, the patch provides a {{desc()}} method, which can be used to
> provide a default assertion description ({{assertTrue(desc(),
> some.boolean())}}), thus avoiding unnecessary typing/test description
> duplication.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------