Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions cdi/alternatives/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,5 @@
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>org.javaee7.cdi</groupId>
<artifactId>alternatives</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
</project>

This file was deleted.

55 changes: 0 additions & 55 deletions cdi/alternatives/src/main/webapp/index.jsp

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package org.javaee7.cdi.alternatives;

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Test;
import org.junit.runner.RunWith;

import javax.inject.Inject;

import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;

/**
* @author Alexis Hassler
*/
@RunWith(Arquillian.class)
public class GreetingTest {
@Deployment
public static Archive<?> deploy() {
return ShrinkWrap.create(JavaArchive.class)
.addClasses(Greeting.class, SimpleGreeting.class, FancyGreeting.class)
.addAsManifestResource("beans.xml");
}

@Inject Greeting bean;

@Test
public void should_bean_be_injected() throws Exception {
assertThat(bean, is(notNullValue()));
}

@Test
public void should_bean_be_fancy() throws Exception {
// because it is declared as the alternative in beans.xml
assertThat(bean, instanceOf(FancyGreeting.class));
}
}
14 changes: 14 additions & 0 deletions cdi/alternatives/src/test/resources/arquillian.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://jboss.org/schema/arquillian" xsi:schemaLocation="http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

<defaultProtocol type="Servlet 3.0"/>

<container qualifier="test" default="true">
<configuration>
<property name="jbossHome">${serverRoot:target/wildfly-8.0.0.Beta1}</property>
<property name="serverConfig">${serverProfile:standalone-full.xml}</property>
</configuration>
</container>

</arquillian>

This file was deleted.

Loading