Example usage for org.aspectj.util FileUtil listFiles

List of usage examples for org.aspectj.util FileUtil listFiles

Introduction

In this page you can find the example usage for org.aspectj.util FileUtil listFiles.

Prototype

public static String[] listFiles(File srcDir) 

Source Link

Document

Recursively list files in srcDir.

Usage

From source file:com.thoughtworks.go.server.materials.MaterialDatabaseGitUpdaterTest.java

License:Apache License

@Test
public void shouldRemoveFlyweightWhenConfiguredBranchDoesNotExist() throws Exception {
    File flyweightDir = new File("pipelines", "flyweight");
    FileUtils.deleteQuietly(flyweightDir);

    material = new GitMaterial(testRepo.projectRepositoryUrl(), "bad-bad-branch");

    try {//from w  w  w  . j  a  v  a 2 s . c  o m
        updater.updateMaterial(material);
        fail("material update should have failed as given branch does not exist in repository");
    } catch (Exception e) {
        //ignore
    }

    MaterialInstance materialInstance = materialRepository.findMaterialInstance(material);

    assertThat(materialInstance, is(nullValue()));
    assertThat(FileUtil.listFiles(flyweightDir).length, is(0));//no flyweight dir left behind
}