Refactoring of the welcome diagram.

This commit is contained in:
Maxime Sinclair
2011-03-09 16:55:57 +01:00
parent c98015f417
commit 5c149977fb
4 changed files with 49 additions and 9 deletions

View File

@@ -73,7 +73,7 @@ public class TestForm extends TestCase {
public void testEmptyUrl() throws Exception {
WebConversation conversation = new WebConversation();
// Fill the form and submit it
WebRequest request = new GetMethodWebRequest( "http://localhost/plantuml/" );
WebRequest request = new GetMethodWebRequest( TestUtils.getServerUrl() );
WebResponse response = TestUtils.tryGetResponse(conversation, request );
WebForm formUrl = response.getForms()[1];
formUrl.setParameter("url", "");
@@ -82,11 +82,11 @@ public class TestForm extends TestCase {
WebForm forms[] = response.getForms();
assertEquals( 2, forms.length );
// Ensure the Text field is empty
assertTrue( forms[0].getParameterValue("text").startsWith("Bob"));
// Ensure the URL field is correct
assertTrue( forms[1].getParameterValue("url").endsWith("/img/SyfFKj2rKt3CoKnELR1Io4ZDoSa70000"));
// Ensure the image is present
assertEquals( 1, response.getImages().length);
assertNull( forms[0].getParameterValue("text"));
// Ensure the URL field is empty
assertTrue( forms[1].getParameterValue("url").isEmpty());
// Ensure there is no image
assertEquals( 0, response.getImages().length);
}
}