-
Notifications
You must be signed in to change notification settings - Fork 51
fix(QTDI-3531): Fix uispec goal failure #1286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
undx
wants to merge
6
commits into
master
Choose a base branch
from
undx/QTDI-3531_fix_uispec_goal_failure
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a7019d5
fix(QTDI-3531): Fix uispec goal failure
undx 2e492f6
docs(QTDI-3531): record uispec isolated classloader and manual valida…
undx 1860795
fix: Deduplicate gmavenplus-plugin declaration in component-starter-s…
undx a47512f
fix(QTDI-3531): Complete JVM --add-opens flags for uispec invoker IT
undx 0bf42b0
fix(QTDI-3531): Address review round 1 on uispec mojo
undx 52215f2
fix(QTDI-3531): Address review round 2 on uispec mojo
undx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
49 changes: 49 additions & 0 deletions
49
...g/talend/sdk/component/tools/webapp/standalone/generator/StaticResourceGeneratorTest.java
This file contains hidden or 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,49 @@ | ||
| /** | ||
| * Copyright (C) 2006-2026 Talend Inc. - www.talend.com | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.talend.sdk.component.tools.webapp.standalone.generator; | ||
|
|
||
| import static java.util.Collections.emptyMap; | ||
| import static org.junit.jupiter.api.Assertions.assertArrayEquals; | ||
| import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
|
||
| import java.nio.charset.StandardCharsets; | ||
| import java.util.TreeMap; | ||
|
|
||
| import org.junit.jupiter.api.Test; | ||
| import org.talend.sdk.component.tools.webapp.standalone.Route; | ||
|
|
||
| class StaticResourceGeneratorTest { | ||
|
|
||
| @Test | ||
| void routeWithNullContentHasEmptyBody() { | ||
| final Route route = StaticResourceGenerator | ||
| .route("component_server_environment", "/api/v1/cache/clear", new TreeMap<>(), emptyMap(), emptyMap(), | ||
| null); | ||
|
|
||
| assertEquals(200, route.getStatus()); | ||
| assertEquals("/api/v1/cache/clear", route.getPath()); | ||
| assertArrayEquals(new byte[0], route.getContent()); | ||
| } | ||
|
|
||
| @Test | ||
| void routeWithContentKeepsUtf8Body() { | ||
| final Route route = StaticResourceGenerator | ||
| .route("component_server_environment", "/api/v1/environment", new TreeMap<>(), emptyMap(), emptyMap(), | ||
| "{\"a\":\"é\"}"); | ||
|
|
||
| assertArrayEquals("{\"a\":\"é\"}".getBytes(StandardCharsets.UTF_8), route.getContent()); | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 @@ | ||
| --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/sun.nio.cs=ALL-UNNAMED --add-opens=java.base/sun.security.action=ALL-UNNAMED --add-opens=java.base/sun.security.x509=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED |
This file contains hidden or 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,78 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| Copyright (C) 2006-2026 Talend Inc. - www.talend.com | ||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| --> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <parent> | ||
| <groupId>org.talend.sdk.component</groupId> | ||
| <artifactId>component-runtime</artifactId> | ||
| <version>@project.version@</version> | ||
| </parent> | ||
|
|
||
| <artifactId>sample-it-uispec</artifactId> | ||
| <name>Component Runtime :: Maven Plugin :: IT :: UiSpec</name> | ||
|
|
||
| <properties> | ||
| <rootlocation>${project.basedir}</rootlocation> | ||
| <talend.build.name>${talend.build.name.base}.sample.it.uispec</talend.build.name> | ||
| <spotless.skip>true</spotless.skip> | ||
| </properties> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.talend.sdk.component</groupId> | ||
| <artifactId>component-api</artifactId> | ||
| <version>@project.version@</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.talend.sdk.component</groupId> | ||
| <artifactId>talend-component-maven-plugin</artifactId> | ||
| <version>@project.version@</version> | ||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.talend.components</groupId> | ||
| <artifactId>@it-component-artifact-id@</artifactId> | ||
| <version>@it-component-version@</version> | ||
| <classifier>component</classifier> | ||
| <type>car</type> | ||
| </dependency> | ||
| <!-- shadows the CXF/servlet version used by the embedded server if the generator runs in the plugin classloader --> | ||
| <dependency> | ||
| <groupId>org.apache.cxf</groupId> | ||
| <artifactId>cxf-rt-transports-http</artifactId> | ||
| <version>4.1.8</version> | ||
| </dependency> | ||
| </dependencies> | ||
| <executions> | ||
| <execution> | ||
| <id>uispec</id> | ||
| <goals> | ||
| <goal>uispec</goal> | ||
| </goals> | ||
| <phase>package</phase> | ||
| <configuration> | ||
| <uiSpecZip>${project.build.directory}/talend-component-kit/uispec.zip</uiSpecZip> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </project> |
38 changes: 38 additions & 0 deletions
38
talend-component-maven-plugin/src/it/uispec/postbuild.groovy
This file contains hidden or 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,38 @@ | ||
| /** | ||
| * Copyright (C) 2006-2026 Talend Inc. - www.talend.com | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| import java.nio.file.Paths | ||
| import java.util.zip.ZipFile | ||
|
|
||
| /** | ||
| * Checks that the uispec mojo generated its archive even if the plugin classpath is polluted by conflicting libraries | ||
| */ | ||
| static def checkUiSpecMojo(final File basedir) { | ||
| final File zip = Paths.get(basedir.toString()).resolve('target/talend-component-kit/uispec.zip').toFile() | ||
| if (!zip.exists()) { | ||
| throw new FileNotFoundException("Could not find uispec archive ${zip}") | ||
| } | ||
| final ZipFile archive = new ZipFile(zip) | ||
| try { | ||
| final List<String> names = archive.entries().collect { it.name } | ||
| assert names.contains('component/') | ||
| assert names.contains('configuration/') | ||
| assert names.any { it.startsWith('component/') && it != 'component/' } | ||
| } finally { | ||
| archive.close() | ||
| } | ||
| } | ||
|
|
||
| checkUiSpecMojo(basedir) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.