Package com.google.enterprise.connector.instantiator

Examples of com.google.enterprise.connector.instantiator.Configuration


    return getConfiguration(TYPENAME);
  }

  /** Gets a new instance of Configuration. */
  protected static Configuration getConfiguration(String typeName) {
    return new Configuration(typeName, Collections.<String, String>emptyMap(),
        CONFIG_XML);
  }
View Full Code Here


  public void testConfiguration() {
    Map<String, String> configMap = new HashMap<String, String>();
    configMap.put("property1", "value1");
    configMap.put("property2", "2");
    configMap.put("property3", "true");
    Configuration resultConfig =
        new Configuration(TYPENAME, configMap, CONFIG_XML);
    ConnectorTestUtils.compareMaps(configMap, resultConfig.getMap());
    assertEquals(TYPENAME, resultConfig.getTypeName());
    assertEquals(CONFIG_XML, resultConfig.getXml());
  }
View Full Code Here

    StoreContext storeContext = getStoreContext(connectorName);
    Map<String, String> configMap = new HashMap<String, String>();
    configMap.put("property1", "value1");
    configMap.put("property2", "2");
    configMap.put("property3", "true");
    Configuration expectedConfig =
        new Configuration(TYPENAME, configMap, CONFIG_XML);
    store.storeConnectorConfiguration(storeContext, expectedConfig);
    Configuration resultConfig = store.getConnectorConfiguration(storeContext);
    ConnectorTestUtils.compareConfigurations(expectedConfig, resultConfig);
  }
View Full Code Here

    StoreContext storeContext = getStoreContext(connectorName);
    Map<String, String> configMap = new HashMap<String, String>();
    configMap.put("property1", "value1");
    configMap.put("property2", "2");
    configMap.put("property3", "true");
    Configuration expectedConfig =
        new Configuration(TYPENAME, configMap, CONFIG_XML);
    store.storeConnectorConfiguration(storeContext, expectedConfig);
    Configuration resultConfig = store.getConnectorConfiguration(storeContext);
    ConnectorTestUtils.compareConfigurations(expectedConfig, resultConfig);

    // Now change the configuration and make sure it sticks.
    configMap.remove("property2");
    configMap.put("property4", "score");
    expectedConfig = new Configuration(TYPENAME, configMap, null);
    store.storeConnectorConfiguration(storeContext, expectedConfig);
    resultConfig = store.getConnectorConfiguration(storeContext);
    ConnectorTestUtils.compareConfigurations(expectedConfig, resultConfig);
  }
View Full Code Here

    configMap.put("property2", "2");
    configMap.put("property3", "true");
    configMap.put("password", "fred");
    configMap.put("PASSWORDS", "fred");
    configMap.put("xyzpasswordzy", "fred");
    Configuration expectedConfig =
        new Configuration(TYPENAME, configMap, null);
    store.storeConnectorConfiguration(storeContext, expectedConfig);
    Configuration resultConfig = store.getConnectorConfiguration(storeContext);
    ConnectorTestUtils.compareConfigurations(expectedConfig, resultConfig);
  }
View Full Code Here

    ConnectorTestUtils.compareConfigurations(expectedConfig, resultConfig);
  }

  // Tests getting configuration for an unknown connector.
  public void testGetConnectorConfigurationNoConnector() {
    Configuration config = store.getConnectorConfiguration(
        getStoreContext("some weird connector name"));
    // Should return null, not an empty map.
    assertNull(config);
  }
View Full Code Here

    Map<String, String> configMap = new HashMap<String, String>();
    configMap.put("property1", "value1");
    configMap.put("property2", "2");
    configMap.put("property3", "true");
    StoreContext storeContext = getStoreContext(connectorName);
    Configuration config = store.getConnectorConfiguration(storeContext);
    assertNull(config);
    store.storeConnectorConfiguration(storeContext,
        new Configuration(TYPENAME, configMap, CONFIG_XML));
    config = store.getConnectorConfiguration(storeContext);
    ConnectorTestUtils.compareMaps(configMap, config.getMap());
    store.removeConnectorConfiguration(storeContext);
    config = store.getConnectorConfiguration(storeContext);
    assertNull(config);
  }
View Full Code Here

  /** Tests the inventory of a store with one object in multiple instances. */
  public void testInventoryMultipleInstances() {
    StoreContext one = getStoreContext("one");
    StoreContext two = getStoreContext("two");
    Configuration configuration2 = getConfiguration();
    assertNotSame(configuration, configuration2);

    checkIsEmpty(store);
    store.storeConnectorConfiguration(one, configuration);
    checkContains(store, one);
View Full Code Here

  /** Tests the inventory of a store with instances in multiple types. */
  public void testInventoryMultipleTypes() {
    StoreContext one = getStoreContext("one");
    StoreContext two = getStoreContext("two", "TestConnectorB");
    Configuration configuration2 = getConfiguration("TestConnectorB");

    checkIsEmpty(store);
    store.storeConnectorConfiguration(one, configuration);
    checkContains(store, one);
    store.storeConnectorConfiguration(two, configuration2);
View Full Code Here

   * instances.
   */
  public void testInventoryComplete() {
    StoreContext one = getStoreContext("one");
    StoreContext two = getStoreContext("two");
    Configuration configurationTwo = getConfiguration();
    Schedule scheduleTwo = getSchedule();
    assertNotSame(configuration, configurationTwo);
    assertNotSame(schedule, scheduleTwo);

    checkIsEmpty(store);
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.instantiator.Configuration

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.