use of com.sonar.orchestrator.locator.MavenLocator in project sonar-java by SonarSource.
the class JavaTest method should_execute_rule_on_test.
@Test
public void should_execute_rule_on_test() throws Exception {
MavenLocation junit_4_11 = MavenLocation.of("junit", "junit", "4.11");
new MavenLocator(orchestrator.getConfiguration()).copyToDirectory(junit_4_11, tmp.getRoot());
MavenBuild build = MavenBuild.create().setPom(TestUtils.projectPom("java-inner-classes")).setProperty("sonar.profile", "ignored-test-check").setProperty("sonar.java.test.binaries", "target/test-classes").setProperty("sonar.java.test.libraries", new File(tmp.getRoot(), junit_4_11.getFilename()).getAbsolutePath()).setCleanPackageSonarGoals();
orchestrator.executeBuild(build);
assertThat(getMeasureAsInteger("com.sonarsource.it.samples:java-inner-classes", "violations")).isEqualTo(1);
}
use of com.sonar.orchestrator.locator.MavenLocator in project sonar-java by SonarSource.
the class JavaClasspathTest method copyGuavaJar.
@Before
public void copyGuavaJar() {
MavenLocation guava = MavenLocation.of("com.google.guava", "guava", "10.0.1");
File subFolder = new File(tmp.getRoot(), "subFolder");
File subSubFolder = new File(subFolder, "subSubFolder");
new MavenLocator(ORCHESTRATOR.getConfiguration()).copyToDirectory(guava, subSubFolder);
aarPath = new File(new File(TestUtils.projectDir("using-aar-dep"), "lib"), "cache-1.3.0.aar").getAbsolutePath();
guavaJarPath = new File(subSubFolder.getAbsolutePath(), guava.getFilename()).getAbsolutePath();
fakeGuavaJarPath = new File(new File(TestUtils.projectDir("dit-check"), "lib"), "fake-guava-1.0.jar").getAbsolutePath();
}
Aggregations