Examples of ConnectorFactory


Examples of com.facebook.presto.spi.ConnectorFactory

    @Test
    public void testCreateConnector()
            throws Exception
    {
        Plugin plugin = new PostgreSqlPlugin();
        ConnectorFactory factory = getOnlyElement(plugin.getServices(ConnectorFactory.class));
        factory.create("test", ImmutableMap.of("connection-url", "test"));
    }
View Full Code Here

Examples of com.facebook.presto.spi.ConnectorFactory

        }
    }

    public void addConnectorFactory(ConnectorFactory connectorFactory)
    {
        ConnectorFactory existingConnectorFactory = connectorFactories.putIfAbsent(connectorFactory.getName(), connectorFactory);
        checkArgument(existingConnectorFactory == null, "Connector %s is already registered", connectorFactory.getName());
    }
View Full Code Here

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

  }

  /** Tests a basic where clause that returns results. */
  public void testVcWhereClause_results() {
    validMap.put("where_clause", MockDmQuery.TRUE_WHERE_CLAUSE);
    ConnectorFactory connectorFactory = new WhereClauseFactory(false);

    ConfigureResponse response = type.validateConfig(validMap, Locale.US,
        connectorFactory);
    if (response != null)
      fail(response.getMessage());
View Full Code Here

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

  }

  /** Tests a where clause that returns no results. */
  public void testVcWhereClause_noresults() {
    validMap.put("where_clause", MockDmQuery.FALSE_WHERE_CLAUSE);
    ConnectorFactory connectorFactory = new WhereClauseFactory(false);
    String expected = resources.getString("additionalTooRestrictive");

    ConfigureResponse response = type.validateConfig(validMap, Locale.US,
        connectorFactory);
    assertNotNull(response);
View Full Code Here

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

  }

  /** Tests that multiple entries are valid. */
  public void testVcWhereClause_list() {
    validMap.put("where_clause", MockDmQuery.TRUE_WHERE_CLAUSE);
    ConnectorFactory connectorFactory =
        new WhereClauseFactory(false, MockDmQuery.TRUE_WHERE_CLAUSE);

    ConfigureResponse response = type.validateConfig(validMap, Locale.US,
        connectorFactory);
    if (response != null)
View Full Code Here

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

  }

  /** Tests that an XML entry that returns no results leads to an error. */
  public void testVcWhereClause_listnoresults() {
    validMap.put("where_clause", MockDmQuery.TRUE_WHERE_CLAUSE);
    ConnectorFactory connectorFactory =
        new WhereClauseFactory(false, MockDmQuery.FALSE_WHERE_CLAUSE);
    String expected = resources.getString("additionalTooRestrictive");

    ConfigureResponse response = type.validateConfig(validMap, Locale.US,
        connectorFactory);
View Full Code Here

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

  }

  /** Tests that ignoring a non-empty map entry leads to an error. */
  public void testVcWhereClause_ignoremap() {
    validMap.put("where_clause", MockDmQuery.TRUE_WHERE_CLAUSE);
    ConnectorFactory connectorFactory =
        new WhereClauseFactory(true, MockDmQuery.ALT_TRUE_WHERE_CLAUSE);
    String expected = resources.getString("whereClauseNotUsed");

    ConfigureResponse response = type.validateConfig(validMap, Locale.US,
        connectorFactory);
View Full Code Here

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

   * Tests that an ignored map entry and an XML entry that returns no
   * results leads to an error. It's not important which error.
   */
  public void testVcWhereClause_ignoremapnoresults() {
    validMap.put("where_clause", MockDmQuery.TRUE_WHERE_CLAUSE);
    ConnectorFactory connectorFactory =
        new WhereClauseFactory(true, MockDmQuery.FALSE_WHERE_CLAUSE);
    List<String> expected = new ArrayList<String>();
    Collections.addAll(expected, resources.getString("whereClauseNotUsed"),
        resources.getString("additionalTooRestrictive"));

View Full Code Here

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

    assertTrue(response.getMessage(), expected.contains(response.getMessage()));
  }

  /** Tests that an empty map entry can be safely ignored. */
  public void testVcWhereClause_ignoremapempty() {
    ConnectorFactory connectorFactory =
        new WhereClauseFactory(true, MockDmQuery.TRUE_WHERE_CLAUSE);

    ConfigureResponse response = type.validateConfig(validMap, Locale.US,
        connectorFactory);
    if (response != null)
View Full Code Here

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

  /**
   * Tests that an empty map entry with an XML entry that returns no
   * results leads to an error.
  */
  public void testVcWhereClause_emptynoresults() {
    ConnectorFactory connectorFactory =
        new WhereClauseFactory(true, MockDmQuery.FALSE_WHERE_CLAUSE);
    String expected = resources.getString("additionalTooRestrictive");

    ConfigureResponse response = type.validateConfig(validMap, Locale.US,
        connectorFactory);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.