Project directory structure
===========================
product -	contains the JBossESB product codebase, including unit tests.
qa -		contains the QA infrastructure for JBossESB.

IDE
===

Eclipse:
The IDE/JBossIDE/ directory contains .project and .classpath files for Eclipse. 
Copy these files to the corresponding directories under the trunk/product directory.

The product/services directory contains several sub-projects that have their own src and test folders. 
Each of these can be created as new projects in eclipse. 
Example of creating a project for jbpm:
1) Ctrl-N -> "Java Project" -> "Create project from existing source"
2) Browse to product/services/jbpm and press "ok"
3) Name the project something like "jbpm_<workspaceName>"

Just repeat the above steps for the projects in the services directory that you want to have included
in your workspace. The same can also be done for the product directory.. 
A good way to keep different branches separate is to use working sets in Eclipse, this is where the 
suffix _workspaceName comes handy.

The projects use the following user variables in Eclipse:
ESB_ROOT	-> should point to directory *above* product
ESB_HOME	-> should point to product/build/jbossesb/lib
ESB_LIB		-> should point to product/lib/ext
LOG4J		-> should point to a log4j.jar

The projects use the following libraries in Eclipse:
JUnit 4

Development
===========
If you have svn commit rights, then try to do your work within the workspace area first, before
committing it to the trunk. We have a continuous integration build process that runs against the
trunk whenever it is updated. See 'Subversion Guidelines' for more information.

Please run the following test prior to commiting code against the main trunk:
# product/build.xml 							-> target 'test'
# product/build.xml 							-> target 'integration' (requires a local ftp server. See product.properties)
# product/samples/quickstarts/test/build.xml 	-> target 'test'
# qa/build.xml 									-> target 'test'

Coding guidelines
=================
NOTE: you must ensure that all source files have the standard JBoss copyright at the start.

DO NOT reformat code that is checked out from the repository. In the JBossESB 4.x codebase there
is no mandatory style guide (we will fix this in the ESB 5 effort). If you change the format of
code for no other reason than to make it easier to read, it makes it harder for others to determine
what changes have occurred. Such changes may be backed out as a result.

If adding tests then they should either be called:

*UnitTest - unit tests
*FuncTest - functional tests
*IntegrationTest - integration tests

Subversion Guidelines 
=====================
Simple bug fixes may be performed on the trunk, but anything else should
be done in a personal workspace. The following text will describe how to
create a personal workspace, how to merge changes from main into your
workspace, and also how to merge changes from your workspace into the trunk.


	Creating a personal workspace
	==============================
	1) svn mkdir https://svn.jboss.org/repos/labs/labs/jbossesb/workspace/yourName
	2) svn copy https://svn.jboss.org/repos/labs/labs/jbossesb/trunk https://svn.jboss.org/repos/labs/labs/jbossesb/workspace/yourName/branchName
	3) svn co https://svn.jboss.org/repos/labs/labs/jbossesb/workspace/yourName/branchName [<some local folder>]

	Step 1 is simply creating a directory where we can store as many workspaces as we want.
	Step 2 is making a copy of the main trunk to a folder name of your choice (branchName). This step can be repeated whenever 
	you have the need to work on a separate branch, for example if you need to address a bug and do not want to disturb your 
	current workspace with the changes.
	Step 3 is just a normal checkout of the workspace just copied.


	Merging changes from the trunk to your private workspace
	========================================================
	Change directory to the local working copy of your workspace prior to performing the commands below. 

	 1) svn merge -r initial_revision:$HEAD https://svn.jboss.org/repos/labs/labs/jbossesb/trunk
	 2) resolve conflicts, run tests...
	 3) svn ci -m 'Merge from main initial_revision:$HEAD'
	
	* initial_revision - is the revision given to your branch by the svn copy command in step 2 of 'Creating a 
	  personal workspace'. You can use the command 'svn log --stop-on-copy' from within your working
	  copy to display this revision number.
	* $HEAD is not a valid value, but specified in this way to indicate that you should use the actual value of 
	  the revision you want. This can be found by running 'svn update' from within the workspace copy
	  of the main trunk. This is important, especially in the commit log message.

	Next time you want to update your working branch you can use the log command and grep like this:
	 svn log | grep -A 1 -B 3 'Merge from main' 
	This will display the list of merges that have been preformed previously. The next merge should use
	the value of the lastest merge's $HEAD value instead of the initial_revison number above.


	Merging changes from your private workspace to the trunk
	========================================================
	Change directory to your working copy of the trunk prior to performing the commands below.

	1) svn merge -r last_merge_commit_revision:$HEAD https://svn.jboss.org/repos/labs/labs/jbossesb/workspace/yourName/branchName
	2) Make sure you run the unit tests in the product directory and also the tests in the qa directory.
	3) svn commit -m 'Merge from workspace/yourName/branchName last_merge_commit_revision:$HEAD'

	* last_merge_commit_revision - If this is the first time you are merging your workspace branch with main
	  then this will be the revision given to your branch by the svn copy command in step 2 of 'Creating a 
	  personal workspace'. You can use the command 'svn log --stop-on-copy' from within your working
	  copy to display this revision number.
	  If this is not the first time you can run the following command from within your copy of the main trunks
	  workspace:
	   svn log | grep -A 1 -B 3 'Merge from workspace/yourName/branchName'
	  This will give you a list all the merges that you have performed, BUT you should not use the revision numbers
	  in this message, but instead the revision number of the commit for the entry, which is specified in the first column
	  and the number is prefixed with an 'r', like r17.

	* $HEAD is not a valid value, but specified in this way to indicate that you should use the actual value of 
	  the revision you want. This can be found by running 'svn update' from with the workspace copy
	  of the main trunk. This is important especially in the commit log message.
	
	Deleting your workspace 
	=======================
	You can delete branches that you have created when they are no longer needed.
	1) svn list https://svn.jboss.org/repos/labs/labs/jbossesb/workspace/yourName
	2) svn delete https://svn.jboss.org/repos/labs/labs/jbossesb/workspace/yourName/branchName

	Step 1 is simply listing your branches.

	The branch is missing from the HEAD revision but can be resurrected.

