poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From one...@apache.org
Subject svn commit: r1742866 - in /poi/trunk/src/testcases/org/apache/poi: hssf/usermodel/TestHSSFComment.java ss/usermodel/BaseTestCellComment.java
Date Mon, 09 May 2016 03:35:45 GMT
Author: onealj
Date: Mon May  9 03:35:45 2016
New Revision: 1742866

URL: http://svn.apache.org/viewvc?rev=1742866&view=rev
Log:
move TestHSSFComment#attemptToSave2CommentsWithSameCoordinates down to BaseTestCellComment

Modified:
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFComment.java
    poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCellComment.java

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFComment.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFComment.java?rev=1742866&r1=1742865&r2=1742866&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFComment.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFComment.java Mon May  9
03:35:45 2016
@@ -455,23 +455,4 @@ public final class TestHSSFComment exten
         
         wb.close();
     }
-    
-    @Test
-    public void attemptToSave2CommentsWithSameCoordinates(){
-        Object err = null;
-        
-        HSSFWorkbook wb = new HSSFWorkbook();
-        HSSFSheet sh = wb.createSheet();
-        HSSFPatriarch patriarch = sh.createDrawingPatriarch();
-        patriarch.createCellComment(new HSSFClientAnchor());
-        patriarch.createCellComment(new HSSFClientAnchor());
-        
-        try{
-            HSSFTestDataSamples.writeOutAndReadBack(wb);
-        } catch (IllegalStateException e){
-            err = 1;
-            assertEquals(e.getMessage(), "found multiple cell comments for cell $A$1");
-        }
-        assertNotNull(err);
-    }
 }

Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCellComment.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCellComment.java?rev=1742866&r1=1742865&r2=1742866&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCellComment.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCellComment.java Mon May 
9 03:35:45 2016
@@ -23,6 +23,7 @@ import static org.junit.Assert.assertFal
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.io.IOException;
 
@@ -354,4 +355,21 @@ public abstract class BaseTestCellCommen
         
         wb.close();
     }
+    
+    @Test
+    public void attemptToSave2CommentsWithSameCoordinates(){
+        Workbook wb = _testDataProvider.createWorkbook();
+        Sheet sh = wb.createSheet();
+        CreationHelper factory = wb.getCreationHelper();
+        Drawing patriarch = sh.createDrawingPatriarch();
+        patriarch.createCellComment(factory.createClientAnchor());
+        patriarch.createCellComment(factory.createClientAnchor());
+        
+        try{
+            _testDataProvider.writeOutAndReadBack(wb);
+            fail("Expected IllegalStateException(found multiple cell comments for cell $A$1");
+        } catch (IllegalStateException e){
+            assertEquals("found multiple cell comments for cell $A$1", e.getMessage());
+        }
+    }
 }



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


Mime
View raw message