This is an automated email from the ASF dual-hosted git repository.
thiagohp pushed a commit to branch feature/requirejs-less
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git
The following commit(s) were added to refs/heads/feature/requirejs-less by this
push:
new 4d47e170b Fixing AssetTests.external_url_asset_bindings
4d47e170b is described below
commit 4d47e170b8d2fa8689fda73e5b3ee5d1cf55c99d
Author: Thiago H. de Paula Figueiredo <[email protected]>
AuthorDate: Tue Jul 29 21:22:46 2025 -0300
Fixing AssetTests.external_url_asset_bindings
---
.../apache/tapestry5/integration/app1/AssetTests.java | 8 ++++----
.../tapestry5/integration/app1/services/AppModule.java | 5 +++++
.../tapestry5/integration/app1/pages/nested/AssetDemo.js | 16 ++++++++++++++--
3 files changed, 23 insertions(+), 6 deletions(-)
diff --git
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AssetTests.java
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AssetTests.java
index 06a92458a..7cb10e5e5 100644
---
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AssetTests.java
+++
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AssetTests.java
@@ -52,10 +52,10 @@ public class AssetTests extends App1TestCase
{
openLinks("AssetDemo");
- assertEquals("http://cdnjs.cloudflare.com/ajax/libs/d3/3.0.0/d3.js",
getText("httpAsset"));
- assertEquals("https://cdnjs.cloudflare.com/ajax/libs/d3/3.0.0/d3.js",
getText("httpsAsset"));
- assertEquals("http://cdnjs.cloudflare.com/ajax/libs/d3/3.0.0/d3.js",
getText("protocolRelativeAsset"));
- assertEquals("ftp://cdnjs.cloudflare.com/ajax/libs/d3/3.0.0/d3.js",
getText("ftpAsset"));
+ assertEquals("http://cdnjs.cloudflare.com/ajax/libs/d3/7.9.0/d3.js",
getText("httpAsset"));
+ assertEquals("https://cdnjs.cloudflare.com/ajax/libs/d3/7.9.0/d3.js",
getText("httpsAsset"));
+ assertEquals("http://cdnjs.cloudflare.com/ajax/libs/d3/7.9.0/d3.js",
getText("protocolRelativeAsset"));
+ assertEquals("ftp://cdnjs.cloudflare.com/ajax/libs/d3/7.9.0/d3.js",
getText("ftpAsset"));
// check whether externaly @Import'ed d3 works
assertTrue(isElementPresent("css=svg"));
diff --git
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java
index b5c7017cc..173707245 100644
---
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java
+++
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java
@@ -191,6 +191,11 @@ public class AppModule
configuration.add(SymbolConstants.PRELOADER_MODE,
PreloaderMode.ALWAYS);
configuration.add(SymbolConstants.OPENAPI_APPLICATION_VERSION,
"1.2.3.4");
configuration.add(SymbolConstants.OPENAPI_BASE_PATH, "/rest/");
+
+ configuration.add(SymbolConstants.CORS_ENABLED, "true");
+ configuration.add(SymbolConstants.CORS_ALLOWED_ORIGINS,
"https://cdnjs.cloudflare.com");
+ configuration.add(SymbolConstants.CORS_MAX_AGE, "60");
+
// configuration.add(SymbolConstants.ERROR_CSS_CLASS, "yyyy");
// configuration.add(SymbolConstants.DEFAULT_STYLESHEET,
"classpath:/org/apache/tapestry5/integration/app1/app1.css");
// configuration.add(SymbolConstants.CORS_ENABLED, true);
diff --git
a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/nested/AssetDemo.js
b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/nested/AssetDemo.js
index 5b6a4cb05..2eb6c0421 100644
---
a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/nested/AssetDemo.js
+++
b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/nested/AssetDemo.js
@@ -1,4 +1,5 @@
-var sampleSVG = d3.select("#viz")
+function run(d3) {
+ var sampleSVG = d3.select("#viz")
.append("svg")
.attr("width", 100)
.attr("height", 100);
@@ -10,4 +11,15 @@ var sampleSVG = d3.select("#viz")
.attr("cx", 50)
.attr("cy", 50)
.on("mouseover", function(){d3.select(this).style("fill",
"aliceblue");})
- .on("mouseout", function(){d3.select(this).style("fill", "white");});
\ No newline at end of file
+ .on("mouseout", function(){d3.select(this).style("fill", "white");});
+
+}
+
+if (typeof require !== 'undefined') {
+ require(["http://cdnjs.cloudflare.com/ajax/libs/d3/7.9.0/d3.js"],
function(d3) {
+ run(d3);
+ })
+}
+else {
+
import("http://cdnjs.cloudflare.com/ajax/libs/d3/7.9.0/d3.js").then(ignored =>
run(d3));
+}
\ No newline at end of file