maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rfscho...@apache.org
Subject svn commit: r1691830 - /maven/plugins/trunk/maven-shade-plugin/src/test/java/org/apache/maven/plugins/shade/resource/ServiceResourceTransformerTest.java
Date Sun, 19 Jul 2015 14:59:10 GMT
Author: rfscholte
Date: Sun Jul 19 14:59:10 2015
New Revision: 1691830

URL: http://svn.apache.org/r1691830
Log:
[MSHADE-190] Shade does not relocate the contents of META-INF/services files
Also make test compilable with JDK 1.5, since String.getBytes(CharSet) is introduced with
JDK6

Modified:
    maven/plugins/trunk/maven-shade-plugin/src/test/java/org/apache/maven/plugins/shade/resource/ServiceResourceTransformerTest.java

Modified: maven/plugins/trunk/maven-shade-plugin/src/test/java/org/apache/maven/plugins/shade/resource/ServiceResourceTransformerTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/test/java/org/apache/maven/plugins/shade/resource/ServiceResourceTransformerTest.java?rev=1691830&r1=1691829&r2=1691830&view=diff
==============================================================================
--- maven/plugins/trunk/maven-shade-plugin/src/test/java/org/apache/maven/plugins/shade/resource/ServiceResourceTransformerTest.java
(original)
+++ maven/plugins/trunk/maven-shade-plugin/src/test/java/org/apache/maven/plugins/shade/resource/ServiceResourceTransformerTest.java
Sun Jul 19 14:59:10 2015
@@ -19,12 +19,9 @@
 
 package org.apache.maven.plugins.shade.resource;
 
-import com.google.common.base.Charsets;
-import com.google.common.collect.Lists;
-import org.apache.commons.io.IOUtils;
-import org.apache.maven.plugins.shade.relocation.Relocator;
-import org.apache.maven.plugins.shade.relocation.SimpleRelocator;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.io.ByteArrayInputStream;
 import java.io.File;
@@ -35,9 +32,12 @@ import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.jar.JarOutputStream;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import org.apache.commons.io.IOUtils;
+import org.apache.maven.plugins.shade.relocation.Relocator;
+import org.apache.maven.plugins.shade.relocation.SimpleRelocator;
+import org.junit.Test;
+
+import com.google.common.collect.Lists;
 
 /**
  * Test for handling META-INF/service/...
@@ -50,7 +50,7 @@ public class ServiceResourceTransformerT
         List<Relocator> relocators = Lists.<Relocator>newArrayList( relocator
);
 
         String content = "org.foo.Service\n";
-        byte[] contentBytes = content.getBytes( Charsets.UTF_8 );
+        byte[] contentBytes = content.getBytes( "UTF-8" );
         InputStream contentStream = new ByteArrayInputStream( contentBytes );
         String contentResource = "META-INF/services/org.something.another";
 
@@ -90,7 +90,7 @@ public class ServiceResourceTransformerT
         List<Relocator> relocators = Lists.<Relocator>newArrayList( relocator
);
 
         String content = "org.foo.Service\n";
-        byte[] contentBytes = content.getBytes( Charsets.UTF_8 );
+        byte[] contentBytes = content.getBytes( "UTF-8" );
         InputStream contentStream = new ByteArrayInputStream( contentBytes );
         String contentResource = "META-INF/services/org.something.another";
 
@@ -98,7 +98,7 @@ public class ServiceResourceTransformerT
         xformer.processResource( contentResource, contentStream, relocators );
 
         content = "org.blah.Service\n";
-        contentBytes = content.getBytes( Charsets.UTF_8 );
+        contentBytes = content.getBytes( "UTF-8" );
         contentStream = new ByteArrayInputStream( contentBytes );
         contentResource = "META-INF/services/org.something.another";
 



Mime
View raw message