Ejemplo n.º 1
0
  @Test
  public void testGlobsUpToDate() throws Exception {
    assertTrue(cache.globsUpToDate());

    // Initialize the cache
    cache.getGlob("*.txt");
    assertTrue(cache.globsUpToDate());

    cache.getGlob("*.js");
    assertTrue(cache.globsUpToDate());

    // Change the filesystem
    scratch.file("isolated/third.txt", "# this is third.txt");
    assertFalse(cache.globsUpToDate());

    // Fool the cache to observe the method's behavior.
    cache.setGlobPaths(
        "*.txt",
        false,
        Futures.<List<Path>>immediateFuture(
            Lists.newArrayList(
                scratch.resolve("isolated/first.txt"),
                scratch.resolve("isolated/second.txt"),
                scratch.resolve("isolated/third.txt"))));
    assertTrue(cache.globsUpToDate());
  }