1. Dominare il codice
ereditato
Tommaso Torti e Matteo Vaccari
Agile Day 2007, Bologna, 23 novembre
(cc) Some rights reserved.
2. ReadMe
Per vedere funzionare l'applicazione:
* modifica /etc/hosts inserendo
1 2 7 . 0 . 0 . 1 x x x . y y y. i t
10.0.1.2 xxx.zzz.it
* inserisci i seguenti plugin di Firefox:
* M o d i f i c a g l i h e a d e r : https://addons.mozilla.org/en-US/firefox/addon/967
v a i s u To o l s - > M o d i f y H e a d e r s e a g g i u n g i :
MSISDN = 393928390078
PA RT Y- I D = 3 4 3 5 3 2 5 2
* U s e r a g e n t sw i t c h e r : https://addons.mozilla.org/en-US/firefox/addon/59
s a l v a r e i l f i l e h t t p : / / x x x . s o u r c e s e n s e . c o m / f i l e s / z e r o 9 / u s e r a g e n t s w i t c h e r. x m l
e importarlo
* esegui quot;script/create_databases.shquot;
* esegui quot;script/start.shquot;
* p u n t a i l b row s e r a http://localhost:8080/progetto/p.do?page=Home
3. create_databases.sh
#!/bin/bash
if [ ! -d db ]; then
echo quot;Questo script deve essere eseguito nella dir principale del progettoquot;
exit 1
fi
echo 'Drop databases...'
mysqladmin -uroot --force drop db
mysqladmin -uroot --force drop db_test
echo 'Create databases...'
mysqladmin -uroot create db
mysqladmin -uroot create db_test
echo quot;grant all on db.* to db@localhost identified by 'db';quot; | mysql -uroot
echo quot;grant all on db_test.* to db@localhost identified by 'db';quot; | mysql -uroot
echo 'Build schema...'
cat db/db-schema.sql | mysql -udb db -pdb
cat db/db-schema.sql | mysql -udb db_test -pdb
echo 'Populate development...'
mysql -udb -pdb db < db/populate_db.sql
echo 'Done!'
4. start.sh
#!/bin/bash
if [ -z quot;${CMT_DEVELOPMENT_UPLOAD}quot; ] ; then
echo quot;Deve essere settata la variabile di ambiente CMT_DEVELOPMENT_UPLOADquot;;
exit 1;
fi
ABS_PATH=$(cd $(dirname $0); cd ..; pwd)
CATALINA_HOME=quot;$ABS_PATH/tomcat-5.5.25quot;
rm -rf $CATALINA_HOME/logs/*
rm -rf $CATALINA_HOME/webapps/progetto*
ant clean
ant deploy
ln -s /tmp $CATALINA_HOME/webapps/progetto/dynamicImages/upload
$CATALINA_HOME/bin/catalina.sh jpda start
tail -f $CATALINA_HOME/logs/catalina.out
24. Dipendenze
JavaGameRetriever BillingService
public JavaGameRetriever() { this(new BillingService()); }
public JavaGameRetriever(BillingService billingService)
public class FakeBillingService extends BillingService
FakeBillingService
25. Configurazioni
<target name=quot;preparequot;>
<copy todir=quot;./web/WEB-INF/quot;>
<fileset dir=quot;${conf.dir}quot;>
<include name=quot;ApplicationResource.propertiesquot;/>
<include name=quot;web.xmlquot; />
</fileset>
...
<target name=quot;cleanquot;>
<delete file=quot;./web/WEB-INF/
ApplicationResource.propertiesquot;/>
<delete file=quot;./web/WEB-INF/web.xmlquot; />
createWarForPreProduction.sh
#!/bin/bash
ant clean
ant war -Dconf.dir=conf/preproduction