Arquillian and seam problem
vrtunski May 30, 2011 3:36 AMHello,
I am developing app that i wanna test with arquillian alpha 5. When i test beans that have properties managed by seam extensions i
always get "unsatisfied dependecies error" . I am using seam solder module and seam servlet module. Beans that have Logger and Servlet Context injected fail when being tested.
My pom :
<profile>
<id>arq-weld-embedded</id>
<activation>
<property>
<name>!arquillian</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>org.jboss.weld.arquillian.container</groupId>
<artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
<scope>test</scope>
</dependency>
<!-- Arquillian Weld EE Embedded requires the EL and EJB 3.1 APIs; Weld
runtime provided by weld-servlet -->
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<!-- remove scope if bundling EL libraries w/ webapp -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.ejb</groupId>
<artifactId>jboss-ejb-api_3.1_spec</artifactId>
<version>1.0.0.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-tomcat-support</artifactId>
<version>1.0.1-CR2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.seam.servlet</groupId>
<artifactId>seam-servlet</artifactId>
<version>3.0.0.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>3.0.0.Beta1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.6.0.Final</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
Exact exception :
org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [ServletContext] with qualifiers [@Default] at injection point [[field] @Inject private biz.netdialog.properties.PropertyUtil.sc
Test:
@Deployment
public static Archive<?> createTestArchive() {
WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war")
.addLibraries(MavenArtifactResolver.resolve("org.jboss.seam.solder", "seam-solder"),MavenArtifactResolver.resolve("org.jboss.weld.servlet", "weld-servlet"))
.addClass(HelloWorld.class)
.addClass(EntityManagerPool.class)
.addClass(SessionData.class)
.addClass(NetXDB.class)
.addClass(MockServletContext.class)
.addClass(DBProperties.class)
.addClass(ServletContext.class)
.addClass(PropertyUtil.class)
.addWebResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"))
.addManifestResource("test-persistence.xml",ArchivePaths.create("persistence.xml"));
System.out.println(war.toString(true));
return war;