public String getOwner() { if (owner == null) return TestSession.DEFAULT_TEST_SESSION.getValue(); return owner; }
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(); }
private void build(TestSession testSession, String id) throws BadSimIdException { testSession.clean(); id = cleanId(id); if (testSession.getValue().contains(SEPARATOR)) throw new BadSimIdException(SEPARATOR + " is illegal in simulator testSession name"); if (testSession.getValue().contains(SLASH)) throw new BadSimIdException(SLASH + " is illegal in simulator testSession name"); if (id.contains(SLASH)) throw new BadSimIdException(SLASH + " is illegal in simulator id"); this.testSession = testSession; this.id = id; }
public TestSession getTestSession() { return new TestSession(testSession); } }
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 boolean isTestSession(TestSession testSession) { return testSession != null && testSession.equals(this.testSession); } public boolean isValid() { return (!isEmpty(testSession.getValue())) && (!isEmpty(id)); }
throw new EnvironmentNotSelectedException(""); if ((mesaTestSession == null || mesaTestSession.toString().equals(""))) throw new TestSessionNotSelectedException("Must choose test session"); session.setSiteSpec(siteSpec);
public TestKitSearchPath(String environment, String testSession) { this(environment, new TestSession(testSession)); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SimId simId = (SimId) o; if (testSession != null ? !testSession.equals(simId.testSession) : simId.testSession != null) return false; return id != null ? id.equals(simId.id) : simId.id == null; }
public List<Result> querySts(SiteSpec siteSpec, String query, Map<String, String> params, boolean persistResult, TestSession testSession) { setGazelleTruststore(); String environmentName = "default"; Session mySession = new Session(Installation.instance().warHome(), testSession.toString()); mySession.setEnvironment(environmentName); // Site must exist if (mySession.getTestSession() == null) mySession.setTestSession(testSession); mySession.setSiteSpec(siteSpec); mySession.setTls(true); // Required for STS String stsTpName = Installation.instance().propertyServiceManager().getStsTpName(); TestInstance testInstance = new TestInstance(stsTpName, TestSession.DEFAULT_TEST_SESSION); List<String> sections = new ArrayList<String>(); sections.add(query); XdsTestServiceManager xtsm = new XdsTestServiceManager(mySession); List<Result> results = runTestInstance(xtsm, environmentName,testSession,siteSpec,testInstance,sections,params,true, persistResult); return results; }
@Override public String toString() { return testSession.getValue() + "/" + name; }
if (testSession!=null) { usrTestkit = new File(environmentTestkitsFile, testSession.getValue()); }else { LOGGER.info("Mesa session name is null"); if (usrTestkit != null && usrTestkit.exists() && !testSession.equals(new TestSession("default"))) testkits.add(usrTestkit); if (environmentDefaultTestkit.exists()) {
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 String validateState() { StringBuilder buf = new StringBuilder(); if (testSession == null || testSession.equals("")) buf.append("No testSession specified\n"); if (id == null || id.equals("")) buf.append("No id specified\n"); if (actorType == null || actorType.equals("")) buf.append("No actorType specified\n"); if (environmentName == null || environmentName.equals("")) buf.append("No environmentName specified"); if (buf.length() == 0) return null; // no errors return buf.toString(); }
public File getSessionDir(TestSession testSession) { return new File(cache + File.separator + testSession.getValue()); } }
public void createTestSession(String name) throws Exception { TestSessionServiceManager.INSTANCE.create(new TestSession(name)); }
public List<String> reloadCommonSites(TestSession testSession) throws FactoryConfigurationError, Exception { logger.debug("reloadCommonSites for " + testSession.getValue()); Sites sites = getCommonSites(testSession); // does reload List<String> values = sites.getSiteNames(); logger.debug("reloaded CommonSites are " + testSession.getValue() + ": " + values); return values; }
/** * 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; }
@Override public boolean equals(Object o) { if (o == null) return false; if (!(o instanceof Site)) return false; Site s = (Site) o; return ((name == null) ? s.name == null : name.equals(s.name)) && ((testSession == null) ? s.testSession == null : testSession.equals(s.testSession)) && ((home == null) ? s.home == null : home.equals(s.home)) && ((pifHost == null) ? s.pifHost == null : pifHost.equals(s.pifHost)) && ((pifPort == null) ? s.pifPort == null : pifPort.equals(s.pifPort)) && ((pidAllocateURI == null) ? s.pidAllocateURI == null : pidAllocateURI.equals(s.pidAllocateURI)) && transactions.equals(s.transactions) && repositories.equals(s.repositories); }