use of br.eti.kinoshita.testlinkjavaapi.util.TestLinkAPIException in project elastest-torm by elastest.
the class TestLinkService method init.
@PostConstruct
public void init() {
if (!etEtmTestLinkHost.equals("none")) {
if (etEtmTestLinkServiceName.equals(etEtmTestLinkHost)) {
etEtmTestLinkHost = etEtmTestLinkContainerName;
}
try {
// Default development
this.testLinkHost = this.dockerService.getContainerIpByNetwork(etEtmTestLinkHost, etDockerNetwork);
this.testLinkPort = etEtmTestLinkPort;
// If not development, start socat
if (!etPublicHost.equals("localhost")) {
try {
String testLinkIp = UtilTools.doPing(etEtmTestLinkHost);
logger.info("Real TestLink Ip: {}", testLinkIp);
SocatBindedPort socatBindedPort = dockerService.bindingPort(testLinkIp, etEtmTestLinkPort, etDockerNetwork);
this.testLinkHost = etPublicHost;
this.testLinkPort = socatBindedPort.getListenPort();
} catch (Exception e) {
logger.error("Cannot get Testlink socat data", e);
this.testLinkHost = etEtmTestLinkHost;
this.testLinkPort = etEtmTestLinkPort;
}
}
String url = this.getTestLinkUrl() + "/lib/api/xmlrpc/v1/xmlrpc.php";
try {
testlinkURL = new URL(url);
} catch (MalformedURLException mue) {
mue.printStackTrace();
}
try {
api = new TestLinkAPI(testlinkURL, devKey);
} catch (TestLinkAPIException te) {
logger.error(te.getMessage());
}
} catch (Exception e) {
logger.error("Cannot get TestLink container ip");
}
}
}
use of br.eti.kinoshita.testlinkjavaapi.util.TestLinkAPIException in project elastest-torm by elastest.
the class TestLinkService method getFullDetailedTestCases.
public TestCase[] getFullDetailedTestCases(TestCase[] testCases) {
TestCase[] fullDetailedCases = null;
try {
for (TestCase currentCase : testCases) {
currentCase = this.getFullDetailedTestCase(currentCase);
fullDetailedCases = (TestCase[]) ArrayUtils.add(fullDetailedCases, currentCase);
}
} catch (TestLinkAPIException e) {
// EMPTY
}
if (fullDetailedCases == null) {
fullDetailedCases = testCases;
}
return fullDetailedCases;
}
use of br.eti.kinoshita.testlinkjavaapi.util.TestLinkAPIException in project elastest-torm by elastest.
the class TestLinkService method getPlanBuildTestCases.
public TestCase[] getPlanBuildTestCases(Integer planId) {
TestCase[] cases = null;
Build[] builds = this.getPlanBuilds(planId);
if (builds != null) {
for (Build currentBuild : builds) {
try {
cases = (TestCase[]) ArrayUtils.addAll(cases, this.api.getTestCasesForTestPlan(planId, null, currentBuild.getId(), null, null, null, null, null, null, null, TestCaseDetails.FULL));
} catch (TestLinkAPIException e) {
// EMPTY
}
}
}
return cases;
}
Aggregations