Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,22 @@
<artifactId>org.eclipse.sisu.plexus</artifactId>
<scope>test</scope>
</dependency>
<!-- Used by: ShadeMojoTest, which extends AbstractMojoTestCase (JUnit 3 TestCase) -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
Expand Down
73 changes: 35 additions & 38 deletions src/test/java/org/apache/maven/plugins/shade/DefaultShaderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@
import org.apache.maven.plugins.shade.resource.ServicesResourceTransformer;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.Os;
import org.junit.Assert;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import org.mockito.ArgumentCaptor;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
Expand All @@ -78,9 +77,9 @@
import static org.hamcrest.CoreMatchers.hasItems;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
Expand All @@ -93,8 +92,8 @@ public class DefaultShaderTest {
private static final String[] EXCLUDES =
new String[] {"org/codehaus/plexus/util/xml/Xpp3Dom", "org/codehaus/plexus/util/xml/pull.*"};

@ClassRule
public static final TemporaryFolder TEMPORARY_FOLDER = new TemporaryFolder();
@TempDir
static File temporaryFolder;

private static final String NEWLINE = "\n";

Expand Down Expand Up @@ -190,17 +189,16 @@ public void testOverlappingResourcesAreLogged() throws IOException, MojoExecutio

@Test
public void testOverlappingResourcesAreLoggedExceptATransformerHandlesIt() throws Exception {
TemporaryFolder temporaryFolder = new TemporaryFolder();
File temporaryFolder = Files.createTempDirectory("junit").toFile();
try {
Set<File> set = new LinkedHashSet<>();
temporaryFolder.create();
File j1 = temporaryFolder.newFile("j1.jar");
File j1 = newFile(temporaryFolder, "j1.jar");
try (JarOutputStream jos = new JarOutputStream(new FileOutputStream(j1))) {
jos.putNextEntry(new JarEntry("foo.txt"));
jos.write("c1".getBytes(StandardCharsets.UTF_8));
jos.closeEntry();
}
File j2 = temporaryFolder.newFile("j2.jar");
File j2 = newFile(temporaryFolder, "j2.jar");
try (JarOutputStream jos = new JarOutputStream(new FileOutputStream(j2))) {
jos.putNextEntry(new JarEntry("foo.txt"));
jos.write("c2".getBytes(StandardCharsets.UTF_8));
Expand Down Expand Up @@ -293,7 +291,7 @@ public void testShaderWithoutExcludesShouldRemoveReferencesOfOriginalPattern() t

@Test
public void testHandleDirectory() throws Exception {
final File dir = TEMPORARY_FOLDER.getRoot();
final File dir = temporaryFolder;
// explode src/test/jars/test-artifact-1.0-SNAPSHOT.jar in this temp dir
try (JarInputStream in =
new JarInputStream(Files.newInputStream(Paths.get("src/test/jars/test-artifact-1.0-SNAPSHOT.jar")))) {
Expand Down Expand Up @@ -391,12 +389,10 @@ public void visitSource(String arg0, String arg1) {

@Test
public void testShaderWithNestedJar() throws Exception {
TemporaryFolder temporaryFolder = new TemporaryFolder();
File temporaryFolder = Files.createTempDirectory("junit").toFile();

final String innerJarFileName = "inner.jar";

temporaryFolder.create();
File innerJar = temporaryFolder.newFile(innerJarFileName);
File innerJar = newFile(temporaryFolder, innerJarFileName);
try (JarOutputStream jos = new JarOutputStream(Files.newOutputStream(innerJar.toPath()))) {
jos.putNextEntry(new JarEntry("foo.txt"));
jos.write("c1".getBytes(StandardCharsets.UTF_8));
Expand All @@ -408,7 +404,7 @@ public void testShaderWithNestedJar() throws Exception {
shadeRequest.setFilters(Collections.emptyList());
shadeRequest.setRelocators(Collections.emptyList());
shadeRequest.setResourceTransformers(Collections.emptyList());
File shadedFile = temporaryFolder.newFile("shaded.jar");
File shadedFile = newFile(temporaryFolder, "shaded.jar");
shadeRequest.setUberJar(shadedFile);

DefaultShader shader = newShader();
Expand All @@ -427,19 +423,17 @@ public void testShaderWithNestedJar() throws Exception {

@Test
public void testShaderNoOverwrite() throws Exception {
TemporaryFolder temporaryFolder = new TemporaryFolder();
File temporaryFolder = Files.createTempDirectory("junit").toFile();

final String innerJarFileName = "inner.jar";

temporaryFolder.create();
File innerJar = temporaryFolder.newFile(innerJarFileName);
File innerJar = newFile(temporaryFolder, innerJarFileName);
try (JarOutputStream jos = new JarOutputStream(new FileOutputStream(innerJar))) {
jos.putNextEntry(new JarEntry("foo.txt"));
jos.write("c1".getBytes(StandardCharsets.UTF_8));
jos.closeEntry();
}

File outerJar = temporaryFolder.newFile("outer.jar");
File outerJar = newFile(temporaryFolder, "outer.jar");
try (JarOutputStream jos = new JarOutputStream(new FileOutputStream(outerJar))) {
FileInputStream innerStream = new FileInputStream(innerJar);
byte[] bytes = IOUtil.toByteArray(innerStream, 32 * 1024);
Expand All @@ -452,7 +446,7 @@ public void testShaderNoOverwrite() throws Exception {
shadeRequest.setFilters(new ArrayList<>());
shadeRequest.setRelocators(new ArrayList<>());
shadeRequest.setResourceTransformers(new ArrayList<>());
File shadedFile = temporaryFolder.newFile("shaded.jar");
File shadedFile = newFile(temporaryFolder, "shaded.jar");
shadeRequest.setUberJar(shadedFile);

DefaultShader shader = newShader();
Expand All @@ -462,27 +456,26 @@ public void testShaderNoOverwrite() throws Exception {
JarEntry entry = shadedJarFile.getJarEntry(innerJarFileName);

// After shading, entry compression method should not be changed.
Assert.assertEquals(entry.getMethod(), ZipEntry.STORED);
Assertions.assertEquals(entry.getMethod(), ZipEntry.STORED);

temporaryFolder.delete();
}

@Test
public void testShaderWithDuplicateService() throws Exception {
TemporaryFolder temporaryFolder = new TemporaryFolder();
temporaryFolder.create();
File temporaryFolder = Files.createTempDirectory("junit").toFile();

String serviceEntryName = "META-INF/services/my.foo.Service";
String serviceEntryValue = "my.foo.impl.Service1";

File innerJar1 = temporaryFolder.newFile("inner1.jar");
File innerJar1 = newFile(temporaryFolder, "inner1.jar");
try (JarOutputStream jos = new JarOutputStream(Files.newOutputStream(innerJar1.toPath()))) {
jos.putNextEntry(new JarEntry(serviceEntryName));
jos.write((serviceEntryValue + NEWLINE).getBytes(StandardCharsets.UTF_8));
jos.closeEntry();
}

File innerJar2 = temporaryFolder.newFile("inner2.jar");
File innerJar2 = newFile(temporaryFolder, "inner2.jar");
try (JarOutputStream jos = new JarOutputStream(Files.newOutputStream(innerJar2.toPath()))) {
jos.putNextEntry(new JarEntry(serviceEntryName));
jos.write((serviceEntryValue + NEWLINE).getBytes(StandardCharsets.UTF_8));
Expand All @@ -494,7 +487,7 @@ public void testShaderWithDuplicateService() throws Exception {
shadeRequest.setFilters(Collections.emptyList());
shadeRequest.setRelocators(Collections.emptyList());
shadeRequest.setResourceTransformers(Collections.singletonList(new ServicesResourceTransformer()));
File shadedFile = temporaryFolder.newFile("shaded.jar");
File shadedFile = newFile(temporaryFolder, "shaded.jar");
shadeRequest.setUberJar(shadedFile);

DefaultShader shader = newShader();
Expand All @@ -509,20 +502,18 @@ public void testShaderWithDuplicateService() throws Exception {
.collect(Collectors.toList());

// After shading, there should be a single input
Assert.assertEquals(Collections.singletonList(serviceEntryValue), lines);
Assertions.assertEquals(Collections.singletonList(serviceEntryValue), lines);

temporaryFolder.delete();
}

@Test
public void testShaderWithSmallEntries() throws Exception {
TemporaryFolder temporaryFolder = new TemporaryFolder();
File temporaryFolder = Files.createTempDirectory("junit").toFile();

final String innerJarFileName = "inner.jar";
int len;

temporaryFolder.create();
File innerJar = temporaryFolder.newFile(innerJarFileName);
File innerJar = newFile(temporaryFolder, innerJarFileName);
try (JarOutputStream jos = new JarOutputStream(Files.newOutputStream(innerJar.toPath()))) {
jos.putNextEntry(new JarEntry("foo.txt"));
byte[] bytes = "c1".getBytes(StandardCharsets.UTF_8);
Expand All @@ -536,7 +527,7 @@ public void testShaderWithSmallEntries() throws Exception {
shadeRequest.setFilters(new ArrayList<>());
shadeRequest.setRelocators(new ArrayList<>());
shadeRequest.setResourceTransformers(new ArrayList<>());
File shadedFile = temporaryFolder.newFile("shaded.jar");
File shadedFile = newFile(temporaryFolder, "shaded.jar");
shadeRequest.setUberJar(shadedFile);

DefaultShader shader = newShader();
Expand All @@ -546,7 +537,7 @@ public void testShaderWithSmallEntries() throws Exception {
JarEntry entry = shadedJarFile.getJarEntry("foo.txt");

// After shading, entry compression method should not be changed.
Assert.assertEquals(entry.getSize(), len);
Assertions.assertEquals(entry.getSize(), len);

temporaryFolder.delete();
}
Expand Down Expand Up @@ -628,4 +619,10 @@ private boolean areEqual(final JarFile jar1, final JarFile jar2, final String en
return Arrays.equals(IOUtil.toByteArray(s1), IOUtil.toByteArray(s2));
}
}

private static File newFile(File parent, String child) throws IOException {
File result = new File(parent, child);
result.createNewFile();
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,35 @@
import org.apache.maven.model.Build;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.project.MavenProject;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import org.mockito.ArgumentCaptor;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeFalse;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assumptions.assumeFalse;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

public class MinijarFilterTest {

@Rule
public TemporaryFolder tempFolder =
TemporaryFolder.builder().assureDeletion().build();
@TempDir
File tempFolder;

private File outputDirectory;
private File emptyFile;
private File jarFile;
private Log log;
private ArgumentCaptor<CharSequence> logCaptor;

@Before
@BeforeEach
public void init() throws IOException {
this.outputDirectory = tempFolder.newFolder();
this.emptyFile = tempFolder.newFile();
this.jarFile = tempFolder.newFile();
this.outputDirectory = newFolder(tempFolder, "junit");
this.emptyFile = File.createTempFile("junit", null, tempFolder);
this.jarFile = File.createTempFile("junit", null, tempFolder);
new JarOutputStream(Files.newOutputStream(this.jarFile.toPath())).close();
this.log = mock(Log.class);
logCaptor = ArgumentCaptor.forClass(CharSequence.class);
Expand All @@ -75,9 +73,7 @@ public void init() throws IOException {
*/
@Test
public void testWithMockProject() throws IOException {
assumeFalse(
"Expected to run under JDK8+",
System.getProperty("java.version").startsWith("1.7"));
assumeFalse(System.getProperty("java.version").startsWith("1.7"), "Expected to run under JDK8+");

MavenProject mavenProject = mockProject(outputDirectory, emptyFile);

Expand Down Expand Up @@ -171,4 +167,13 @@ public void finishedShouldProduceMessageForClassesTotalZero() {

assertEquals("Minimized 0 -> 0", logCaptor.getValue());
}

private static File newFolder(File root, String... subDirs) throws IOException {
String subFolder = String.join("/", subDirs);
File result = new File(root, subFolder);
if (!result.mkdirs()) {
throw new IOException("Couldn't create folders " + root);
}
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
import java.util.Collections;

import org.apache.maven.plugins.shade.mojo.ArchiveFilter;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

Expand All @@ -37,15 +37,15 @@
public void testIsFiltered() {
SimpleFilter filter;

filter = new SimpleFilter(null, null, null);

Check warning on line 40 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / ubuntu-latest jdk-17-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated

Check warning on line 40 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / ubuntu-latest jdk-21-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated

Check warning on line 40 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / macos-latest jdk-21-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated

Check warning on line 40 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / macos-latest jdk-25-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated

Check warning on line 40 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / ubuntu-latest jdk-25-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated

Check warning on line 40 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / ubuntu-latest jdk-8-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated

Check warning on line 40 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / macos-latest jdk-8-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated
assertFalse(filter.isFiltered("a.properties"));
assertFalse(filter.isFiltered("org/Test.class"));

filter = new SimpleFilter(null, Collections.<String>emptySet(), Collections.<String>emptySet());

Check warning on line 44 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / ubuntu-latest jdk-17-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated

Check warning on line 44 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / ubuntu-latest jdk-21-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated

Check warning on line 44 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / macos-latest jdk-21-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated

Check warning on line 44 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / macos-latest jdk-25-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated

Check warning on line 44 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / ubuntu-latest jdk-25-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated

Check warning on line 44 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / ubuntu-latest jdk-8-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated

Check warning on line 44 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / macos-latest jdk-8-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated
assertFalse(filter.isFiltered("a.properties"));
assertFalse(filter.isFiltered("org/Test.class"));

filter = new SimpleFilter(null, Collections.singleton("org/Test.class"), Collections.<String>emptySet());

Check warning on line 48 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / ubuntu-latest jdk-17-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated

Check warning on line 48 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / ubuntu-latest jdk-21-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated

Check warning on line 48 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / macos-latest jdk-21-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated

Check warning on line 48 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / macos-latest jdk-25-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated

Check warning on line 48 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / ubuntu-latest jdk-25-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated

Check warning on line 48 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / ubuntu-latest jdk-8-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated

Check warning on line 48 in src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java

View workflow job for this annotation

GitHub Actions / Verify / macos-latest jdk-8-zulu 3.10.0-rc-1

SimpleFilter(java.util.Set<java.io.File>,java.util.Set<java.lang.String>,java.util.Set<java.lang.String>) in org.apache.maven.plugins.shade.filter.SimpleFilter has been deprecated
assertTrue(filter.isFiltered("a.properties"));
assertFalse(filter.isFiltered("org/Test.class"));
assertTrue(filter.isFiltered("org/Test.properties"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
*/
package org.apache.maven.plugins.shade.mojo;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
* @author Benjamin Bentmann
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
import java.util.Collection;
import java.util.Collections;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
* @author Benjamin Bentmann
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import java.io.File;
import java.io.IOException;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class RelativizePathTest {
static final String[] PARENTS = {
Expand All @@ -49,7 +49,7 @@ public void runTests() throws IOException {
File child = new File(CHILDREN[x]).getCanonicalFile();
String answer = ANSWER[x];
String r = RelativizePath.convertToRelativePath(parent, child);
assertEquals(String.format("parent %s child %s", parent.toString(), child.toString()), answer, r);
assertEquals(answer, r, String.format("parent %s child %s", parent.toString(), child.toString()));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

import java.util.Collections;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.fail;

public class SimpleRelocatorParameterTest {

Expand Down
Loading
Loading