[JBoss JIRA] (ARQ-1303) Add Spring StaticApplicationContext
by omid pourhadi (JIRA)
omid pourhadi created ARQ-1303:
----------------------------------
Summary: Add Spring StaticApplicationContext
Key: ARQ-1303
URL: https://issues.jboss.org/browse/ARQ-1303
Project: Arquillian
Issue Type: Enhancement
Security Level: Public (Everyone can see)
Components: Extension - Spring
Reporter: omid pourhadi
Assignee: Marius Bogoevici
Priority: Minor
It is a common way that developers programmatically register beans into context specially in testing rather than reading bean definitions from external configuration sources, in this case, you need to use StaticApplicationContext.
As far as my experience concerned, there are some circumstances that you need to have populated context when you are testing
1. for registering mock objects into context
let's assume we inject a DAO into a service and we want to mock DAO then test our service
{code:title=Bar.java|borderStyle=solid}
public class MockTest(){
@Mock
Dao dao;
public void testMethod(){
ctx.getBeanFactory().registerSingleton(dao.getClass().getName(), dao);
}
}
{code}
2. for specifying classes not packages
sometimes you need to create a spring context by only some specific classes from different packages not the whole packages.
It might be good idea to have an annotation ClassToScan({}) to define whcih classes, you want to scan
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 10 months
[JBoss JIRA] (ARQ-1302) Support Weld 2.x
by Aslak Knutsen (JIRA)
[ https://issues.jboss.org/browse/ARQ-1302?page=com.atlassian.jira.plugin.s... ]
Aslak Knutsen resolved ARQ-1302.
--------------------------------
Resolution: Done
pushed upstream https://github.com/arquillian/arquillian-container-weld/commit/51994df41d...
> Support Weld 2.x
> ----------------
>
> Key: ARQ-1302
> URL: https://issues.jboss.org/browse/ARQ-1302
> Project: Arquillian
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Components: Weld Containers
> Affects Versions: weld_1.0.0.CR5
> Reporter: Aslak Knutsen
> Assignee: Aslak Knutsen
> Fix For: weld_1.0.0.Final
>
>
> ARQ-1168 Added a tight dependency on the BeansXml API from Weld Bootstrap SPI. This SPI has changed in the Weld 2.x branch which cause the Container to fail runtime.
> The reason for the tight dependency is to support merging duplicate entries in beans.xml when using a FlatDeployment structure.
> Weld 2.x Bootstrap has added support for this feature via the new parse(beans.xml, merge) method.
> Update the weld containers to support the old and new way of merging the beans.xml.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 10 months