Commit 1ecfda20 authored by Malo Toudic's avatar Malo Toudic
Browse files
parent 9edc8e7a
......@@ -65,5 +65,9 @@ WHERE disable IS NULL;
INSERT INTO app_configuration (id, variable, value)
VALUES (nextval('app_configuration_id_seq'), 'ehealthsuisse', 'false');
/* PART 2 */
ALTER TABLE cmn_transaction_instance ALTER COLUMN standard type VARCHAR(64);
......@@ -137,7 +137,7 @@
<dependency>
<groupId>net.ihe.gazelle.junit</groupId>
<artifactId>gazelle-junit</artifactId>
<version>1.0.17</version>
<version>1.0.18</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
......
package net.ihe.gazelle.wstester.action;
import net.ihe.gazelle.common.tree.GazelleTreeNodeImpl;
import net.ihe.gazelle.preferences.PreferenceService;
import net.ihe.gazelle.wstester.dao.ExecutionDao;
import net.ihe.gazelle.wstester.model.CustomProperty;
import net.ihe.gazelle.wstester.model.CustomPropertyUsed;
import net.ihe.gazelle.wstester.model.Execution;
import net.ihe.gazelle.wstester.model.TestComponent;
import net.ihe.gazelle.wstester.util.Application;
import net.ihe.gazelle.wstester.util.Tree;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Create;
import org.jboss.seam.annotations.Name;
......@@ -17,6 +22,7 @@ import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
@Name("executionResult")
@Scope(ScopeType.PAGE)
......@@ -24,6 +30,7 @@ public class ExecutionResult {
private static final Logger LOG = LoggerFactory.getLogger(ExecutionResult.class);
private Execution execution;
private List<CustomPropertyUsed> customPropertyUsedList;
@RequestParameter("id")
private Integer id;
......@@ -36,6 +43,26 @@ public class ExecutionResult {
this.execution = execution;
}
public List<CustomPropertyUsed> getCustomPropertyUsedList() {
return customPropertyUsedList;
}
public void setCustomPropertyUsedList(List<CustomPropertyUsed> customPropertyUsedList) {
this.customPropertyUsedList = customPropertyUsedList;
}
public void setCustomPropertyUsedList(TestComponent testComponent) {
this.customPropertyUsedList = testComponent.getCustomPropertiesUsed(execution);
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Create
public void init() {
execution = ExecutionDao.getExecutionById(id);
......@@ -93,4 +120,8 @@ public class ExecutionResult {
}
return false;
}
public GazelleTreeNodeImpl<TestComponent> getComponentWithParentsAsTree() {
return Tree.getComponentWithParentsAsTree(execution.getTestComponent());
}
}
......@@ -3,6 +3,7 @@ package net.ihe.gazelle.wstester.action;
import com.eviware.soapui.SoapUI;
import com.eviware.soapui.impl.wsdl.WsdlProject;
import com.eviware.soapui.impl.wsdl.WsdlTestSuite;
import com.eviware.soapui.impl.wsdl.support.http.SoapUIMultiThreadedHttpConnectionManager;
import com.eviware.soapui.impl.wsdl.testcase.WsdlProjectRunner;
import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase;
import com.eviware.soapui.impl.wsdl.teststeps.WsdlMessageExchangeTestStepResult;
......@@ -214,6 +215,7 @@ public class RunInstanceAction {
TestCaseRunner runner = testCase.run(new PropertiesMap(), false);
listResult.add(runner);
}
SoapUI.shutdown();
}
return listResult;
}
......
......@@ -15,7 +15,7 @@ import java.util.List;
@DiscriminatorValue("testSuite")
public class GwtTestSuite extends TestComponent implements Serializable {
@ManyToOne(fetch = FetchType.LAZY)
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "project_id")
private GwtProject gwtProject;
......
......@@ -121,6 +121,19 @@ public abstract class TestComponent implements Serializable {
return customProperties;
}
public List<CustomPropertyUsed> getCustomPropertiesUsed(Execution execution) {
List<CustomPropertyUsed> customProperties = new ArrayList<>();
for (CustomProperty customProperty : getCustomProperties()) {
if (customProperty.getCustomPropertyUsedByExecution(execution) != null) {
customProperties.add(customProperty.getCustomPropertyUsedByExecution(execution));
} else {
CustomPropertyUsed customPropertyUsed = new CustomPropertyUsed(customProperty.getDefaultValue(), execution, customProperty);
customProperties.add(customPropertyUsed);
}
}
return customProperties;
}
public boolean isExecutable() {
return executable;
}
......
......@@ -9,15 +9,15 @@ import net.ihe.gazelle.wstester.model.TestComponent;
public class Tree {
public static GazelleTreeNodeImpl<TestComponent> getComponentAsTree(TestComponent component, boolean withTestStep) {
public static GazelleTreeNodeImpl<TestComponent> getComponentAsTree(TestComponent testComponent, boolean withTestStep) {
GazelleTreeNodeImpl<TestComponent> treeRoot = new GazelleTreeNodeImpl<>();
int index = 0;
if (component instanceof GwtProject) {
getProjectAsTree((GwtProject) component, treeRoot, index, withTestStep);
} else if (component instanceof GwtTestSuite) {
getTestSuiteAsTree((GwtTestSuite) component, treeRoot, index, withTestStep);
} else if (component instanceof GwtTestCase) {
getTestCaseAsTree((GwtTestCase) component, treeRoot, index, withTestStep);
if (testComponent instanceof GwtProject) {
getProjectAsTree((GwtProject) testComponent, treeRoot, index, withTestStep);
} else if (testComponent instanceof GwtTestSuite) {
getTestSuiteAsTree((GwtTestSuite) testComponent, treeRoot, index, withTestStep);
} else if (testComponent instanceof GwtTestCase) {
getTestCaseAsTree((GwtTestCase) testComponent, treeRoot, index, withTestStep);
}
return treeRoot;
}
......@@ -62,4 +62,31 @@ public class Tree {
}
}
}
public static GazelleTreeNodeImpl<TestComponent> getComponentWithParentsAsTree(TestComponent testComponent){
GazelleTreeNodeImpl<TestComponent> treeRoot = new GazelleTreeNodeImpl<>();
int index = 0;
if (testComponent instanceof GwtProject) {
getProjectAsTree((GwtProject) testComponent, treeRoot, index, false);
} else if (testComponent instanceof GwtTestSuite) {
GazelleTreeNodeImpl<TestComponent> nodeProject = new GazelleTreeNodeImpl<>();
nodeProject.setData(((GwtTestSuite) testComponent).getProject());
treeRoot.addChild(index, nodeProject);
index++;
getTestSuiteAsTree((GwtTestSuite) testComponent, nodeProject, index, false);
} else if (testComponent instanceof GwtTestCase) {
GazelleTreeNodeImpl<TestComponent> nodeProject = new GazelleTreeNodeImpl<>();
nodeProject.setData(((GwtTestCase) testComponent).getTestSuite().getProject());
treeRoot.addChild(index, nodeProject);
index++;
GazelleTreeNodeImpl<TestComponent> nodeSuite = new GazelleTreeNodeImpl<>();
nodeSuite.setData(((GwtTestCase) testComponent).getTestSuite());
nodeProject.addChild(index, nodeSuite);
index++;
getTestCaseAsTree((GwtTestCase) testComponent, nodeSuite, index, false);
}
return treeRoot;
}
}
<ui:composition xmlns:h="http://java.sun.com/jsf/html" xmlns:s="http://jboss.org/schema/seam/taglib"
xmlns:f="http://java.sun.com/jsf/core" xmlns:rich="http://richfaces.org/rich"
xmlns:g="http://www.ihe.net/gazelle"
xmlns:g="http://www.ihe.net/gazelle" xmlns:a4j="http://richfaces.org/a4j"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:gri="http://java.sun.com/jsf/composite/gri" xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jstl/core" template="/layout/template.xhtml">
......@@ -131,6 +131,65 @@
</g:column>
</rich:dataTable>
<ui:decorate template="/layout/panels/_panel_collapse.xhtml">
<ui:param name="panel_id" value="collapsed_panel"/>
<ui:param name="openByDefault" value="false"/>
<ui:define name="panel_title">
<h:outputText value="Properties used"/>
</ui:define>
<div class="row">
<div class="col-md-6">
<rich:tree id="treeOfParams" value="#{executionResult.getComponentWithParentsAsTree()}" var="node">
<rich:treeNode iconExpanded="images/testcase.png"
iconCollapsed="images/testcase.png"
rendered="#{node.data.getClass().getSimpleName() == 'GwtTestCase'}"
expanded="true">
<a4j:commandLink render="paramPanel" ajaxSingle="true"
actionListener="#{executionResult.setCustomPropertyUsedList(node.data)}"
value="#{node.data.label}"/>
</rich:treeNode>
<rich:treeNode iconExpanded="images/testsuite.png"
iconCollapsed="images/testsuite.png"
rendered="#{node.data.getClass().getSimpleName() == 'GwtTestSuite'}"
expanded="true">
<a4j:commandLink render="paramPanel" ajaxSingle="true"
actionListener="#{executionResult.setCustomPropertyUsedList(node.data)}"
value="#{node.data.label}"/>
</rich:treeNode>
<rich:treeNode iconExpanded="images/project.png"
iconCollapsed="images/project.png"
rendered="#{node.data.getClass().getSimpleName() == 'GwtProject'}"
expanded="true">
<a4j:commandLink render="paramPanel" ajaxSingle="true"
actionListener="#{executionResult.setCustomPropertyUsedList(node.data)}"
value="#{node.data.label}"/>
</rich:treeNode>
</rich:tree>
</div>
<div class="col-md-6">
<s:div id="paramPanel">
<gri:panel>
<f:facet name="header">
<h:outputText value="Parameters"/>
</f:facet>
<rich:list value="#{executionResult.customPropertyUsedList}" id="list"
var="propertySelected"
type="unordered">
<s:decorate template="/layout/form/_checkbox.xhtml">
<s:decorate template="/layout/display/_display.xhtml">
<ui:define name="label">#{propertySelected.customProperty.label}</ui:define>
<h:outputText value="#{propertySelected.value}"/>
</s:decorate>
</s:decorate>
</rich:list>
</gri:panel>
</s:div>
</div>
</div>
</ui:decorate>
<gri:tabPanel rendered="#{not empty executionResult.execution.testStepResults}" withBorder="true">
<c:forEach items="#{executionResult.execution.testStepResults}" var="testStepResult">
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>net.ihe.gazelle.simulators</groupId>
<artifactId>simulator-common</artifactId>
<version>4.4.4-SNAPSHOT</version>
<version>4.4.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
Supports Markdown
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