Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nicholas@mordor:~/NetBeansProjects/testng_gradle$
- nicholas@mordor:~/NetBeansProjects/testng_gradle$ gradle test --tests testing_gradle.AppTest
- > Task :app:test FAILED
- FAILURE: Build failed with an exception.
- * What went wrong:
- Execution failed for task ':app:test'.
- > No tests found for given includes: [testing_gradle.AppTest](--tests filter)
- * Try:
- 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.
- * Get more help at https://help.gradle.org
- Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
- Use '--warning-mode all' to show the individual deprecation warnings.
- See https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings
- BUILD FAILED in 741ms
- 3 actionable tasks: 1 executed, 2 up-to-date
- nicholas@mordor:~/NetBeansProjects/testng_gradle$
- nicholas@mordor:~/NetBeansProjects/testng_gradle$ cat app/build.gradle
- /*
- * This file was generated by the Gradle 'init' task.
- *
- * This generated file contains a sample Java application project to get you started.
- * For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
- * User Manual available at https://docs.gradle.org/7.0.2/userguide/building_java_projects.html
- */
- plugins {
- // Apply the application plugin to add support for building a CLI application in Java.
- id 'application'
- }
- repositories {
- // Use Maven Central for resolving dependencies.
- mavenCentral()
- mavenLocal()
- jcenter()
- // https://riptutorial.com/
- }
- dependencies {
- // Use TestNG framework, also requires calling test.useTestNG() below
- testImplementation 'org.testng:testng:7.3.0'
- //compile 'org.testng:testng:7.3.0'
- // This dependency is used by the application.
- implementation 'com.google.guava:guava:30.0-jre'
- }
- application {
- // Define the main class for the application.
- mainClass = 'testng_gradle.App'
- }
- test {
- useTestNG() {
- includeGroups 'smoke', 'sanity'
- excludeGroups 'regression'
- testLogging.showStandardStreams = true
- suiteXmlBuilder().suite(name: 'Sample Suite') {
- test(name : 'Sample Test') {
- classes('') {
- 'class'(name: 'testing_gradle.AppTest')
- }
- }
- }
- }
- }
- nicholas@mordor:~/NetBeansProjects/testng_gradle$
- nicholas@mordor:~/NetBeansProjects/testng_gradle$ cat app/src/test/java/testng_gradle/AppTest.java
- /*
- * This Java source file was generated by the Gradle 'init' task.
- */
- package testng_gradle;
- import org.testng.annotations.*;
- import static org.testng.Assert.*;
- public class AppTest {
- @Test public void appHasAGreeting() {
- App classUnderTest = new App();
- assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
- }
- }
- nicholas@mordor:~/NetBeansProjects/testng_gradle$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement