Advertisement
nsaunders

Untitled

Aug 2nd, 2021
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  1. nicholas@mordor:~/NetBeansProjects/testng_gradle$
  2. nicholas@mordor:~/NetBeansProjects/testng_gradle$ gradle test --tests testing_gradle.AppTest
  3. > Task :app:test FAILED
  4.  
  5. FAILURE: Build failed with an exception.
  6.  
  7. * What went wrong:
  8. Execution failed for task ':app:test'.
  9. > No tests found for given includes: [testing_gradle.AppTest](--tests filter)
  10.  
  11. * Try:
  12. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
  13.  
  14. * Get more help at https://help.gradle.org
  15.  
  16. Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
  17. Use '--warning-mode all' to show the individual deprecation warnings.
  18. See https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings
  19.  
  20. BUILD FAILED in 741ms
  21. 3 actionable tasks: 1 executed, 2 up-to-date
  22. nicholas@mordor:~/NetBeansProjects/testng_gradle$
  23. nicholas@mordor:~/NetBeansProjects/testng_gradle$ cat app/build.gradle
  24. /*
  25. * This file was generated by the Gradle 'init' task.
  26. *
  27. * This generated file contains a sample Java application project to get you started.
  28. * For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
  29. * User Manual available at https://docs.gradle.org/7.0.2/userguide/building_java_projects.html
  30. */
  31.  
  32. plugins {
  33. // Apply the application plugin to add support for building a CLI application in Java.
  34. id 'application'
  35. }
  36.  
  37. repositories {
  38. // Use Maven Central for resolving dependencies.
  39. mavenCentral()
  40. mavenLocal()
  41. jcenter()
  42. // https://riptutorial.com/
  43. }
  44.  
  45. dependencies {
  46. // Use TestNG framework, also requires calling test.useTestNG() below
  47. testImplementation 'org.testng:testng:7.3.0'
  48. //compile 'org.testng:testng:7.3.0'
  49.  
  50. // This dependency is used by the application.
  51. implementation 'com.google.guava:guava:30.0-jre'
  52. }
  53.  
  54. application {
  55. // Define the main class for the application.
  56. mainClass = 'testng_gradle.App'
  57. }
  58.  
  59.  
  60.  
  61. test {
  62. useTestNG() {
  63. includeGroups 'smoke', 'sanity'
  64. excludeGroups 'regression'
  65. testLogging.showStandardStreams = true
  66. suiteXmlBuilder().suite(name: 'Sample Suite') {
  67. test(name : 'Sample Test') {
  68. classes('') {
  69. 'class'(name: 'testing_gradle.AppTest')
  70. }
  71. }
  72. }
  73.  
  74. }
  75. }
  76.  
  77.  
  78.  
  79. nicholas@mordor:~/NetBeansProjects/testng_gradle$
  80. nicholas@mordor:~/NetBeansProjects/testng_gradle$ cat app/src/test/java/testng_gradle/AppTest.java
  81. /*
  82. * This Java source file was generated by the Gradle 'init' task.
  83. */
  84. package testng_gradle;
  85.  
  86. import org.testng.annotations.*;
  87. import static org.testng.Assert.*;
  88.  
  89. public class AppTest {
  90. @Test public void appHasAGreeting() {
  91. App classUnderTest = new App();
  92. assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
  93. }
  94. }
  95. nicholas@mordor:~/NetBeansProjects/testng_gradle$
  96.  
  97.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement