Skip to main content
Jump to: navigation, search

Difference between revisions of "OFMP/Release 1.0.0M1"

(New page: ==Requirements== #Oracle XE 10.2 with system/system credentials #JDK 1.5 (not JRE as Maven requires a JDK) #Eclipse 3.4 #Maven 2.0.9 #m2eclipse 0.9.6 #Spring IDE Ckeckout org.eclipse.ofmp...)
 
Line 7: Line 7:
 
#Spring IDE
 
#Spring IDE
  
Ckeckout org.eclipse.ofmp.server
+
==Installation==
 +
*Ckeckout following projects:
 +
**org.eclipse.ofmp.server
 +
**org.eclipse.ofmp.common
 +
**org.eclipse.ofmp.test
 +
**org.eclipse.ofmp.security
 +
**org.eclipse.ofmp.currency
 +
 
 +
Extract other projects as required from CVS repository.
  
 
The database schema is located in the org.eclipse.ofmp.service project, sql folder. Run the build_database.xml ant file as usual.
 
The database schema is located in the org.eclipse.ofmp.service project, sql folder. Run the build_database.xml ant file as usual.
Line 17: Line 25:
 
Required bundles are mavenized or provided by Spring Source repository
 
Required bundles are mavenized or provided by Spring Source repository
 
   
 
   
For every service to be extracted from the org.eclipse.ofmp.service.core project we have to:
 
# extract bundle (scr and src.tests) from the core, mavenize and OSGify it
 
# create an integration test project based on Spring DM test framework and run integration tests on it.
 
  
 
==Naming conventions==
 
==Naming conventions==
Line 26: Line 31:
  
 
==OFMP bundles creation==
 
==OFMP bundles creation==
 +
For every service to be extracted from the org.eclipse.ofmp.service.core project we have to:
 +
# extract bundle (scr and src.tests) from the core, mavenize and OSGify it
 +
# create an integration test project based on Spring DM test framework and run integration tests on it.
 +
 +
 
#open shell cmd line in workspace folder
 
#open shell cmd line in workspace folder
 
#Create the project using Spring DM Maven artifact:
 
#Create the project using Spring DM Maven artifact:
mvn archetype:create -DarchetypeGroupId=org.springframework.osgi -DarchetypeArtifactId=spring-osgi-bundle-archetype -DarchetypeVersion= -DgroupId=org.eclipse.ofmp -DartifactId=org.eclipse.ofmp.<project name> -Dversion=1.0.0
+
mvn archetype:create -DarchetypeGroupId=org.springframework.osgi -DarchetypeArtifactId=spring-osgi-bundle-archetype -DarchetypeVersion= -DgroupId=org.eclipse.ofmp -DartifactId=org.eclipse.ofmp.<project name> -Dversion=1.0.0
mvn org.apache.felix:maven-bundle-plugin:manifest
+
mvn org.apache.felix:maven-bundle-plugin:manifest
 
+
2.1 Create an integrationtests bundle if required
+
  
3- Import project(s) within Eclipse workspace
+
#Create an integrationtests bundle if required
4- Enable Maven Dependency Management and remove Plugin dependencies from the project Java Build Path libraries
+
#Import project(s) within Eclipse workspace
5- Setup pom.xml (org.eclipse.ofmp.security/pom.xml is a good example)
+
#Enable Maven Dependency Management and remove Plugin dependencies from the project Java Build Path libraries
6- Move packages from lu.kaupthing.fm.server to org.eclipse.ofmp (dont use "service" prefix for bundles)
+
#Setup pom.xml (org.eclipse.ofmp.security/pom.xml is a good example)
7- Use Bnd to automate generation of Manifest.MF OSGi tags:
+
#Move packages from lu.kaupthing.fm.server to org.eclipse.ofmp (dont use "service" prefix for bundles)
 +
#Use Bnd to automate generation of Manifest.MF OSGi tags:
 
     - replace Require-Bundle by Import-Packages as much as possible
 
     - replace Require-Bundle by Import-Packages as much as possible
 
     - ensure proper bundles versioning AND dependencies versioning e.g.: Import-Package: osgitut.movies;version="[1.0.0,2.0.0)"
 
     - ensure proper bundles versioning AND dependencies versioning e.g.: Import-Package: osgitut.movies;version="[1.0.0,2.0.0)"
Line 44: Line 53:
 
         • org.example.foo - exported API package
 
         • org.example.foo - exported API package
 
         • org.example.foo.internal - private implementation package
 
         • org.example.foo.internal - private implementation package
8- Remove any Kaupthing specific wordings (victoria/apsys) in source code
+
#Remove any Kaupthing specific wordings (victoria/apsys) in source code
9- Enable project Spring nature if required and enlist Spring files in project properties
+
#Enable project Spring nature if required and enlist Spring files in project properties
  
Test infrastructure:
+
==Test infrastructure==
OFMP Test infrastructure is built on Spring DM Test framework:
+
OFMP Test infrastructure is built on [
http://static.springframework.org/osgi/docs/current/reference/html/testing.html#testing:integration
+
http://static.springframework.org/osgi/docs/current/reference/html/testing.html#testing:integration Spring DM Test framework]
  
 
Have a look at
 
Have a look at
Line 59: Line 68:
 
Tests are run automatically by maven when you install a bundle.
 
Tests are run automatically by maven when you install a bundle.
  
When running tests from Eclipse you need to set 2 JVM parameters so that Spring DM Test frmwk locate bundles properly:
+
When running tests from Eclipse you need to set 2 JVM parameters so that Spring DM Test frameyork locate bundles properly:
 
-Declipse.target.area1=D:\project\Victoria_OSGi\org.eclipse.ofmp.server\target\eclipse_plugins
 
-Declipse.target.area1=D:\project\Victoria_OSGi\org.eclipse.ofmp.server\target\eclipse_plugins
 
-Declipse.target.area2=D:\project\Victoria_OSGi\org.eclipse.ofmp.server\target\maven_plugins
 
-Declipse.target.area2=D:\project\Victoria_OSGi\org.eclipse.ofmp.server\target\maven_plugins
Line 66: Line 75:
  
  
Open issues:
+
==Open issues==
- Problem of running Spring DM/Maven bundles inside an Eclipse OSGi framework run config: http://forum.springframework.org/showthread.php?t=62590
+
*Problem of running Spring DM/Maven bundles inside an Eclipse OSGi framework run config: http://forum.springframework.org/showthread.php?t=62590
- True modular "per bundle" persistence
+
*True modular "per bundle" persistence
- JMX in OSGi
+
*JMX in OSGi
- Load time weaving of aspects using Equinox Aspect and Spring AOP. needed for some iBatis handlers.
+
*Load time weaving of aspects using Equinox Aspect and Spring AOP. needed for some iBatis handlers.
- Remoting/Web infrastructure
+
*Remoting/Web infrastructure
- BIRT integration
+
*BIRT integration
- buggy m2Eclipse
+
*buggy m2Eclipse
  
 
==TODO==
 
==TODO==

Revision as of 11:10, 31 October 2008

Requirements

  1. Oracle XE 10.2 with system/system credentials
  2. JDK 1.5 (not JRE as Maven requires a JDK)
  3. Eclipse 3.4
  4. Maven 2.0.9
  5. m2eclipse 0.9.6
  6. Spring IDE

Installation

  • Ckeckout following projects:
    • org.eclipse.ofmp.server
    • org.eclipse.ofmp.common
    • org.eclipse.ofmp.test
    • org.eclipse.ofmp.security
    • org.eclipse.ofmp.currency

Extract other projects as required from CVS repository.

The database schema is located in the org.eclipse.ofmp.service project, sql folder. Run the build_database.xml ant file as usual.

External dependencies are provided by the Eclipse OFMP target that you can find in the org.eclipse.ofmp.server project, in the target folder.

Run "mvn install" against the org.eclipse.ofmp.server/target/pom.xml file and point your Eclipse Target to org.eclipse.ofmp.server\target\org.eclipse.ofmp.server.target

Required bundles are mavenized or provided by Spring Source repository


Naming conventions

  1. every service bundle does not hold the ".service." acronym in its bundle name
  2. every lib bundle(like Jencks) should contain the ".lib." acronym in its bundle name

OFMP bundles creation

For every service to be extracted from the org.eclipse.ofmp.service.core project we have to:

  1. extract bundle (scr and src.tests) from the core, mavenize and OSGify it
  2. create an integration test project based on Spring DM test framework and run integration tests on it.


  1. open shell cmd line in workspace folder
  2. Create the project using Spring DM Maven artifact:
mvn archetype:create -DarchetypeGroupId=org.springframework.osgi -DarchetypeArtifactId=spring-osgi-bundle-archetype -DarchetypeVersion= -DgroupId=org.eclipse.ofmp -DartifactId=org.eclipse.ofmp.<project name> -Dversion=1.0.0
mvn org.apache.felix:maven-bundle-plugin:manifest
  1. Create an integrationtests bundle if required
  2. Import project(s) within Eclipse workspace
  3. Enable Maven Dependency Management and remove Plugin dependencies from the project Java Build Path libraries
  4. Setup pom.xml (org.eclipse.ofmp.security/pom.xml is a good example)
  5. Move packages from lu.kaupthing.fm.server to org.eclipse.ofmp (dont use "service" prefix for bundles)
  6. Use Bnd to automate generation of Manifest.MF OSGi tags:
   - replace Require-Bundle by Import-Packages as much as possible
   - ensure proper bundles versioning AND dependencies versioning e.g.: Import-Package: osgitut.movies;version="[1.0.0,2.0.0)"
   - Hide Implementation Details: ONLY export public API packages in Manifest
       Put implementation details in separate packages from the public API
       • org.example.foo - exported API package
       • org.example.foo.internal - private implementation package
  1. Remove any Kaupthing specific wordings (victoria/apsys) in source code
  2. Enable project Spring nature if required and enlist Spring files in project properties

Test infrastructure

OFMP Test infrastructure is built on [ http://static.springframework.org/osgi/docs/current/reference/html/testing.html#testing:integration Spring DM Test framework]

Have a look at org.eclipse.ofmp.test/src/main/java/org/eclipse/ofmp/test/AbstractOFMPDBUnitTest org.eclipse.ofmp.test/src/main/java/org/eclipse/ofmp/test/AbstractOFMSpringDMTest

The org.eclipse.ofmp.test bundle expose the service required to cleanup/initialize the database before any tests.

Tests are run automatically by maven when you install a bundle.

When running tests from Eclipse you need to set 2 JVM parameters so that Spring DM Test frameyork locate bundles properly: -Declipse.target.area1=D:\project\Victoria_OSGi\org.eclipse.ofmp.server\target\eclipse_plugins -Declipse.target.area2=D:\project\Victoria_OSGi\org.eclipse.ofmp.server\target\maven_plugins

See \org.eclipse.ofmp.security.integrationtests\launch


Open issues

  • Problem of running Spring DM/Maven bundles inside an Eclipse OSGi framework run config: http://forum.springframework.org/showthread.php?t=62590
  • True modular "per bundle" persistence
  • JMX in OSGi
  • Load time weaving of aspects using Equinox Aspect and Spring AOP. needed for some iBatis handlers.
  • Remoting/Web infrastructure
  • BIRT integration
  • buggy m2Eclipse

TODO

Short term

  1. Create our own OFMP Maven artifact to setup our Maven projects more easily
  2. Create Maven modules to have a super POM parent managing common dependencies
  3. Create POM base Maven project, based on the Target, to deploy all the bundles

Long term

  • Run FindBugs plugin on source code
  • Active checkStyle
  • Move event listeners/publishers to JMS/Camel
  • Ensure proper logging and logging levels
  • Ensure proper security on local and remote interface
  • Ensure proper transactional context of methods
  • Improve and generate Javadoc
  • Validate pre-conditions of public/protected methods using Apache Commons Lang Validate
  • Validate pre/post-conditions of private methods with java asserts
  • Use Eclipse API Tools
  • Run Code Coverage tests
  • Fix any TODO or FIXME
  • Return Quickly from Framework Callbacks: If you need to do something that takes some time then either use eventing or spin off a background thread to perform the long running work
  • Check source code copyrights
  • Check source code for copyrighted names (reuters, apsys, ebs, ...)
  • Use EasyMock for unit tests
  • Produce UMLGraph

References

Back to the top