mirror of
https://github.com/octoleo/plantuml-server.git
synced 2025-01-03 05:00:14 +00:00
Add simple EPS test case
This commit is contained in:
parent
7293235cd6
commit
c212cb9488
@ -12,6 +12,7 @@ public class AllTests extends TestSuite {
|
|||||||
suite.addTestSuite(TestImage.class);
|
suite.addTestSuite(TestImage.class);
|
||||||
suite.addTestSuite(TestAsciiArt.class);
|
suite.addTestSuite(TestAsciiArt.class);
|
||||||
suite.addTestSuite(TestSVG.class);
|
suite.addTestSuite(TestSVG.class);
|
||||||
|
suite.addTestSuite(TestEPS.class);
|
||||||
suite.addTestSuite(TestProxy.class);
|
suite.addTestSuite(TestProxy.class);
|
||||||
suite.addTestSuite(TestMap.class);
|
suite.addTestSuite(TestMap.class);
|
||||||
suite.addTestSuite(TestCharset.class);
|
suite.addTestSuite(TestCharset.class);
|
||||||
|
27
src/test/java/net/sourceforge/plantuml/servlet/TestEPS.java
Normal file
27
src/test/java/net/sourceforge/plantuml/servlet/TestEPS.java
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package net.sourceforge.plantuml.servlet;
|
||||||
|
|
||||||
|
import com.meterware.httpunit.GetMethodWebRequest;
|
||||||
|
import com.meterware.httpunit.WebConversation;
|
||||||
|
import com.meterware.httpunit.WebRequest;
|
||||||
|
import com.meterware.httpunit.WebResponse;
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
public class TestEPS extends WebappTestCase {
|
||||||
|
/**
|
||||||
|
* Verifies the generation of the EPS for the Bob -> Alice sample
|
||||||
|
*/
|
||||||
|
public void testSimpleSequenceDiagram() throws Exception {
|
||||||
|
WebConversation conversation = new WebConversation();
|
||||||
|
WebRequest request = new GetMethodWebRequest(getServerUrl() + "eps/" + TestUtils.SEQBOB);
|
||||||
|
WebResponse response = conversation.getResource(request);
|
||||||
|
// Analyze response
|
||||||
|
// Verifies the Content-Type header
|
||||||
|
assertEquals("Response content type is not EPS", "application/postscript", response.getContentType());
|
||||||
|
// Get the content and verify its size
|
||||||
|
String diagram = response.getText();
|
||||||
|
int diagramLen = diagram.length();
|
||||||
|
assertTrue(diagramLen > 10000);
|
||||||
|
assertTrue(diagramLen < 12000);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user