poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From one...@apache.org
Subject svn commit: r1748073 - /poi/branches/ss_border_property_template/src/testcases/org/apache/poi/ss/util/TestBorderPropertyTemplate.java
Date Mon, 13 Jun 2016 00:50:52 GMT
Author: onealj
Date: Mon Jun 13 00:50:52 2016
New Revision: 1748073

URL: http://svn.apache.org/viewvc?rev=1748073&view=rev
Log:
test copy constructor: make changes to same range: this is a better test for deepcopy

Modified:
    poi/branches/ss_border_property_template/src/testcases/org/apache/poi/ss/util/TestBorderPropertyTemplate.java

Modified: poi/branches/ss_border_property_template/src/testcases/org/apache/poi/ss/util/TestBorderPropertyTemplate.java
URL: http://svn.apache.org/viewvc/poi/branches/ss_border_property_template/src/testcases/org/apache/poi/ss/util/TestBorderPropertyTemplate.java?rev=1748073&r1=1748072&r2=1748073&view=diff
==============================================================================
--- poi/branches/ss_border_property_template/src/testcases/org/apache/poi/ss/util/TestBorderPropertyTemplate.java
(original)
+++ poi/branches/ss_border_property_template/src/testcases/org/apache/poi/ss/util/TestBorderPropertyTemplate.java
Mon Jun 13 00:50:52 2016
@@ -47,11 +47,7 @@ public final class TestBorderPropertyTem
     @Test
     public void createTemplateFromExisting() throws IOException {
         CellRangeAddress a1a1 = new CellRangeAddress(0, 0, 0, 0); //A1:A1
-        CellRangeAddress b2b2 = new CellRangeAddress(1, 1, 1, 1); //B2:B2
-        CellRangeAddress c3c3 = new CellRangeAddress(2, 2, 2, 2); //C3:C3
         CellAddress a1 = new CellAddress(0, 0); //A1
-        CellAddress b2 = new CellAddress(1, 1); //B2
-        CellAddress c3 = new CellAddress(2, 2); //C3
 
         BorderPropertyTemplate pt1 = new BorderPropertyTemplate();
         pt1.drawBorders(a1a1, BorderStyle.THIN, RED, BorderExtent.TOP);
@@ -63,16 +59,18 @@ public final class TestBorderPropertyTem
         assertRed(pt2.getTemplateProperty(a1, CellUtil.TOP_BORDER_COLOR));
 
         // Changes to original template should not affect copied template.
-        pt1.drawBorders(b2b2, BorderStyle.THIN, RED, BorderExtent.TOP);
-        assertEquals(0, pt2.getNumBorders(b2));
-        assertNull(pt2.getTemplateProperty(b2, CellUtil.BORDER_TOP));
-        assertNull(pt2.getTemplateProperty(b2, CellUtil.TOP_BORDER_COLOR));
+        assertEquals(1, pt2.getNumBorders(a1));
+        pt1.drawBorders(a1a1, BorderStyle.THIN, RED, BorderExtent.LEFT);
+        assertEquals(1, pt2.getNumBorders(a1));
+        assertNull(pt2.getTemplateProperty(a1, CellUtil.BORDER_LEFT));
+        assertNull(pt2.getTemplateProperty(a1, CellUtil.LEFT_BORDER_COLOR));
 
         // Changes to copied template should not affect original template
-        pt2.drawBorders(c3c3, BorderStyle.THIN, RED, BorderExtent.TOP);
-        assertEquals(0, pt1.getNumBorders(c3));
-        assertNull(pt1.getTemplateProperty(c3, CellUtil.BORDER_TOP));
-        assertNull(pt1.getTemplateProperty(c3, CellUtil.TOP_BORDER_COLOR));
+        assertEquals(2, pt1.getNumBorders(a1));
+        pt2.drawBorders(a1a1, BorderStyle.THIN, RED, BorderExtent.RIGHT);
+        assertEquals(2, pt1.getNumBorders(a1));
+        assertNull(pt1.getTemplateProperty(a1, CellUtil.BORDER_RIGHT));
+        assertNull(pt1.getTemplateProperty(a1, CellUtil.RIGHT_BORDER_COLOR));
     }
 
     @Test



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message