mirror of
https://github.com/octoleo/plantuml-server.git
synced 2024-12-22 08:48:54 +00:00
AsciiArt unit test addition.
This commit is contained in:
parent
b201367aba
commit
c8fc7a480d
@ -10,6 +10,7 @@ public class AllTests extends TestSuite {
|
||||
//$JUnit-BEGIN$
|
||||
suite.addTestSuite(TestForm.class);
|
||||
suite.addTestSuite(TestImage.class);
|
||||
suite.addTestSuite(TestAsciiArt.class);
|
||||
suite.addTestSuite(TestProxy.class);
|
||||
//$JUnit-END$
|
||||
return suite;
|
||||
|
28
test/src/net/sourceforge/plantuml/servlet/TestAsciiArt.java
Normal file
28
test/src/net/sourceforge/plantuml/servlet/TestAsciiArt.java
Normal 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);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user