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:
parent
c07e4ffe07
commit
b909e3cb8d
@ -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;
|
||||
|
28
test/src/net/sourceforge/plantuml/servlet/TestSVG.java
Normal file
28
test/src/net/sourceforge/plantuml/servlet/TestSVG.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 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);
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user