Work, test and debug

### About

To modify and test your changes on Opush, you need a working OBM installation.
We suggest to install the latest OBM version onto a virtual machine and get the corresponding branch code from our git, see [obm-git](/wiki/obm-git) for this.

### Work on Opush, test your changes and debug them !

1. **On your OBM installation**
1. **Remove the actual Opush installation**
1. Stop Opush : **/etc/init.d/opush stop**
2. Remove the Opush application : **rm -fr /var/lib/jetty/webapps/opush/**

2. **On your working code repository**

1. **Modify Opush**, feel free to modify Opush as you expect it to work !
2. **Compile Opush**, once your are done with your changes, you have to compile Opush.

	cd **OBM_SOURCE_PATH**/java/sync
	mvn clean install

3. **Push your changes** on your OBM installation. At this step you are able to push your new Opush on your OBM installation !

	scp -r opush/push/target/opush/ root@**VM_IP**:/usr/share/jetty/webapps/opush/

3. **On your OBM installation**
1. **Make Opush debuggable** by configuring Jetty, the default Opush's application server.
In this example the Jetty process will listen on the port 4000.
Edit the **/etc/default/jetty** file, search the line starting with **JAVA_OPTIONS** and append these parameters :

	JAVA_OPTIONS=...   -Xdebug -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n

2. **Attach the Eclipse's debogger to Jetty**. Into Eclipse do :
1. Debug->Debug Configuration->double click on "Remote Java Application"
2. Select the _push_ project
3. _Host_ field is the IP of your server
4. _Port_ field is the port choosen at the JAVA_OPTIONS line, _4000_ in our case

4. **You can now use Opush with your changes and debug it !**
1. Configure loggers as explained [here](/wiki/logs)
2. Create an Exchange ActiveSync account with a smartphone bound to your OBM installation
3. Watch discussion between Opush and your device : **less /var/log/opush/opush.log**
3. Put an Eclipse's breakpoint and start debugingMarcas de calçado, bolsas e vestuário na Spartoo