Author: mes
Date: 2009-11-20 17:21:43 -0800 (Fri, 20 Nov 2009)
New Revision: 18537
Modified:
corelibs/trunk/render.stateful/tests/cytoscape/render/stateful/MeasuredLineCreatorTest.java
Log:
added more tests
Modified:
corelibs/trunk/render.stateful/tests/cytoscape/render/stateful/MeasuredLineCreatorTest.java
===================================================================
---
corelibs/trunk/render.stateful/tests/cytoscape/render/stateful/MeasuredLineCreatorTest.java
2009-11-21 01:07:53 UTC (rev 18536)
+++
corelibs/trunk/render.stateful/tests/cytoscape/render/stateful/MeasuredLineCreatorTest.java
2009-11-21 01:21:43 UTC (rev 18537)
@@ -117,7 +117,37 @@
assertFalse( ml.get(ml.size()-1).getLine().equals("") );
}
+ public void testTotalHeight() {
+ mlc = new MeasuredLineCreator("homerbart lisa
margesmithers",serif,frc,2.0,false,10);
+ printLines("total height",mlc);
+ double h = mlc.getTotalHeight();
+ double total = 0;
+ for ( MeasuredLine ml : mlc.getMeasuredLines() )
+ total += ml.getHeight();
+ assertEquals( total, h, 0.001 );
+ }
+
+ public void testRespectFontHeight() {
+ mlc = new MeasuredLineCreator("homerbart lisa
margesmithers",serif,frc,2.0,false,10);
+ double h1 = mlc.getTotalHeight();
+ printLines("respect font height 1",mlc);
+ mlc = new MeasuredLineCreator("homerbart lisa
margesmithers",sansSerif,frc,2.0,false,10);
+ double h2 = mlc.getTotalHeight();
+ printLines("respect font height 2",mlc);
+
+ assertTrue( h1 < h2 );
+ }
+
+ public void testRespectOverallWidthLimit() {
+ mlc = new MeasuredLineCreator("homer marge bart lisa maggie
smithers",
+ serif,frc,2.0,false,50.0);
+ double mw = mlc.getMaxLineWidth();
+ printLines("respect overall width",mlc);
+
+ assertTrue( mw < (50.0*2.0) );
+ }
+
private void printLines(String title, MeasuredLineCreator mlx) {
System.out.println("------------------------- " + title);
System.out.println("max line width: " + mlx.getMaxLineWidth());
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=.