Advertisement
nsaunders

Untitled

Aug 2nd, 2021
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.89 KB | None | 0 0
  1. nicholas@mordor:~/NetBeansProjects/testng_gradle/app$
  2. nicholas@mordor:~/NetBeansProjects/testng_gradle/app$ gradle clean 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 771ms
  21. 4 actionable tasks: 4 executed
  22. nicholas@mordor:~/NetBeansProjects/testng_gradle/app$
  23. nicholas@mordor:~/NetBeansProjects/testng_gradle/app$ gradle clean
  24.  
  25. Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
  26. Use '--warning-mode all' to show the individual deprecation warnings.
  27. See https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings
  28.  
  29. BUILD SUCCESSFUL in 663ms
  30. 1 actionable task: 1 executed
  31. nicholas@mordor:~/NetBeansProjects/testng_gradle/app$
  32. nicholas@mordor:~/NetBeansProjects/testng_gradle/app$ tree
  33. .
  34. ├── build.gradle
  35. └── src
  36. ├── main
  37. │   ├── java
  38. │   │   └── testng_gradle
  39. │   │   └── App.java
  40. │   └── resources
  41. └── test
  42. ├── java
  43. │   └── testng_gradle
  44. │   └── AppTest.java
  45. └── resources
  46.  
  47. 9 directories, 3 files
  48. nicholas@mordor:~/NetBeansProjects/testng_gradle/app$
  49. nicholas@mordor:~/NetBeansProjects/testng_gradle/app$ cat build.gradle
  50. /*
  51. * This file was generated by the Gradle 'init' task.
  52. *
  53. * This generated file contains a sample Java application project to get you started.
  54. * For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
  55. * User Manual available at https://docs.gradle.org/7.0.2/userguide/building_java_projects.html
  56. */
  57.  
  58. plugins {
  59. // Apply the application plugin to add support for building a CLI application in Java.
  60. id 'application'
  61. }
  62.  
  63. repositories {
  64. // Use Maven Central for resolving dependencies.
  65. mavenCentral()
  66. mavenLocal()
  67. jcenter()
  68. }
  69.  
  70. dependencies {
  71. // Use TestNG framework, also requires calling test.useTestNG() below
  72. //compile 'org.testng:testng:7.3.0'
  73. testImplementation 'org.testng:testng:7.3.0'
  74.  
  75. // This dependency is used by the application.
  76. implementation 'com.google.guava:guava:30.0-jre'
  77. }
  78.  
  79. application {
  80. // Define the main class for the application.
  81. mainClass = 'testng_gradle.App'
  82. }
  83.  
  84.  
  85.  
  86.  
  87. tasks.named('test') {
  88. useTestNG() {
  89. includeGroups 'smoke', 'sanity'
  90. excludeGroups 'regression'
  91. testLogging.showStandardStreams = true
  92. suiteXmlBuilder().suite(name: 'Sample Suite') {
  93. test(name : 'Sample Test') {
  94. classes('') {
  95. 'class'(name: 'testing_gradle.AppTest')
  96. }
  97. }
  98. }
  99.  
  100. }
  101. }
  102.  
  103.  
  104.  
  105.  
  106. nicholas@mordor:~/NetBeansProjects/testng_gradle/app$
  107. nicholas@mordor:~/NetBeansProjects/testng_gradle/app$ cat src/test/java/testng_gradle/AppTest.java
  108. /*
  109. * This Java source file was generated by the Gradle 'init' task.
  110. */
  111. package testng_gradle;
  112.  
  113. import org.testng.annotations.*;
  114. import static org.testng.Assert.*;
  115.  
  116. public class AppTest {
  117. @Test public void appHasAGreeting() {
  118. App classUnderTest = new App();
  119. assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
  120. }
  121. }
  122. nicholas@mordor:~/NetBeansProjects/testng_gradle/app$
  123.  
  124.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement