package org.jboss.shrinkwrap.resolver.impl.maven.integration;

import java.io.File;

import org.jboss.shrinkwrap.resolver.api.Resolvers;
import org.jboss.shrinkwrap.resolver.api.maven.ConfiguredResolveStage;
import org.jboss.shrinkwrap.resolver.api.maven.MavenResolverSystem;
import org.jboss.shrinkwrap.resolver.impl.maven.strategy.NonTransitiveStrategy;
import org.jboss.shrinkwrap.resolver.impl.maven.util.ValidationUtil;
import org.junit.Assert;
import org.junit.Test;

/**
 * Verified plugin integration on current project
 *
 * This tests are expected to fail in IDE until integration with IDE is done.
 *
 * @author <a href="kpiwko@redhat.com">Karel Piwko</a>
 *
 */
public class PluginIntegrationTestCase {

    @Test
    public void loadCurrentProject() {
        ConfiguredResolveStage resolver = Resolvers.use(MavenResolverSystem.class).configureFromPlugin();
        Assert.assertNotNull("Resolver was retrieved from environment", resolver);
    }

    @Test
    public void loadCurrentVersion() {
        ConfiguredResolveStage resolver = Resolvers.use(MavenResolverSystem.class).configureFromPlugin();

        File[] files = resolver.resolve("org.sonatype.aether:aether-api").withTransitivity().as(File.class);
        new ValidationUtil("aether-api").validate(files);
    }

    @Test
    public void strictlyLoadTestDependencies() {
        ConfiguredResolveStage resolver = Resolvers.use(MavenResolverSystem.class).configureFromPlugin();

        File[] files = resolver.importRuntimeAndTestDependencies(new NonTransitiveStrategy()).as(File.class);

        new ValidationUtil("shrinkwrap-impl-base", "junit", "commons-codec", "jetty").validate(files);
    }

}

@@ -664,15 +664,12 @@
 /a%3E%0A
- *%0A
  */%0A
+
 publ
@@ -706,16 +706,164 @@
 Case %7B%0A%0A
+    /*%0A     * NOTE: This test will depend upon information declared in this project's POM. Changes to the POM will impact the%0A     * test.%0A     */%0A%0A
     @Tes
@@ -1595,32 +1595,38 @@
 gin();%0A%0A        
+final 
 File%5B%5D files = r
@@ -1650,15 +1650,8 @@
 time
-AndTest
 Depe
@@ -1704,17 +1704,16 @@
 class);%0A
-%0A
         
@@ -1736,65 +1736,534 @@
 il(%22
-shrinkwrap-impl-base%22, %22junit%22, %22commons-codec%22, %22jetty%22)
+maven-settings-builder%22, %22plexus-interpolation%22, %22maven-settings%22, %22aether-util%22,%0A            %22aether-spi%22, %22maven-model-builder%22, %22wagon-provider-api%22, %22plexus-cipher%22, %22maven-repository-metadata%22,%0A            %22shrinkwrap-resolver-api-maven-prototype%22, %22maven-model%22, %22jsoup%22, %22sisu-inject-plexus%22,%0A            %22maven-aether-provider%22, %22plexus-utils%22, %22wagon-file%22, %22aether-api%22, %22aether-connector-wagon%22,%0A            %22plexus-classworlds%22, %22wagon-http-lightweight%22, %22plexus-component-annotations%22, %22aether-impl%22)%0A            
 .val

Fix PluginIntegrationTestCase to reflect current POM dependencies