Package com.google.enterprise.connector.manager

Examples of com.google.enterprise.connector.manager.Context


  }

  // Test that connectors not in the import set are not removed on import
  // if noRemove is true.
  public final void testNoRemove() throws Exception {
    Context context = Context.getInstance();
    ConnectorCoordinatorMap ccm = getCoordinatorMap();

    addConnector("connector-01", "red");
    addConnector("connector-02", "blue");
View Full Code Here


    assertEquals("0-0", schedule.getTimeIntervals());
  }

  // Test that connectors not in the import set are removed on import.
  public final void testDoRemove() throws Exception {
    Context context = Context.getInstance();
    ConnectorCoordinatorMap ccm = getCoordinatorMap();

    addConnector("connector-01", "red");
    addConnector("connector-02", "blue");
View Full Code Here

    // Clear out any old connector state files.
    ConnectorTestUtils.deleteAllFiles(connectorDir);

    // Create a stand alone context with real ProductionManager.
    Context.refresh();
    Context context = Context.getInstance();
    context.setStandaloneContext(Context.DEFAULT_JUNIT_CONTEXT_LOCATION,
        Context.DEFAULT_JUNIT_COMMON_DIR_PATH);
    context.setFeeding(false);
    context.start();
    manager = context.getManager();
    instantiator = context.getInstantiator();
  }
View Full Code Here

       File connectorDir) {
    Map<String, String> newConfig = Maps.newHashMap(config.getMap());
    newConfig.put(PropertiesUtils.GOOGLE_CONNECTOR_NAME, name);
    newConfig.put(PropertiesUtils.GOOGLE_CONNECTOR_WORK_DIR,
                  connectorDir.getPath());
    Context context = Context.getInstance();
    newConfig.put(PropertiesUtils.GOOGLE_WORK_DIR,
                  context.getCommonDirPath());
    // TODO: This should either set real GData configuration or supply the
    // connector with a GDataClientFactory. See comment on setGDataConfig().
    if (context.getGsaFeedHost() != null) {  // Because Properties hate nulls.
      newConfig.put(PropertiesUtils.GOOGLE_FEED_HOST, context.getGsaFeedHost());
    }
    return new Configuration(newConfig, config);
  }
View Full Code Here

      return;
    }

    NDC.push("Support");
    try {
      Context context = Context.getInstance();

      // Fetch the name of the archive file to return. getPathInfo() returns
      // items with a leading '/', so we want to pull off only the basename.
      // WARNING: For security reasons, the PathInfo parameter must never
      // be passed directly to a File() or shell command.
      String fileName = baseName(req.getPathInfo());
      if (fileName == null) {
        // Force a redirect to the archive file.
        res.sendRedirect(res.encodeRedirectURL(
            baseName(req.getServletPath()) + "/" + archiveName));
      } else if (fileName.equalsIgnoreCase(archiveName)) {
        res.setContentType(ServletUtil.MIMETYPE_ZIP);
        ServletOutputStream out = res.getOutputStream();
        try {
          handleDoGet(context.getCommonDirPath(), out);
        } finally {
          out.close();
        }
      } else {
        // Force a redirect to the archive file.
View Full Code Here

      super.tearDown();
    }
  }

  private TypeMap getTypeMap() {
    Context context = Context.getInstance();
    return (TypeMap) context.getRequiredBean("TypeMap", TypeMap.class);
  }
View Full Code Here

  private ClassLoader classLoader;

  @Override
  protected void setUp() throws Exception {
    Context.refresh();
    Context context = Context.getInstance();
    context.setStandaloneContext(APPLICATION_CONTEXT, TEST_DIR);
    mgr = new DatabaseResourceBundleManager();
    classLoader = new TestClassLoader();
  }
View Full Code Here

    // Clear out any old connector state files.
    ConnectorTestUtils.deleteAllFiles(connectorDir);

    // Create a stand alone context with real ProductionManager.
    Context.refresh();
    Context context = Context.getInstance();
    context.setStandaloneContext(APPLICATION_CONTEXT,
        Context.DEFAULT_JUNIT_COMMON_DIR_PATH);
    context.setFeeding(false);
    context.start();
    manager = context.getManager();

    req = new MockHttpServletRequest();
    res = new MockHttpServletResponse();
  }
View Full Code Here

  private SpringInstantiator instantiator;

  @Override
  protected void setUp() throws Exception {
    Context.refresh();
    Context context = Context.getInstance();
    context.setStandaloneContext(APPLICATION_CONTEXT,
        Context.DEFAULT_JUNIT_COMMON_DIR_PATH);
    persistentStore.clear();
    instantiator = createInstantiator();
    assertEquals(0, connectorCount());
  }
View Full Code Here

    assertEquals(0, connectorCount());
  }

  private SpringInstantiator createInstantiator() {
    Context.refresh();
    Context context = Context.getInstance();
    context.setStandaloneContext(APPLICATION_CONTEXT,
        Context.DEFAULT_JUNIT_COMMON_DIR_PATH);
    SpringInstantiator si = (SpringInstantiator) context.getRequiredBean(
        "Instantiator", SpringInstantiator.class);
    si.init();
    return si;
  }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.manager.Context

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.