- Project tools
-
-
- Using ArgoUML
-
- The ArgoUML Project
-
- Nightly builds of docs
-
- The Stats Project
-
- How do I...
-
| Category |
Featured projects |
| scm |
Subversion,
Subclipse,
TortoiseSVN,
RapidSVN
|
| issuetrack |
Scarab |
| requirements |
xmlbasedsrs |
| design |
ArgoUML |
| techcomm |
SubEtha,
eyebrowse,
midgard,
cowiki |
| construction |
antelope,
scons,
frameworx,
build-interceptor,
propel,
phing
|
| testing |
maxq,
aut
|
| deployment |
current |
| process |
ReadySET |
| libraries |
GEF,
Axion,
Style,
SSTree
|
| Over 500 more tools... |
|
2.9. Setting up Eclipse 3
If you are running Eclipse 3.2 or 3.3
we have prepared a recommended setup configured through Eclipse Team Project
Set .psf files available at the developer zone web site:
http://argouml.tigris.org/psf/.
The directory structure of an Eclipse check-out of the main source code now
mirrors the svn repository structure (since 20 April 2008).
For details on the directory structure and layouts,
see Section 2.2, “Source layout”.
The
argouml-core-projectset.psf
project
set contains a small subset of the full repository. It only contains the
files and directories needed to build argouml using Eclipse. It is possible
to extend the core project set by importing the
argouml-command-line-build.psf file
into an existing workspace. This will add the necessary tools to build
argouml from the command line; this build can then be run without opening
Eclipse. Alternatively, you could achieve the same result by checking-out
trunk/ on the command line, and
using Eclipse to edit the files (not requiring any .psf files).
For the recommended setup to work we make certain assumption on
what modules you have available in your Eclipse.
The following are needed:
Subclipse Ant JUnit 3 PDE Tools
The following is optional and the features will be enabled
if available:
2.9.1. Eclipse installation instructions
These instructions are tested on Eclipse 3.3.1.1, downloading
Eclipse IDE for Java developers.
Note that if you download
Eclipse Classic, you will not need to install the
PDE plugin (PDE is included in Eclipse Classic).
Download and install the latest Java Software Development Kit (JDK) from
sun.com:
http://java.sun.com/javase/downloads/
Download and install the latest Eclipse IDE for Java Developers:
http://www.eclipse.org/downloads/
Download and install Subclipse from within Eclipse, see
http://subclipse.tigris.org/install.html.
Download and install the PDE tools from within Eclipse: Help > Software Updates > Find and Install...
Select 'Search for new features to install', click Next.
Select 'The Eclipse Project Updates', click Finish.
Select a nearby mirror if asked.
Select The Eclipse Project > Eclipse SDK Eclipse 3.3.1.1
> Eclipse PDE Plug-in Developer Resources 3.3.2......., Next, Next, Install.
Restart Eclipse.
Download and install Checkstyle from within Eclipse, see
http://eclipse-cs.sourceforge.net/.
Ant and JUnit3 are included in the above.
If any of these instructions don't work or could be improved in some way,
please help in making them better by contacting the editor of the Cookbook.
2.9.2. Basic ideas of the set up
Here are the ideas governing the layout of the recommended Eclipse set up.
Argouml in its own workspace
Prefer project-specific settings to
workspace-specific settings (compiler, JRE, style).
Compile time dependencies are set up using the PDE Tools.
Projects containing java code are Plugin-projects.
Run time dependencies are set up in the Configurations.
Configurations saved in the project where they "belong".
Use as many of the build tools as possible from their
Eclipse distributions.
2.9.3. Checking out through Eclipse
This instruction is for downloading the ArgoUML source through Eclipse.
Eclipse uses Team Project Set (.psf) files to
automatically control the check-out from the SVN repository.
Do the following.
Go to the Team Project Set files download page:
http://argouml.tigris.org/psf/
On Windows systems (quicker way):
Copy the link location of argouml-core-projectset.psf
(copy shortcut/copy link location).
Open Eclipse
File > Import... > Team Project Set > Next.
File name: click 'Browse...'
Right-click > paste, or <ctrl>-v. Press <enter>. After a
short delay, the filename updates with the .psf that's
just been downloaded.
Click Finish.
On any other system:
Download the argouml-core-projectset.psf Team Project
Set file and save it somewhere.
Open Eclipse
File > Import... > Team Project Set > Next.
File name: click 'Browse...'
Navigate to the .psf file you just saved and
press <enter>.
Click Finish.
Now everything is automatic even though it takes a while. What happens is:
Files are downloaded from the Tigris SVN server and put into Eclipse
projects.
It is around 45MB that is downloaded so beware if you are on a slow
connection.
The projects are built.
First things that are special for ArgoUML, generated Java code,
are created by Eclipse calling ant,
then Eclipse kicks in and compiles the Java code.
Eclipse finds the Configurations that are also checked out.
If this doesn't work, try to
select Project => Clean...
and clean the projects that were not built properly.
Verify that you can start ArgoUML from the debugger within Eclipse.
You can do this by clicking on the little down-arrow close to the
Debug icon in the tool bar,
selecting Debug... or Run...,
and finding ArgoUML in the list (under Java Application).
2.9.4. Eclipse to help with the ArgoUML coding style![[Note]](images/note.png) | Note |
|---|
With the change to project specific settings this need not be
done by every developer.
|
This instruction is to set up Eclipse to work according to
the ArgoUML Coding standards.
If this is not done correctly you will most likely find that you will have to
do a lot of manual edits every time Eclipse has
touched the code.
You have your tool working against you instead of for you.
The instructions here are for these settings to affect your Eclipse Workspace.
If you have other projects in
the same Eclipse Workspace you would probably want this for
only the ArgoUML projects and that is possible although not explained here.
We suggest you to consider having ArgoUML work in an
Eclipse Workspace separate from your other projects.
2.9.4.1. Code conventions
Select in the menu Window => Preferences.
Then select Java => Code Style => Formatter.
For Eclipse 3.2 and later you do:
Select Java Conventions [built-in].
[3]
Press OK.
This will give you Code Conventions exactly like the Sun Coding Style
that we use in the ArgoUML project.
2.9.4.2. New file templates
Select in the menu Window => Preferences.
Then select Java => Code Style => Code Templates.
Select Import and give the file
EclipseWorkspace/argouml-core-tools/eclipse/eclipse-argo-codetemplates.xml
located in the argouml-core-tools project that you just checked out.
Press OK.
This will set up templates to be used when using the Eclipse functions
for creating files, functions, types and Javadoc...
2.9.5. Eclipse to automatically find problems in the code![[Note]](images/note.png) | Note |
|---|
With the change to project specific settings this need not be
done by every developer.
|
This instruction is to set up Eclipse to automatically find
what, in the ArgoUML project, could be considered problems in the code.
You can apply these individually depending on what level of help you need
in your coding.
I (Linus Tolke) recommend that you set them all on the Warning level.
This makes them visible for you.
You can then decide to fix them or not depending on how you feel about
the code you are working with.
The instructions on where to find the different settings are for Eclipse 3.2.
If you use Eclipse 3.1 you might need to search through the tabs to find
where the setting is since they were reorganized for Eclipse 3.2.
Compiler compliance level.
See in the menu Window => Preferences.
Then select
Java => Compiler.
At the right hand side set
Compiler compliance level: 5.0.
Check Use default compliance settings.
In the ArgoUML project we have decided to keep source compliance to Java5
(See Section 3.3.1, “Choice of JRE:
ArgoUML will support any JRE compatible with a
Sun specification of any JRE from Sun that has not begun the Sun End of Life
(EOL) process.
”).
This setting enables Eclipse to tell you where some
Java6
features have crept in.
Find forgotten and incorrect Javadoc comments.
In the menu select Window => Preferences.
Then select
Java => Compiler => Javadoc.
Suggested settings for these tabs
(Only things diverting from the Eclipse defaults are listed):
Javadoc => Malformed Javadoc comments:
Warning,
Private,
Check all "Report...".
Javadoc => Missing Javadoc tags: Warning, Private,
check Check overriding and implementing methods.
Javadoc => Missing Javadoc comments: Warning, Protected,
uncheck Check overriding and implementing methods.
These problems
(except missing Javadoc comments)
are also found by Checkstyle so if you are
running Checkclipse (See Section 2.9.6, “Settings for Checkclipse”)
put this in Ignore instead.
Code that hides other code.
In the menu select Window => Preferences.
Then select
Java => Compiler => Error/Warnings.
Suggested settings for these tabs
(Only things diverting from the Eclipse defaults are listed):
Potential programming problems => Serializable class without serialVersionUID:
Ignore
We don't use serialization in the ArgoUML project anyway.
Potential programming problems =>
Possible accidental boolean assignment: Warning.
Name shadowing and conflicts =>
Field declaration hides another field or variable: Warning.
Name shadowing and conflicts =>
Local variable declaration hides another field or variable: Warning,
check Include constructor or setter method parameters.
Find Code that shall be removed.
In the menu select Window => Preferences.
Then select
Java => Compiler => Error/Warnings.
Suggested settings for these tabs
(Only things diverting from the Eclipse defaults are listed):
Unnecessary code => Local variable is never read: Warning.
(This is default in Eclipse 3.3.)
Unnecessary code => Parameter is never read: Warning.
uncheck Ignore parameters documented with '@param' tag.
Unnecessary code => Unused or unread private members: Warning.
(This is reformulated and default in Eclipse 3.3.)
Unnecessary code => Unnecessary semicolon: Warning.
Unnecessary code => Unnecessary cast or 'instanceof' operation: Warning.
Unnecessary code =>
Unnecessary declaration of thrown checked exception: Warning.
2.9.6. Settings for Checkclipse![[Note]](images/note.png) | Note |
|---|
This description needs to be updated!
|
Checkclipse is a plug in for Eclipse which needs to be installed separately.
It enables style checking according the rules set for the ArgoUML project.
Get the latest Checkclipse kit from SourceForge at
http://sourceforge.net/projects/checkclipse
and install it by unzipping into your Eclipse plug-ins directory and
restarting Eclipse. (Checkstyle is bundled with Checkclipse so it's
not necessary to install it separately, but the web site is
http://checkstyle.sourceforge.net/
for reference.)
Most ArgoUML projects in Eclipse have their Checkclipse settings
predefined which should be found as soon as you install Checkclipse,
but if you need to set them up by hand, use the following instructions.
These instructions are for Checkclipse 2.1.
In the Java perspective, in the Package Explorer
select the project argouml-app.
Then, in the menu, select Project => Properties,
select Checkclipse (appears only if Checkclipse is correctly installed)
and then fill the fields like this:
Enable Checkstyle -
Checked.
Set Project Classloader - Checked. Checkstyle Configuration File:
/argouml-core-tools/checkstyle/checkstyle_argouml.xml
in the argouml-core-tools project.
Checkstyle Properties File:
/argouml-core-tools/checkstyle/checkstyle.properties
in the argouml-core-tools project.
Leave the rest of the fields at their default (empty). The File Filters
are defined on an additional preferences tab rather than in a separate
file as in earlier versions of Checkclipse. If this isn't populated with
the saved values from SVN you can add individual files to the exclude
list as you encounter them, but generally any machine generated source
file (JavaLexer, JavaRecognizer, etc) should be excluded from the checks.
2.9.7. Running JUnit test cases from within Eclipse
Most of the JUnit test cases belong to the argouml-core-tests Eclipse project.
The argouml-core-tests Eclipse project has its compile time dependencies
set up to include the things needed to compile the test cases.
This means that it is possible to compile the test cases and
nobody will create tests that use the insides of some subsystem that
is supposed to be hidden.
The Model subsystem is separated in two parts:
There is also for test purposes a partly implemented
Mock implementation of the model subsystem in the
org.argouml.model.MockModelImplementation-class
for the purpose of testing the interfaces and the bootstrap code
but it requires the test cases to be written especially for that.
The tests are never to be compiled against the MDR-implementation but
against the interfaces.
This means that the MDR-implementation is not included in the project
dependencies.
When it comes to running the tests,
most of the tests require the Model subsystem working to succeed.
To run the application with a working Model subsystem, a working
implementation is needed so the tests require the MDR-implementation.
The simplest way to solve this is to:
Create the test (by right-clicking on any of the test classes
and select Run as JUnit Test or Debug as JUnit Test).
The test fails with a
java.lang.ExceptionInInitializerError
on the first reference to Model.
If it doesn't then the perhaps the test case doesn't use the Model.
Select Debug... or Run... to get the configuration editing box.
It has remembered the test case and it is selected.
Add the argouml-core-model-mdr to the class path.
Classpath tab,
Select User Entries,
Add Projects,
Check argouml-core-model-mdr,
make sure
Add exported entries of selected projects
and
Add required projects of selected projects are checked,
Press OK,
Press Debug or Run.
Eclipse will remember these changes to that configuration
but you will have to do it all over again once for each new test case.
2.9.7.1. Running all JUnit test cases from within Eclipse
The description so far describes how to do this for a single test case
at the time.
If you want to run all test cases in one go from within Eclipse
it is also possible.
We have not prepared that for three reasons:
Some of the tests fail when run in this way.
The guess (Linus July 2006) is that this depends on the fact that
Eclipse doesn't start each test in its own JVM and some of the tests
relies on a fresh environment (empty models...).
Let's hope that an upcoming version of Eclipse includes a function
to allow us to specify that the tests are to be run each in its own JVM.
Another cause might be that the tests rely on certain other files being
in specified places that the Eclipse set up doesn't provide.
Maintaining the Configuration.
Since we have an Eclipse setup with a mismatch between the
compile time dependencies and the run time dependencies
this Configuration contains references to specific jar-files.
This means a maintenance problem whenever changing version of
a dependency.
Selection of tests.
In the project we keep all tests in the same tree,
whether they are working or not.
We distinguish between test classes with names starting with "Test", "GUITest",
and neither of them.
The ones starting with "Test" or "GUITest" are official tests
that should be working.
All others are tests that are never run automatically.
They are perhaps used for other purposes.
In Eclipse, there is no way to specify this so the description below
will run all tests.
Such a test is the DoAllTests-test suite that runs all tests so
tests risk to be run twice.
If you want to test this, this is what you do:
Right-click on the project argouml-core-tests.
On the multilevel pop-up that opens, select
Run As... JUnit Test or
Debug As... JUnit Test.
A Configuration is created on that project with the
Run all tests in the selected project, package or source folder:
checked
and the configuration is started/launched.
Stop the running Configuration.
The newly Configuration has the same problem as every single
test above with the model subsystem so it won't work.
Press Debug... or Run... to open the Configuration editor.
The newly created Configuration argouml-core-test is selected.
Add the argouml-core-model-mdr project to the class path.
This is done by:
selecting the Classpath tab, selecting argouml-core-tests under User Entries, clicking Add projects, and
selecting the argouml-core-model-mdr project and press OK.
Run all the tests by pressing Debug or Run.
2.9.8. How to work with the modules
The Eclipse set up is prepared to handle work with some
ArgoUML subprojects too in the same way.
To work on these, or having them enabled in the workspace to spot
incompatible changes you do the following:
Set the workspace default file for ant to
tools/eclipse/eclipse-ant.properties.
Window => Preferences,
Ant -> Runtime
Properties
and add a Global property file
${workspace_loc:/argouml-core-tools/eclipse/eclipse-ant.properties}.
Import from the argouml-modules-projectset.psf files.
|