Package com.google.enterprise.connector.util.diffing.testing

Examples of com.google.enterprise.connector.util.diffing.testing.TestDirectoryManager


  private HashMap<String, String> goodConfig;

  @Override
  public void setUp() throws Exception {

    File startDir = new TestDirectoryManager(this).makeDirectory("startdir");

    goodConfig = new HashMap<String, String>();

    int numInputs = FileConnectorType.getMaxInputsOfMultiLineFieldForTesting();
    for (int i = 0; i < numInputs; i++) {
View Full Code Here


  protected FileSystemType<?> fst;

  @Override
  public void setUp() {
    try {
      TestDirectoryManager testDirectoryManager = new TestDirectoryManager(this);
      dir = testDirectoryManager.makeDirectory("root");
      file = testDirectoryManager.writeFile("root/file1", "file1_data");
    } catch (IOException e) {
      fail("failed to set up file system: " + e.getMessage());
    }
    fst = getFileSystemType();
  }
View Full Code Here

        ImmutableList.of(new JavaFileSystemType()));
    PathParser pathParser = new PathParser(fileSystemTypeRegistry);

    type = new FileConnectorType(pathParser);

    TestDirectoryManager testDirectoryManager = new TestDirectoryManager(this);

    // Create a complete configuration. For now, most of the values are nonsense.
    config = Maps.newHashMap();
    for (Field field : FileConnectorType.getRequiredFieldsForTesting()) {
      config.put(field.getName(), field.getLabel(US_BUNDLE));
    }

    // Full Traversal Interval needs to be an integer.
    config.put("fulltraversal", "0");

    // Create some test directories to validate.
    for (int k = 0; k < 5; ++k) {
      File dir = testDirectoryManager.makeDirectory(String.format("start-path-%d", k));
      TestFileSystemFactory.createDirectory(dir, 5, 1);
      // The start paths are actually checked, so make them valid.
      config.put("start_" + k, dir.getAbsolutePath());
      // The start path cannot be eliminated by include/exclude patterns
      config.put("include_" + k, dir.getAbsolutePath());
View Full Code Here

  private File snapshotDir;
  private SnapshotStore store;

  @Override
  public void setUp() throws Exception {
    TestDirectoryManager testDirectoryManager = new TestDirectoryManager(this);
    File rootDir = testDirectoryManager.makeDirectory("rootDir");
    snapshotDir = new File(rootDir, "snapshots");
    store = new SnapshotStore(new File(rootDir, "snapshots"),
        new MockDocumentSnapshotFactory());
  }
View Full Code Here

    return ix % 2 == 0;
  }

  @Override
  public void setUp() throws IOException {
    TestDirectoryManager testDirectoryManager = new TestDirectoryManager(this);
    persistDir = testDirectoryManager.makeDirectory("queue");
    assertTrue("Directory " + persistDir + " is not empty",
        persistDir.listFiles().length == 0);
  }
View Full Code Here

  private DeleteDocumentHandleFactory internalFactory;
  private MockDocumentHandleFactory clientFactory;

  @Override
  public void setUp() throws IOException {
    testDirectoryManager = new TestDirectoryManager(this);
    persistDir = testDirectoryManager.makeDirectory("queue");
    internalFactory = new DeleteDocumentHandleFactory();
    clientFactory = new MockDocumentHandleFactory();

    deleteDir(persistDir);
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.util.diffing.testing.TestDirectoryManager

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.