Commit bd52d9ab authored by Malo Toudic's avatar Malo Toudic
Browse files

logs display, check-dependencies, direct link for execution result

git-svn-id: https://scm.gforge.inria.fr/authscm/ycadoret/svn/gazelle/Maven/simulators/gazelle-webservice-tester/trunk@60655 356b4b1a-1d2b-0410-8bf1-ffa24008f01e
parent da45dc33
......@@ -192,14 +192,14 @@
<dependency>
<groupId>net.ihe.gazelle.maven</groupId>
<artifactId>GazelleTRMClient</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>net.ihe.gazelle.maven</groupId>
<artifactId>GazelleProxyClient</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.0.0</version>
</dependency>
<dependency>
......
......@@ -105,6 +105,15 @@ public class ExecutionResult {
return null;
}
public String getLink() {
if (PreferenceService.getString("application_url") != null) {
return PreferenceService.getString("application_url") + "/executionResult.seam?id=" + execution.getId();
} else {
LOG.error("The preference application_url is not set : can't display instance result link");
return null;
}
}
public boolean isUserAllowed() {
if (Identity.instance().hasRole("admin_role") ||
Identity.instance().hasRole("monitor_role") ||
......
......@@ -175,14 +175,20 @@ public class RunInstanceAction {
try {
String path = PreferenceService.getString("logs_directory") + this.execution.getId() + "/";
if (new File(path).mkdirs()) {
Files.move(Paths.get("soapui.log"), Paths.get(path + "soapui.log"));
Files.move(Paths.get("soapui-errors.log"), Paths.get(path + "soapui-errors.log"));
if (new File("soapui.log").exists()) {
Files.move(Paths.get("soapui.log"), Paths.get(path + "soapui.log"));
}
if (new File("soapui-errors.log").exists()) {
Files.move(Paths.get("soapui-errors.log"), Paths.get(path + "soapui-errors.log"));
}
if (new File("global-groovy.log").exists()) {
Files.move(Paths.get("global-groovy.log"), Paths.get(path + "global-groovy.log"));
}
} else {
LOG.error("moveLogs() : " + path + " directory couldn't be created : log file will not be moved");
LOG.error("moveLogs() : " + path + " directory couldn't be created : log files will not be moved");
}
} catch (IOException e) {
LOG.error("moveLogs()" + e.getMessage());
LOG.error("moveLogs() " + e.getMessage());
}
}
}
......@@ -211,9 +217,17 @@ public class RunInstanceAction {
GazelleTRMServiceStub.GetTestInstanceByIdResponse response = WsClient.getTestInstanceById(testInstanceId);
if (response != null) {
execution = new Execution();
execution.setTestInstanceResult(new TestInstanceResult(testInstanceId, GwtTestSuiteDao.getGwtTestSuite(response.getTestInstance().getTest().getKeyword(), currentProject.getLabel())));
execution.getTestInstanceResult().setExecution(execution);
return true;
GwtTestSuite gwtTestSuite = GwtTestSuiteDao.getGwtTestSuite(response.getTestInstance().getTest().getKeyword(), currentProject.getLabel());
if (gwtTestSuite != null) {
execution.setTestInstanceResult(new TestInstanceResult(testInstanceId, gwtTestSuite));
execution.getTestInstanceResult().setExecution(execution);
return true;
} else {
execution = null;
RunInstanceAction.LOG.error("There is no test available for this test instance in this project");
FacesMessages.instance().add(StatusMessage.Severity.ERROR, "There is no test available for this test instance in this project");
return false;
}
} else {
RunInstanceAction.LOG.error("There is no test instance with this id");
FacesMessages.instance().add(StatusMessage.Severity.ERROR, "There is no test instance with this id");
......
......@@ -61,7 +61,7 @@
<h:outputText value="#{execution.testInstanceResult.testInstance}"/>
</g:column>
<g:column sortBy="#{'launchBy'}" filterBy="#{'launchBy'}">
<ui:define name="header">Execute by</ui:define>
<ui:define name="header">Executed by</ui:define>
<h:outputText value="#{execution.launchBy}"/>
</g:column>
<g:column sortBy="#{'company'}" filterBy="#{'company'}">
......
......@@ -27,6 +27,14 @@
<h:outputText value="#{executionResult.execution.launchDate}"/>
</s:decorate>
<s:decorate template="/layout/display/_display.xhtml">
<ui:define name="label">Direct link</ui:define>
<h:outputLink
value="#{executionResult.getLink()}"
target="_blank">#{executionResult.getLink()}
</h:outputLink>
</s:decorate>
<s:decorate template="/layout/display/_display.xhtml">
<ui:define name="label">Global status</ui:define>
<h:outputText value="#{executionResult.execution.getGlobalStatus()}"
......@@ -78,18 +86,18 @@
styleClass="gzl-label #{testStepSummary.getStatusForCss()}"/>
</s:div>
</g:column>
<!--<g:column>
<ui:define name="header">EVSClient Validation Request</ui:define>
<h:outputText value=""/>
<g:column>
<ui:define name="header">Request validation</ui:define>
<h:outputText value="Not yet implemented"/>
</g:column>
<g:column>
<ui:define name="header">EVSClient Validation Response</ui:define>
<h:outputText value=""/>
<ui:define name="header">Response validation</ui:define>
<h:outputText value="Not yet implemented"/>
</g:column>
<g:column>
<ui:define name="header">X Validation</ui:define>
<h:outputText value=""/>
</g:column>-->
<ui:define name="header">Cross-Validation</ui:define>
<h:outputText value="Not yet implemented"/>
</g:column>
</rich:dataTable>
<gri:tabPanel rendered="#{not empty executionResult.execution.testStepResults}" withBorder="true">
......@@ -134,33 +142,35 @@
</gri:tab>
</c:forEach>
<!--<gri:tab head="Logs">
<gri:tab head="Logs">
<gri:panel>
<f:facet name="header">
<h:outputText value="soapui.log"/>
</f:facet>
<h:outputText value="#{executionResult.getSoapuiLog()}" escape="false"/>
<pre><h:outputText value="#{executionResult.getSoapuiLog()}" escape="false"/></pre>
</gri:panel>
<gri:panel>
<f:facet name="header">
<h:outputText value="soapui-errors.log"/>
</f:facet>
<pre>
<h:outputText value="#{executionResult.getSoapuiErrorLog()}" escape="false"/>
</pre>
</gri:panel>
<gri:panel>
<f:facet name="header">
<h:outputText value="global-groovy.log"/>
</f:facet>
<pre>
<h:outputText value="#{executionResult.getGroovyLog()}" escape="false"/>
</pre>
</gri:panel>
</gri:tab>-->
</gri:tab>
</gri:tabPanel>
</gri:panel>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment