2017-06-28 11:16:45 +00:00
|
|
|
package net.sourceforge.plantuml.servlet;
|
|
|
|
|
2021-10-11 10:38:37 +00:00
|
|
|
import java.io.IOException;
|
|
|
|
import java.net.URL;
|
|
|
|
import java.net.URLConnection;
|
2017-06-28 11:16:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
public class TestEPS extends WebappTestCase {
|
2021-10-11 10:38:37 +00:00
|
|
|
|
2017-06-28 11:16:45 +00:00
|
|
|
/**
|
|
|
|
* Verifies the generation of the EPS for the Bob -> Alice sample
|
|
|
|
*/
|
2021-10-11 10:38:37 +00:00
|
|
|
public void testSimpleSequenceDiagram() throws IOException {
|
|
|
|
final URL url = new URL(getServerUrl() + "/eps/" + TestUtils.SEQBOB);
|
|
|
|
final URLConnection conn = url.openConnection();
|
2017-06-28 11:16:45 +00:00
|
|
|
// Analyze response
|
|
|
|
// Verifies the Content-Type header
|
2021-10-11 10:38:37 +00:00
|
|
|
assertEquals(
|
|
|
|
"Response content type is not EPS",
|
|
|
|
"application/postscript",
|
|
|
|
conn.getContentType().toLowerCase()
|
|
|
|
);
|
2017-06-28 11:16:45 +00:00
|
|
|
// Get the content and verify its size
|
2021-10-11 10:38:37 +00:00
|
|
|
String diagram = getContentText(conn);
|
2017-06-28 11:16:45 +00:00
|
|
|
int diagramLen = diagram.length();
|
|
|
|
assertTrue(diagramLen > 10000);
|
|
|
|
assertTrue(diagramLen < 12000);
|
|
|
|
}
|
2021-10-11 10:38:37 +00:00
|
|
|
|
2017-06-28 11:16:45 +00:00
|
|
|
}
|