Adding an additional test suite to Gradle

前端 未结 3 1465
不知归路
不知归路 2020-12-16 16:53

I am attempting to add Gradle (1.4) to an existing project that has multiple test suites. The standard unit test located in src/test/java ran successfully, but

3条回答
  •  情歌与酒
    2020-12-16 17:06

    the "integration" sourceSet has not configured its compile and runtime classpath. That's why it can't find the classes from your main sourceset. you can configure the compile and runtime classpath in the following way:

    sourceSets {
        integTest {
            java.srcDir file('src/integration-test/java')
            resources.srcDir file('src/integration-test/resources')
            compileClasspath = sourceSets.main.output + configurations.integTest
            runtimeClasspath = output + compileClasspath
        }
    }
    

提交回复
热议问题