buildscript { dependencies { classpath fileTree(dir: 'plugins', include: '*.jar', exclude: '*-sources.jar') } } repositories { jcenter() } dependencies { plugin 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.0' } apply plugin: 'org.asciidoctor.gradle.asciidoctor' dependencies { compile project(":automation") compile project(":testing/proxy") compile project(":testing/servlet") compile fileTree(dir: 'vendor', include: '*.jar', exclude: '*-sources.jar') } dependencies { vendor 'com.esotericsoftware.yamlbeans:yamlbeans:1.09' vendor 'com.esotericsoftware.yamlbeans:yamlbeans:1.09:sources' vendor 'org.antlr:stringtemplate:4.0.2' vendor 'org.antlr:stringtemplate:4.0.2:sources' vendor 'org.testng:testng:6.9.9' vendor 'org.testng:testng:6.9.9:sources' vendor 'org.apache.httpcomponents:httpcore:4.4.4' vendor 'org.apache.httpcomponents:httpcore:4.4.4:sources' } configurations { vendor.exclude group: "org.apache.logging.log4j", module: "log4j-api" } task runAll(type: JavaExec, dependsOn: 'classes') { description = "Runs the testng-all.xml suite, which includes many of the other suites" main = 'org.testng.TestNG' classpath = files("./src/test/resources", project.sourceSets.main.compileClasspath, project.sourceSets.test.compileClasspath, project.sourceSets.main.runtimeClasspath, project.sourceSets.test.runtimeClasspath) args = ["-d", "./build/test-output-all", "-configfailurepolicy", "continue", "./testng-all.xml"] dependsOn ':server:jar' } task runBasicMainlineTests(type: JavaExec, dependsOn: 'classes') { description = "Runs the test suite for the local HWS in dev mode against the mainline p4d" main = 'org.testng.TestNG' classpath = files("./src/test/resources", project.sourceSets.main.compileClasspath, project.sourceSets.test.compileClasspath, project.sourceSets.main.runtimeClasspath, project.sourceSets.test.runtimeClasspath) args = ["-parallel", "methods", "-threadcount", "1", "-d", "./build/test-output-basic-mainline", "-configfailurepolicy", "continue", "./testng-basic-mainline.xml"] dependsOn ':server:jar' } task runBasic14_1Tests(type: JavaExec, dependsOn: 'classes') { description = "Runs the test suite for the local HWS in dev mode against the r14.1 server" main = 'org.testng.TestNG' classpath = files("./src/test/resources", project.sourceSets.main.compileClasspath, project.sourceSets.test.compileClasspath, project.sourceSets.main.runtimeClasspath, project.sourceSets.test.runtimeClasspath) args = ["-parallel", "methods", "-threadcount", "1", "-d", "./build/test-output-basic-14.1", "-configfailurepolicy", "continue", "./testng-basic-14.1.xml"] dependsOn ':server:jar' } task runBasic14_2Tests(type: JavaExec, dependsOn: 'classes') { description = "Runs the test suite for the local HWS in dev mode against the r14.2 server" main = 'org.testng.TestNG' classpath = files("./src/test/resources", project.sourceSets.main.compileClasspath, project.sourceSets.test.compileClasspath, project.sourceSets.main.runtimeClasspath, project.sourceSets.test.runtimeClasspath) args = ["-parallel", "methods", "-threadcount", "1", "-configfailurepolicy", "continue", "-d", "./build/test-output-basic-14.2", "./testng-basic-14.2.xml"] dependsOn ':server:jar' } task runBasic15_1Tests(type: JavaExec, dependsOn: 'classes') { description = "Runs the test suite for the local HWS in dev mode against the r15.1 server" main = 'org.testng.TestNG' classpath = files("./src/test/resources", project.sourceSets.main.compileClasspath, project.sourceSets.test.compileClasspath, project.sourceSets.main.runtimeClasspath, project.sourceSets.test.runtimeClasspath) args = ["-parallel", "methods", "-threadcount", "1", "-d", "./build/test-output-basic-15.1", "-configfailurepolicy", "continue", "./testng-basic-15.1.xml"] dependsOn ':server:jar' } task runBasic15_2Tests(type: JavaExec, dependsOn: 'classes') { description = "Runs the test suite for the local HWS in dev mode against the r15.2 server" main = 'org.testng.TestNG' classpath = files("./src/test/resources", project.sourceSets.main.compileClasspath, project.sourceSets.test.compileClasspath, project.sourceSets.main.runtimeClasspath, project.sourceSets.test.runtimeClasspath) args = ["-parallel", "methods", "-threadcount", "1", "-d", "./build/test-output-basic-15.2", "-configfailurepolicy", "continue", "./testng-basic-15.2.xml"] dependsOn ':server:jar' } task runBasic16_1Tests(type: JavaExec, dependsOn: 'classes') { description = "Runs the test suite for the local HWS in dev mode against the 16.1 server" main = 'org.testng.TestNG' classpath = files("./src/test/resources", project.sourceSets.main.compileClasspath, project.sourceSets.test.compileClasspath, project.sourceSets.main.runtimeClasspath, project.sourceSets.test.runtimeClasspath) args = ["-parallel", "methods", "-threadcount", "1", "-d", "./build/test-output-basic-16.1", "-configfailurepolicy", "continue", "./testng-basic-16.1.xml"] dependsOn ':server:jar' } task runBasic16_1SslTests(type: JavaExec, dependsOn: 'classes') { description = "Runs the test suite for the local HWS in dev mode against the 16.1 SSL server" main = 'org.testng.TestNG' classpath = files("./src/test/resources", project.sourceSets.main.compileClasspath, project.sourceSets.test.compileClasspath, project.sourceSets.main.runtimeClasspath, project.sourceSets.test.runtimeClasspath) args = ["-parallel", "methods", "-threadcount", "1", "-d", "./build/test-output-basic-16.1-ssl", "-configfailurepolicy", "continue", "./testng-basic-16.1-ssl.xml"] dependsOn ':server:jar' } task runCloudTests(type: JavaExec, dependsOn: 'classes') { description = "Runs the test suite for the local HWS in Cloud Setup with mock Raymond" main = 'org.testng.TestNG' classpath = files("./src/test/resources", project.sourceSets.main.compileClasspath, project.sourceSets.test.compileClasspath, project.sourceSets.main.runtimeClasspath, project.sourceSets.test.runtimeClasspath) args = ["-parallel", "methods", "-threadcount", "1", "-d", "./build/test-output-cloud", "-configfailurepolicy", "continue", "./testng-cloud.xml"] dependsOn ':server:jar' } task runGitFusionTests(type: JavaExec, dependsOn: 'classes') { description = "Runs the test suite for the local HWS in Cloud Setup with mock Raymond" main = 'org.testng.TestNG' classpath = files("./src/test/resources", project.sourceSets.main.compileClasspath, project.sourceSets.test.compileClasspath, project.sourceSets.main.runtimeClasspath, project.sourceSets.test.runtimeClasspath) args = ["-parallel", "methods", "-threadcount", "1", "-d", "./build/test-output-git-fusion", "-configfailurepolicy", "continue", "./testng-git-fusion.xml"] dependsOn ':server:jar' } ext { installSuiteName = "2016.1.0 Java SDK - ${System.getProperty('INSTALL_TYPE')} Install Setup " + "- 16.1 p4d - ${System.getProperty('os.name')} ${System.getProperty('DISTNAME')}" } task copyTestngInstall(type: Copy) { from "./testng-install.xml" into "$buildDir" expand(suiteName: installSuiteName) } task runInstallTests(type: JavaExec, dependsOn: ['classes', copyTestngInstall]) { description = "Runs the test suite for an installed HWS" main = 'org.testng.TestNG' classpath = files("./src/test/resources", project.sourceSets.main.compileClasspath, project.sourceSets.test.compileClasspath, project.sourceSets.main.runtimeClasspath, project.sourceSets.test.runtimeClasspath) args = ["-parallel", "methods", "-threadcount", "1", "-d", "./build/test-output-install", "-configfailurepolicy", "continue", "$buildDir/testng-install.xml"] } task runRubyTests(type: JavaExec, dependsOn: ['classes', copyTestngInstall]) { description = "Runs the ruby 16.1 test suite" main = 'org.testng.TestNG' classpath = files("./src/test/resources", project.sourceSets.main.compileClasspath, project.sourceSets.test.compileClasspath, project.sourceSets.main.runtimeClasspath, project.sourceSets.test.runtimeClasspath) args = ["-parallel", "methods", "-threadcount", "1", "-d", "./build/test-output-ruby", "-configfailurepolicy", "continue", "./testng-ruby-16.1.xml"] } task runPythonTests(type: JavaExec, dependsOn: ['classes', copyTestngInstall]) { description = "Runs the python 16.1 test suite" main = 'org.testng.TestNG' classpath = files("./src/test/resources", project.sourceSets.main.compileClasspath, project.sourceSets.test.compileClasspath, project.sourceSets.main.runtimeClasspath, project.sourceSets.test.runtimeClasspath) args = ["-parallel", "methods", "-threadcount", "1", "-d", "./build/test-output-python", "-configfailurepolicy", "continue", "./testng-python-16.1.xml"] } task runDebTests(type: JavaExec, dependsOn: ['classes']) { description = "Runs the .deb deployment test suite" main = 'org.testng.TestNG' classpath = files("./src/test/resources", project.sourceSets.main.compileClasspath, project.sourceSets.test.compileClasspath, project.sourceSets.main.runtimeClasspath, project.sourceSets.test.runtimeClasspath) args = ["-parallel", "methods", "-threadcount", "1", "-d", "./build/test-output-deployment-deb", "-configfailurepolicy", "continue", "./testng-deployment-deb.xml"] } task runRpmTests(type: JavaExec, dependsOn: ['classes']) { description = "Runs the .rpm deployment test suite" main = 'org.testng.TestNG' classpath = files("./src/test/resources", project.sourceSets.main.compileClasspath, project.sourceSets.test.compileClasspath, project.sourceSets.main.runtimeClasspath, project.sourceSets.test.runtimeClasspath) args = ["-parallel", "methods", "-threadcount", "1", "-d", "./build/test-output-deployment-rpm", "-configfailurepolicy", "continue", "./testng-deployment-rpm.xml"] } task asciidocReport(type: JavaExec) { description 'Create asciidoc report from test results' classpath = sourceSets.main.runtimeClasspath main = 'com.perforce.hws.testing.reporting.AsciidocReportGenerator' args file("${buildDir}/test-output-all").canonicalPath, file("${buildDir}/asciidoc-report/report.asc").canonicalPath } asciidoctor { backends = ['html', 'docbook'] sourceDir = file("${buildDir}/asciidoc-report") sourceDocumentNames = fileTree("${buildDir}/asciidoc-report") { include 'report.asc' } } asciidoctor.dependsOn 'asciidocReport'