Package org.apache.poi.hssf.model

Examples of org.apache.poi.hssf.model.TextboxShape


    public void testResultEqualsToAbstractShape() {
        HSSFWorkbook wb = new HSSFWorkbook();
        HSSFSheet sh = wb.createSheet();
        HSSFPatriarch patriarch = sh.createDrawingPatriarch();
        HSSFTextbox textbox = patriarch.createTextbox(new HSSFClientAnchor());
        TextboxShape textboxShape = HSSFTestModelHelper.createTextboxShape(1025, textbox);

        assertEquals(textbox.getEscherContainer().getChildRecords().size(), 5);
        assertEquals(textboxShape.getSpContainer().getChildRecords().size(), 5);

        //sp record
        byte[] expected = textboxShape.getSpContainer().getChild(0).serialize();
        byte[] actual = textbox.getEscherContainer().getChild(0).serialize();

        assertEquals(expected.length, actual.length);
        assertArrayEquals(expected, actual);

        expected = textboxShape.getSpContainer().getChild(2).serialize();
        actual = textbox.getEscherContainer().getChild(2).serialize();

        assertEquals(expected.length, actual.length);
        assertArrayEquals(expected, actual);

        expected = textboxShape.getSpContainer().getChild(3).serialize();
        actual = textbox.getEscherContainer().getChild(3).serialize();

        assertEquals(expected.length, actual.length);
        assertArrayEquals(expected, actual);

        expected = textboxShape.getSpContainer().getChild(4).serialize();
        actual = textbox.getEscherContainer().getChild(4).serialize();

        assertEquals(expected.length, actual.length);
        assertArrayEquals(expected, actual);

        ObjRecord obj = textbox.getObjRecord();
        ObjRecord objShape = textboxShape.getObjRecord();

        expected = obj.serialize();
        actual = objShape.serialize();

        TextObjectRecord tor = textbox.getTextObjectRecord();
        TextObjectRecord torShape = textboxShape.getTextObjectRecord();

        expected = tor.serialize();
        actual = torShape.serialize();

        assertEquals(expected.length, actual.length);
View Full Code Here


    public void testResultEqualsToAbstractShape() {
        HSSFWorkbook wb = new HSSFWorkbook();
        HSSFSheet sh = wb.createSheet();
        HSSFPatriarch patriarch = sh.createDrawingPatriarch();
        HSSFTextbox textbox = patriarch.createTextbox(new HSSFClientAnchor());
        TextboxShape textboxShape = HSSFTestModelHelper.createTextboxShape(1025, textbox);

        assertEquals(textbox.getEscherContainer().getChildRecords().size(), 5);
        assertEquals(textboxShape.getSpContainer().getChildRecords().size(), 5);

        //sp record
        byte[] expected = textboxShape.getSpContainer().getChild(0).serialize();
        byte[] actual = textbox.getEscherContainer().getChild(0).serialize();

        assertEquals(expected.length, actual.length);
        assertTrue(Arrays.equals(expected, actual));

        expected = textboxShape.getSpContainer().getChild(2).serialize();
        actual = textbox.getEscherContainer().getChild(2).serialize();

        assertEquals(expected.length, actual.length);
        assertTrue(Arrays.equals(expected, actual));

        expected = textboxShape.getSpContainer().getChild(3).serialize();
        actual = textbox.getEscherContainer().getChild(3).serialize();

        assertEquals(expected.length, actual.length);
        assertTrue(Arrays.equals(expected, actual));

        expected = textboxShape.getSpContainer().getChild(4).serialize();
        actual = textbox.getEscherContainer().getChild(4).serialize();

        assertEquals(expected.length, actual.length);
        assertTrue(Arrays.equals(expected, actual));

        ObjRecord obj = textbox.getObjRecord();
        ObjRecord objShape = textboxShape.getObjRecord();

        expected = obj.serialize();
        actual = objShape.serialize();

        TextObjectRecord tor = textbox.getTextObjectRecord();
        TextObjectRecord torShape = textboxShape.getTextObjectRecord();

        expected = tor.serialize();
        actual = torShape.serialize();

        assertEquals(expected.length, actual.length);
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.model.TextboxShape

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.