Project

General

Profile

Actions

TaxonomicEditorDevelopersGuide » History » Revision 51

« Previous | Revision 51/246 (diff) | Next »
Cherian Mathew, 10/12/2015 05:05 PM


This page contains all information related to developing with the remoting based version of the Taxonomic Editor

Development Environment

This section contains the different editor /server combinations that can be used for testing

Eclipse : Editor / Server

This section provides details on how to setup the standard development environment with the editor and server both launched from the eclipse workspace.

Server Side

Edit the cdmlib-remote-webapp - run configuration to set the jetty port to 8080 and to add the VM arguments

-Dspring.profiles.active=remoting

Editor Side

Edit the eu.etaxonomy.taxeditor.application.product debug / runtime configuration to add the VM arguments

-Dcdm.server.dev.port=8080 
-Dcdm.server.dev.username=<username>
-Dcdm.server.dev.password=<password>

This will force the editor to always automatically connect to the server running on port 8080.

The editor login mechanism checks against the timestamp of the cdmlib-services jar and will not allow a connection if the timestamp is not exactly the same. This can be problematic in development when the timestamps may differ for SNAPSHOT versions. To bypass this check, add

-Dcdm.server.version.lm.ignore=true

to the above product configurations.

Runtime

Launch the editor from the eclipse workspace using the eu.etaxonomy.taxeditor.application.product configuration.

Click on General->Connect and the editor should directly connect to the server launched from the eclipse workspace.

Notes

This environment allows developers to edit code live as eclipse hot swaps the code for both editor and server. In the case of changes in class structure (i.e. changes in method signature, addition of new methods, changes in static members, etc) eclipse will ask for the running process to be termintated. In the case where these changes apply to code shared by the editor (service layer, model, etc), executing mvn validate on the eu.etaxonomy.taxeditor.cdmlib project will be required.

Eclipse : JUnit Plugin Tests / Server

This section provides details on how to setup the unit test environment for the editor targeting a manually launched server from the eclipse workspace.

Server Side

Duplicate the cdmlib-remote-webapp - run configuration (with the spring profile vm argument) to cdmlib-remote-webapp-unit-tests and set the jetty port to 9090.

The configuration for the server using the editor test db is described in the diagram below.

[!testingpng|1000px!]

Setting up the server side includes,

  • adding the taxeditor test datasources to the .cdmLibrary/datasources.xml
    <bean id="local-cdmTest"  lazy-init="true" class="com.mchange.v2.c3p0.ComboPooledDataSource">
        <property name="driverClass" value="eu.etaxonomy.cdm.database.LocalH2"/>
        <property name="user" value="sa"/>
        <property name="password" value=""/>
        <property name="jdbcUrl" value="jdbc:h2:file:/home/cmathew/Development/EDIT/taxeditor/eu.etaxonomy.taxeditor.test/target/classes/h2/cdmTest;AUTO_SERVER=TRUE"/>
    </bean>
  • activating the above datasource as the default one in .cdmLibrary/cdmlib-properties
cdm.datasource=local-cyprus

Editor Side

The tests reside in the eu.etaxonomy.taxeditor.test project and uses the settings in src/test/resources/server.properties

Runtime

The unit tests should be run by clicking the test / test class and choosing the JUnit Plug-in Test option in the right-click menu.

Notes

The JUnit Plug-in Test choice is important since this will ensure that the test is run in the RCP environment.

The live coding and debug possibilities are similar to the editor / server environment.

Maven : JUnit Plugin Tests / Server

This section provides details on the environment for running automated tests using maven.

Server Side

The maven configuration in the eu.etaxonomy.taxeditor.test project has been setup launch a jetty server with the cdmlib-remote-webapp.war from the eu.etaxonomy.taxeditor.cdmlib project on port 9090 using the datasources.xml file located in src/test/resources which contains the local cdm h2 test db as target datasource.

Editor Side

All tests in the eu.etaxonomy.taxeditor.test project can be run.

Runtime

Before running any test, execute mvn install in the taxeditor parent project. This will install all taxeditor projects which is required for the mvn tests to run with the latest compiled code base.

Once the projects have been installed, the usual maven test goals are available to be executed from the eu.etaxonomy.taxeditor.test project directory. These include,

  • Executing mvn integration-test for running all tests.

  • Executing mvn test -Dtest= for running a single test class.

Eclipse Editor with Remote Server

This section provides details on how to setup the development environment for the editor targeting a remote server.

Server Side

Ensure that the remote cdmserver is running and has the remoting flag activated.

Editor Side

Duplicate the eu.etaxonomy.taxeditor.application.product configuration to say eu.etaxonomy.taxeditor.application.product.remote and remove the cdm.server.dev.* VM arguments.

The editor login mechanism checks against the timestamp of the cdmlib-services jar and will not allow a connection if the timestamp is not exactly the same. This can be problematic in development when the timestamps may differ for SNAPSHOT versions. To bypass this check, add

-Dcdm.server.version.lm.ignore=true

to the above product configurations.

Runtime

Launch the editor from the eclipse workspace using the eu.etaxonomy.taxeditor.application.product configuration.

Click on General->Connect and the editor will display the remoting login dialog which will allow you to connect to the target server.

Maven Goals

The maven goals available within the editor project are as follows :

  • Generate the product files : In order to generate the final products execute mvn package -P buildProducts in the taxeditor parent project.

  • Copy dependent jars : To update the dependent jars in all projects , execute mvn clean validate in the taxeditor parent project. For updating only individual projects (currently eu.etaxonomy.taxeditor.cdmlib and eu.etaxonomy.taxeditor.molecular.lib) the mvn clean validate command should be run in the project directory. To force the use of locally installed dependent jars, execute mvn clean validate -Plocal-repository -Dlocalrepo=

Model Change Actions

The actions required following a model include,

CDM h2 Test DB update

  • Generate new empty CDM h2 db.

  • Replace the existing src/test/resources/h2/cdmTest.h2.db in the eu.etaxonomy.taxeditor.test project with the newly generated one.

CDM Hibernate Serialised mapping update

  • Copy the latest cdmlib hibernate.cfg.xml to src/main/resources/eu/etaxonomy/cdm/mappings/hibernate.cfg.xml in the eu.etaxonomy.taxeditor.cdmlib project.

  • Execute mvn exec:java -Dexec.mainClass="eu.etaxonomy.taxeditor.remoting.cache.CdmModelCacher" in the eu.etaxonomy.taxeditor.cdmlib project dir.

This will generate a new cdm.map.ser file in the resources directory.

== Eager Lazy Loading

Remoting Session Architecture

Handler / Operations Architecture

Data Change Service / Events / Listeners

Known Errors / Exceptions

Debugging

Performance Tuning

Term Loading

General FAQ

Updated by Cherian Mathew over 8 years ago · 51 revisions