gov.nist.toolkit.installation.server.Installation.instance()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中gov.nist.toolkit.installation.server.Installation.instance()方法的一些代码示例,展示了Installation.instance()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Installation.instance()方法的具体详情如下:
包路径:gov.nist.toolkit.installation.server.Installation
类名称:Installation
方法名:instance

Installation.instance介绍

暂无

代码示例

代码示例来源:origin: usnistgov/iheos-toolkit2

static public File getRoot(String environmentName, TestSession testSession) {
  String sep = File.separator;
  StringBuilder buf = new StringBuilder();
  buf.append(Installation.instance().environmentFile().toString());
  buf.append(sep).append(environmentName);
  buf.append(sep).append("testkits");
  buf.append(sep).append(testSession.getValue());
  return new File(buf.toString());
}

代码示例来源:origin: usnistgov/iheos-toolkit2

public TestKitSourceEnum detectSource() {
    String testDir = getTestDir().toString();
    if ((testDir != null)) {
      if (testDir.startsWith(Installation.instance().warHome().toString())) {
        return TestKitSourceEnum.EMBEDDED;
      } else if (testDir.startsWith(Installation.instance().externalCache().toString())) {
        return TestKitSourceEnum.LOCAL;
      }
    }
  return TestKitSourceEnum.UNKNOWN;
}

代码示例来源:origin: usnistgov/iheos-toolkit2

@Override
public File getKeystoreDir() throws EnvironmentNotSelectedException {
  File f = Installation.instance().getKeystoreDir(environmentName);
  if (f.exists() && f.isDirectory())
    return f;
  throw new EnvironmentNotSelectedException("Environment " + environmentName + " does not have a keystore");
}

代码示例来源:origin: usnistgov/iheos-toolkit2

private File getEnvironmentDir() throws EnvironmentNotSelectedException {
  File env = Installation.instance().environmentFile(environmentName);
  if (!env.exists() || !env.isDirectory())
    throw new EnvironmentNotSelectedException("Environment " + environmentName + " does not exist");
  return env;
}

代码示例来源:origin: usnistgov/iheos-toolkit2

private File getFilePath2(TestInstance testInstance,TestSession testSession) throws IOException {
    File dir = new File(
        Installation.instance().propertyServiceManager().getTestLogCache().toString() + File.separator +
            testSession
//                        + File.separator + "Results"
    );
      return new File(dir.toString() + File.separator + testInstance.getId().replace(":",""));
  }
}

代码示例来源:origin: usnistgov/iheos-toolkit2

private File getFilePath(TestInstance testInstance,TestSession testSession, String sectionName, boolean write) throws IOException {
  File dir = new File(
      Installation.instance().propertyServiceManager().getTestLogCache().toString() + File.separator +
      testSession + File.separator + 
      "Results");
  if (write)
    dir.mkdirs();
  if (sectionName == null)
    return new File(dir.toString() + File.separator + testInstance.getId().replace(":","") + ".ser");
  return new File(dir.toString() + File.separator + testInstance.getId().replace(":","") + sectionName + ".ser");
}

代码示例来源:origin: usnistgov/iheos-toolkit2

private String getEndpointPort(boolean isTLS, boolean isProxy) throws Exception {
  if (isTLS && isProxy)
    throw new Exception("Proxy does not support TLS");
  if (isProxy)
    return Installation.instance().propertyServiceManager().getProxyPort();
  return (isTLS) ? Installation.instance().propertyServiceManager().getToolkitTlsPort() : Installation.instance().propertyServiceManager().getToolkitPort();
}

代码示例来源:origin: usnistgov/iheos-toolkit2

public EnvSetting(String envName) {
  this.envName = envName;
  this.envDir = Installation.instance().environmentFile(envName);
  validateEnvironment();
}

代码示例来源:origin: usnistgov/iheos-toolkit2

public boolean useGazelleConfigFeed() {
  String c = Installation.instance().propertyServiceManager().getPropertyManager()
      .getToolkitGazelleConfigURL();
  return c.trim().length() > 0;
}

代码示例来源:origin: usnistgov/iheos-toolkit2

private void installDefaultSecurityParamsIfNeeded() {
  if (securityParams != null)
    return;
  this.securityParams = new SecurityParamsImpl(Installation.instance().defaultEnvironmentName());
}

代码示例来源:origin: usnistgov/iheos-toolkit2

