Skip to content
Snippets Groups Projects
Commit 8c85cd27 authored by srosse's avatar srosse
Browse files

OO-354: enhance the pom.xml to run the unit tests on Oracle, update the...

OO-354: enhance the pom.xml to run the unit tests on Oracle, update the TESTING.README.LATEST with tips about Oracle
parent ed85c3d5
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,18 @@ junit and integration tests in OpenOLAT 8
- MySQL
mvn clean test -Dwith-mysql
- PostgreSQL
mvn clean test -Dwith-postgresql
mvn clean test -Dwith-postgresql
- Oracle
The support of Oracle is still EXPERIMENTAL
- you need a clean database as the maven process doesn't create a new one (every time)
- You need more cursors (if you don't know what it is, don't run this tests :-):
ALTER SYSTEM SET open_cursors = 400 SCOPE=BOTH;
- configure the olat.local.properties in src/test/profile/oracle
- you need to install the JDBC driver locally (one time) as there isn't any maven repo for them (licensing issue)
mvn install:install-file -Dfile=ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.0 -Dpackaging=jar -DcreateChecksum=true
then you can run the test suite
mvn clean test -Dwith-oracle
- The junit testresults can be found at target/surefire-reports/*
Double click the xml files in Eclipse to display the results in the standards jUnit console
......
......@@ -511,6 +511,88 @@
</plugins>
</build>
</profile>
<profile>
<id>oracleunittests</id>
<activation>
<property>
<name>with-oracle</name>
</property>
</activation>
<properties>
<skipTests>false</skipTests>
<skipITs>true</skipITs>
<testFailureIgnore>false</testFailureIgnore>
<test.env.db.hibernate.ddl.auto>
</test.env.db.hibernate.ddl.auto>
<test.env>oracle</test.env>
</properties>
<build>
<plugins>
<plugin>
<!-- Documentation: http://maven.apache.org/plugins/maven-surefire-plugin/ -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.8.1</version>
<configuration>
<argLine>-XX:MaxPermSize=128m -Xmx512m -Xms256m -Djava.awt.headless=true</argLine>
<systemPropertyVariables>
<java.io.tmpdir>${project.build.directory}/olatdata</java.io.tmpdir>
</systemPropertyVariables>
<testNGArtifactName>none:none</testNGArtifactName>
<includes>
<include>org/olat/test/AllTestsJunit4.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<id>copy-resources-4-postgresqlunittests</id>
<!-- hook in to copy maven.build.properties to allow test and integration-test
phase run properly -->
<phase>generate-test-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/test-classes</outputDirectory>
<resources>
<resource>
<!-- place resources you like to get filtered an copied -->
<directory>src/test/profile/${test.env}</directory>
<includes>
<include>olat.local.properties</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<!-- place resources you like to get filtered an copied -->
<directory>src/main/resources/database/oracle</directory>
<includes>
<include>setupDatabase.sql</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.0</version>
<optional>true</optional>
</dependency>
</dependencies>
</profile>
<!-- Retain the dependency for cluster -->
<profile>
......
#########################
#
# This olat.local.properties file is only used when running junit tests! (Unit tests run in its own classpath environment)
# Use this file to set properties that affect or are a prerequisite for your tests.
#
#########################
tomcat.id=2
defaultlang=de
db.show_sql=false
#force use of java.io.tmpDir for unit tests
archive.dir=
log.dir=
folder.root=
restapi.enable=true
instance.id=${test.env.instance.id}
generate.index.at.startup=false
# for UserTest
keepUserEmailAfterDeletion=true
keepUserLoginAfterDeletion=true
# do not run upgrades and scheduled jobs and such
cluster.singleton.services = disabled
jmx.rmi.port=${test.env.jmx.rmi.port.0}
# SingleVM jms.broker.url
jms.broker.url=vm://embedded?broker.persistent=false
search.broker.url=vm://embedded?broker.persistent=false
codepoint.jms.broker.url=vm://embedded?broker.persistent=false
# Cluster (remote) jms.broker.url
#jms.broker.url=failover:(tcp://localhost:${test.env.jms.broker.port}?wireFormat.maxInactivityDuration=0)
#search.broker.url=failover:(tcp://localhost:${test.env.jms.broker.port}?wireFormat.maxInactivityDuration=0)
#codepoint.jms.broker.url=failover:(tcp://localhost:${test.env.jms.broker.port}?wireFormat.maxInactivityDuration=0)
# enable/disable codepoint/breakpoint framework
codepoint_server.enabled=true
smtp.host=testing
#
# if you like to run your tests against mysql just uncomment the following. Please do not commit it!
#
db.vendor=oracle
db.name=xe
db.user=OLATTEST
db.pass=oracle
db.host=192.168.1.202
db.host.port=1521
db.default.schema=olattest
db.database.dialect=org.hibernate.dialect.Oracle10gDialect
db.hibernate.ddl.auto=
auto.upgrade.database=false
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