[JBoss JIRA] (ARQ-841) Should not scan for classes in Archive if it contains no beans.xml
by Karim de Fombelle (JIRA)
[ https://issues.jboss.org/browse/ARQ-841?page=com.atlassian.jira.plugin.sy... ]
Karim de Fombelle edited comment on ARQ-841 at 1/19/13 6:54 PM:
----------------------------------------------------------------
Similar issue observed with Arquillian 1.0.3.Final / arquillian-weld-se-embedded-1.1 1.0.0.CR5 / weld-core 1.1.10.Final / Shrinkwrap 2.0.0-alpha-1
Arquillian performs micro deployment in a CDI container, according the container adapter and the container found in the developer classpath.
The deployed content is built in a test class in the method annotated with @Deployment
CDI specification (JSR-299) mentions that the container will scan for "managed bean" only _bean archives_, and those archive must contain a META-INF/bean.xml file
{quote} 12.1. Bean archives
Bean classes of enabled beans must be deployed in bean archives.
• A library jar, EJB jar, application client jar or rar archive is a bean archive if it has a file named beans.xml in the
META-INF directory.
(...)
The container searches for beans in all bean archives in the application classpath
{quote}
However, as illustrated in the test class below, without adding any descriptor, the content of the archive is scanned and beans are managed.
The injection below is successful whereas it is expected the test throws an "UnsatisfiedResolutionException."
Test case below:
{code}
@RunWith(Arquillian.class)
public class ArquillianBeanXmlTest {
@Inject
private TestBean testBean;
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class)
.addClass(TestBean.class);
//.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");//sounds useless
}
//test is successful whereas it is expected to fail
@Test
public void testBeanInjected() {
assertNotNull(testBean);
}
}
{code}
And bean:
{code}
package org.jboss.arquillian.junit;
public class TestBean {
}
{code}
The pom is attached.
was (Author: kdefombelle):
Similar issue observed with Arquillian 1.0.3.Final / arquillian-weld-se-embedded-1.1 1.0.0.CR5 / weld-core 1.1.10.Final / Shrinkwrap 2.0.0-alpha-1
Arquillian performs micro deployment in a CDI container, according the container adapter and the container found in the developer classpath.
The deployed content is built in a test class in the method annotated with @Deployment
CDI specification (JSR-2999) mentions that the container will scan for "managed bean" only _bean archives_, and those archive must contain a META-INF/bean.xml file
{quote} 12.1. Bean archives
Bean classes of enabled beans must be deployed in bean archives.
• A library jar, EJB jar, application client jar or rar archive is a bean archive if it has a file named beans.xml in the
META-INF directory.
(...)
The container searches for beans in all bean archives in the application classpath
{quote}
However, as illustrated in the test class below, without adding any descriptor, the content of the archive is scanned and beans are managed.
The injection below is successful whereas it is expected the test throws an "UnsatisfiedResolutionException."
Test case below:
{code}
@RunWith(Arquillian.class)
public class ArquillianBeanXmlTest {
@Inject
private TestBean testBean;
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class)
.addClass(TestBean.class);
//.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");//sounds useless
}
//test is successful whereas it is expected to fail
@Test
public void testBeanInjected() {
assertNotNull(testBean);
}
}
{code}
And bean:
{code}
package org.jboss.arquillian.junit;
public class TestBean {
}
{code}
The pom is attached.
> Should not scan for classes in Archive if it contains no beans.xml
> ------------------------------------------------------------------
>
> Key: ARQ-841
> URL: https://issues.jboss.org/browse/ARQ-841
> Project: Arquillian
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Weld Containers
> Affects Versions: weld_1.0.0.CR3
> Reporter: Aslak Knutsen
> Labels: starter
> Fix For: weld_1.1.0.next
>
> Attachments: pom.xml
>
>
> A deployment with no beans.xml should not result in Beans being registered in the Weld Container.
--
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, 11 months
[JBoss JIRA] (ARQ-841) Should not scan for classes in Archive if it contains no beans.xml
by Karim de Fombelle (JIRA)
[ https://issues.jboss.org/browse/ARQ-841?page=com.atlassian.jira.plugin.sy... ]
Karim de Fombelle edited comment on ARQ-841 at 1/19/13 6:53 PM:
----------------------------------------------------------------
Similar issue observed with Arquillian 1.0.3.Final / arquillian-weld-se-embedded-1.1 1.0.0.CR5 / weld-core 1.1.10.Final / Shrinkwrap 2.0.0-alpha-1
Arquillian performs micro deployment in a CDI container, according the container adapter and the container found in the developer classpath.
The deployed content is built in a test class in the method annotated with @Deployment
CDI specification (JSR-2999) mentions that the container will scan for "managed bean" only _bean archives_, and those archive must contain a META-INF/bean.xml file
{quote} 12.1. Bean archives
Bean classes of enabled beans must be deployed in bean archives.
• A library jar, EJB jar, application client jar or rar archive is a bean archive if it has a file named beans.xml in the
META-INF directory.
(...)
The container searches for beans in all bean archives in the application classpath
{quote}
However, as illustrated in the test class below, without adding any descriptor, the content of the archive is scanned and beans are managed.
The injection below is successful whereas it is expected the test throws an "UnsatisfiedResolutionException."
Test case below:
{code}
@RunWith(Arquillian.class)
public class ArquillianBeanXmlTest {
@Inject
private TestBean testBean;
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class)
.addClass(TestBean.class);
//.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");//sounds useless
}
//test is successful whereas it is expected to fail
@Test
public void testBeanInjected() {
assertNotNull(testBean);
}
}
{code}
And bean:
{code}
package org.jboss.arquillian.junit;
public class TestBean {
}
{code}
The pom is attached.
was (Author: kdefombelle):
Similar issue observed with Arquillian 1.0.3.Final / arquillian-weld-se-embedded-1.1 1.0.0.CR5 / weld-core 1.1.10.Final / Shrinkwrap 2.0.0-alpha-1
Arquillian performs micro deployment in a CDI container, according the container adapter and the container found in the developer classpath.
The deployed content is built in a test class in the method annotated wit @Deployment
CDI specification (JSR-2999) mentions that the container will scan for "managed bean" only _bean archives_, and those archive must contain a META-INF/bean.xml file
{quote} 12.1. Bean archives
Bean classes of enabled beans must be deployed in bean archives.
• A library jar, EJB jar, application client jar or rar archive is a bean archive if it has a file named beans.xml in the
META-INF directory.
(...)
The container searches for beans in all bean archives in the application classpath
{quote}
However, as illustrated in the test class below, without adding any descriptor, the content of the archive is scanned and beans are managed.
The injection below is successful whereas it is expected the test throws an "UnsatisfiedResolutionException."
Test case below:
{code}
@RunWith(Arquillian.class)
public class ArquillianBeanXmlTest {
@Inject
private TestBean testBean;
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class)
.addClass(TestBean.class);
//.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");//sounds useless
}
//test is successful whereas it is expected to fail
@Test
public void testBeanInjected() {
assertNotNull(testBean);
}
}
{code}
And bean:
{code}
package org.jboss.arquillian.junit;
public class TestBean {
}
{code}
The pom is attached.
> Should not scan for classes in Archive if it contains no beans.xml
> ------------------------------------------------------------------
>
> Key: ARQ-841
> URL: https://issues.jboss.org/browse/ARQ-841
> Project: Arquillian
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Weld Containers
> Affects Versions: weld_1.0.0.CR3
> Reporter: Aslak Knutsen
> Labels: starter
> Fix For: weld_1.1.0.next
>
> Attachments: pom.xml
>
>
> A deployment with no beans.xml should not result in Beans being registered in the Weld Container.
--
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, 11 months
[JBoss JIRA] (ARQ-841) Should not scan for classes in Archive if it contains no beans.xml
by Karim de Fombelle (JIRA)
[ https://issues.jboss.org/browse/ARQ-841?page=com.atlassian.jira.plugin.sy... ]
Karim de Fombelle edited comment on ARQ-841 at 1/19/13 6:53 PM:
----------------------------------------------------------------
Similar issue observed with Arquillian 1.0.3.Final / arquillian-weld-se-embedded-1.1 1.0.0.CR5 / weld-core 1.1.10.Final / Shrinkwrap 2.0.0-alpha-1
Arquillian performs micro deployment in a CDI container, according the container adapter and the container found in the developer classpath.
The deployed content is built in a test class in the method annotated wit @Deployment
CDI specification (JSR-2999) mentions that the container will scan for "managed bean" only _bean archives_, and those archive must contain a META-INF/bean.xml file
{quote} 12.1. Bean archives
Bean classes of enabled beans must be deployed in bean archives.
• A library jar, EJB jar, application client jar or rar archive is a bean archive if it has a file named beans.xml in the
META-INF directory.
(...)
The container searches for beans in all bean archives in the application classpath
{quote}
However, as illustrated in the test class below, without adding any descriptor, the content of the archive is scanned and beans are managed.
The injection below is successful whereas it is expected the test throws an "UnsatisfiedResolutionException."
Test case below:
{code}
@RunWith(Arquillian.class)
public class ArquillianBeanXmlTest {
@Inject
private TestBean testBean;
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class)
.addClass(TestBean.class);
//.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");//sounds useless
}
//test is successful whereas it is expected to fail
@Test
public void testBeanInjected() {
assertNotNull(testBean);
}
}
{code}
And bean:
{code}
package org.jboss.arquillian.junit;
public class TestBean {
}
{code}
The pom is attached.
was (Author: kdefombelle):
Similar issue observed with Arquillian 1.0.3.Final / arquillian-weld-se-embedded-1.1 1.0.0.CR5 / weld-core 1.1.10.Final / Shrinkwrap 2.0.0-alpha-1
Arquillian performs micro deployment in a CDI container, according the container adapter and the container found in the developer classpath.
The deployed content is built in a test class in the method annotated wit @Deployment
CDI specification (JSR-2999) mentions that the container will scan for "managed bean" only _bean archives_, and those archive must contain a META-INF/bean.xml file
{info} 12.1. Bean archives
Bean classes of enabled beans must be deployed in bean archives.
• A library jar, EJB jar, application client jar or rar archive is a bean archive if it has a file named beans.xml in the
META-INF directory.
(...)
The container searches for beans in all bean archives in the application classpath
{info}
However, as illustrated in the test class below, without adding any descriptor, the content of the archive is scanned and beans are managed.
The injection below is successful whereas it is expected the test throws an "UnsatisfiedResolutionException."
Test case below:
{code}
@RunWith(Arquillian.class)
public class ArquillianBeanXmlTest {
@Inject
private TestBean testBean;
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class)
.addClass(TestBean.class);
//.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");//sounds useless
}
//test is successful whereas it is expected to fail
@Test
public void testBeanInjected() {
assertNotNull(testBean);
}
}
{code}
And bean:
{code}
package org.jboss.arquillian.junit;
public class TestBean {
}
{code}
The pom is attached.
> Should not scan for classes in Archive if it contains no beans.xml
> ------------------------------------------------------------------
>
> Key: ARQ-841
> URL: https://issues.jboss.org/browse/ARQ-841
> Project: Arquillian
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Weld Containers
> Affects Versions: weld_1.0.0.CR3
> Reporter: Aslak Knutsen
> Labels: starter
> Fix For: weld_1.1.0.next
>
> Attachments: pom.xml
>
>
> A deployment with no beans.xml should not result in Beans being registered in the Weld Container.
--
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, 11 months
[JBoss JIRA] (ARQ-841) Should not scan for classes in Archive if it contains no beans.xml
by Karim de Fombelle (JIRA)
[ https://issues.jboss.org/browse/ARQ-841?page=com.atlassian.jira.plugin.sy... ]
Karim de Fombelle edited comment on ARQ-841 at 1/19/13 6:48 PM:
----------------------------------------------------------------
Similar issue observed with Arquillian 1.0.3.Final / arquillian-weld-se-embedded-1.1 1.0.0.CR5 / weld-core 1.1.10.Final / Shrinkwrap 2.0.0-alpha-1
Arquillian performs micro deployment in a CDI container, according the container adapter and the container found in the developer classpath.
The deployed content is built in a test class in the method annotated wit @Deployment
CDI specification (JSR-2999) mentions that the container will scan for "managed bean" only _bean archives_, and those archive must contain a META-INF/bean.xml file
bq. 12.1. Bean archives
Bean classes of enabled beans must be deployed in bean archives.
• A library jar, EJB jar, application client jar or rar archive is a bean archive if it has a file named beans.xml in the
META-INF directory.
(...)
The container searches for beans in all bean archives in the application classpath
However, as illustrated in the test class below, without adding any descriptor, the content of the archive is scanned and beans are managed.
The injection below is successful whereas it is expected the test throws an "UnsatisfiedResolutionException."
Test case below:
{code}
@RunWith(Arquillian.class)
public class ArquillianBeanXmlTest {
@Inject
private TestBean testBean;
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class)
.addClass(TestBean.class);
//.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");//sounds useless
}
//test is successful whereas it is expected to fail
@Test
public void testBeanInjected() {
assertNotNull(testBean);
}
}
{code}
And bean:
{code}
package org.jboss.arquillian.junit;
public class TestBean {
}
{code}
The pom is attached.
was (Author: kdefombelle):
Similar issue observed with Arquillian 1.0.3.Final / arquillian-weld-se-embedded-1.1 1.0.0.CR5 / weld-core 1.1.10.Final / Shrinkwrap 2.0.0-alpha-1
Arquillian performs micro deployment in a CDI container, according the container adapter and the container found in the developer classpath.
The deployed content is built in a test class in the method annotated wit @Deployment
CDI specification (JSR-2999) mentions that the container will scan for "managed bean" only _bean archives_, and those archive must contain a META-INF/bean.xml file
bq. 12.1. Bean archives
bq. Bean classes of enabled beans must be deployed in bean archives.
bq. • A library jar, EJB jar, application client jar or rar archive is a bean archive if it has a file named beans.xml in the
bq. META-INF directory.
bq. (...)
bq. The container searches for beans in all bean archives in the application classpath
However, as illustrated in the test class below, without adding any descriptor, the content of the archive is scanned and beans are managed.
The injection below is successful whereas it is expected the test throws an "UnsatisfiedResolutionException."
Test case below:
{code}
@RunWith(Arquillian.class)
public class ArquillianBeanXmlTest {
@Inject
private TestBean testBean;
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class)
.addClass(TestBean.class);
//.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");//sounds useless
}
//test is successful whereas it is expected to fail
@Test
public void testBeanInjected() {
assertNotNull(testBean);
}
}
{code}
And bean:
{code}
package org.jboss.arquillian.junit;
public class TestBean {
}
{code}
The pom is attached.
> Should not scan for classes in Archive if it contains no beans.xml
> ------------------------------------------------------------------
>
> Key: ARQ-841
> URL: https://issues.jboss.org/browse/ARQ-841
> Project: Arquillian
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Weld Containers
> Affects Versions: weld_1.0.0.CR3
> Reporter: Aslak Knutsen
> Labels: starter
> Fix For: weld_1.1.0.next
>
> Attachments: pom.xml
>
>
> A deployment with no beans.xml should not result in Beans being registered in the Weld Container.
--
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, 11 months
[JBoss JIRA] (ARQ-841) Should not scan for classes in Archive if it contains no beans.xml
by Karim de Fombelle (JIRA)
[ https://issues.jboss.org/browse/ARQ-841?page=com.atlassian.jira.plugin.sy... ]
Karim de Fombelle edited comment on ARQ-841 at 1/19/13 6:50 PM:
----------------------------------------------------------------
Similar issue observed with Arquillian 1.0.3.Final / arquillian-weld-se-embedded-1.1 1.0.0.CR5 / weld-core 1.1.10.Final / Shrinkwrap 2.0.0-alpha-1
Arquillian performs micro deployment in a CDI container, according the container adapter and the container found in the developer classpath.
The deployed content is built in a test class in the method annotated wit @Deployment
CDI specification (JSR-2999) mentions that the container will scan for "managed bean" only _bean archives_, and those archive must contain a META-INF/bean.xml file
{info} 12.1. Bean archives
Bean classes of enabled beans must be deployed in bean archives.
• A library jar, EJB jar, application client jar or rar archive is a bean archive if it has a file named beans.xml in the
META-INF directory.
(...)
The container searches for beans in all bean archives in the application classpath
{info}
However, as illustrated in the test class below, without adding any descriptor, the content of the archive is scanned and beans are managed.
The injection below is successful whereas it is expected the test throws an "UnsatisfiedResolutionException."
Test case below:
{code}
@RunWith(Arquillian.class)
public class ArquillianBeanXmlTest {
@Inject
private TestBean testBean;
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class)
.addClass(TestBean.class);
//.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");//sounds useless
}
//test is successful whereas it is expected to fail
@Test
public void testBeanInjected() {
assertNotNull(testBean);
}
}
{code}
And bean:
{code}
package org.jboss.arquillian.junit;
public class TestBean {
}
{code}
The pom is attached.
was (Author: kdefombelle):
Similar issue observed with Arquillian 1.0.3.Final / arquillian-weld-se-embedded-1.1 1.0.0.CR5 / weld-core 1.1.10.Final / Shrinkwrap 2.0.0-alpha-1
Arquillian performs micro deployment in a CDI container, according the container adapter and the container found in the developer classpath.
The deployed content is built in a test class in the method annotated wit @Deployment
CDI specification (JSR-2999) mentions that the container will scan for "managed bean" only _bean archives_, and those archive must contain a META-INF/bean.xml file
bq. 12.1. Bean archives
Bean classes of enabled beans must be deployed in bean archives.
• A library jar, EJB jar, application client jar or rar archive is a bean archive if it has a file named beans.xml in the
META-INF directory.
(...)
The container searches for beans in all bean archives in the application classpath
However, as illustrated in the test class below, without adding any descriptor, the content of the archive is scanned and beans are managed.
The injection below is successful whereas it is expected the test throws an "UnsatisfiedResolutionException."
Test case below:
{code}
@RunWith(Arquillian.class)
public class ArquillianBeanXmlTest {
@Inject
private TestBean testBean;
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class)
.addClass(TestBean.class);
//.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");//sounds useless
}
//test is successful whereas it is expected to fail
@Test
public void testBeanInjected() {
assertNotNull(testBean);
}
}
{code}
And bean:
{code}
package org.jboss.arquillian.junit;
public class TestBean {
}
{code}
The pom is attached.
> Should not scan for classes in Archive if it contains no beans.xml
> ------------------------------------------------------------------
>
> Key: ARQ-841
> URL: https://issues.jboss.org/browse/ARQ-841
> Project: Arquillian
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Weld Containers
> Affects Versions: weld_1.0.0.CR3
> Reporter: Aslak Knutsen
> Labels: starter
> Fix For: weld_1.1.0.next
>
> Attachments: pom.xml
>
>
> A deployment with no beans.xml should not result in Beans being registered in the Weld Container.
--
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, 11 months
[JBoss JIRA] (ARQ-841) Should not scan for classes in Archive if it contains no beans.xml
by Karim de Fombelle (JIRA)
[ https://issues.jboss.org/browse/ARQ-841?page=com.atlassian.jira.plugin.sy... ]
Karim de Fombelle edited comment on ARQ-841 at 1/19/13 6:48 PM:
----------------------------------------------------------------
Similar issue observed with Arquillian 1.0.3.Final / arquillian-weld-se-embedded-1.1 1.0.0.CR5 / weld-core 1.1.10.Final / Shrinkwrap 2.0.0-alpha-1
Arquillian performs micro deployment in a CDI container, according the container adapter and the container found in the developer classpath.
The deployed content is built in a test class in the method annotated wit @Deployment
CDI specification (JSR-2999) mentions that the container will scan for "managed bean" only _bean archives_, and those archive must contain a META-INF/bean.xml file
bq. 12.1. Bean archives
bq. Bean classes of enabled beans must be deployed in bean archives.
bq. • A library jar, EJB jar, application client jar or rar archive is a bean archive if it has a file named beans.xml in the
bq. META-INF directory.
bq. (...)
bq. The container searches for beans in all bean archives in the application classpath
However, as illustrated in the test class below, without adding any descriptor, the content of the archive is scanned and beans are managed.
The injection below is successful whereas it is expected the test throws an "UnsatisfiedResolutionException."
Test case below:
{code}
@RunWith(Arquillian.class)
public class ArquillianBeanXmlTest {
@Inject
private TestBean testBean;
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class)
.addClass(TestBean.class);
//.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");//sounds useless
}
//test is successful whereas it is expected to fail
@Test
public void testBeanInjected() {
assertNotNull(testBean);
}
}
{code}
And bean:
{code}
package org.jboss.arquillian.junit;
public class TestBean {
}
{code}
The pom is attached.
was (Author: kdefombelle):
Similar issue observed with Arquillian 1.0.3.Final / arquillian-weld-se-embedded-1.1 1.0.0.CR5 / weld-core 1.1.10.Final / Shrinkwrap 2.0.0-alpha-1
Arquillian performs micro deployment in a CDI container, according the container adapter and the container found in the developer classpath.
The deployed content is built in a test class in the method annotated wit @Deployment
CDI specification (JSR-2999) mentions that the container will scan for "managed bean" only "bean archives", and those archive must contain a META-INF/bean.xml file
bq. 12.1. Bean archives
Bean classes of enabled beans must be deployed in bean archives.
• A library jar, EJB jar, application client jar or rar archive is a bean archive if it has a file named beans.xml in the
META-INF directory.
(...)
The container searches for beans in all bean archives in the application classpath
However, as illustrated in the test class below, without adding any descriptor, the content of the archive is scanned and beans are managed.
The injection below is successful whereas it is expected the test throws an "UnsatisfiedResolutionException."
Test case below:
{code}
@RunWith(Arquillian.class)
public class ArquillianBeanXmlTest {
@Inject
private TestBean testBean;
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class)
.addClass(TestBean.class);
//.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");//sounds useless
}
//test is successful whereas it is expected to fail
@Test
public void testBeanInjected() {
assertNotNull(testBean);
}
}
{code}
And bean:
{code}
package org.jboss.arquillian.junit;
public class TestBean {
}
{code}
The pom is attached.
> Should not scan for classes in Archive if it contains no beans.xml
> ------------------------------------------------------------------
>
> Key: ARQ-841
> URL: https://issues.jboss.org/browse/ARQ-841
> Project: Arquillian
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Weld Containers
> Affects Versions: weld_1.0.0.CR3
> Reporter: Aslak Knutsen
> Labels: starter
> Fix For: weld_1.1.0.next
>
> Attachments: pom.xml
>
>
> A deployment with no beans.xml should not result in Beans being registered in the Weld Container.
--
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, 11 months
[JBoss JIRA] (ARQ-841) Should not scan for classes in Archive if it contains no beans.xml
by Karim de Fombelle (JIRA)
[ https://issues.jboss.org/browse/ARQ-841?page=com.atlassian.jira.plugin.sy... ]
Karim de Fombelle edited comment on ARQ-841 at 1/19/13 6:45 PM:
----------------------------------------------------------------
Similar issue observed with Arquillian 1.0.3.Final / arquillian-weld-se-embedded-1.1 1.0.0.CR5 / weld-core 1.1.10.Final / Shrinkwrap 2.0.0-alpha-1
Arquillian performs micro deployment in a CDI container, according the container adapter and the container found in the developer classpath.
The deployed content is built in a test class in the method annotated wit @Deployment
CDI specification mentions that the container will scan for "managed bean" only "bean archives", and those archive must contain a META-INF/bean.xml file
12.1. Bean archives
Bean classes of enabled beans must be deployed in bean archives.
• A library jar, EJB jar, application client jar or rar archive is a bean archive if it has a file named beans.xml in the
META-INF directory.
(...)
The container searches for beans in all bean archives in the application classpath
However, as illustrated in the test class below, without adding any descriptor, the content of the archive is scanned and beans are managed.
The injection below is successful whereas it is expected the test throws an "UnsatisfiedResolutionException."
Test case below:
{code}
@RunWith(Arquillian.class)
public class ArquillianBeanXmlTest {
@Inject
private TestBean testBean;
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class)
.addClass(TestBean.class);
//.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");//sounds useless
}
//test is successful whereas it is expected to fail
@Test
public void testBeanInjected() {
assertNotNull(testBean);
}
}
{code}
And bean:
{code}
package org.jboss.arquillian.junit;
public class TestBean {
}
{code}
The pom is attached.
was (Author: kdefombelle):
Similar issue observed with Arquillian 1.0.3.Final / arquillian-weld-se-embedded-1.1 1.0.0.CR5 / weld-core 1.1.10.Final / Shrinkwrap 2.0.0-alpha-1
Test case below:
{code}
@RunWith(Arquillian.class)
public class ArquillianBeanXmlTest {
@Inject
private TestBean testBean;
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class)
.addClass(TestBean.class);
//.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");//sounds useless
}
//test is successful whereas it is expected to fail
@Test
public void testBeanInjected() {
assertNotNull(testBean);
}
}
{code}
And bean:
{code}
package org.jboss.arquillian.junit;
public class TestBean {
}
{code}
The pom is attached.
> Should not scan for classes in Archive if it contains no beans.xml
> ------------------------------------------------------------------
>
> Key: ARQ-841
> URL: https://issues.jboss.org/browse/ARQ-841
> Project: Arquillian
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Weld Containers
> Affects Versions: weld_1.0.0.CR3
> Reporter: Aslak Knutsen
> Labels: starter
> Fix For: weld_1.1.0.next
>
> Attachments: pom.xml
>
>
> A deployment with no beans.xml should not result in Beans being registered in the Weld Container.
--
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, 11 months
[JBoss JIRA] (ARQ-841) Should not scan for classes in Archive if it contains no beans.xml
by Karim de Fombelle (JIRA)
[ https://issues.jboss.org/browse/ARQ-841?page=com.atlassian.jira.plugin.sy... ]
Karim de Fombelle edited comment on ARQ-841 at 1/19/13 6:45 PM:
----------------------------------------------------------------
Similar issue observed with Arquillian 1.0.3.Final / arquillian-weld-se-embedded-1.1 1.0.0.CR5 / weld-core 1.1.10.Final / Shrinkwrap 2.0.0-alpha-1
Arquillian performs micro deployment in a CDI container, according the container adapter and the container found in the developer classpath.
The deployed content is built in a test class in the method annotated wit @Deployment
CDI specification (JSR-2999) mentions that the container will scan for "managed bean" only "bean archives", and those archive must contain a META-INF/bean.xml file
bq. 12.1. Bean archives
Bean classes of enabled beans must be deployed in bean archives.
• A library jar, EJB jar, application client jar or rar archive is a bean archive if it has a file named beans.xml in the
META-INF directory.
(...)
The container searches for beans in all bean archives in the application classpath
However, as illustrated in the test class below, without adding any descriptor, the content of the archive is scanned and beans are managed.
The injection below is successful whereas it is expected the test throws an "UnsatisfiedResolutionException."
Test case below:
{code}
@RunWith(Arquillian.class)
public class ArquillianBeanXmlTest {
@Inject
private TestBean testBean;
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class)
.addClass(TestBean.class);
//.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");//sounds useless
}
//test is successful whereas it is expected to fail
@Test
public void testBeanInjected() {
assertNotNull(testBean);
}
}
{code}
And bean:
{code}
package org.jboss.arquillian.junit;
public class TestBean {
}
{code}
The pom is attached.
was (Author: kdefombelle):
Similar issue observed with Arquillian 1.0.3.Final / arquillian-weld-se-embedded-1.1 1.0.0.CR5 / weld-core 1.1.10.Final / Shrinkwrap 2.0.0-alpha-1
Arquillian performs micro deployment in a CDI container, according the container adapter and the container found in the developer classpath.
The deployed content is built in a test class in the method annotated wit @Deployment
CDI specification mentions that the container will scan for "managed bean" only "bean archives", and those archive must contain a META-INF/bean.xml file
12.1. Bean archives
Bean classes of enabled beans must be deployed in bean archives.
• A library jar, EJB jar, application client jar or rar archive is a bean archive if it has a file named beans.xml in the
META-INF directory.
(...)
The container searches for beans in all bean archives in the application classpath
However, as illustrated in the test class below, without adding any descriptor, the content of the archive is scanned and beans are managed.
The injection below is successful whereas it is expected the test throws an "UnsatisfiedResolutionException."
Test case below:
{code}
@RunWith(Arquillian.class)
public class ArquillianBeanXmlTest {
@Inject
private TestBean testBean;
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class)
.addClass(TestBean.class);
//.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");//sounds useless
}
//test is successful whereas it is expected to fail
@Test
public void testBeanInjected() {
assertNotNull(testBean);
}
}
{code}
And bean:
{code}
package org.jboss.arquillian.junit;
public class TestBean {
}
{code}
The pom is attached.
> Should not scan for classes in Archive if it contains no beans.xml
> ------------------------------------------------------------------
>
> Key: ARQ-841
> URL: https://issues.jboss.org/browse/ARQ-841
> Project: Arquillian
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Weld Containers
> Affects Versions: weld_1.0.0.CR3
> Reporter: Aslak Knutsen
> Labels: starter
> Fix For: weld_1.1.0.next
>
> Attachments: pom.xml
>
>
> A deployment with no beans.xml should not result in Beans being registered in the Weld Container.
--
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, 11 months
[JBoss JIRA] (ARQ-841) Should not scan for classes in Archive if it contains no beans.xml
by Karim de Fombelle (JIRA)
[ https://issues.jboss.org/browse/ARQ-841?page=com.atlassian.jira.plugin.sy... ]
Karim de Fombelle edited comment on ARQ-841 at 1/19/13 6:42 PM:
----------------------------------------------------------------
Similar issue observed with Arquillian 1.0.3.Final / arquillian-weld-se-embedded-1.1 1.0.0.CR5 / weld-core 1.1.10.Final / Shrinkwrap 2.0.0-alpha-1
Test case below:
{code}
@RunWith(Arquillian.class)
public class ArquillianBeanXmlTest {
@Inject
private TestBean testBean;
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class)
.addClass(TestBean.class);
//.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");//sounds useless
}
//test is successful whereas it is expected to fail
@Test
public void testBeanInjected() {
assertNotNull(testBean);
}
}
{code}
And bean:
{code}
package org.jboss.arquillian.junit;
public class TestBean {
}
{code}
The pom is attached.
was (Author: kdefombelle):
Similar issue observed with Arquillian 1.0.3.Final / arquillian-weld-se-embedded-1.1 1.0.0.CR5 / weld-core 1.1.10.Final / Shrinkwrap 2.0.0-alpha-1
Test case below:
{code}
@RunWith(Arquillian.class)
public class ArquillianBeanXmlTest {
@Inject
private TestBean testBean;
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class)
.addClass(TestBean.class);
//.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");//sounds useless
}
//test is successful whereas it is expected to fail
@Test
public void testBeanInjected() {
assertNotNull(testBean);
}
}
{code}
And bean:
{code}
package org.jboss.arquillian.junit;
public class TestBean {
}
{code}
The pom is attached.
> Should not scan for classes in Archive if it contains no beans.xml
> ------------------------------------------------------------------
>
> Key: ARQ-841
> URL: https://issues.jboss.org/browse/ARQ-841
> Project: Arquillian
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Weld Containers
> Affects Versions: weld_1.0.0.CR3
> Reporter: Aslak Knutsen
> Labels: starter
> Fix For: weld_1.1.0.next
>
> Attachments: pom.xml
>
>
> A deployment with no beans.xml should not result in Beans being registered in the Weld Container.
--
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, 11 months