Skip to content
This repository has been archived by the owner on Mar 6, 2018. It is now read-only.

Seam 2 support for Arquillian. Supports injection points annotated with @in and handles packaging Seam 2 libraries.

License

Notifications You must be signed in to change notification settings

arquillian/arquillian-extension-seam2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Obsolete

We don't maintain this code base anymore. If you are interested in picking it up from where we left please reach out to us through Arquillian forum.

Seam 2 support for Arquillian

  • Test enrichment for @In injection points from the Seam 2 Context.
  • Packaging support for adding the Seam 2 framework.
  • Tested on JBoss AS 4.2.3.GA and 5.1.0.Final (both remote and managed).

For more details please refer to Arquillian Confluence.

Code example

@Name("fluidOuncesConverter")
public class FluidOuncesConverter
{

   public Double convertToMillilitres(Double ounces)
   {
      return ounces * 29.5735296;
   }

}

@RunWith(Arquillian.class)
public class ComponentInjectionTestCase
{
   @Deployment
   public static Archive<?> createDeployment()
   {
      return ShrinkWrap.create(WebArchive.class, "test.war")
                       .addClass(FluidOuncesConverter.class)
                       .addPackages(true, "org.fest")
                       .addPackages(true, "org.dom4j") // Required for JBoss AS 4.2.3.GA
                       .addAsResource(EmptyAsset.INSTANCE, "seam.properties")
                       .setWebXML("web.xml");
   }

   @In
   FluidOuncesConverter fluidOuncesConverter;

   @Test
   public void shouldInjectSeamComponent() throws Exception
   {
      assertThat(fluidOuncesConverter).isNotNull();
   }

   @Test
   public void shouldConvertFluidOuncesToMillilitres() throws Exception
   {
      // given
      Double ouncesToConver = Double.valueOf(8.0d);
      Double expectedMillilitres = Double.valueOf(236.5882368d);

      // when
      Double millilitres = fluidOuncesConverter.convertToMillilitres(ouncesToConver);

      // then
      assertThat(millilitres).isEqualTo(expectedMillilitres);

   }
}

Note: if you will face problems fetching some dependencies add following Maven repositories.

About

Seam 2 support for Arquillian. Supports injection points annotated with @in and handles packaging Seam 2 libraries.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages