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:
parent
ab77f245f9
commit
cbb6eb0ac2
@ -11,8 +11,8 @@ 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);
|
||||
suite.addTestSuite(TestSVG.class);
|
||||
suite.addTestSuite(TestProxy.class);
|
||||
//$JUnit-END$
|
||||
return suite;
|
||||
}
|
||||
|
@ -31,11 +31,12 @@ public class TestImage extends WebappTestCase {
|
||||
imageStream.write( buf, 0, n);
|
||||
}
|
||||
imageStream.close();
|
||||
responseStream.close();
|
||||
byte[] inMemoryImage = imageStream.toByteArray();
|
||||
int diagramLen = inMemoryImage.length;
|
||||
assertTrue( diagramLen > 10000);
|
||||
assertTrue( diagramLen < 20000);
|
||||
Thread.sleep(500);
|
||||
responseStream.close();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -21,7 +21,7 @@ public class TestProxy extends WebappTestCase {
|
||||
// Analyze response
|
||||
// Verifies the Content-Type header
|
||||
//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();
|
||||
ByteArrayOutputStream imageStream = new ByteArrayOutputStream();
|
||||
byte[] buf = new byte[1024];
|
||||
@ -34,7 +34,7 @@ public class TestProxy extends WebappTestCase {
|
||||
byte[] inMemoryImage = imageStream.toByteArray();
|
||||
int diagramLen = inMemoryImage.length;
|
||||
assertTrue( diagramLen > 1500);
|
||||
assertTrue( diagramLen < 1700);
|
||||
assertTrue( diagramLen < 2500);
|
||||
}
|
||||
|
||||
public void testProxyWithFormat() throws Exception {
|
||||
@ -48,8 +48,8 @@ public class TestProxy extends WebappTestCase {
|
||||
// Get the content and verify its size
|
||||
String diagram = response.getText();
|
||||
int diagramLen = diagram.length();
|
||||
assertTrue( diagramLen > 1700);
|
||||
assertTrue( diagramLen < 1800);
|
||||
assertTrue( diagramLen > 1000);
|
||||
assertTrue( diagramLen < 3000);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -19,8 +19,8 @@ public class TestSVG extends WebappTestCase {
|
||||
// Get the content and verify its size
|
||||
String diagram = response.getText();
|
||||
int diagramLen = diagram.length();
|
||||
assertTrue( diagramLen > 1700);
|
||||
assertTrue( diagramLen < 1800);
|
||||
assertTrue( diagramLen > 1000);
|
||||
assertTrue( diagramLen < 3000);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user