Skip to content

Commit

Permalink
Merge pull request #96 from rmgrimm/back-to-jdk17
Browse files Browse the repository at this point in the history
Pull back to JDK17 until JDK21 base container image is available
  • Loading branch information
rmgrimm authored Nov 7, 2023
2 parents 27deade + e524a58 commit 5c9e197
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/pull-request-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ jobs:
cp -av ${{ github.workspace }}/.mvn/filters/*.txt ${{ steps.find-home.outputs.home }}/.m2/repository/.remoteRepositoryFilters/
- name: Run Maven Build and Verify
# Note: This also builds a container image to ensure image building
# continues to work, but does not push it to any registry
run: >-
./mvnw
--batch-mode
clean
verify
-Dquarkus.container-image.build=true
-Dquarkus.container-image.push=false
24 changes: 19 additions & 5 deletions parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,13 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.release>21</maven.compiler.release>
<maven.compiler.release>17</maven.compiler.release>

<!-- Maven site skin version (can't include dots in name) -->
<maven-fluido-skin-version>2.0.0-M8</maven-fluido-skin-version>

<!-- Requirements -->
<requirements.java-version>[21,)</requirements.java-version>
<requirements.java-version>[17,)</requirements.java-version>
<requirements.maven-version>[3.9.2,)</requirements.maven-version>

<!-- Support Quarkus knowing about multimodule project -->
Expand Down Expand Up @@ -327,6 +325,13 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${version.maven-failsafe-plugin}</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>
org.jboss.logmanager.LogManager
</java.util.logging.manager>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<id>default-integration-test</id>
Expand Down Expand Up @@ -427,6 +432,11 @@
<excludes>
<exclude>**/*IntegrationTest.java</exclude>
</excludes>
<systemPropertyVariables>
<java.util.logging.manager>
org.jboss.logmanager.LogManager
</java.util.logging.manager>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
Expand Down Expand Up @@ -569,12 +579,16 @@
<mutator>STRONGER</mutator>
</mutators>

<jvmArgs>
<jvmArg>-Djava.util.logging.manager=org.jboss.logmanager.LogManager</jvmArg>
</jvmArgs>

<!--
Ensure a minimum mutation threshold percentage (line threshold
will be checked by JaCoCo)
-->
<!-- TODO: Increase this percentage as tests cover additional code -->
<mutationThreshold>40</mutationThreshold>
<mutationThreshold>35</mutationThreshold>

<!--
Unless overridden by a Maven profile (below), do not include
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ public void save(@Nonnull CmsFile file, @Nullable File fileContent) throws ApiEx

@Override
public void save(@Nonnull CmsTemplate template, @Nullable File templateDraft) throws ApiException {
/* When upgraded to JDK21:
switch (template) {
case CmsBuiltinPage cmsBuiltinPage -> saveBuiltinPage(cmsBuiltinPage, templateDraft);
case CmsBuiltinPartial cmsBuiltinPartial -> saveBuiltinPartial(cmsBuiltinPartial, templateDraft);
Expand All @@ -200,6 +201,20 @@ public void save(@Nonnull CmsTemplate template, @Nullable File templateDraft) th
case CmsPartial cmsPartial -> savePartial(cmsPartial, templateDraft);
default -> throw new UnsupportedOperationException("Unknown template type: " + template.getClass().getName());
}
*/
if (template instanceof CmsBuiltinPage cmsBuiltinPage) {
saveBuiltinPage(cmsBuiltinPage, templateDraft);
} else if (template instanceof CmsBuiltinPartial cmsBuiltinPartial) {
saveBuiltinPartial(cmsBuiltinPartial, templateDraft);
} else if (template instanceof CmsLayout cmsLayout) {
saveLayout(cmsLayout, templateDraft);
} else if (template instanceof CmsPage cmsPage) {
savePage(cmsPage, templateDraft);
} else if (template instanceof CmsPartial cmsPartial) {
savePartial(cmsPartial, templateDraft);
} else {
throw new UnsupportedOperationException("Unknown template type: " + template.getClass().getName());
}
}

private void saveBuiltinPage(@Nonnull CmsBuiltinPage page, @Nullable File templateDraft) throws ApiException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public interface CmsTemplateMapper {
TemplateUpdatableFields toRestPartialUpdate(CmsPartial partial);

default CmsTemplate fromRest(Template template) {
/* When upgraded to JDK21:
return switch (template) {
case null -> null;
Expand All @@ -94,6 +95,22 @@ default CmsTemplate fromRest(Template template) {
default -> throw new UnsupportedOperationException("Unknown template type: " + template.getClass().getName());
};
*/
if (template == null) {
return null;
} else if (template instanceof BuiltinPage builtinPage) {
return fromRestBuiltinPage(builtinPage);
} else if (template instanceof BuiltinPartial builtinPartial) {
return fromRestBuiltinPartial(builtinPartial);
} else if (template instanceof Layout layout) {
return fromRestLayout(layout);
} else if (template instanceof Page page) {
return fromRestPage(page);
} else if (template instanceof Partial partial) {
return fromRestPartial(partial);
} else {
throw new UnsupportedOperationException("Unknown template type: " + template.getClass().getName());
}
}

default String mapHandlerFromRest(EnumHandler handler) {
Expand Down

0 comments on commit 5c9e197

Please sign in to comment.