public static void installDefaultEnvironment() {
    File envFile = Installation.instance()./*internal*/environmentFile(DEFAULTENVIRONMENTNAME);
    if (envFile == null || !envFile.exists()) throw new EnvironmentNotSelectedException("Default Environment not configured - file " + envFile + " not found.");
    new EnvSetting(DEFAULTSESSIONID, DEFAULTENVIRONMENTNAME, envFile);
//        new EnvSetting(Installation.defaultSessionName(), DEFAULTENVIRONMENTNAME, envFile);
//        new EnvSetting(Installation.defaultServiceSessionName(), DEFAULTENVIRONMENTNAME, envFile);
  }

代码示例来源:origin: usnistgov/iheos-toolkit2

public void externalCache(File externalCache) {
      this.externalCache = externalCache;
    logger.info("Installation: External Cache set to " + externalCache);
    try {
      tkProps = TkLoader.tkProps(instance().getTkPropsFile()); //TkLoader.tkProps(new File(Installation.instance().externalCache() + File.separator + "tk_props.txt"));
    } catch (Exception e) {
//            logger.warn("Cannot load tk_props.txt file from External Cache");
      tkProps = new TkProps();
    }
  }

代码示例来源:origin: usnistgov/iheos-toolkit2

public boolean isPrivateMesaTesting() {
  if (session != null)
    logger.debug(session.id() + ": " + "isPrivateMesaTesting");
  return Installation.instance().propertyServiceManager().isTestLogCachePrivate();
}

代码示例来源:origin: usnistgov/iheos-toolkit2

@Override
public File getTruststore() throws EnvironmentNotSelectedException {
  if (environmentName == null)
    throw new EnvironmentNotSelectedException("Environment not specified in call");
  File truststoreFile = Installation.instance().getTruststore(environmentName);
  if (!truststoreFile.exists())
    throw new EnvironmentNotSelectedException("Environment " + environmentName + " does not have a truststore (file is " + truststoreFile + ")");
  return truststoreFile;
}

代码示例来源:origin: usnistgov/iheos-toolkit2

public EnvSetting(String sessionId, String name) {
    File dir = Installation.instance().environmentFile(name);
//        logger.info("Session " + sessionId + " environment " + name + " ==> " + dir);
    addSetting(sessionId, new EnvSetting(name, dir));
  }

代码示例来源:origin: usnistgov/iheos-toolkit2

public static void installServiceEnvironment() {
  File envFile = Installation.instance().internalEnvironmentFile(DEFAULTENVIRONMENTNAME);
  if (envFile == null || !envFile.exists()) throw new EnvironmentNotSelectedException("Default Environment not configured - file " + envFile + " not found.");
  new EnvSetting(Installation.defaultServiceSessionName(), DEFAULTENVIRONMENTNAME, envFile);
}

代码示例来源:origin: usnistgov/iheos-toolkit2

private Sites load(TestSession testSession) throws Exception {
  File dir;
  dir = Installation.instance().actorsDir();
  Sites ss = new SeparateSiteLoader(testSession).load(dir, null);
  dir = Installation.instance().actorsDir(testSession);
  Sites ss2 = new SeparateSiteLoader(testSession).load(dir, null);
  ss.add(ss2);
  logger.debug("Loaded (" + testSession + "): " + ss.toString());
  return ss;
}

代码示例来源:origin: usnistgov/iheos-toolkit2

private boolean useActorsFile() {
  if (useGazelleConfigFeed())
    return false;
  return Installation.instance().propertyServiceManager().getPropertyManager()
      .isUseActorsFile();
}

代码示例来源:origin: usnistgov/iheos-toolkit2

private String getQualifiedName(Site s) {
  TestSession owningTestSession = (s.getOwner() == null) ? TestSession.DEFAULT_TEST_SESSION : new TestSession(s.getOwner());
  if (Installation.instance().testSessionExists(owningTestSession) || owningTestSession.equals(TestSession.GAZELLE_TEST_SESSION))
    return owningTestSession.getValue() + ":" + s.getName();
  return "UNDEFINED:" + s.getName();
}

代码示例来源:origin: usnistgov/iheos-toolkit2

public TestOverviewDTO runTest(String environmentName, TestSession mesaTestSession, SiteSpec siteSpec, TestInstance testInstance, List<String> sections,
                Map<String, String> params, Map<String, Object> params2, boolean stopOnFirstFailure) throws Exception {
  if (mesaTestSession == null)
    throw new ToolkitRuntimeException("TestSession is null");
  testInstance.setTestSession(mesaTestSession);
  TestKitSearchPath searchPath = new TestKitSearchPath(environmentName, mesaTestSession);
  session.xt = new Xdstest2(Installation.instance().toolkitxFile(), searchPath, session, testInstance.getTestSession());
  new TestRunner(this).run(session, mesaTestSession, siteSpec, testInstance, sections, params, params2, stopOnFirstFailure);
  return getTestOverview(mesaTestSession, testInstance);
}

相关文章