forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
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 quarkusio#24881 from gsmet/2.8.1-backports-1
2.8.1 backports 1
- Loading branch information
Showing
123 changed files
with
2,253 additions
and
500 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
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
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
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
23 changes: 23 additions & 0 deletions
23
core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeListener.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,23 @@ | ||
package io.quarkus.deployment.dev; | ||
|
||
import io.quarkus.bootstrap.app.RunningQuarkusApplication; | ||
|
||
/** | ||
* SPI that can be used by extensions that need to run code in various phases of dev mode | ||
*/ | ||
public interface DevModeListener { | ||
|
||
int DEFAULT_ORDER = 0; | ||
|
||
void afterFirstStart(RunningQuarkusApplication application); | ||
|
||
void beforeShutdown(); | ||
|
||
/** | ||
* Determines the order with which the listeners are executed. Classes with a lower order are executed | ||
* first during start (the order is reverse for shutdown) | ||
*/ | ||
default int order() { | ||
return DEFAULT_ORDER; | ||
} | ||
} |
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
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
55 changes: 55 additions & 0 deletions
55
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,55 @@ | ||
package io.quarkus.deployment.pkg.steps; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import java.nio.charset.StandardCharsets; | ||
import java.nio.file.FileSystem; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import io.quarkus.deployment.steps.BannerProcessor; | ||
import io.quarkus.fs.util.ZipUtils; | ||
|
||
public class BannerProcessorTest { | ||
|
||
class MyBannerProcessor extends BannerProcessor { | ||
public boolean test(Path path) throws Exception { | ||
return this.isQuarkusCoreBanner(path.toUri().toURL()); | ||
} | ||
} | ||
|
||
@Test | ||
public void checkQuarkusCoreBannerOnFilesystemWithSpecialCharacters() throws Exception { | ||
MyBannerProcessor processor = new MyBannerProcessor(); | ||
|
||
assertFalse(processor.test(Paths.get("tmp", "Descărcări", "test", "something!"))); | ||
|
||
final Path tmpDir = Files.createTempDirectory("Descărcări"); | ||
final Path zipPath = tmpDir.resolve("BannerProcessorTest.jar"); | ||
|
||
try { | ||
try (FileSystem ignored = ZipUtils.newZip(zipPath)) { | ||
} | ||
|
||
try (FileSystem fs = ZipUtils.newFileSystem(zipPath)) { | ||
assertFalse(processor.test(fs.getPath("/"))); | ||
} | ||
|
||
try (final FileSystem fs = ZipUtils.newFileSystem(zipPath)) { | ||
Path classFile = fs.getPath(MyBannerProcessor.class.getName().replace('.', '/') + ".class"); | ||
Files.createDirectories(classFile.getParent()); | ||
Files.write(classFile, "".getBytes(StandardCharsets.UTF_8)); | ||
} | ||
|
||
try (FileSystem fs = ZipUtils.newFileSystem(zipPath)) { | ||
assertTrue(processor.test(fs.getPath("/"))); | ||
} | ||
} finally { | ||
Files.deleteIfExists(zipPath); | ||
} | ||
} | ||
} |
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
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
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
Oops, something went wrong.