Examples of files()


Examples of org.gradle.api.Project.files()

        SourceSet main = pluginConvention.getSourceSets().add(SourceSet.MAIN_SOURCE_SET_NAME);

        SourceSet test = pluginConvention.getSourceSets().add(SourceSet.TEST_SOURCE_SET_NAME);
        test.setCompileClasspath(project.files(main.getClasses(), project.getConfigurations().getByName(
                TEST_COMPILE_CONFIGURATION_NAME)));
        test.setRuntimeClasspath(project.files(test.getClasses(), main.getClasses(),
                project.getConfigurations().getByName(TEST_RUNTIME_CONFIGURATION_NAME)));
    }

    private void configureJavaDoc(final JavaPluginConvention pluginConvention) {
        Project project = pluginConvention.getProject();
View Full Code Here

Examples of org.gradle.api.Project.files()

        final Project project = pluginConvention.getProject();

        SourceSet main = pluginConvention.getSourceSets().create(SourceSet.MAIN_SOURCE_SET_NAME);

        SourceSet test = pluginConvention.getSourceSets().create(SourceSet.TEST_SOURCE_SET_NAME);
        test.setCompileClasspath(project.files(main.getOutput(), project.getConfigurations().getByName(TEST_COMPILE_CONFIGURATION_NAME)));
        test.setRuntimeClasspath(project.files(test.getOutput(), main.getOutput(), project.getConfigurations().getByName(TEST_RUNTIME_CONFIGURATION_NAME)));
    }

    private void configureJavaDoc(final JavaPluginConvention pluginConvention) {
        Project project = pluginConvention.getProject();
View Full Code Here

Examples of org.gradle.api.Project.files()

        SourceSet main = pluginConvention.getSourceSets().create(SourceSet.MAIN_SOURCE_SET_NAME);

        SourceSet test = pluginConvention.getSourceSets().create(SourceSet.TEST_SOURCE_SET_NAME);
        test.setCompileClasspath(project.files(main.getOutput(), project.getConfigurations().getByName(TEST_COMPILE_CONFIGURATION_NAME)));
        test.setRuntimeClasspath(project.files(test.getOutput(), main.getOutput(), project.getConfigurations().getByName(TEST_RUNTIME_CONFIGURATION_NAME)));
    }

    private void configureJavaDoc(final JavaPluginConvention pluginConvention) {
        Project project = pluginConvention.getProject();
View Full Code Here

Examples of org.moresbycoffee.have.annotations.Story.files()

    private static List<org.moresbycoffee.have.domain.Story> parseStories(final Class<?> testClass) throws MByHaveException {
        final List<org.moresbycoffee.have.domain.Story> mutableStories = new ArrayList<org.moresbycoffee.have.domain.Story>();
        if (testClass.isAnnotationPresent(Story.class)) {
            final Story story = testClass.getAnnotation(Story.class);
            final String[] storyFiles = story.files();

            for (final String storyFile : storyFiles) {

                final InputStream storyIs = loadResource(storyFile, testClass);
                org.moresbycoffee.have.domain.Story storyObject;
View Full Code Here

Examples of org.sonar.api.scan.filesystem.ModuleFileSystem.files()

    when(fs.testDirs()).thenReturn(testDirs);

    List<File> mainSourceFiles = scanForSourceFiles(sourceDirs);
    List<File> testSourceFiles = scanForSourceFiles(testDirs);

    when(fs.files(any(FileQuery.class))).thenReturn(mainSourceFiles);

    return fs;
  }

  public static ModuleFileSystem mockFileSystem() {
View Full Code Here

Examples of org.sonar.api.scan.filesystem.ModuleFileSystem.files()

    project = new Project("key");

    JavaScriptSquidSensor sensor = new JavaScriptSquidSensor(mock(RulesProfile.class), fileLinesContextFactory, mock(ResourcePerspectives.class), fs, new NoSonarFilter());

    // no JS files -> do not execute
    when(fs.files(any(FileQuery.class))).thenReturn(Collections.<File>emptyList());
    assertThat(sensor.shouldExecuteOnProject(project)).isFalse();

    // at least one JS file -> do execute
    when(fs.files(any(FileQuery.class))).thenReturn(Arrays.asList(mock(File.class)));
    assertThat(sensor.shouldExecuteOnProject(project)).isTrue();
View Full Code Here

Examples of org.sonar.api.scan.filesystem.ModuleFileSystem.files()

    // no JS files -> do not execute
    when(fs.files(any(FileQuery.class))).thenReturn(Collections.<File>emptyList());
    assertThat(sensor.shouldExecuteOnProject(project)).isFalse();

    // at least one JS file -> do execute
    when(fs.files(any(FileQuery.class))).thenReturn(Arrays.asList(mock(File.class)));
    assertThat(sensor.shouldExecuteOnProject(project)).isTrue();
  }

  @Test
  public void should_analyse() {
View Full Code Here

Examples of org.sonar.api.scan.filesystem.ModuleFileSystem.files()

  @Test
  public void should_analyse() {
    ModuleFileSystem fs = mock(ModuleFileSystem.class);
    when(fs.sourceCharset()).thenReturn(Charset.forName("UTF-8"));
    ImmutableList<File> files = ImmutableList.of(new File("src/test/resources/cpd/Person.js"));
    when(fs.files(any(FileQuery.class))).thenReturn(files);


    SensorContext context = mock(SensorContext.class);
    JavaScriptSquidSensor sensor = new JavaScriptSquidSensor(mock(RulesProfile.class), fileLinesContextFactory, mock(ResourcePerspectives.class), fs, new NoSonarFilter());
View Full Code Here

Examples of org.sonar.api.scan.filesystem.ModuleFileSystem.files()

    };
  }

  private ModuleFileSystem mockFileSystem() {
    ModuleFileSystem fs = mock(ModuleFileSystem.class);
    when(fs.files(any(FileQuery.class))).thenReturn(ImmutableList.of(new File("mock")));

    return fs;
  }

  private JsTestSensor mock_sensor_for_SQ_over_4_0() {
View Full Code Here

Examples of org.sonar.api.scan.filesystem.ModuleFileSystem.files()

    return fs;
  }

  private JsTestSensor mock_sensor_for_SQ_over_4_0() {
    ModuleFileSystem fs = mock(ModuleFileSystem.class);
    when(fs.files(any(FileQuery.class))).thenReturn(ImmutableList.of(new File("mock")));

    return new JsTestSensor(fs, settings);
  }

}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.