package org.jboss.forge.aesh;

import javax.inject.Inject;

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.forge.arquillian.archive.ForgeArchive;
import org.jboss.shrinkwrap.api.ArchivePaths;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.resolver.api.DependencyResolvers;
import org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;

/**
 * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
 */
@RunWith(Arquillian.class)
public class AeshAddonTest
{
   @Deployment
   public static ForgeArchive getDeployment()
   {
      ForgeArchive archive = ShrinkWrap.create(ForgeArchive.class)
               .addClasses(AeshShell.class)
               .addAsLibraries(DependencyResolvers.use(MavenDependencyResolver.class).loadMetadataFromPom("pom.xml").artifact("org.jboss.aesh:aesh:0.22").resolveAs(JavaArchive.class))
               .addAsManifestResource(new StringAsset(""), ArchivePaths.create("beans.xml"))
               .setAsForgeXML(new StringAsset("<addon/>"));

      return archive;
   }

   @Inject
   private AeshShell simple;

   @Test
   public void testContainerInjection()
   {
      Assert.assertNotNull(simple);
   }

   @Test
   public void testLifecycle() throws Exception
   {

   }

}
@@ -450,99 +450,19 @@
 api.
-DependencyResolvers;%0Aimport org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver
+maven.Maven
 ;%0Aim
@@ -786,16 +786,32 @@
 rinkWrap
+%0A               
 .create(
@@ -909,82 +909,65 @@
 ies(
-DependencyResolvers.use(MavenDependencyResolver.class).loadMetadataFromPom
+%0A                        Maven.resolver().loadPomFromFile
 (%22po
@@ -978,16 +978,15 @@
 l%22).
-artifact
+resolve
 (%22or
@@ -1013,17 +1013,63 @@
 22%22)
-.resolveA
+%0A                                 .withTransitivity().a
 s(Ja

Update for new ShrinkWrap API