Skip to content

Commit

Permalink
Merge pull request #22379 from famod/jquery-3.6.0
Browse files Browse the repository at this point in the history
Bump jquery from 3.5.1 to 3.6.0 and use maven managed versions in webjars tests
  • Loading branch information
gsmet authored Dec 20, 2021
2 parents d9f25a2 + 08e2608 commit b9e861d
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 33 deletions.
7 changes: 6 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ updates:
- dependency-name: org.eclipse.microprofile.openapi:microprofile-openapi-tck
- dependency-name: org.eclipse.microprofile.opentracing:microprofile-opentracing-tck*
- dependency-name: org.eclipse.microprofile.rest.client:microprofile-rest-client-tck
# Dev UI web dependencies
- dependency-name: org.webjars:bootstrap
- dependency-name: org.webjars:font-awesome
- dependency-name: org.webjars:jquery
- dependency-name: org.webjars:codemirror
- dependency-name: org.webjars.npm:mermaid
# Others
- dependency-name: com.puppycrawl.tools:checkstyle
- dependency-name: com.google.cloud.functions:*
Expand All @@ -160,7 +166,6 @@ updates:
- dependency-name: org.jboss.modules:jboss-modules
- dependency-name: com.unboundid:unboundid-ldapsdk
- dependency-name: org.commonmark:commonmark
- dependency-name: org.webjars:*
- dependency-name: org.asciidoctor:asciidoctorj
- dependency-name: com.github.javaparser:javaparser-core
- dependency-name: org.jboss.jdeparser:jdeparser
Expand Down
5 changes: 3 additions & 2 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,12 @@
<maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
<maven-dependency-plugin.version>3.1.2</maven-dependency-plugin.version>

<!-- Webjars -->
<!-- Webjars used by the Dev UI -->
<webjar.bootstrap.version>4.6.0</webjar.bootstrap.version>
<webjar.font-awesome.version>5.15.2</webjar.font-awesome.version>
<webjar.jquery.version>3.5.1</webjar.jquery.version>
<webjar.jquery.version>3.6.0</webjar.jquery.version>
<webjar.codemirror.version>5.62.2</webjar.codemirror.version>
<!-- we don't add mermaid as a dependency as it brings a ton of things we don't use -->
<webjar.mermaid.version>8.9.1</webjar.mermaid.version>

<!-- revapi API check -->
Expand Down
38 changes: 26 additions & 12 deletions extensions/webjars-locator/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<artifactId>quarkus-webjars-locator-deployment</artifactId>
<name>Quarkus - WebJar Locator - Deployment</name>

<properties>
<webjar.momentjs.version>2.24.0</webjar.momentjs.version>
<webjar.jquery-ui.version>1.13.0</webjar.jquery-ui.version>
</properties>

<dependencies>
<dependency>
<groupId>org.webjars</groupId>
Expand Down Expand Up @@ -41,19 +46,19 @@
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>

