[
https://issues.jboss.org/browse/ARQ-563?page=com.atlassian.jira.plugin.sy...
]
Hanspeter Gisler edited comment on ARQ-563 at 11/19/11 7:44 AM:
----------------------------------------------------------------
TestNG also reports *tests all passed*, if a normal CDI field @inject fails
(e.g. because the to be injected class has been forgotten to be added via shrinkwrap).
As Aslak Knutsen guesses (
http://community.jboss.org/thread/174948?tstart=0), this
probably has to do with testng's behaviour to skip the tests (and mark them as passed)
if an error occures in @BeforeClass (where arquillian hookes in).
We certainly need a helpful *error message*, when this happens.
was (Author: hpgisler):
TestNG also reports *tests all passed*, if a normal CDI field @inject fails
(e.g. because the to be injected class has been forgotten to be added via shrinkwrap).
As Aslak Knutsen guesses (
http://community.jboss.org/thread/174948?tstart=0), this
probably has to do with testng's behaviour to skip the tests (and mark them as passed)
if an error occures in @BeforeClass (where arquillian hookes in).
@ArquillianResource in TestNG based tests causes test body not to be
evaluated
------------------------------------------------------------------------------
Key: ARQ-563
URL:
https://issues.jboss.org/browse/ARQ-563
Project: Arquillian
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Test Protocol SPIs and Implementation
Affects Versions: 1.0.0.CR4
Environment: Surefire 2.7.2, 2.9
TestNG 5.14.6, 5.14.9
AS 7.0.1 web
Reporter: Karel Piwko
Assignee: Andrew Rubinger
Priority: Blocker
Fix For: 1.0.0.Final
Suppose following test case:
{code}
public class LowercaseConverterTest extends Arquillian {
@Inject
private LowercaseConverter lowercaseConverter;
@Deployment
public static JavaArchive createTestArchive() {
return ShrinkWrap
.create(JavaArchive.class, "test.jar")
.addClasses(LowercaseConverter.class)
.addAsManifestResource(EmptyAsset.INSTANCE,
ArchivePaths.create("beans.xml"));
}
@Test
public void testConvertToLowercase() {
Assert.assertEquals("martin",
lowercaseConverter.convertToLowercase("Martin"));
}
}
{code}
However, if @ArquillianResource is used for a field injection, such as:
{code}
@ArquillianResource URL field;
{code}
than test body is no longer executed and *all tests are reported as passed* even an
obvious failure like:
{code}
@Test
public void testConvertToLowercase() {
Assert.fail();
Assert.assertEquals("karel",
lowercaseConverter.convertToLowercase("Martin"));
}
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira