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

TestNG smoke test doesn't test anything #19329

Closed
wilkinsona opened this issue Dec 8, 2019 · 3 comments
Closed

TestNG smoke test doesn't test anything #19329

wilkinsona opened this issue Dec 8, 2019 · 3 comments
Labels
status: superseded An issue that has been superseded by another

Comments

@wilkinsona
Copy link
Member

wilkinsona commented Dec 8, 2019

The test class and its method are package-private which means that no tests are run. They cannot be made public until spring-io/spring-javaformat#152 is fixed or we configure a Checkstyle suppression.

@wilkinsona wilkinsona added the type: task A general task label Dec 8, 2019
@wilkinsona wilkinsona added this to the 2.2.x milestone Dec 8, 2019
@davebarda
Copy link

I have tried to add public to both class and method and running the check task, but everything worked.
This is the method: smoketest.testng.SampleTestNGApplicationTests#testHome
Can you give some further explanation so I can verify that my solutions works?
Thanks.

@wilkinsona
Copy link
Member Author

There's not much more to explain. With the class and method made public, here's the output when building the module:

./mvnw -f spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-testng verify
[INFO] Scanning for projects...
[INFO] 
[INFO] -------< org.springframework.boot:spring-boot-smoke-test-testng >-------
[INFO] Building Spring Boot TestNG Smoke Test 2.2.3.BUILD-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-checkstyle-plugin:3.0.0:check (checkstyle-validation) @ spring-boot-smoke-test-testng ---
[INFO] There is 1 error reported by Checkstyle 8.22 with src/checkstyle/checkstyle.xml ruleset.
[ERROR] src/test/java/smoketest/testng/SampleTestNGApplicationTests.java:[42,9] (extension) SpringJUnit5: Test method 'testHome' should not be public.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.471 s
[INFO] Finished at: 2019-12-14T20:23:41Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:check (checkstyle-validation) on project spring-boot-smoke-test-testng: You have 1 Checkstyle violation. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

@mbhave
Copy link
Contributor

mbhave commented Feb 20, 2020

I think we can close this since testHome is now public with a checkstyle suppression.

@mbhave mbhave closed this as completed Feb 20, 2020
@mbhave mbhave added status: superseded An issue that has been superseded by another and removed type: task A general task labels Feb 20, 2020
@mbhave mbhave removed this from the 2.2.x milestone Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another
Projects
None yet
Development

No branches or pull requests

3 participants