-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24635 from andreaTP/fix-banner-special-chars
Fix Banner check on filesystem containing special chars
- Loading branch information
Showing
4 changed files
with
37 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
core/deployment/src/test/java/io/quarkus/deployment/pkg/steps/BannerProcessorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package io.quarkus.deployment.pkg.steps; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import java.net.URL; | ||
import java.nio.file.Paths; | ||
|
||
import org.assertj.core.util.Files; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import io.quarkus.deployment.steps.BannerProcessor; | ||
|
||
public class BannerProcessorTest { | ||
|
||
class MyBannerProcessor extends BannerProcessor { | ||
public boolean test(String file) throws Exception { | ||
return this.isQuarkusCoreBanner(new URL("jar", null, 0, file)); | ||
} | ||
} | ||
|
||
@Test | ||
public void checkQuarkusCoreBannerOnFilesystemWithSpecialCharacters() throws Exception { | ||
MyBannerProcessor processor = new MyBannerProcessor(); | ||
|
||
assertFalse(processor.test(Paths.get("tmp", "Descărcări", "test", "something!").toFile().getAbsolutePath())); | ||
assertFalse(processor.test(Paths.get(Files.currentFolder().getAbsolutePath(), "src", "test", "resources", "test", | ||
"Descărcări", "without-class.jar!").toFile().getAbsolutePath())); | ||
assertTrue(processor.test(Paths.get(Files.currentFolder().getAbsolutePath(), "src", "test", "resources", "test", | ||
"Descărcări", "with-class.jar!").toFile().getAbsolutePath())); | ||
} | ||
} |
Binary file not shown.
Binary file added
BIN
+168 Bytes
core/deployment/src/test/resources/test/Descărcări/without-class.jar
Binary file not shown.