Parameter injection for TestNG does not work
--------------------------------------------
Key: ARQ-562
URL:
https://issues.jboss.org/browse/ARQ-562
Project: Arquillian
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Test Protocol SPIs and Implementation
Affects Versions: 1.0.0.CR4
Environment: AS 7.0.1 web profile
Surefire 2.9
TestNG 5.14.6
Reporter: Karel Piwko
While trying to inject @ArquillianResource as method parameter such as
{code}
public class LowercaseConverterTest extends Arquillian {
@Inject
private LowercaseConverter lowercaseConverter;
@ArquillianResource URL context;
@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(@ArquillianResource URL foobar) {
Assert.assertEquals("martin",
lowercaseConverter.convertToLowercase("Martin"));
}
}
{code}
I'm getting following exception:
{code}
org.testng.TestNGException:
Method testConvertToLowercase requires 1 parameters but 0 were supplied in the @Test
annotation.
at org.testng.internal.Parameters.checkParameterTypes(Parameters.java:187)
at org.testng.internal.Parameters.createParameters(Parameters.java:123)
at org.testng.internal.Parameters.createParameters(Parameters.java:357)
at org.testng.internal.Parameters.handleParameters(Parameters.java:433)
at org.testng.internal.Invoker.handleParameters(Invoker.java:1315)
at org.testng.internal.Invoker.createParameters(Invoker.java:1022)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1122)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.runWorkers(TestRunner.java:1147)
at org.testng.TestRunner.privateRun(TestRunner.java:749)
at org.testng.TestRunner.run(TestRunner.java:600)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:317)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:312)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:274)
at org.testng.SuiteRunner.run(SuiteRunner.java:223)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1039)
at org.testng.TestNG.runSuitesLocally(TestNG.java:964)
at org.testng.TestNG.run(TestNG.java:900)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:113)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:207)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
{code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira