1
0
mirror of https://github.com/octoleo/plantuml-server.git synced 2025-01-26 07:08:26 +00:00

Minimal SVG test case added

This commit is contained in:
Maxime Sinclair 2011-07-12 17:58:35 +02:00
parent c07e4ffe07
commit b909e3cb8d
2 changed files with 29 additions and 0 deletions

View File

@ -11,6 +11,7 @@ public class AllTests extends TestSuite {
suite.addTestSuite(TestForm.class);
suite.addTestSuite(TestImage.class);
suite.addTestSuite(TestAsciiArt.class);
suite.addTestSuite(TestSVG.class);
suite.addTestSuite(TestProxy.class);
//$JUnit-END$
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 TestSVG extends TestCase {
/**
* Verifies the generation of the SVG for the Bob -> Alice sample
*/
public void testSimpleSequenceDiagram() throws Exception {
WebConversation conversation = new WebConversation();
WebRequest request = new GetMethodWebRequest( TestUtils.getServerUrl()+"svg/SyfFKj2rKt3CoKnELR1Io4ZDoSa70000");
WebResponse response = conversation.getResource( request);
// Analyze response
// Verifies the Content-Type header
assertEquals( "Response content type is not SVG", "image/svg+xml", response.getContentType());
// Get the content and verify its size
String diagram = response.getText();
int diagramLen = diagram.length();
assertTrue( diagramLen > 1700);
assertTrue( diagramLen < 1800);
}
}