public TestSession getTestSession() { return new TestSession(testSession); } }
public TestKitSearchPath(String environment, String testSession) { this(environment, new TestSession(testSession)); }
static public SimId simIdBuilder(String rawId) { String[] parts = rawId.split("__"); if (parts.length != 2) throw new ToolkitRuntimeException("Not a valid SimId - " + rawId); return new SimId(new TestSession(parts[0]), parts[1]); }
public void createTestSession(String name) throws Exception { TestSessionServiceManager.INSTANCE.create(new TestSession(name)); }
/** * generate list of "alternate" or "infrastructure" log repositories to look for * logs. This needs to be fed by a configuration file soon. * @param ti * @return */ private List<LogRepository> alternateLogRepositories(TestInstance ti) throws IOException { List<LogRepository> logRepositories = new ArrayList<>(); logRepositories.add(InfrastructureLogRepositoryFactory.getLogRepository(TestSession.DEFAULT_TEST_SESSION, ti)); logRepositories.add(InfrastructureLogRepositoryFactory.getLogRepository(new TestSession("cat"), ti)); return logRepositories; }
public TestSession getDefaultTestSession() { String ts = propertyServiceManager().getDefaultTestSession(); if (ts == null || ts.equals("")) return null; return new TestSession(ts); } }
public List<TestSession> getTestSessions() { Set<TestSession> ts = new HashSet<>(); File tlsFile = testLogCacheDir(); if (tlsFile.exists()) { for (File tlFile : tlsFile.listFiles()) { if (tlFile.isDirectory() && !tlFile.getName().startsWith(".")) ts.add(new TestSession(tlFile.getName())); } } tlsFile = simDbFile(); if (tlsFile.exists()) { for (File tlFile : tlsFile.listFiles()) { if (tlFile.isDirectory() && !tlFile.getName().startsWith(".")) ts.add(new TestSession(tlFile.getName())); } } tlsFile = actorsDir(); if (tlsFile.exists()) { for (File tlFile : tlsFile.listFiles()) { if (tlFile.isDirectory() && !tlFile.getName().startsWith(".")) ts.add(new TestSession(tlFile.getName())); } } List<TestSession> testSessions = new ArrayList<>(); testSessions.addAll(ts); return testSessions; }
/** * get all SimIds * @param userFilter - if not null, only return simids for this user * @return */ public List<SimId> getSimIds(String userFilter) { logger.debug(session.id() + ": " + "getSimIds for " + userFilter); if (userFilter == null) throw new ToolkitRuntimeException("TestSession is null"); return SimDb.getAllSimIds(new TestSession(userFilter)); }
static public gov.nist.toolkit.simcommon.client.SimId asServerSimId(SimId simId) { return new gov.nist.toolkit.simcommon.client.SimId(new TestSession(simId.getUser()), simId.getId(), simId.getActorType(), simId.getEnvironmentName(), simId.isFhir()); }
LogRepository(File location, String sessionId, LogIdIOFormat format, LogIdType idType, TestInstance id) { this.location = location; this.testSession = testSession; this.format = format; this.idType = idType; this.id = id; if (id != null) { if (location != null) id.setLocation(location.toString()); id.setTestSession(new TestSession(sessionId)); id.setFormat(format); id.setIdType(idType); } }
if (usrTestkit != null && usrTestkit.exists() && !testSession.equals(new TestSession("default"))) testkits.add(usrTestkit); if (environmentDefaultTestkit.exists()) {
private void assignEvent(TestInstance testInstance) { if (idType != LogIdType.TIME_ID) return; // doesn't use event structure if (testInstance.linkedToLogRepository()) return; String event = Installation.nowAsFilenameBase(); testInstance.setInternalEvent(event); File dir = new File( location + File.separator + testSession + File.separator + event); log.debug(String.format("Assigning SimResource Dir to test instance %s - %s", testInstance, dir)); testInstance.setEventDir(dir.toString()); testInstance.setLocation(location.toString()); testInstance.setTestSession(new TestSession(testSession)); testInstance.setFormat(format); testInstance.setIdType(idType); }
public List<Result> runTest(String testSessionName, SiteSpec siteSpec, TestInstance testInstance, List<String> sections, Map<String, String> params, boolean stopOnFirstFailure) throws Exception { if (testSessionName == null) { testSessionName = "API"; } TestSession testSession = new TestSession(testSessionName); TestSessionServiceManager.INSTANCE.create(testSession); if (session.getTestSession() == null) session.setTestSession(testSession); // TODO create environment name in following call? List<Result> results = xdsTestServiceManager().runMesaTest(environmentName,testSession, siteSpec, testInstance, sections, params, null, stopOnFirstFailure); return results; }
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(); }
public SiteSpec copy() { SiteSpec siteSpec = new SiteSpec(); siteSpec.setSaml(isSaml); siteSpec.setStsAssertion(stsAssertion); siteSpec.setGazelleXuaUsername(getGazelleXuaUsername()); siteSpec.setName(name); siteSpec.setActorType(actorType); siteSpec.testSession = new TestSession(testSession.toString()); return siteSpec; }
public List<Result> runTest(String testSessionName, String siteName, boolean isTls, TestInstance testInstance, List<String> sections, Map<String, String> params, boolean stopOnFirstFailure) throws Exception { if (testSessionName == null) { testSessionName = "API"; } TestSession testSession = new TestSession(testSessionName); TestSessionServiceManager.INSTANCE.create(testSession); SiteSpec siteSpec = new SiteSpec(testSession); siteSpec.setName(siteName); siteSpec.setTls(isTls); siteSpec.validate(); session.isTls = isTls; if (session.getTestSession() == null) session.setTestSession(testSession); // TODO create environment name in following call? return xdsTestServiceManager().runMesaTest(environmentName,testSession, siteSpec, testInstance, sections, params, null, stopOnFirstFailure); }