Author: olamy
Date: Tue Mar 13 16:12:32 2012
New Revision: 1300215

URL: http://svn.apache.org/viewvc?rev=1300215&view=rev
Log:
[SHADE-91] Allow using external Shader implementation
add integration test.

Added:
    maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/
    maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/pom.xml   
(with props)
    maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/
    maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/main/
    
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/main/java/
    
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/main/java/org/
    
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/main/java/org/apache/
    
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/main/java/org/apache/maven/
    
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/main/java/org/apache/maven/plugins/
    
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/main/java/org/apache/maven/plugins/shade/
    
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/main/java/org/apache/maven/plugins/shade/its/
    
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/main/java/org/apache/maven/plugins/shade/its/App.java
   (with props)
    maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/test/
    
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/test/java/
    
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/test/java/org/
    
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/test/java/org/apache/
    
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/test/java/org/apache/maven/
    
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/test/java/org/apache/maven/plugins/
    
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/test/java/org/apache/maven/plugins/shade/
    
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/test/java/org/apache/maven/plugins/shade/its/
    
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/test/java/org/apache/maven/plugins/shade/its/AppTest.java
   (with props)
    
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/verify.groovy   
(with props)
    
maven/plugins/trunk/maven-shade-plugin/src/test/java/org/apache/maven/plugins/shade/MockShader.java
   (with props)

Added: maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/pom.xml?rev=1300215&view=auto
==============================================================================
--- maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/pom.xml 
(added)
+++ maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/pom.xml Tue 
Mar 13 16:12:32 2012
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.plugins.shade.its</groupId>
+  <artifactId>users-shader-impl</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <name>users-shader-impl</name>
+
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.7</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <configuration>
+            <source>1.5</source>
+            <target>1.5</target>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>@project.version@</version>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-shade-plugin</artifactId>
+            <version>@project.version@</version>
+            <classifier>tests</classifier>
+          </dependency>
+        </dependencies>
+        <executions>
+          <execution>
+            <id>create-shaded-artifact</id>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <shaderHint>mock</shaderHint>
+              <shadedArtifactAttached>true</shadedArtifactAttached>
+              <shadedClassifierName>shaded</shadedClassifierName>
+              <createDependencyReducedPom>false</createDependencyReducedPom>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: 
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/main/java/org/apache/maven/plugins/shade/its/App.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/main/java/org/apache/maven/plugins/shade/its/App.java?rev=1300215&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/main/java/org/apache/maven/plugins/shade/its/App.java
 (added)
+++ 
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/main/java/org/apache/maven/plugins/shade/its/App.java
 Tue Mar 13 16:12:32 2012
@@ -0,0 +1,13 @@
+package org.apache.maven.plugins.shade.its;
+
+/**
+ * Hello world!
+ *
+ */
+public class App 
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}

Propchange: 
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/main/java/org/apache/maven/plugins/shade/its/App.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/main/java/org/apache/maven/plugins/shade/its/App.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/test/java/org/apache/maven/plugins/shade/its/AppTest.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/test/java/org/apache/maven/plugins/shade/its/AppTest.java?rev=1300215&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/test/java/org/apache/maven/plugins/shade/its/AppTest.java
 (added)
+++ 
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/test/java/org/apache/maven/plugins/shade/its/AppTest.java
 Tue Mar 13 16:12:32 2012
@@ -0,0 +1,38 @@
+package org.apache.maven.plugins.shade.its;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest 
+    extends TestCase
+{
+    /**
+     * Create the test case
+     *
+     * @param testName name of the test case
+     */
+    public AppTest( String testName )
+    {
+        super( testName );
+    }
+
+    /**
+     * @return the suite of tests being tested
+     */
+    public static Test suite()
+    {
+        return new TestSuite( AppTest.class );
+    }
+
+    /**
+     * Rigourous Test :-)
+     */
+    public void testApp()
+    {
+        assertTrue( true );
+    }
+}

Propchange: 
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/test/java/org/apache/maven/plugins/shade/its/AppTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/src/test/java/org/apache/maven/plugins/shade/its/AppTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/verify.groovy
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/verify.groovy?rev=1300215&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/verify.groovy 
(added)
+++ 
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/verify.groovy 
Tue Mar 13 16:12:32 2012
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+assert new File(basedir, 'build.log').exists();
+
+content = new File(basedir, 'build.log').text;
+assert content.contains( 'Executing MockShader#shade');
+
+return true;
\ No newline at end of file

Propchange: 
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/verify.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-shade-plugin/src/it/users-shader-impl/verify.groovy
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/plugins/trunk/maven-shade-plugin/src/test/java/org/apache/maven/plugins/shade/MockShader.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/test/java/org/apache/maven/plugins/shade/MockShader.java?rev=1300215&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-shade-plugin/src/test/java/org/apache/maven/plugins/shade/MockShader.java
 (added)
+++ 
maven/plugins/trunk/maven-shade-plugin/src/test/java/org/apache/maven/plugins/shade/MockShader.java
 Tue Mar 13 16:12:32 2012
@@ -0,0 +1,45 @@
+package org.apache.maven.plugins.shade;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.shade.filter.Filter;
+import org.apache.maven.plugins.shade.relocation.Relocator;
+import org.apache.maven.plugins.shade.resource.ResourceTransformer;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author Olivier Lamy
+ * @plexus.component instantiation-strategy="per-lookup" role-hint="mock"
+ */
+public class MockShader
+    implements Shader
+{
+    public void shade( Set<File> jars, File uberJar, List<Filter> filters, 
List<Relocator> relocators,
+                       List<ResourceTransformer> resourceTransformers )
+        throws IOException, MojoExecutionException
+    {
+
+        System.out.println( "Executing MockShader#shade" );
+    }
+}

Propchange: 
maven/plugins/trunk/maven-shade-plugin/src/test/java/org/apache/maven/plugins/shade/MockShader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-shade-plugin/src/test/java/org/apache/maven/plugins/shade/MockShader.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision


Reply via email to