1
0
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:
Jesse Tan 2017-06-28 13:16:45 +02:00
parent 7293235cd6
commit c212cb9488
2 changed files with 28 additions and 0 deletions

View File

@ -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);

View 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);
}
}