public boolean isTestSession(TestSession testSession) { return testSession != null && testSession.equals(this.testSession); } public boolean isValid() { return (!isEmpty(testSession.getValue())) && (!isEmpty(id)); }
@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 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(); }
@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); }
public Sites getCommonSites(TestSession testSession) throws FactoryConfigurationError, Exception { logger.debug("getCommonSites(" + testSession + ")"); Sites retSites = load(TestSession.DEFAULT_TEST_SESSION); if (!testSession.equals(TestSession.DEFAULT_TEST_SESSION)) retSites.add(load(testSession)); logger.debug("Returned common: " + retSites); return retSites; }
private TestSession getTestSession(List<Site> sites) { for (Site s : sites) { if (!s.getTestSession().equals(TestSession.DEFAULT_TEST_SESSION)) return s.getTestSession(); } return TestSession.DEFAULT_TEST_SESSION; }
private TestSession testSessionFromCollection(Collection<Site> sites) { for (Site site : sites) { if (site.getTestSession() != null && !site.getTestSession().equals(TestSession.DEFAULT_TEST_SESSION)) return site.getTestSession(); } return TestSession.DEFAULT_TEST_SESSION; }
if (usrTestkit != null && usrTestkit.exists() && !testSession.equals(new TestSession("default"))) testkits.add(usrTestkit); if (environmentDefaultTestkit.exists()) {
names.add((qualified)? getQualifiedName(s) : s.getName()); if (!testSession.equals(TestSession.DEFAULT_TEST_SESSION)) { sites = getCommonSites(TestSession.DEFAULT_TEST_SESSION); if (sites != null) {
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(); }