Package org.gradle.api.tasks.testing

Examples of org.gradle.api.tasks.testing.Test


                                .getJava().getSrcDirs());
                    }
                });
            }
        });
        Test test = project.getTasks().add(TEST_TASK_NAME, Test.class);
        test.setDescription("Runs the unit tests.");
        test.setGroup(JavaBasePlugin.VERIFICATION_GROUP);
    }
View Full Code Here


                properties.put("sonar.tests", testDirectories);

                properties.put("sonar.binaries", nonEmptyOrNull(Iterables.filter(main.getRuntimeClasspath(), IS_DIRECTORY)));
                properties.put("sonar.libraries", getLibraries(main));

                final Test testTask = (Test) project.getTasks().getByName(JavaPlugin.TEST_TASK_NAME);

                if (sourceDirectories != null || testDirectories != null) {
                    File testResultsDir = testTask.getReports().getJunitXml().getDestination();
                    // create the test results folder to prevent SonarQube from emitting
                    // a warning if a project does not contain any tests
                    testResultsDir.mkdirs();


                    properties.put("sonar.surefire.reportsPath", testResultsDir);
                    // added due to https://issues.gradle.org/browse/GRADLE-3005
                    properties.put("sonar.junit.reportsPath", testResultsDir);
                }

                project.getPlugins().withType(JacocoPlugin.class, new Action<JacocoPlugin>() {
                    public void execute(JacocoPlugin jacocoPlugin) {
                        JacocoTaskExtension jacocoTaskExtension = testTask.getExtensions().getByType(JacocoTaskExtension.class);
                        File destinationFile = jacocoTaskExtension.getDestinationFile();
                        if (destinationFile.exists()) {
                            properties.put("sonar.jacoco.reportPath", destinationFile);
                        }
                    }
View Full Code Here

            child.getDependencies().add("compile", "org.codehaus:groovy:groovy-all:2.0.5");
            child.getDependencies().add("compile", "commons-codec:commons-codec:1.2");
            child.getDependencies().add("testCompile", "junit:junit:4.11");
            child.getDependencies().add("testCompile", "org.testng:testng:6.4");
            child.getDependencies().add("runtime", "com.googlecode:reflectasm:1.01");
            Test test = (Test)(child.getTasks().getByName("test"));
            test.jvmArgs("-XX:MaxPermSize=512m", "-XX:+HeapDumpOnOutOfMemoryError");
            child.getTasks().add("dependencyReport", DependencyReportTask.class).setOutputFile(new File(child.getBuildDir(), "dependencies.txt"));
        }
    }
View Full Code Here

                                .getJava().getSrcDirs());
                    }
                });
            }
        });
        Test test = project.getTasks().create(TEST_TASK_NAME, Test.class);
        project.getTasks().getByName(JavaBasePlugin.CHECK_TASK_NAME).dependsOn(test);
        test.setDescription("Runs the unit tests.");
        test.setGroup(JavaBasePlugin.VERIFICATION_GROUP);
    }
View Full Code Here

TOP

Related Classes of org.gradle.api.tasks.testing.Test

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.