1
0
mirror of https://github.com/octoleo/plantuml-server.git synced 2024-12-22 08:48:54 +00:00

Testcases are coming back !

This commit is contained in:
maximesinclair 2013-07-01 22:40:14 +02:00
parent ab77f245f9
commit cbb6eb0ac2
4 changed files with 10 additions and 9 deletions

View File

@ -11,8 +11,8 @@ public class AllTests extends TestSuite {
suite.addTestSuite(TestForm.class); suite.addTestSuite(TestForm.class);
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(TestProxy.class); suite.addTestSuite(TestProxy.class);
//$JUnit-END$ //$JUnit-END$
return suite; return suite;
} }

View File

@ -31,11 +31,12 @@ public class TestImage extends WebappTestCase {
imageStream.write( buf, 0, n); imageStream.write( buf, 0, n);
} }
imageStream.close(); imageStream.close();
responseStream.close();
byte[] inMemoryImage = imageStream.toByteArray(); byte[] inMemoryImage = imageStream.toByteArray();
int diagramLen = inMemoryImage.length; int diagramLen = inMemoryImage.length;
assertTrue( diagramLen > 10000); assertTrue( diagramLen > 10000);
assertTrue( diagramLen < 20000); assertTrue( diagramLen < 20000);
Thread.sleep(500);
responseStream.close();
} }
/** /**

View File

@ -21,7 +21,7 @@ public class TestProxy extends WebappTestCase {
// Analyze response // Analyze response
// Verifies the Content-Type header // Verifies the Content-Type header
//assertEquals( "Response content type is not PNG", "image/png", response.getContentType()); //assertEquals( "Response content type is not PNG", "image/png", response.getContentType());
// Get the image and verify its size (~1600 bytes) // Get the image and verify its size (~2000 bytes)
InputStream responseStream = response.getInputStream(); InputStream responseStream = response.getInputStream();
ByteArrayOutputStream imageStream = new ByteArrayOutputStream(); ByteArrayOutputStream imageStream = new ByteArrayOutputStream();
byte[] buf = new byte[1024]; byte[] buf = new byte[1024];
@ -34,7 +34,7 @@ public class TestProxy extends WebappTestCase {
byte[] inMemoryImage = imageStream.toByteArray(); byte[] inMemoryImage = imageStream.toByteArray();
int diagramLen = inMemoryImage.length; int diagramLen = inMemoryImage.length;
assertTrue( diagramLen > 1500); assertTrue( diagramLen > 1500);
assertTrue( diagramLen < 1700); assertTrue( diagramLen < 2500);
} }
public void testProxyWithFormat() throws Exception { public void testProxyWithFormat() throws Exception {
@ -48,8 +48,8 @@ public class TestProxy extends WebappTestCase {
// Get the content and verify its size // Get the content and verify its size
String diagram = response.getText(); String diagram = response.getText();
int diagramLen = diagram.length(); int diagramLen = diagram.length();
assertTrue( diagramLen > 1700); assertTrue( diagramLen > 1000);
assertTrue( diagramLen < 1800); assertTrue( diagramLen < 3000);
} }
/** /**

View File

@ -19,8 +19,8 @@ public class TestSVG extends WebappTestCase {
// Get the content and verify its size // Get the content and verify its size
String diagram = response.getText(); String diagram = response.getText();
int diagramLen = diagram.length(); int diagramLen = diagram.length();
assertTrue( diagramLen > 1700); assertTrue( diagramLen > 1000);
assertTrue( diagramLen < 1800); assertTrue( diagramLen < 3000);
} }
} }