Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.MockRetriever


  private MockInstantiator getMockInstantiator() throws Exception {
    MockInstantiator instantiator =
        new MockInstantiator(new ThreadPool(5, new SystemClock()));
    instantiator.setupTestTraversers();
    instantiator.addConnector(connectorName,
        new MockConnector(null, null, null, new MockRetriever(), null));
    return instantiator;
  }
View Full Code Here


  }

  /** Test getDocumentContent with Document NotFound. */
  public void testGetDocumentContentDocumentNotFound() throws Exception {
    instantiator.addConnector(connectorName,
        new MockConnector(null, null, null, new MockRetriever(), null));
    try {
      manager.getDocumentContent(connectorName, MockRetriever.DOCID_NOT_FOUND);
      fail("Expected RepositoryDocumentException");
    } catch (RepositoryDocumentException expected) {
      // Expected.
View Full Code Here

  }

  /** Test getDocumentContent with RepositoryException. */
  public void testGetDocumentContentRepositoryException() throws Exception {
    instantiator.addConnector(connectorName,
        new MockConnector(null, null, null, new MockRetriever(), null));
    try {
      manager.getDocumentContent(connectorName,
                                 MockRetriever.DOCID_REPOSITORY_EXCEPTION);
      fail("Expected RepositoryException");
    } catch (RepositoryException expected) {
View Full Code Here

  }

  /** Test getDocumentContent where document has no content. */
  public void testGetDocumentContentNoContent() throws Exception {
    instantiator.addConnector(connectorName,
        new MockConnector(null, null, null, new MockRetriever(), null));
    InputStream in = manager.getDocumentContent(connectorName,
                                                MockRetriever.DOCID_NO_CONTENT);
    // GSA still doesn't handle docs with no content, so the
    // Production Manager substitutes a single space.
    assertNotNull(in);
View Full Code Here

  }

  /** Test getDocumentContent where document has empty content. */
  public void testGetDocumentContentEmptyContent() throws Exception {
    instantiator.addConnector(connectorName,
        new MockConnector(null, null, null, new MockRetriever(), null));
    InputStream in = manager.getDocumentContent(connectorName,
                                                MockRetriever.DOCID_NO_CONTENT);
    // GSA still doesn't handle docs with no content, so the
    // Production Manager substitutes a single space.
    assertNotNull(in);
View Full Code Here

  }

  /** Test getDocumentContent. */
  public void testGetDocumentContent() throws Exception {
    instantiator.addConnector(connectorName,
        new MockConnector(null, null, null, new MockRetriever(), null));
    InputStream in = manager.getDocumentContent(connectorName, "docid");
    assertNotNull(in);
    assertEquals("docid", StringUtils.streamToString(in));
  }
View Full Code Here

  }

  /** Test getDocumentMetaData with Document NotFound. */
  public void testGetDocumentMetaDataDocumentNotFound() throws Exception {
    instantiator.addConnector(connectorName,
        new MockConnector(null, null, null, new MockRetriever(), null));
    try {
      manager.getDocumentMetaData(connectorName, MockRetriever.DOCID_NOT_FOUND);
      fail("Expected RepositoryDocumentException");
    } catch (RepositoryDocumentException expected) {
      // Expected.
View Full Code Here

  }

  /** Test getDocumentMetaData with RepositoryException. */
  public void testGetDocumentMetaDataRepositoryException() throws Exception {
    instantiator.addConnector(connectorName,
        new MockConnector(null, null, null, new MockRetriever(), null));
    try {
      manager.getDocumentMetaData(connectorName,
                                  MockRetriever.DOCID_REPOSITORY_EXCEPTION);
      fail("Expected RepositoryException");
    } catch (RepositoryException expected) {
View Full Code Here

  }

  /** Test getDocumentMetaData. */
  public void testGetDocumentMetaData() throws Exception {
    instantiator.addConnector(connectorName,
        new MockConnector(null, null, null, new MockRetriever(), null));
    Document document = manager.getDocumentMetaData(connectorName, "docid");
    assertNotNull(document);
    assertEquals("docid",
        Value.getSingleValueString(document, SpiConstants.PROPNAME_DOCID));
  }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.spi.MockRetriever

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.