Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
Articles
CreateActions_it
ValidationAndListSpr...




JSPWiki v2.2.33

[RSS]


Hide Menu

SpringControllers_it


Difference between version 9 and version 3:

At line 18 changed 1 line.
* [6] Crea i WebTest Canoo per il test delle azioni stile browser
* [6] Crea i WebTest Canoo per il test delle azioni con simulazione del browser
At line 26 changed 1 line.
* Esegui __ant -Dobject.name=Person -Dappgen.type=pojo -Dapp.module=__ per generare un po' di file in extras/appgen/build/gen. Di fatto, saranno generati tutti i file di cui hai bisogno per completare questo tutorial. In ogni caso prendi solo quelli necessari.
* Esegui __ant -Dobject.name=Person -Dappgen.type=pojo -Dapp.module=""__ per generare un po' di file in extras/appgen/build/gen. Di fatto, saranno generati tutti i file di cui hai bisogno per completare questo tutorial. In ogni caso prendi solo quelli necessari.
At line 131 changed 1 line.
assertNotNull(request.getSession().getAttribute("messages"));
assertNotNull(request.getSession().getAttribute("successMessages"));
At line 139 changed 1 line.
assertNotNull(request.getSession().getAttribute("messages"));
assertNotNull(request.getSession().getAttribute("successMessages"));
At line 317 changed 1 line.
If you want to add a usability enhancement to your form, you can set the cursor to focus on the first field when the page loads. Simply add the following JavaScript at the bottom of your form:
Se vuoi aggiungere un miglioramento in usabilità del tuo form, puoi impostare il cursore in modo da avere il focus sul primo campo al caricamento della pagina. Basta che aggiungi il JavaScript seguente in fondo al tuo form:
At line 320 changed 1 line.
document.forms["person"].elements["firstName"].focus();
Form.focusFirstElement($('personForm'));
At line 331 changed 2 lines.
!![[Optional] Create a Canoo WebTest to test browser-like actions [#6]
The final (optional) step in this tutorial is to create a [Canoo WebTest|http://webtest.canoo.com] to test the JSPs.
!![[Opzionale] Crea i WebTest Canoo per il test delle azioni con simulazione del browser [#6]
Il passo finale (opzionale) in questo tutorial è la creazione di un [WebTest Canoo|http://webtest.canoo.com] per il test delle JSP.
At line 334 changed 1 line.
;:''I say this step is optional, because you can run the same tests through your browser.''
;:''Dico che questo passo è opzionale, in quanto puoi eseguire gli stessi test navigando direttamente dal tuo browser.''
At line 336 changed 1 line.
You can use the following URLs to test the different actions for adding, editing and saving a user.
Puoi usare le seguenti URL per il test delle varie azioni di aggiunta, modifica e registrazione utente.
At line 338 changed 4 lines.
* Add - [http://localhost:8080/appfuse/editPerson.html].
* Edit - [http://localhost:8080/appfuse/editPerson.html?id=1] (make sure and run __ant db-load__ first).
* Delete - [http://localhost:8080/appfuse/editPerson.html?method=Delete&id=1] (or edit and click on the Delete button).
* Save - Click [edit|http://localhost:8080/appfuse/editPerson.html?id=1] and then click the Save button.
* Aggiungi - [http://localhost:8080/appfuse/editPerson.html].
* Modifica - [http://localhost:8080/appfuse/editPerson.html?id=1] (assicurati di eseguire prima __ant db-load__).
* Elimina - [http://localhost:8080/appfuse/editPerson.html?method=Delete&id=1] (o modifica e fai clic sul pulsante Elimina).
* Registra - Fai clic su [modifica|http://localhost:8080/appfuse/editPerson.html?id=1] e poi fai clic sul pulsante Registra.
At line 343 changed 1 line.
Canoo tests are pretty slick in that they're simply configured in an XML file. To add tests for add, edit, save and delete, open test/web/web-tests.xml and add the following XML. You'll notice that this fragment has a target named ''PersonTests'' that runs all the related tests.
I test Canoo sono molto comodi perché si configurano semplicemente in un file XML. Per aggiungere test per le operazioni di aggiungi, modifica, registra ed elimina, apri test/web/web-tests.xml ed aggiungi il seguente XML. Noterai che questo frammento ha un target denominato ''PersonTests'' che esegue tutti i test correlati.
At line 345 changed 1 line.
;:''I use CamelCase target names (vs. the traditional lowercase, dash-separated) because when you're typing ''-Dtestcase=Name'', I've found that I'm used to doing CamelCase for my JUnit Tests.''
;:''Uso nomi di target in CamelCase (al posto del tradizionale lowercase, separato da trattini) perché quanto digiti ''-Dtestcase=Nome'', ho scoperto che sono abituato ad usare il CamelCase come per i miei test JUnit.''
At line 349 changed 1 line.
<!-- runs person-related tests -->
<!-- esegui i test relativi a person -->
At line 356 changed 1 line.
<!-- Verify the edit person screen displays without errors -->
<!-- Verifica che la schermata di modifica persona sia visualizzata senza errori -->
At line 370 changed 1 line.
<!-- Edit a person and then save -->
<!-- Modifica una persona e poi registra -->
At line 381 changed 1 line.
<clickbutton label="Save" description="Click Save"/>
<clickbutton label="${button.save}" description="Click Save"/>
At line 389 changed 1 line.
<!-- Add a new Person -->
<!-- Aggiungi un nuovo oggetto Person -->
At line 409 changed 1 line.
<!-- Delete existing person -->
<!-- Elimina persona esistente -->
At line 427 changed 1 line.
After adding this, you should be able to run __ant test-canoo -Dtestcase=PersonTests__ with Tomcat running or __ant test-jsp -Dtestcase=PersonTests__ if you want Ant to start/stop Tomcat for you. To include the PersonTests when all Canoo tests are run, add it as a dependency to the "run-all-tests" target.
Dopo aver aggiunto quanto sopra, dovresti poter eseguire __ant test-canoo -Dtestcase=PersonTests__ con Tomcat attivo o __ant test-jsp -Dtestcase=PersonTests__ se vuoi che Ant avvii e fermi Tomcat per te. Per includere PersonTests quando vengono eseguiti tutti i test Canoo, aggiungilo come dipendenza al target "run-all-tests".
At line 429 changed 1 line.
You'll notice that there's no logging in the client-side window by Canoo. If you'd like to see what it's doing, you can add the following between &lt;/webtest&gt; and &lt;/target&gt; at the end of each target.
;:''I test Canoo funzionano solo se è configurato almeno un tag XDoclet per la validazione dell'input, come spiegato nel prossimo tutorial [Aggiungere Validazione e Schermata Elenco|ValidationAndListSpring_it]. In alternativa eliminare in personForm.jsp la chiamata alla funzione JavaScript validatePerson sull'evento onsubmit del form.''
At line 431 added 2 lines.
Noterai che non c'è alcun log nella finestra lato client generato da Canoo. Se vuoi vedere cosa sta facendo, puoi aggiungere le righe seguenti fra &lt;/webtest&gt; e &lt;/target&gt; alla fine di ogni target.

Back to SpringControllers_it, or to the Page History.