[JBoss JIRA] (ARQ-2189) Injection into JUnit rule does not work properly
by Björn Kautler (JIRA)
[ https://issues.jboss.org/browse/ARQ-2189?page=com.atlassian.jira.plugin.s... ]
Björn Kautler updated ARQ-2189:
-------------------------------
Description:
We just upgraded our Arquillian version to 1.4.0.Final and now the JUnit rules do not work properly.
We have a {{LoginRule}} like
{code}
public class LoginRule implements TestRule
{
@EJB
private SecurityManagement securityManagement;
private String username;
private String password;
public LoginRule(String username, String password)
{
this.username = username;
this.password = password;
}
@Override
public Statement apply(Statement base, Description description)
{
return new Statement()
{
public void evaluate() throws Throwable
{
login();
base.evaluate();
}
};
}
...
}
{code}
If we use it in a test like
{code}
@Rule
public LoginRule login = new LoginRule("user", "pass");
@Test
public void test()
{
// do something with login
}
{code}
Unfortunately this does not work anymore, as {{securityManagement}} was not injected and so the {{login}} method in the rule fails which would have used it.
With a subclass with default constructor like
{code}
public class CertainLoginRule extends LoginRule
{
public CertainLoginRule()
{
super("user", "pass");
}
}
{code}
and the usage
{code}
@Rule
public CertainLoginRule login = new CertainLoginRule();
@Test
public void test()
{
// do something with login
}
{code}
it works properly.
We tested different variations with subclass, without, constructors with parameters, without and so on.
The significant part seems to be the parameters to the constructor. If there are none injection works as expected, if there are some, injection is not done. :-(
was:
We just upgraded our Arquillian version to 1.4.0.Final and now the JUnit rules do not work properly.
We have a {{LoginRule}} like
{code}
public class LoginRule implements TestRule
{
@EJB
private SecurityManagement securityManagement;
private String username;
private String password;
public LoginRule(String username, String password)
{
this.username = username;
this.password = password;
}
@Override
public Statement apply(Statement base, Description description)
{
return new Statement()
{
public void evaluate() throws Throwable
{
login();
base.evaluate();
}
};
}
...
}
{code}
If we use it in a test like
{code}
@Rule
public LoginRule login = new LoginRule("user", "pass");
@Test
public void test()
{
// do something with login
}
{code}
Unfortunately this does not work anymore, as {{securityManagement}} was not injected and so the {{login}} method in the rule fails which would have used it.
With a subclass with default constructor like
{code}
public class CertainLoginRule extends LoginRule
{
public CertainLoginRule()
{
super("user", "pass");
}
}
{code}
and the usage
{code}
@Rule
public CertainLoginRule login = new CertainLoginRule();
@Test
public void test()
{
// do something with login
}
{code}
it works properly.
We tested different variations with subclass, without, constructors with parameters, without and so on.
The significant part seems to be the parameters to the constructor. If there are none injection works as expected, if there some, injection is not done. :-(
> Injection into JUnit rule does not work properly
> ------------------------------------------------
>
> Key: ARQ-2189
> URL: https://issues.jboss.org/browse/ARQ-2189
> Project: Arquillian
> Issue Type: Bug
> Affects Versions: 1.4.0.Final
> Reporter: Björn Kautler
>
> We just upgraded our Arquillian version to 1.4.0.Final and now the JUnit rules do not work properly.
> We have a {{LoginRule}} like
> {code}
> public class LoginRule implements TestRule
> {
> @EJB
> private SecurityManagement securityManagement;
> private String username;
> private String password;
> public LoginRule(String username, String password)
> {
> this.username = username;
> this.password = password;
> }
> @Override
> public Statement apply(Statement base, Description description)
> {
> return new Statement()
> {
> public void evaluate() throws Throwable
> {
> login();
> base.evaluate();
> }
> };
> }
> ...
> }
> {code}
> If we use it in a test like
> {code}
> @Rule
> public LoginRule login = new LoginRule("user", "pass");
> @Test
> public void test()
> {
> // do something with login
> }
> {code}
> Unfortunately this does not work anymore, as {{securityManagement}} was not injected and so the {{login}} method in the rule fails which would have used it.
> With a subclass with default constructor like
> {code}
> public class CertainLoginRule extends LoginRule
> {
> public CertainLoginRule()
> {
> super("user", "pass");
> }
> }
> {code}
> and the usage
> {code}
> @Rule
> public CertainLoginRule login = new CertainLoginRule();
> @Test
> public void test()
> {
> // do something with login
> }
> {code}
> it works properly.
> We tested different variations with subclass, without, constructors with parameters, without and so on.
> The significant part seems to be the parameters to the constructor. If there are none injection works as expected, if there are some, injection is not done. :-(
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 5 months
[JBoss JIRA] (ARQ-2189) Injection into JUnit rule does not work properly
by Björn Kautler (JIRA)
[ https://issues.jboss.org/browse/ARQ-2189?page=com.atlassian.jira.plugin.s... ]
Björn Kautler updated ARQ-2189:
-------------------------------
Description:
We just upgraded our Arquillian version to 1.4.0.Final and now the JUnit rules do not work properly.
We have a {{LoginRule}} like
{code}
public class LoginRule implements TestRule
{
@EJB
private SecurityManagement securityManagement;
private String username;
private String password;
public LoginRule(String username, String password)
{
this.username = username;
this.password = password;
}
@Override
public Statement apply(Statement base, Description description)
{
return new Statement()
{
public void evaluate() throws Throwable
{
login();
base.evaluate();
}
};
}
...
}
{code}
If we use it in a test like
{code}
@Rule
public LoginRule login = new LoginRule("user", "pass");
@Test
public void test()
{
// do something with login
}
{code}
Unfortunately this does not work anymore, as {{securityManagement}} was not injected and so the {{login}} method in the rule fails which would have used it.
With a subclass with default constructor like
{code}
public class CertainLoginRule extends LoginRule
{
public CertainLoginRule()
{
super("user", "pass");
}
}
{code}
and the usage
{code}
@Rule
public CertainLoginRule login = new CertainLoginRule();
@Test
public void test()
{
// do something with login
}
{code}
it works properly.
We tested different variations with subclass, without, constructors with parameters, without and so on.
The significant part seems to be the parameters to the constructor. If there are none injection works as expected, if there some, injection is not done. :-(
was:
We just upgraded our Arquillian version to 1.4.0.Final and now the JUnit rules do not work properly.
We have a {{LoginRule}} like
{code}
public class LoginRule implements TestRule
{
@EJB
private SecurityManagement securityManagement;
private String username;
private String password;
public LoginRule(String username, String password)
{
this.username = username;
this.password = password;
}
@Override
public Statement apply(Statement base, Description description)
{
return new Statement()
{
public void evaluate() throws Throwable
{
login();
base.evaluate();
}
};
}
...
}
{code}
If we use it in a test like
{code}
@Rule
public LoginRule login = new LoginRule("user", "pass");
@Test
public void test()
{
// do something with login
}
{code}
Unfortunately this does not work anymore, as {{securityManagement}} was not injected and so the {{login}} method in the rule fails which would have used it.
With a subclass with default parameter like
{code}
public class CertainLoginRule extends LoginRule
{
public CertainLoginRule()
{
super("user", "pass");
}
}
{code}
and the usage
{code}
@Rule
public CertainLoginRule login = new CertainLoginRule();
@Test
public void test()
{
// do something with login
}
{code}
it works properly.
We tested different variations with subclass, without, constructors with parameters, without and so on.
The significant part seems to be the parameters to the constructor. If there are none injection works as expected, if there some, injection is not done. :-(
> Injection into JUnit rule does not work properly
> ------------------------------------------------
>
> Key: ARQ-2189
> URL: https://issues.jboss.org/browse/ARQ-2189
> Project: Arquillian
> Issue Type: Bug
> Affects Versions: 1.4.0.Final
> Reporter: Björn Kautler
>
> We just upgraded our Arquillian version to 1.4.0.Final and now the JUnit rules do not work properly.
> We have a {{LoginRule}} like
> {code}
> public class LoginRule implements TestRule
> {
> @EJB
> private SecurityManagement securityManagement;
> private String username;
> private String password;
> public LoginRule(String username, String password)
> {
> this.username = username;
> this.password = password;
> }
> @Override
> public Statement apply(Statement base, Description description)
> {
> return new Statement()
> {
> public void evaluate() throws Throwable
> {
> login();
> base.evaluate();
> }
> };
> }
> ...
> }
> {code}
> If we use it in a test like
> {code}
> @Rule
> public LoginRule login = new LoginRule("user", "pass");
> @Test
> public void test()
> {
> // do something with login
> }
> {code}
> Unfortunately this does not work anymore, as {{securityManagement}} was not injected and so the {{login}} method in the rule fails which would have used it.
> With a subclass with default constructor like
> {code}
> public class CertainLoginRule extends LoginRule
> {
> public CertainLoginRule()
> {
> super("user", "pass");
> }
> }
> {code}
> and the usage
> {code}
> @Rule
> public CertainLoginRule login = new CertainLoginRule();
> @Test
> public void test()
> {
> // do something with login
> }
> {code}
> it works properly.
> We tested different variations with subclass, without, constructors with parameters, without and so on.
> The significant part seems to be the parameters to the constructor. If there are none injection works as expected, if there some, injection is not done. :-(
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 5 months
[JBoss JIRA] (ARQ-2189) Injection into JUnit rule does not work properly
by Björn Kautler (JIRA)
Björn Kautler created ARQ-2189:
----------------------------------
Summary: Injection into JUnit rule does not work properly
Key: ARQ-2189
URL: https://issues.jboss.org/browse/ARQ-2189
Project: Arquillian
Issue Type: Bug
Affects Versions: 1.4.0.Final
Reporter: Björn Kautler
We just upgraded our Arquillian version to 1.4.0.Final and now the JUnit rules do not work properly.
We have a {{LoginRule}} like
{code}
public class LoginRule implements TestRule
{
@EJB
private SecurityManagement securityManagement;
private String username;
private String password;
public LoginRule(String username, String password)
{
this.username = username;
this.password = password;
}
@Override
public Statement apply(Statement base, Description description)
{
return new Statement()
{
public void evaluate() throws Throwable
{
login();
base.evaluate();
}
};
}
...
}
If we use it in a test like
{code}
@Rule
public LoginRule login = new LoginRule("user", "pass");
@Test
public void test()
{
// do something with login
}
{code}
Unfortunately this does not work anymore, as {{securityManagement}} was not injected and so the {{login}} method in the rule fails which would have used it.
With a subclass with default parameter like
{code}
public class CertainLoginRule extends LoginRule
{
public CertainLoginRule()
{
super("user", "pass");
}
}
{code}
and the usage
{code}
@Rule
public CertainLoginRule login = new CertainLoginRule();
@Test
public void test()
{
// do something with login
}
{code}
it works properly.
We tested different variations with subclass, without, constructors with parameters, without and so on.
The significant part seems to be the parameters to the constructor. If there are none injection works as expected, if there some, injection is not done. :-(
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 5 months
[JBoss JIRA] (ARQ-2189) Injection into JUnit rule does not work properly
by Björn Kautler (JIRA)
[ https://issues.jboss.org/browse/ARQ-2189?page=com.atlassian.jira.plugin.s... ]
Björn Kautler updated ARQ-2189:
-------------------------------
Description:
We just upgraded our Arquillian version to 1.4.0.Final and now the JUnit rules do not work properly.
We have a {{LoginRule}} like
{code}
public class LoginRule implements TestRule
{
@EJB
private SecurityManagement securityManagement;
private String username;
private String password;
public LoginRule(String username, String password)
{
this.username = username;
this.password = password;
}
@Override
public Statement apply(Statement base, Description description)
{
return new Statement()
{
public void evaluate() throws Throwable
{
login();
base.evaluate();
}
};
}
...
}
{code}
If we use it in a test like
{code}
@Rule
public LoginRule login = new LoginRule("user", "pass");
@Test
public void test()
{
// do something with login
}
{code}
Unfortunately this does not work anymore, as {{securityManagement}} was not injected and so the {{login}} method in the rule fails which would have used it.
With a subclass with default parameter like
{code}
public class CertainLoginRule extends LoginRule
{
public CertainLoginRule()
{
super("user", "pass");
}
}
{code}
and the usage
{code}
@Rule
public CertainLoginRule login = new CertainLoginRule();
@Test
public void test()
{
// do something with login
}
{code}
it works properly.
We tested different variations with subclass, without, constructors with parameters, without and so on.
The significant part seems to be the parameters to the constructor. If there are none injection works as expected, if there some, injection is not done. :-(
was:
We just upgraded our Arquillian version to 1.4.0.Final and now the JUnit rules do not work properly.
We have a {{LoginRule}} like
{code}
public class LoginRule implements TestRule
{
@EJB
private SecurityManagement securityManagement;
private String username;
private String password;
public LoginRule(String username, String password)
{
this.username = username;
this.password = password;
}
@Override
public Statement apply(Statement base, Description description)
{
return new Statement()
{
public void evaluate() throws Throwable
{
login();
base.evaluate();
}
};
}
...
}
If we use it in a test like
{code}
@Rule
public LoginRule login = new LoginRule("user", "pass");
@Test
public void test()
{
// do something with login
}
{code}
Unfortunately this does not work anymore, as {{securityManagement}} was not injected and so the {{login}} method in the rule fails which would have used it.
With a subclass with default parameter like
{code}
public class CertainLoginRule extends LoginRule
{
public CertainLoginRule()
{
super("user", "pass");
}
}
{code}
and the usage
{code}
@Rule
public CertainLoginRule login = new CertainLoginRule();
@Test
public void test()
{
// do something with login
}
{code}
it works properly.
We tested different variations with subclass, without, constructors with parameters, without and so on.
The significant part seems to be the parameters to the constructor. If there are none injection works as expected, if there some, injection is not done. :-(
> Injection into JUnit rule does not work properly
> ------------------------------------------------
>
> Key: ARQ-2189
> URL: https://issues.jboss.org/browse/ARQ-2189
> Project: Arquillian
> Issue Type: Bug
> Affects Versions: 1.4.0.Final
> Reporter: Björn Kautler
>
> We just upgraded our Arquillian version to 1.4.0.Final and now the JUnit rules do not work properly.
> We have a {{LoginRule}} like
> {code}
> public class LoginRule implements TestRule
> {
> @EJB
> private SecurityManagement securityManagement;
> private String username;
> private String password;
> public LoginRule(String username, String password)
> {
> this.username = username;
> this.password = password;
> }
> @Override
> public Statement apply(Statement base, Description description)
> {
> return new Statement()
> {
> public void evaluate() throws Throwable
> {
> login();
> base.evaluate();
> }
> };
> }
> ...
> }
> {code}
> If we use it in a test like
> {code}
> @Rule
> public LoginRule login = new LoginRule("user", "pass");
> @Test
> public void test()
> {
> // do something with login
> }
> {code}
> Unfortunately this does not work anymore, as {{securityManagement}} was not injected and so the {{login}} method in the rule fails which would have used it.
> With a subclass with default parameter like
> {code}
> public class CertainLoginRule extends LoginRule
> {
> public CertainLoginRule()
> {
> super("user", "pass");
> }
> }
> {code}
> and the usage
> {code}
> @Rule
> public CertainLoginRule login = new CertainLoginRule();
> @Test
> public void test()
> {
> // do something with login
> }
> {code}
> it works properly.
> We tested different variations with subclass, without, constructors with parameters, without and so on.
> The significant part seems to be the parameters to the constructor. If there are none injection works as expected, if there some, injection is not done. :-(
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 5 months
[JBoss JIRA] (ARQ-1282) TestNG @DataProvider is fully invoked for each record
by Alex Holmansky (JIRA)
[ https://issues.jboss.org/browse/ARQ-1282?page=com.atlassian.jira.plugin.s... ]
Alex Holmansky commented on ARQ-1282:
-------------------------------------
Is there any plan to get this fixed? This makes data providers next to impossible to use with Arquillian.
> TestNG @DataProvider is fully invoked for each record
> -----------------------------------------------------
>
> Key: ARQ-1282
> URL: https://issues.jboss.org/browse/ARQ-1282
> Project: Arquillian
> Issue Type: Bug
> Components: JBoss AS Containers
> Affects Versions: 1.0.3.Final
> Reporter: Karel Cemus
> Assignee: Bartosz Majsak
> Attachments: ArquillianDataProvider.java, FlightServiceTest.java
>
>
> h2. Expected behavior
> TestNG defines @DataProvider annotation to allow single method to perform multiple test cases. Provider method annotated with @DataProvider returns an array of arrays, each containing one test case. These parameters are given to the target method as input parameters. By the definition, the total count of performed test by single method is equal to number of test cases in related data provider.
> h2. Actual behavior
> Using TestNG under Arquillian framework makes this functionality buggy. Although the client (maven, IDE, etc.) thinks, that the total number of invoked test is correct, it is not. When we take a look into server's log, we can see that for each single test case it invoked full set of all test cases. It means, that in the end the amount of performed tests is equal to expected count squared. Such behaviour is not only slow but also in some cases it doesn't work and it makes tests to fail.
> h2. Example
> {code:java}
> @DataProvider
> public Object[][] sumProvider() {
> return new Object[][]{
> new Object[]{ 0, 0, 0 },
> new Object[]{ 1, 1, 2 },
> new Object[]{ 1, 5, 6 },
> new Object[]{ 5, 1, 6 }
> };
> }
> {code}
> h3. Expected output in server log
> {quote}
> Execution of sum: 0 + 0 = 0
> Execution of sum: 1 + 1 = 2
> Execution of sum: 1 + 5 = 6
> Execution of sum: 5 + 1 = 6
> {quote}
> h3. Actual output
> {quote}
> Execution of sum: 0 + 0 = 0
> Execution of sum: 1 + 1 = 2
> Execution of sum: 1 + 5 = 6
> Execution of sum: 5 + 1 = 6
> Execution of sum: 0 + 0 = 0
> Execution of sum: 1 + 1 = 2
> Execution of sum: 1 + 5 = 6
> Execution of sum: 5 + 1 = 6
> Execution of sum: 0 + 0 = 0
> Execution of sum: 1 + 1 = 2
> Execution of sum: 1 + 5 = 6
> Execution of sum: 5 + 1 = 6
> Execution of sum: 0 + 0 = 0
> Execution of sum: 1 + 1 = 2
> Execution of sum: 1 + 5 = 6
> Execution of sum: 5 + 1 = 6
> {quote}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 5 months
[JBoss JIRA] (ARQ-2188) RemoteLoadableExtensions are not loaded by Weld embedded container
by James Roper (JIRA)
James Roper created ARQ-2188:
--------------------------------
Summary: RemoteLoadableExtensions are not loaded by Weld embedded container
Key: ARQ-2188
URL: https://issues.jboss.org/browse/ARQ-2188
Project: Arquillian
Issue Type: Enhancement
Components: Weld Containers
Reporter: James Roper
Consider the autodiscover extension showcase:
https://github.com/arquillian/arquillian-showcase/tree/master/extensions/...
This provides things like mockito support for in a container. There's no reason that a feature like this shouldn't work on top of an embedded container like Weld, but it doesn't - it doesn't work if you add the {{RemoteLoadableExtension}} to the auxillery archive appender, nor does it work if you put the extension in your own {{META-INF/services}} directory, because the Weld container does not load remote loadable extensions.
I think an embedded container should inspect auxiliary archives to locate any {{RemoteLoadableExtension}}'s that are registered, and load them. Supporting this would help TCK's to be able to, for example, supply {{@ArquillianResource}} resources that work both in embedded and remote containers.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 5 months