-
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 #32999 from mkouba/qute-dev-mode-fix-extmet-optimi…
…zation Qute - fix a regression introduced in #32653 (3.0.1)
- Loading branch information
Showing
4 changed files
with
101 additions
and
34 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
40 changes: 40 additions & 0 deletions
40
...t/src/test/java/io/quarkus/qute/deployment/devmode/ExistingValueResolversDevModeTest.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,40 @@ | ||
package io.quarkus.qute.deployment.devmode; | ||
|
||
import static io.restassured.RestAssured.given; | ||
|
||
import org.hamcrest.Matchers; | ||
import org.jboss.shrinkwrap.api.asset.StringAsset; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusDevModeTest; | ||
|
||
/** | ||
* Test that built-in extension value resolvers are correctly registered after live reload. | ||
*/ | ||
public class ExistingValueResolversDevModeTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusDevModeTest config = new QuarkusDevModeTest() | ||
.withApplicationRoot(root -> root | ||
.addClass(TestRoute.class) | ||
.addAsResource(new StringAsset( | ||
"{#let a = 3}{#let b = a.minus(2)}b={b}{/}{/}"), | ||
"templates/let.html")); | ||
|
||
@Test | ||
public void testExistingValueResolvers() { | ||
given().get("test") | ||
.then() | ||
.statusCode(200) | ||
.body(Matchers.equalTo("b=1")); | ||
|
||
config.modifyResourceFile("templates/let.html", t -> t.concat("::MODIFIED")); | ||
|
||
given().get("test") | ||
.then() | ||
.statusCode(200) | ||
.body(Matchers.equalTo("b=1::MODIFIED")); | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
extensions/qute/deployment/src/test/java/io/quarkus/qute/deployment/devmode/TestRoute.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,19 @@ | ||
package io.quarkus.qute.deployment.devmode; | ||
|
||
import jakarta.inject.Inject; | ||
|
||
import io.quarkus.qute.Template; | ||
import io.quarkus.vertx.web.Route; | ||
import io.vertx.ext.web.RoutingContext; | ||
|
||
public class TestRoute { | ||
|
||
@Inject | ||
Template let; | ||
|
||
@Route(path = "test") | ||
public void test(RoutingContext ctx) { | ||
ctx.end(let.render()); | ||
} | ||
|
||
} |
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