-
Notifications
You must be signed in to change notification settings - Fork 15
development environment
Wiki ▸ Development Environment
Follow these instructions to setup a Linux computer to be used for building or developing software for Biobank.
-
Using the Ubuntu package manager install the required packages.
sudo apt-get install ant git-core gettext zip unzip
-
Follow these instructions to install the Java Standard Edition 6 Development Kit.
-
Download Tomcat 8.5.30 from https://tomcat.apache.org/download-80.cgi.
For security reasons, it is better to run Tomcat as a non root user and take other precautions given here: Tomcat.
-
Download Eclipse for RCP and RAP Developers from this page. Make sure you download the 64-bit version if you are running 64-bit Ubuntu.
Extract the file to your Eclipse Home directory. For example, if my Eclipse Home directory is
/opt/eclipse
, then use the following commands (this must be done using the root account):mkdir /opt/eclipse cd /opt/eclipse mv eclipse-rcp-indigo-SR2-linux-gtk-x86_64.tar.gz . tar zxvf eclipse-rcp-indigo-SR2-linux-gtk-x86_64.tar.gz
This results in having the directory
/opt/eclipse/eclipse
. -
Download the Eclipse Delta Pack from this page and copy the file to your
eclipse
subdirectory in your Eclipse Home directory. From that directory extract the files (this must be done using the root account). For example:cp eclipse-3.7.2-delta-pack.zip /opt/eclipse/eclipse cd /opt/eclipse/eclipse unzip eclipse-3.7.2-delta-pack.zip
The delta pack is required to build the client for the other operating systems. The delta pack version must match the version of Eclipse being used.
-
Create a bash profile file to define enviroment variables. Create the file
/opt/tomcat/.bash_profile
and add the following lines:export CATALINA_HOME=/opt/tomcat/apache-tomcat-8.5.30 export JAVA_HOME=/usr/lib/jvm/java-7-oracle/jre export JAVA_TOOL_OPTIONS=-Dhttps.protocols=TLSv1.2 export ECLIPSE_HOME=/opt/eclipse/eclipse
-
Retrieve the Biobank source code from the GitHub repository to your Biobank Source Code Home directory. It is recommended to use
/opt/tomcat/build/biobank
. Use the following commands starting with a shell logged into the root account.su - tomcat cd /opt/tomcat mkdir build cd build git clone https://github.com/cbsrbiobank/biobank.git cd biobank git submodule init git checkout TAG git submodule update
Replace
TAG
with the tag name for the version you want to build. To see a list of all tags use the command:git tag
-
Configure your database settings.
ant init
Now edit the file named
db.properties
at the project's root directory and fill in with your settings. -
Download the project dependencies.
At the project's root directory use the following command:
ant deploy-eclipse
All the required libraries are copied to the Eclipse projects.
-
Open Eclipse with the workspace pointing at the
eclipse_ws
directory. From the command line you can use the following command:<path_to_eclipse>/eclipse -data /opt/tomcat/build/biobank/eclipse_ws &
-
From Eclipse, import the projects into the workspace:
File -> Import -> General -> Existing Projects into Workspace
. -
From the
Package Explorer
pane and expand thebiobank2
project, and double click theplugin.xml
file under it. On the right hand side of the form that pops up click on theLaunch and Eclipse application
link under theTesting
heading. -
From the main menu select
Run -> Debug configurations
and then select theArguments
tab on the right hand side of the dialog box. Add--debug
toProgram arguments
. Then select thePlug-ins
tab and do the following:- Press the
Deselect All
button. - Select
features selected below
. - Select
biobank2.feature.core
andbiobank2.feature.platform
. - Press the
Select required
button.
Now press the
Debug
button to launch the Biobank client in Debug mode. - Press the
-
Optional: remove needless warnings about Non-extenalize strings (NON-NLS).
For project biobank2.tests and biobank2.tools do the following:
- right click on the project in the
Package Explorer
pane and selectProperties
. - From the left pane in the dialog box select:
Java Compiler -> Errors/Warnings
. - Click
Enable project specific settings
to turn this setting on. - Set
Non-extenalize strings (missing/unused $NON-NLS$ tag)
toIgnore
. - Click the
Apply
, followed by theYes
button on the dialog box that pops up. - Press the
OK
button.
- right click on the project in the
You may run into the following problems / issues:
-
Eclipse does not have the Java 1.6 JRE.
- From the main menu select:
Window -> Preferences
. - From the left pane in the dialog box select:
Java -> Installed JREs
. - Press the
Add
button and add the path to your Java 1.6 JDK.
- From the main menu select:
-
Errors due to workspace compliance.
- From the main menu select:
Window -> Preferences
. - From the left pane in the dialog box select: Java -> Compiler.
- Look for
Compiler compliance level
and select 1.6.
- From the main menu select:
-
Ensure the database seetings in
db.properties
(at the project root) are valid. -
Initialize the database:
ant dbcreate
.Alternatively, to create the database with a user that can log in, use the command
ant -Ddebug=true dbcreate
. This creates the user with user nametestuser
and passwordtest
. -
Initialize the database migration tables:
ant flyway-init -Dflyway.initialVersion=1.6 -Dflyway.initialDescription="biobank v3100"
This command initialize the database to the Biobank version 3.10.0 schema.
-
Optional: save a dump of the empty database to a file for later use,
mysqldump --login-path=local biobank | gzip > biobank_empty.sql.gz
Before running tests, the database must be emptied: see Creating an empty database.
To run the tests suite in Eclipse:
-
Open the
AllTestsSuite.java
file by pressingCtrl-Shift T
(open type). -
Right click on the class name,
AllTestSUite
, and selectRun As -> JUnit Test
from the context menu that opens up.
-
To run the tests from the command line use the following command at the project's root directory:
ant test
The report is written to
<project_root>/testing/html/junit-noframes.html
. -
To run the tests, with code coverage, from the command line use the following command at the project's root directory:
ant test-emma
The report is written to
<project_root>/coverage/index.html
.
This configuration allows for testing and demos. The following are created:
-
One clinic, named
Clinic1
with one contact. -
The following studies:
Study1
andStudy2
. Both assigned the contact fromClinic1
. -
Multiple patients are created which have one collection event and one source specimen.
- Two sites:
Site1
andSite2
.
To create this confuration, follow these steps:
-
The database must be emptied: see Creating an empty database.
-
Add the test user to the database (if
testuser
does not yet exist):ant -Ddebug=true dbcreate-add-testuser
-
Create the confiruation with this command:
ant test-config-create
-
Optional: a configuration that can link grandchild specimens can be created with the following command:
ant -Dgrandchild=true test-config-create
Grandchild specimens have two parents: the aliquot they came from and the source specimen.