Commit cbb6eb0a authored by maximesinclair's avatar maximesinclair
Browse files

Testcases are coming back !

parent ab77f245
......@@ -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);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment