Skip to content
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

Minor archetype fixes for generated project unit tests #6

Merged

Conversation

JCgH4164838Gh792C124B5
Copy link
Contributor

Minor archetype fixes:

  • Allow the unit tests for projects built from the Angular and Convention archetypes to run under JDK 11 (issue not seen with JDK8).
  • Fix broken unit test for projects built from Blank archetype.
  • Fix broken unit test for projects built from Convention archetype.
  • Fix comment typo in HelloAction for the Convention archetype.

- Allow the unit tests for projects built from the Angular and Convention
  archetypes to run under JDK 11 (issue not seen with JDK8).
- Fix broken unit test for projects built from Blank archetype.
- Fix broken unit test for projects built from Convention archetype.
- Fix comment typo in HelloAction for the Convention archetype.
@JCgH4164838Gh792C124B5
Copy link
Contributor Author

Hello Apache Struts Team.

This PR should fix a few minor issues with the unit tests failing in a few of the projects generated from the struts2-archetypes.

The "JDK11 only" test dependency for the projects built from the Angular and Convention archetypes (must declare a test-scope dependency on commons-compress) is weird, but applying it makes things work for both JDK 8 and JDK 11. If someone can see why this situation arises, please feel free to let others know in a comment. 😄

Copy link
Member

@lukaszlenart lukaszlenart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@lukaszlenart lukaszlenart merged commit fc87415 into apache:master May 17, 2020
@JCgH4164838Gh792C124B5 JCgH4164838Gh792C124B5 deleted the FixGeneratedTestBugs branch May 17, 2020 18:24
@hikaen2
Copy link

hikaen2 commented Oct 12, 2020

8aae883#diff-019fb6a527487bb473675a65a0fc046e0b87a1427175d94678d7b4bd20af6417R70

Allow the unit tests for projects built from the Angular and Convention archetypes to run under JDK 11 (issue not seen with JDK8).

In mvn test or mvn jetty:run, org.apache.struts2.convention.PackageBasedActionConfigBuilder#getActionAnnotations receives parameter "class org.apache.logging.log4j.core.appender.rolling.action.CommonsCompressAction".
If there is no commons-compress in pom.xml, NoClassDefFoundError will be thrown.

Is this correct behavior?

image

@JCgH4164838Gh792C124B5
Copy link
Contributor Author

Hello @hikaen2 .

I am not sure if it is considered correct behaviour or not, but what you report seems to indicate that commons-compress may also be a runtime scope dependency for newer JDKs (like JDK 11) and the Conventions archetype, and not just a test scope dependency.

If that is the case, then the Conventions archetype should probably have the commons-compress dependency modified from test to runtime. @lukaszlenart , what do you think ?

If declaring commons-compress in pom.xml as a runtime dependency for the project seems to work, it sounds like it may be the only option.

@lukaszlenart
Copy link
Member

@JCgH4164838Gh792C124B5 thanks a lot and I think you are right, changing scope is the only option for now.

hikaen2 added a commit to hikaen2/struts2-example that referenced this pull request Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants