1
0
mirror of https://github.com/octoleo/plantuml-server.git synced 2024-11-17 17:55:12 +00:00

AsciiArt unit test addition.

This commit is contained in:
Maxime Sinclair 2011-04-08 12:58:56 +02:00
parent b201367aba
commit c8fc7a480d
2 changed files with 29 additions and 0 deletions

View File

@ -10,6 +10,7 @@ public class AllTests extends TestSuite {
//$JUnit-BEGIN$ //$JUnit-BEGIN$
suite.addTestSuite(TestForm.class); suite.addTestSuite(TestForm.class);
suite.addTestSuite(TestImage.class); suite.addTestSuite(TestImage.class);
suite.addTestSuite(TestAsciiArt.class);
suite.addTestSuite(TestProxy.class); suite.addTestSuite(TestProxy.class);
//$JUnit-END$ //$JUnit-END$
return suite; return suite;

View File

@ -0,0 +1,28 @@
package net.sourceforge.plantuml.servlet;
import junit.framework.TestCase;
import com.meterware.httpunit.*;
import java.util.Date;
import java.util.Locale;
import java.text.SimpleDateFormat;
public class TestAsciiArt extends TestCase {
/**
* Verifies the generation of the ascii art for the Bob -> Alice sample
*/
public void testSimpleSequenceDiagram() throws Exception {
WebConversation conversation = new WebConversation();
WebRequest request = new GetMethodWebRequest( TestUtils.getServerUrl()+"txt/SyfFKj2rKt3CoKnELR1Io4ZDoSa70000");
WebResponse response = conversation.getResource( request);
// Analyze response
// Verifies the Content-Type header
assertEquals( "Response content type is not TEXT PLAIN", "text/plain", response.getContentType());
// Get the content and verify its size
String diagram = response.getText();
int diagramLen = diagram.length();
assertTrue( diagramLen > 200);
assertTrue( diagramLen < 250);
}
}