예제 #1
0
  @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();
  }
예제 #2
0
 private static void feedDriverMavenKey(
     FileSystem fileSystem, DatabaseClient.Builder builder, String propertyValue) {
   String[] fields = StringUtils.split(propertyValue, ':');
   Preconditions.checkArgument(
       fields.length == 3,
       "Format is groupId:artifactId:version. Please check the property sonar.jdbc.driverMavenKey: "
           + propertyValue);
   MavenLocation location = MavenLocation.create(fields[0], fields[1], fields[2]);
   File file = fileSystem.locate(location);
   Preconditions.checkState(file.exists(), "Driver file does not exist: " + location);
   builder.setDriverFile(file);
 }