Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 1ca7771a authored by comanca's avatar comanca
Browse files

Merge remote-tracking branch 'origin/development' into development

parents 11a21bc4 6549b6c8
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -16,6 +16,11 @@ After unzipping the path to the executable need to be updated in the pom.xml fil
under "/project/profiles/profile/build/plugins/plugin/configuration/systemPropertyVariables".
In the same set of variables please update the URL for the SMP home page.
Maven parameters
- url - Sets the SMP url without ui context. Ex.: http://localhost:7001/smp
- gecko.driver.path - set the path to gecko driver. Ex.: /opt/drivers/geckodriver
- chrome.driver.path - set the path to gecko driver. Ex.: drivers/chromedriver.exe
* Run:
......@@ -27,6 +32,9 @@ To run on Linux command line you need to install "Xvfb" and of course Firefox or
(There is a crash when starting Chromium so it is better to run using Firefox until the crash is resolved)
sudo xvfb-run --server-args="-screen 0 1920x1080x24" mvn test -P<profileName>
example
mvn clean install -Pubuntu -Durl=http://localhost:7001/smp -Dgecko.driver.path=drivers/geckodriver
* Reports
......
......@@ -11,6 +11,9 @@
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<url>http://localhost:8080/smp</url>
<gecko.driver.path>drivers/geckodriver.exe</gecko.driver.path>
<chrome.driver.path>drivers/chromedriver.exe</chrome.driver.path>
</properties>
<dependencies>
......@@ -73,14 +76,14 @@
<configuration>
<failIfNoTests>true</failIfNoTests>
<systemPropertyVariables>
<webdriver.chrome.driver>chromedriver.exe</webdriver.chrome.driver>
<webdriver.gecko.driver>geckodriver.exe</webdriver.gecko.driver>
<webdriver.chrome.driver>${chrome.driver.path}</webdriver.chrome.driver>
<webdriver.gecko.driver>${gecko.driver.path}</webdriver.gecko.driver>
<reports.folder>./target/</reports.folder>
<data.folder>.\src\main\resources\</data.folder>
<testdata.file>testData.json</testdata.file>
<LONG_TIMEOUT>30</LONG_TIMEOUT>
<SHORT_TIMEOUT>5</SHORT_TIMEOUT>
<UI_BASE_URL>http://edeltest5.westeurope.cloudapp.azure.com:7003/smp/ui/</UI_BASE_URL>
<UI_BASE_URL>${url}/ui/</UI_BASE_URL>
</systemPropertyVariables>
</configuration>
</plugin>
......@@ -101,13 +104,13 @@
<failIfNoTests>true</failIfNoTests>
<systemPropertyVariables>
<webdriver.chrome.driver>chromedriver</webdriver.chrome.driver>
<webdriver.gecko.driver>${gecko.driver.path}</webdriver.gecko.driver>
<reports.folder>./target/</reports.folder>
<data.folder>./src/main/resources/</data.folder>
<testdata.file>testData.json</testdata.file>
<LONG_TIMEOUT>30</LONG_TIMEOUT>
<SHORT_TIMEOUT>15</SHORT_TIMEOUT>
<UI_BASE_URL>http://edeltest5.westeurope.cloudapp.azure.com:7003/smp/ui/</UI_BASE_URL>
<UI_BASE_URL>${url}/ui/</UI_BASE_URL>
</systemPropertyVariables>
</configuration>
</plugin>
......
......@@ -15,7 +15,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.PostConstruct;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.nio.charset.Charset;
import java.nio.charset.UnsupportedCharsetException;
import java.util.Optional;
import static eu.europa.ec.edelivery.smp.exceptions.ErrorCode.DOMAIN_NOT_EXISTS;
......@@ -50,9 +53,9 @@ public class SearchResource {
@RequestParam(value = "domain", required = false) String domainCode
) {
String participantIdentifierDecoded =StringUtils.isBlank(participantIdentifier)?null:URLDecoder.decode(participantIdentifier);
String participantSchemeDecoded = StringUtils.isBlank(participantScheme)?null:URLDecoder.decode(participantScheme);
String domainCodeDecoded = StringUtils.isBlank(domainCode)?null:URLDecoder.decode(domainCode);
String participantIdentifierDecoded =decodeUrlToUTF8(participantIdentifier);
String participantSchemeDecoded = decodeUrlToUTF8(participantScheme);
String domainCodeDecoded = decodeUrlToUTF8(domainCode);
LOG.info("Search for page: {}, page size: {}, part. id: {}, part sch: {}, domain {}", page, pageSize, participantIdentifierDecoded,
participantSchemeDecoded, domainCodeDecoded);
......@@ -65,4 +68,16 @@ public class SearchResource {
return uiServiceGroupService.getTableList(page, pageSize, orderBy, orderType, sgf);
}
private String decodeUrlToUTF8(String value){
if (StringUtils.isBlank(value)){
return null;
}
try {
return URLDecoder.decode(value, "UTF-8");
} catch (UnsupportedEncodingException ex){
LOG.error("Unsupported UTF-8 encoding while converting: " + value, ex);
}
return value;
}
}
......@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.PostConstruct;
import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.Arrays;
......@@ -61,9 +62,9 @@ public class ServiceGroupResource {
@RequestParam(value = "domain", required = false) String domainCode
) {
String participantIdentifierDecoded =StringUtils.isBlank(participantIdentifier)?null:URLDecoder.decode(participantIdentifier);
String participantSchemeDecoded = StringUtils.isBlank(participantScheme)?null:URLDecoder.decode(participantScheme);
String domainCodeDecoded = StringUtils.isBlank(domainCode)?null:URLDecoder.decode(domainCode);
String participantIdentifierDecoded =decodeUrlToUTF8(participantIdentifier);
String participantSchemeDecoded = decodeUrlToUTF8(participantScheme);
String domainCodeDecoded = decodeUrlToUTF8(domainCode);
LOG.info("Search for page: {}, page size: {}, part. id: {}, part sch: {}, domain {}",page, pageSize, participantIdentifierDecoded,
participantSchemeDecoded, domainCodeDecoded );
......@@ -121,5 +122,17 @@ public class ServiceGroupResource {
LOG.info("GOT LIST OF ServiceGroupRO to UPDATE: " + updateEntities.length);
uiServiceGroupService.updateServiceGroupList(Arrays.asList(updateEntities));
}
private String decodeUrlToUTF8(String value){
if (StringUtils.isBlank(value)){
return null;
}
try {
return URLDecoder.decode(value, "UTF-8");
} catch (UnsupportedEncodingException ex){
LOG.error("Unsupported UTF-8 encoding while converting: " + value, ex);
}
return value;
}
}
......@@ -27,6 +27,6 @@
<h2>Version: ${project.version}</h2>
<h6>Build timestamp: ${buildtimestamp}</h6>
<h6>Specification: <a href="http://docs.oasis-open.org/bdxr/bdx-smp/v1.0/bdx-smp-v1.0.html" target="_blank">http://docs.oasis-open.org/bdxr/bdx-smp/v1.0/bdx-smp-v1.0.html</a></h6>
<h6>UI: <a href="../../../../../smp-angular/src/main/resources/META-INF/resources/ui/index.html" target="_blank">eDelivery SMP</a></h6>
<h6>UI: <a href="ui/index.html" target="_blank">eDelivery SMP</a></h6>
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment