Skip to content

Commit

Permalink
Merge branch 'hotfix-travis'
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando González Cortés committed Dec 18, 2015
2 parents f6d15dc + a4d4f14 commit 2f182e1
Show file tree
Hide file tree
Showing 48 changed files with 744 additions and 49 deletions.
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: java

addons:
postgresql: "9.3"

before_script:
- psql -U postgres -c "create database spatialdata"
- psql -U postgres -d spatialdata -c "create extension postgis"

script:
- mvn deploy -s deploy-settings.xml

after_failure:
- cat integration-tests/target/failsafe-reports/*.xml
- cat /tmp/testportal/portal.properties

notifications:
email:
- [email protected]
on_success: always
16 changes: 8 additions & 8 deletions argentina/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.fao.unredd</groupId>
<artifactId>portal-root</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>
<packaging>war</packaging>
<artifactId>argentina</artifactId>
Expand All @@ -22,32 +22,32 @@
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>core</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>base</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>feedback</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>layer-time-sliders</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>time-slider</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>tour</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>ec.gob.dnf.portal</groupId>
Expand Down Expand Up @@ -163,7 +163,7 @@
<plugin>
<groupId>org.fao.unredd</groupId>
<artifactId>jwebclient-analyzer-maven-plugin</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
<executions>
<execution>
<id>generate-buildconfig</id>
Expand Down
4 changes: 2 additions & 2 deletions base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.fao.unredd</groupId>
<artifactId>portal-root</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>
<artifactId>base</artifactId>
<name>UNREDD NFMS base plugins</name>
Expand Down Expand Up @@ -36,7 +36,7 @@
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>core</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</dependency>
<!-- J2EE -->
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.fao.unredd</groupId>
<artifactId>portal-root</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>
<name>UNREDD NFMS portal core</name>
<artifactId>core</artifactId>
Expand Down Expand Up @@ -77,7 +77,7 @@
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>jwebclient-analyzer</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</dependency>
</dependencies>
<build>
Expand Down
22 changes: 11 additions & 11 deletions demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.fao.unredd</groupId>
<artifactId>portal-root</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>
<packaging>war</packaging>
<artifactId>demo</artifactId>
Expand All @@ -22,47 +22,47 @@
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>core</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>base</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>footnote</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>feedback</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>layer-time-sliders</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>language-buttons</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>time-slider</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>tour</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>layer-order</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</dependency>
<!-- Other deployments may access other databases, so it is responsibility
of the application to include the necessary drivers -->
Expand Down Expand Up @@ -173,7 +173,7 @@
<plugin>
<groupId>org.fao.unredd</groupId>
<artifactId>jwebclient-analyzer-maven-plugin</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
<executions>
<execution>
<id>generate-buildconfig</id>
Expand Down
15 changes: 15 additions & 0 deletions deploy-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings
xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

<servers>
<server>
<id>nfms4redd</id>
<username>${env.NFMS4REDD_USER}</username>
<password>${env.NFMS4REDD_PASSWORD}</password>
</server>
</servers>

</settings>
4 changes: 2 additions & 2 deletions feedback/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.fao.unredd</groupId>
<artifactId>portal-root</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>
<artifactId>feedback</artifactId>
<name>feedback</name>
Expand All @@ -30,7 +30,7 @@
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>base</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</dependency>

<!-- API and implementation, as reported here: https://java.net/projects/javamail/pages/Home -->
Expand Down
2 changes: 1 addition & 1 deletion footnote/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.fao.unredd</groupId>
<artifactId>portal-root</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>
<artifactId>footnote</artifactId>
<name>footnote</name>
Expand Down
4 changes: 2 additions & 2 deletions geoexplorer-reader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.fao.unredd</groupId>
<artifactId>portal-root</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>
<artifactId>geoexplorer-reader</artifactId>
<name>geoexplorer-reader</name>
Expand All @@ -24,7 +24,7 @@
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>core</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
Expand Down
7 changes: 5 additions & 2 deletions integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.fao.unredd</groupId>
<artifactId>portal-root</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>
<artifactId>integration-tests</artifactId>
<name>integration-tests</name>
Expand All @@ -24,7 +24,7 @@
<dependency>
<groupId>org.fao.unredd</groupId>
<artifactId>demo</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
<type>war</type>
<scope>test</scope>
</dependency>
Expand Down Expand Up @@ -110,6 +110,9 @@
</dependency>
</dependencies>
<configuration>
<systemPropertyVariables>
<PORTAL_CONFIG_DIR>./test_config</PORTAL_CONFIG_DIR>
</systemPropertyVariables>
<groups>org.fao.unredd.functional.IntegrationTest</groups>
</configuration>
<executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import static junit.framework.Assert.assertTrue;

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
Expand Down Expand Up @@ -69,6 +72,18 @@ public static void setupTests() throws IOException {

@Before
public void setup() throws Exception {
// Replace password with environment variable
File portalPropertiesFile = new File("test_config/portal.properties");
String portalProperties = IOUtils
.toString(portalPropertiesFile.toURI());
portalProperties = portalProperties.replaceAll(
Pattern.quote("$password"),
System.getenv("ONUREDDMAILPASSWORD"));
BufferedOutputStream output = new BufferedOutputStream(
new FileOutputStream(portalPropertiesFile));
IOUtils.write(portalProperties, output);
output.close();

// Clean the database
Class.forName("org.postgresql.Driver");
Connection connection = DriverManager.getConnection(dbUrl, dbUser,
Expand Down Expand Up @@ -98,7 +113,7 @@ public void setup() throws Exception {
server.setHandler(handlers);

SocketConnector connector = new SocketConnector();
connector.setPort(8080);
connector.setPort(8880);
server.setConnectors(new Connector[] { connector });

dataSource = new PGSimpleDataSource();
Expand Down Expand Up @@ -191,7 +206,7 @@ protected void executeLines(String resourceName, String... params)

protected CloseableHttpResponse GET(String path, String... parameters)
throws ClientProtocolException, IOException {
String url = "http://localhost:8080/" + CONTEXT_PATH + "/" + path + "?";
String url = "http://localhost:8880/" + CONTEXT_PATH + "/" + path + "?";
for (int i = 0; i < parameters.length; i = i + 2) {
url += parameters[i] + "="
+ URLEncoder.encode(parameters[i + 1], "UTF-8") + "&";
Expand All @@ -203,7 +218,7 @@ protected CloseableHttpResponse GET(String path, String... parameters)

protected CloseableHttpResponse POST(String path, String... parameters)
throws ClientProtocolException, IOException {
String url = "http://localhost:8080/" + CONTEXT_PATH + "/" + path;
String url = "http://localhost:8880/" + CONTEXT_PATH + "/" + path;
ArrayList<NameValuePair> parameterList = new ArrayList<NameValuePair>();
for (int i = 0; i < parameters.length; i = i + 2) {
parameterList.add(new BasicNameValuePair(parameters[i],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class FeedbackTest extends AbstractIntegrationTest {

@Test
public void testCommentAndVerify() throws Exception {
String email = "fergonco@gmail.com";
String email = "onuredd@gmail.com";
String geometry = "POINT(0 1)";
String comment = "boh";
String layerName = "classification";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.apache.http.client.methods.CloseableHttpResponse;
import org.fao.unredd.functional.AbstractIntegrationTest;
import org.fao.unredd.functional.IntegrationTest;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

Expand Down Expand Up @@ -213,6 +214,7 @@ public void testStatsServiceDataTypes() throws Exception {
checkStatsServiceTest(root);
}

@Ignore
@Test
public void testCalculateStats() throws Exception {
String layerName = "unredd:provinces";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
db-url=jdbc:postgresql://postgis.unredd:5432/spatialdata
db-user=spatial_user
db-password=unr3dd
db-url=jdbc:postgresql://127.0.0.1:5432/spatialdata
db-user=postgres
db-password=
db-test-schema=integration_tests
Loading

0 comments on commit 2f182e1

Please sign in to comment.