Package com.google.enterprise.connector.filesystem.MockDirectoryBuilder

Examples of com.google.enterprise.connector.filesystem.MockDirectoryBuilder.ConfigureFile


        builder.addDir(configureFile, null, "/foo/top-secret");
    runLister(root);
  }

  public void testRootOffLine() throws Exception {
    ConfigureFile configureFile = new ConfigureFile() {
        @Override
        public boolean configure(MockReadonlyFile file) {
          if (file.getParent() == null) {
            file.setException(MockReadonlyFile.Where.ALL,
                              new RepositoryException("Repository Off Line"));
View Full Code Here


    testRootListFilesException(
        new DocumentAccessException("Test Exception"));
  }

  private void testRootListFilesException(final Exception e) throws Exception {
    ConfigureFile configureFile = new ConfigureFile() {
        @Override
        public boolean configure(MockReadonlyFile file) {
          if (file.getParent() == null) {
            file.setException(MockReadonlyFile.Where.LIST_FILES, e);
            return false;
View Full Code Here

    testNonRootListFilesException(new IOException("Test Exception"));
  }

  private void testNonRootListFilesException(final Exception e)
      throws Exception {
    ConfigureFile configureFile = new ConfigureFile() {
        @Override
        public boolean configure(MockReadonlyFile file) {
          if ("bad-dir".equals(file.getName())) {
            file.setException(MockReadonlyFile.Where.LIST_FILES, e);
            return false;
View Full Code Here

    builder.addDir(configureFile, root, "bad-dir", "bad-f1", "bad-f2");
    runLister(root);
  }

  public void testNonRootDocumentAccessException() throws Exception {
    ConfigureFile configureFile = new ConfigureFile() {
        @Override
        public boolean configure(MockReadonlyFile file) {
          if ("top-secret".equals(file.getName())) {
            file.setCanRead(false);
            file.setException(MockReadonlyFile.Where.LIST_FILES,
View Full Code Here

    assertEquals("f2", file.getName());
    assertNull(it.next());
  }       

  public void testFullTraversal() throws Exception {
    ConfigureFile configureFile = new ConfigureFile() {
        @Override
        public boolean configure(MockReadonlyFile file) {
          if (file.getName().contains("newer")) {
            file.setLastModified(NEWER);
          } else {
View Full Code Here

    runIterator(OLDER - 100, configureFile);
  }

  /** Only return newer files, plus all directories. */
  public void testIncrementalTraversal() throws Exception {
    ConfigureFile configureFile = new ConfigureFile() {
        @Override
        public boolean configure(MockReadonlyFile file) throws Exception {
          if (file.getName().contains("newer")) {
            file.setLastModified(NEWER);
            return true;
View Full Code Here

    runIterator(NEWER, configureFile);
  }

  /** If no newer files, still return all directories. */
  public void testIncrementalTraversalNoNewestFiles() throws Exception {
    ConfigureFile configureFile = new ConfigureFile() {
        @Override
        public boolean configure(MockReadonlyFile file) throws Exception {
          if (file.getName().contains("newer")) {
            file.setLastModified(NEWER);
          } else {
View Full Code Here

    traversalContext.setSupportsInheritedAcls(false);
    noDirectoriesTest();
  }

  private void noDirectoriesTest() throws Exception {
    ConfigureFile configureFile = new ConfigureFile() {
        @Override
        public boolean configure(MockReadonlyFile file) throws Exception {
          return !file.isDirectory();
        }
      };
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.filesystem.MockDirectoryBuilder.ConfigureFile

Copyright © 2018 www.massapicom. 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.