move TestHSSFComment#attemptToSave2CommentsWithSameCoordinates down to BaseTestCellComment
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1742866 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
94e4eb5276
commit
88d0eee64b
@ -455,23 +455,4 @@ public final class TestHSSFComment extends BaseTestCellComment {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import static org.junit.Assert.assertFalse;
|
||||
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 BaseTestCellComment {
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user