Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "SMILA/Development Guidelines/How to set up integration environment"

(Create a launch configuration for SMILA)
(Testing your code)
Line 50: Line 50:
  
 
In the menu, open "Run" -> "Run Configurations" or "Debug Configurations" and you should find an entry "OSGi Frameworks" -> "SMILA". Select it and click "Run" or "Debug" and SMILA should start just like when started from the command line.
 
In the menu, open "Run" -> "Run Configurations" or "Debug Configurations" and you should find an entry "OSGi Frameworks" -> "SMILA". Select it and click "Run" or "Debug" and SMILA should start just like when started from the command line.
 
==== Testing your code ====
 
 
To be able to use JUnit test your code, you will need to add a JUnit bundle to the target platform. You can do this by copying the directory <tt>plugins/org.junit_3.8.2.v20080602-1318</tt> (the exact version numbers may vary in your installation) from your Eclipse installation to <tt>SMILA/plugins</tt>. You then need to press "Reload" again in the Target Platform pane of Window->Preferences to enable the JUnit bundle.
 
 
You may want to check out <tt>org.eclipse.smila.test</tt> from our SVN repository at <tt>http://dev.eclipse.org/svnroot/rt/org.eclipse.smila/</tt>. It contains some base classes for testing OSGi services and JMX agents. There are a lot of bundles named <tt>*.test</tt> in the repository that can serve you as an example of how to create test cases for crawlers and pipelets.
 
  
 
[[Category:SMILA]]
 
[[Category:SMILA]]

Revision as of 08:30, 23 September 2011


WORK IN PROGRESS

This how-to describes the necessary steps for setting up SMILA integration environment. Normally this setup is only interesting for SMILA integrators who just want to integrate their components in SMILA. SMILA committers and contributors should work with another setup described at How to set up the development environment.

Preconditions

Here is the list of things that you will definitely need for developing SMILA components:

  1. JDK 1.6
  2. Eclipse SDK - This howto was tested with Eclipse 3.6.2
  3. SMILA binary distribution

Install the binary distribution

Just pick up the latest binary distribution of SMILA:

Simply unzip the file you downloaded into a new directory on your local hard disk and you've done with the installation.

Create a new Workspace and setup target platform

Start your Eclipse SDK and let it create a new workspace at a location of your choice. Then you use the SMILA binaries as the target platform for plugin develoment. This enables you to create own bundles that can use the code in the SMILA bundles:

  • Open Windows -> Preferences
  • Window --> Preferences --> Plug-in Development --> Target Platform --> Add...
  • Initialize the target definition with: Nothing --> Next
  • Insert some sensible name (how about "SMILA", maybe? ;-)
  • In the "Location" tab, click "Add"
    • Select "Installation" --> Click "Next"
    • In the "Location" slot, browse to your directory where you installed SMILA (do not press <Enter>)
    • --> click "Finish"
  • In the "Location" tab, click "Add" again
    • select "Features" --> Click "Next"
    • in the "Location" slot select "${eclipse_home}"
    • select Features "org.eclipse.platform" and "org.eclipse.jdt"
    • --> click "Finish"
  • switch to "Content" tab:
    • filter for "junit" and deselect the bundles "org.junit (4.8.1)" and "org.junit4 (4.8.1)". Only "org.junit (3.8.2)" must be selected.
  • --> click "Finish"
  • Set the new target platform active
  • --> click "OK", you're done.

Create a launch configuration for SMILA

Getting right the launch configuration for SMILA is a bit tedious, so we prepared an example package:

In the menu, open "Run" -> "Run Configurations" or "Debug Configurations" and you should find an entry "OSGi Frameworks" -> "SMILA". Select it and click "Run" or "Debug" and SMILA should start just like when started from the command line.

Back to the top