[
https://issues.jboss.org/browse/SHRINKWRAP-419?page=com.atlassian.jira.pl...
]
Aslak Knutsen commented on SHRINKWRAP-419:
------------------------------------------
Have a similar problem in Arquillian Core as well. The issue is of course that while the
EnterpriseArchive interface is correct (does not extend on ClassContainer), the
EnterpriseArchiveImpl extends the generic ContainerBase implement that extend all of the
XContainer interfaces.
In general we should not rely on the Type of appArchive to determine what it is. The type
is just a wrapper and could be anything, it's the archive name's file extension
that determines the end result.
appArchive could be MyConstomWrapperType while the underlying archive is still my-app.ear.
ViewType != ArchiveType. ShrinkWrap currently only operate on ViewTypes and ignores
ArchiveTypes.
SHRINKWRAP-402
UnsupportedOperationException: EnterpriseArchive does not support
classes
-------------------------------------------------------------------------
Key: SHRINKWRAP-419
URL:
https://issues.jboss.org/browse/SHRINKWRAP-419
Project: ShrinkWrap
Issue Type: Bug
Reporter: Bernard Labno
Fix For: 1.1.0-alpha-4
EnterpriseArchiveImpl extends EnterpriseContainerBase which extends ContainerBase which
implements ClassContainer.
However addClass from ClassContainer interface throws UnsupportedOperationException.
This is not nice. MockContexts extension for Arquillian does this:
{code:java}
if (appArchive instanceof ClassContainer) {
((ClassContainer) appArchive).addClass(MockViewScopedContext.class);
((ClassContainer) appArchive).addClass(MockConversationScopedContext.class);
}{code}
To avoid such problems, and for EAR it hits UnsupportedOperationException. Very not nice.
--
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