Unverified Commit 25745450 authored by bonita-ci's avatar bonita-ci Committed by GitHub
Browse files

fix(deps): update test dependencies (#26)


Signed-off-by: default avatarRomain Bioteau <romain.bioteau@bonitasoft.com>
Co-authored-by: default avatarRomain Bioteau <romain.bioteau@bonitasoft.com>
parent cff89796
......@@ -11,9 +11,9 @@ updates:
directory: "/"
schedule:
interval: "daily"
commit_message:
commit-message:
prefix: "chore"
include_scope: true
include: "scope"
# Maintain dependencies for maven
- package-ecosystem: "maven"
......@@ -21,6 +21,6 @@ updates:
target-branch: master
schedule:
interval: "daily"
commit_message:
commit-message:
prefix: "chore"
include_scope: true
include: "scope"
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
\ No newline at end of file
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip
\ No newline at end of file
......@@ -3,7 +3,7 @@
<groupId>org.bonitasoft.connectors</groupId>
<artifactId>bonita-connector-database</artifactId>
<version>2.0.4-SNAPSHOT</version>
<version>2.1.0-SNAPSHOT</version>
<name>Database Connector</name>
<description>Database connector for Bonita</description>
......@@ -28,13 +28,13 @@
<properties>
<!-- Maven -->
<java.version>1.8</java.version>
<java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.build.timestamp.format>yyyy.MM.dd-hh.mm</maven.build.timestamp.format>
<!-- Bonita -->
<bonita.engine.version>7.8.0</bonita.engine.version>
<bonita.engine.version>7.13.0</bonita.engine.version>
<!--Connector -->
<jdbc-generic.def.id>database-jdbc</jdbc-generic.def.id>
......@@ -125,28 +125,26 @@
<teradata.impl.version>${project.version}</teradata.impl.version>
<!-- Test -->
<junit-jupiter-engine.version>5.6.2</junit-jupiter-engine.version>
<junit-platform-runner.version>1.6.2</junit-platform-runner.version>
<assertj-core.version>3.16.1</assertj-core.version>
<jacoco-maven-plugin.version>0.8.5</jacoco-maven-plugin.version>
<sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
<hsqldb.version>1.8.0.7</hsqldb.version>
<mysql-connector-java.version>8.0.16</mysql-connector-java.version>
<h2.version>1.3.168</h2.version>
<catalina.version>6.0.14</catalina.version>
<junit-jupiter-engine.version>5.8.2</junit-jupiter-engine.version>
<assertj-core.version>3.22.0</assertj-core.version>
<jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
<sonar-maven-plugin.version>3.9.1.2184</sonar-maven-plugin.version>
<hsqldb.version>2.6.1</hsqldb.version>
<tomcat-catalina.version>9.0.62</tomcat-catalina.version>
<!-- Maven plugins -->
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
<maven.compiler.release>${java.version}</maven.compiler.release>
<maven-assembly-plugin.version>3.3.0</maven-assembly-plugin.version>
<groovy-maven-plugin.version>2.1.1</groovy-maven-plugin.version>
<groovy-all.version>2.4.16</groovy-all.version>
<maven-surefire-plugin.version>3.0.0-M4</maven-surefire-plugin.version>
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
<maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
<groovy.version>3.0.10</groovy.version>
<maven-surefire-plugin.version>3.0.0-M6</maven-surefire-plugin.version>
<nexus-staging-maven-plugin.version>1.6.12</nexus-staging-maven-plugin.version>
<maven-javadoc-plugin.version>3.3.2</maven-javadoc-plugin.version>
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<license-maven-plugin.version>4.0.rc2</license-maven-plugin.version>
<license-maven-plugin.version>4.1</license-maven-plugin.version>
<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
<!-- Sonar -->
<sonar.projectKey>bonitasoft_bonita-connector-database</sonar.projectKey>
......@@ -169,12 +167,6 @@
<version>${junit-jupiter-engine.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit-platform-runner.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
......@@ -182,27 +174,15 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>hsqldb</groupId>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>${hsqldb.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector-java.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>catalina</artifactId>
<version>${catalina.version}</version>
<artifactId>tomcat-catalina</artifactId>
<version>${tomcat-catalina.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
......@@ -267,8 +247,8 @@
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>${groovy-all.version}</version>
<artifactId>groovy</artifactId>
<version>${groovy.version}</version>
</dependency>
</dependencies>
</plugin>
......@@ -276,18 +256,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<enableAssertions>true</enableAssertions>
<forkCount>1</forkCount>
<reuseForks>true</reuseForks>
</configuration>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit-platform-runner.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
......@@ -413,7 +381,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
......
......@@ -18,8 +18,8 @@
package org.bonitasoft.connectors.database.datasource;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertFalse;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
......@@ -42,14 +42,11 @@ import javax.sql.DataSource;
import org.bonitasoft.engine.connector.ConnectorException;
import org.bonitasoft.engine.connector.ConnectorValidationException;
import org.h2.jdbcx.JdbcDataSource;
import org.hsqldb.jdbc.jdbcDataSource;
import org.hsqldb.jdbc.JDBCDataSource;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.mysql.cj.jdbc.MysqlDataSource;
/**
* @author Baptiste Mesta
* @author Frédéric Bouquet
......@@ -100,25 +97,11 @@ class DatasourceConnectorTest {
final TypeDatabaseEnum type = TypeDatabaseEnum.valueOf(db.toUpperCase());
db = db + ".datasource" + ".";
switch (type) {
case MYSQL:
ds = new MysqlDataSource();
((MysqlDataSource) ds).setServerName(prop.getProperty(db + "SERVERNAME"));
((MysqlDataSource) ds).setPort(Integer.parseInt(prop.getProperty(db + "PORT")));
((MysqlDataSource) ds).setDatabaseName(prop.getProperty(db + "DATABASENAME"));
((MysqlDataSource) ds).setUser(prop.getProperty(db + "USERNAME"));
((MysqlDataSource) ds).setPassword(prop.getProperty(db + "PASSWORD"));
break;
case HSQL:
ds = new jdbcDataSource();
((jdbcDataSource) ds).setDatabase(prop.getProperty(db + "JDBC_URL"));
((jdbcDataSource) ds).setUser(prop.getProperty(db + "USERNAME"));
((jdbcDataSource) ds).setPassword(prop.getProperty(db + "PASSWORD"));
break;
case H2:
ds = new JdbcDataSource();
((JdbcDataSource) ds).setURL(prop.getProperty(db + "JDBC_URL"));
((JdbcDataSource) ds).setUser(prop.getProperty(db + "USERNAME"));
((JdbcDataSource) ds).setPassword(prop.getProperty(db + "PASSWORD"));
ds = new JDBCDataSource();
((JDBCDataSource) ds).setDatabase(prop.getProperty(db + "JDBC_URL"));
((JDBCDataSource) ds).setUser(prop.getProperty(db + "USERNAME"));
((JDBCDataSource) ds).setPassword(prop.getProperty(db + "PASSWORD"));
break;
default:
throw new Exception("This type of database is not supported");
......@@ -222,7 +205,10 @@ class DatasourceConnectorTest {
final Map<String, Object> execute = datasourceConnector.execute();
ResultSet resultSet = (ResultSet) execute.get("resultset");
assertNotNull(resultSet);
assertThat(resultSet.getFetchSize()).isEqualTo(1);
resultSet.first();
assertThat(resultSet.getString(2)).isEqualTo("John");
resultSet.next();
assertThat(resultSet.getString(2)).isEqualTo("Jane");
datasourceConnector.disconnect();
}
......@@ -329,7 +315,7 @@ class DatasourceConnectorTest {
void testInvalidColumnName() throws Exception {
final DatasourceConnector datasourceConnector = getDatasourceConnectorWithNoParameter();
final List<String> columns = executeAndGetColumns(datasourceConnector);
assertFalse("state is not a valid column name", columns.contains("state"));
assertFalse(columns.contains("state"), "state is not a valid column name");
}
@Test
......
......@@ -18,10 +18,10 @@
package org.bonitasoft.connectors.database.jdbc;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.fail;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
......@@ -126,7 +126,7 @@ class JdbcConnectorTest {
void testGetAllValues() throws Exception {
final JdbcConnector jdbcConnector = getJdbcConnectorWithNoParameter();
final List<List<Object>> rowSet = executeAndGetResult(jdbcConnector);
assertEquals(1, rowSet.get(0).get(0));
assertEquals(1, rowSet.get(0).get(0));
assertEquals("John", rowSet.get(0).get(1));
assertEquals("Doe", rowSet.get(0).get(2));
assertEquals(27, rowSet.get(0).get(3));
......@@ -166,7 +166,10 @@ class JdbcConnectorTest {
final Map<String, Object> execute = datasourceConnector.execute();
ResultSet resultSet = (ResultSet) execute.get("resultset");
assertNotNull(resultSet);
assertThat(resultSet.getFetchSize()).isEqualTo(1);
resultSet.first();
assertThat(resultSet.getString(2)).isEqualTo("John");
resultSet.next();
assertThat(resultSet.getString(2)).isEqualTo("Jane");
datasourceConnector.disconnect();
}
......
......@@ -13,30 +13,6 @@ hsql.select=SELECT columns FROM table_name WHERE condition ORDER BY order
hsql.update=UPDATE table_name SET set_clause WHERE condition
hsql.delete=DELETE FROM table_name WHERE condition
h2.JDBC_DRIVER=org.h2.Driver
h2.JDBC_URL=jdbc:h2:file:${bonita.home}/server/platform/work/bonita6_journal;FILE_LOCK=NO;LOCK_MODE=0;MVCC=TRUE;DB_CLOSE_ON_EXIT=TRUE
h2.USERNAME=sa
h2.PASSWORD=
h2.create_table=CREATE TABLE table_name (id INT auto_increment PRIMARY KEY, firstname VARCHAR(25), lastname VARCHAR(25), age INT, average DOUBLE)
h2.auto_increment=AUTO_INCREMENT
h2.drop_table=DROP TABLE table_name
h2.insert=INSERT INTO table_name columns VALUES values
h2.select=SELECT columns FROM table_name WHERE condition ORDER BY order
h2.update=UPDATE table_name SET set_clause WHERE condition
h2.delete=DELETE FROM table_name WHERE condition
mysql.JDBC_DRIVER=com.mysql.jdbc.Driver
mysql.JDBC_URL=jdbc:mysql://localhost:3306/test
mysql.USERNAME=root
mysql.PASSWORD=
mysql.create_table=CREATE TABLE table_name (id INT auto_increment PRIMARY KEY, firstname VARCHAR(25), lastname VARCHAR(25), age INT, average DOUBLE)
mysql.auto_increment=AUTO_INCREMENT
mysql.drop_table=DROP TABLE table_name
mysql.insert=INSERT INTO table_name columns VALUES values
mysql.select=SELECT columns FROM table_name WHERE condition ORDER BY order
mysql.update=UPDATE table_name SET set_clause WHERE condition
mysql.delete=DELETE FROM table_name WHERE condition
datasource.batch_script=CREATE TABLE film (title VARCHAR(255) PRIMARY KEY);CREATE TABLE showtime (time VARCHAR(8) PRIMARY KEY);CREATE TABLE theater (id INTEGER auto_increment PRIMARY KEY, film_id VARCHAR(255), showtime_id VARCHAR(8), free_seats INTEGER, seats VARCHAR(255) );ALTER TABLE theater ADD CONSTRAINT fk_film FOREIGN KEY (film_id) REFERENCES film(title);ALTER TABLE theater ADD CONSTRAINT fk_showtime FOREIGN KEY (showtime_id) REFERENCES showtime(time);DROP TABLE theater;DROP TABLE film;DROP TABLE showtime;
hsql.datasource.JDBC_URL=jdbc:hsqldb:mem:xdb
......@@ -51,29 +27,5 @@ hsql.datasource.selectWithoutCondition=SELECT columns FROM table_name
hsql.datasource.update=UPDATE table_name SET set_clause WHERE condition
hsql.datasource.delete=DELETE FROM table_name WHERE condition
h2.datasource.JDBC_URL=jdbc:h2:file:${bonita.home}/server/platform/work/bonita6_journal;FILE_LOCK=NO;LOCK_MODE=0;MVCC=TRUE;DB_CLOSE_ON_EXIT=TRUE
h2.datasource.USERNAME=sa
h2.datasource.PASSWORD=
h2.datasource.create_table=CREATE TABLE table_name (id INT auto_increment PRIMARY KEY, firstname VARCHAR(25), lastname VARCHAR(25), age INT, average DOUBLE)
h2.datasource.auto_increment=AUTO_INCREMENT
h2.datasource.drop_table=DROP TABLE table_name
h2.datasource.insert=INSERT INTO table_name columns VALUES values
h2.datasource.select=SELECT columns FROM table_name WHERE condition
h2.datasource.selectWithoutCondition=SELECT columns FROM table_name
h2.datasource.update=UPDATE table_name SET set_clause WHERE condition
h2.datasource.delete=DELETE FROM table_name WHERE condition
mysql.datasource.SERVERNAME=localhost
mysql.datasource.PORT=3306
mysql.datasource.DATABASENAME=test
mysql.datasource.USERNAME=root
mysql.datasource.PASSWORD=
mysql.datasource.create_table=CREATE TABLE table_name (id INT auto_increment PRIMARY KEY, firstname VARCHAR(25), lastname VARCHAR(25), age INT, average DOUBLE)
mysql.datasource.auto_increment=AUTO_INCREMENT
mysql.datasource.drop_table=DROP TABLE table_name
mysql.datasource.insert=INSERT INTO table_name columns VALUES values
mysql.datasource.select=SELECT columns FROM table_name WHERE condition
mysql.datasource.selectWithoutCondition=SELECT columns FROM table_name
mysql.datasource.update=UPDATE table_name SET set_clause WHERE condition
mysql.datasource.delete=DELETE FROM table_name WHERE condition
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