<!-- Using setForcedDependencies only works if the dependency is in the pom's test scope. -->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>${webjar.jquery.version}</version>
<scope>test</scope>
<groupId>org.webjars</groupId>
<artifactId>jquery-ui</artifactId>
<version>${webjar.jquery-ui.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>momentjs</artifactId>
<version>2.24.0</version>
<scope>test</scope>
<groupId>org.webjars</groupId>
<artifactId>momentjs</artifactId>
<version>${webjar.momentjs.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.webjars.bowergithub.dc-js</groupId>
Expand All @@ -62,9 +67,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-deployment</artifactId>
<scope>test</scope>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-deployment</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

Expand All @@ -82,6 +87,15 @@
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<webjar.jquery-ui.version>${webjar.jquery-ui.version}</webjar.jquery-ui.version>
<webjar.momentjs.version>${webjar.momentjs.version}</webjar.momentjs.version>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import io.quarkus.test.QuarkusDevModeTest;
import io.restassured.RestAssured;

public class WebJarLocatorDevModeTest {
public class WebJarLocatorDevModeTest extends WebJarLocatorTestSupport {
private static final String META_INF_RESOURCES = "META-INF/resources/";

@RegisterExtension
Expand Down Expand Up @@ -42,15 +42,15 @@ public void testDevMode() {
.body(is("Test"));

// Test Existing Web Jars
RestAssured.get("/webjars/jquery/jquery.min.js").then()
RestAssured.get("/webjars/jquery-ui/jquery-ui.min.js").then()
.statusCode(200);
RestAssured.get("/webjars/momentjs/min/moment.min.js").then()
.statusCode(200);

// Test using version in url of existing Web Jar
RestAssured.get("/webjars/jquery/3.5.1/jquery.min.js").then()
RestAssured.get("/webjars/jquery-ui/" + JQUERY_UI_VERSION + "/jquery-ui.min.js").then()
.statusCode(200);
RestAssured.get("/webjars/momentjs/2.24.0/min/moment.min.js").then()
RestAssured.get("/webjars/momentjs/" + MOMENTJS_VERSION + "/min/moment.min.js").then()
.statusCode(200);

// Test non-existing Web Jar
Expand Down Expand Up @@ -95,9 +95,9 @@ public void testDevMode() {
.statusCode(200);

// Test using version in url of existing Web Jar
RestAssured.get("/webjars/jquery/3.5.1/jquery.min.js").then()
RestAssured.get("/webjars/jquery-ui/" + JQUERY_UI_VERSION + "/jquery-ui.min.js").then()
.statusCode(200);
RestAssured.get("/webjars/momentjs/2.24.0/min/moment.min.js").then()
RestAssured.get("/webjars/momentjs/" + MOMENTJS_VERSION + "/min/moment.min.js").then()
.statusCode(200);

// Test non-existing Web Jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
import io.quarkus.test.QuarkusUnitTest;
import io.restassured.RestAssured;

public class WebJarLocatorTest {
public class WebJarLocatorTest extends WebJarLocatorTestSupport {
private static final String META_INF_RESOURCES = "META-INF/resources/";

@RegisterExtension
static QuarkusUnitTest runner = new QuarkusUnitTest()
.withApplicationRoot((jar) -> jar
.addAsResource(new StringAsset("<html>Hello!<html>"), META_INF_RESOURCES + "/index.html")
.addAsResource(new StringAsset("Test"), META_INF_RESOURCES + "/some/path/test.txt"))
.setForcedDependencies(Arrays.asList(new AppArtifact("org.webjars", "jquery", "3.5.1"),
new AppArtifact("org.webjars", "momentjs", "2.24.0")));
.setForcedDependencies(Arrays.asList(new AppArtifact("org.webjars", "jquery-ui", JQUERY_UI_VERSION),
new AppArtifact("org.webjars", "momentjs", MOMENTJS_VERSION)));

@Test
public void test() {
Expand All @@ -39,15 +39,15 @@ public void test() {
.body(is("Test"));

// Test Existing Web Jars
RestAssured.get("/webjars/jquery/jquery.min.js").then()
RestAssured.get("/webjars/jquery-ui/jquery-ui.min.js").then()
.statusCode(200);
RestAssured.get("/webjars/momentjs/min/moment.min.js").then()
.statusCode(200);

// Test using version in url of existing Web Jar
RestAssured.get("/webjars/jquery/3.5.1/jquery.min.js").then()
RestAssured.get("/webjars/jquery-ui/" + JQUERY_UI_VERSION + "/jquery-ui.min.js").then()
.statusCode(200);
RestAssured.get("/webjars/momentjs/2.24.0/min/moment.min.js").then()
RestAssured.get("/webjars/momentjs/" + MOMENTJS_VERSION + "/min/moment.min.js").then()
.statusCode(200);

// Test non-existing Web Jar
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package io.quarkus.webjar.locator.test;

class WebJarLocatorTestSupport {

static final String JQUERY_UI_VERSION = System.getProperty("webjar.jquery-ui.version");
static final String MOMENTJS_VERSION = System.getProperty("webjar.momentjs.version");
}
21 changes: 17 additions & 4 deletions integration-tests/webjars-locator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
<artifactId>quarkus-integration-test-webjars-locator</artifactId>

<name>Quarkus - Integration Tests - WebJar Locator</name>


<properties>
<webjar.momentjs.version>2.24.0</webjar.momentjs.version>
<webjar.jquery-ui.version>1.13.0</webjar.jquery-ui.version>
</properties>

<dependencies>
<dependency>
Expand All @@ -26,13 +30,13 @@
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>${webjar.jquery.version}</version>
<artifactId>jquery-ui</artifactId>
<version>${webjar.jquery-ui.version}</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>momentjs</artifactId>
<version>2.24.0</version>
<version>${webjar.momentjs.version}</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -88,6 +92,15 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<webjar.jquery-ui.version>${webjar.jquery-ui.version}</webjar.jquery-ui.version>
<webjar.momentjs.version>${webjar.momentjs.version}</webjar.momentjs.version>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
@QuarkusTest
public class WebJarResourceTest {

private static final String JQUERY_UI_VERSION = System.getProperty("webjar.jquery-ui.version");
private static final String MOMENTJS_VERSION = System.getProperty("webjar.momentjs.version");

@Test
void testWebJar() {
// Test Existing Web Jars
Expand All @@ -17,9 +20,9 @@ void testWebJar() {
.statusCode(200);

// Test using version in url of existing Web Jar
RestAssured.get("/webjars/jquery/3.5.1/jquery.min.js").then()
RestAssured.get("/webjars/jquery-ui/" + JQUERY_UI_VERSION + "/jquery-ui.min.js").then()
.statusCode(200);
RestAssured.get("/webjars/momentjs/2.24.0/min/moment.min.js").then()
RestAssured.get("/webjars/momentjs/" + MOMENTJS_VERSION + "/min/moment.min.js").then()
.statusCode(200);

// Test non-existing Web Jar
Expand Down

0 comments on commit b9e861d

Please sign in to comment.