示例#1
0
  public TestEngine(TestEngineConfig config)
      throws CannotCreateSessionException, PermissionDeniedException, ServerError {
    this.config = config;
    ProxyFactory pf = new ProxyFactory(new OMEROMetadataStoreClient());
    pf.addAdvice(interceptor);
    pf.setProxyTargetClass(true);
    store = (OMEROMetadataStoreClient) pf.getProxy();
    wrapper = new OMEROWrapper(new ImportConfig());

    login_url = config.getFeedbackLoginUrl();
    login_username = config.getFeedbackLoginUsername();
    login_password = config.getFeedbackLoginPassword();
    message_url = config.getFeedbackMessageUrl();
    comment_url = config.getCommentUrl();

    // Login
    if (config.getSessionKey() != null) {
      store.initialize(config.getHostname(), config.getPort(), config.getSessionKey());
    } else {
      store.initialize(
          config.getUsername(), config.getPassword(), config.getHostname(), config.getPort());
    }
    importLibrary = new ImportLibrary(store, wrapper);
  }