Package lib

Examples of lib.TestEnvironment


        } catch (com.sun.star.uno.Exception e) {
            e.printStackTrace(log);
            throw new StatusException("Unexpected exception", e);
        }

        TestEnvironment tEnv = new TestEnvironment(oObj);

        return tEnv;
    }
View Full Code Here


        oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class, oSheet);

        log.println("creating a new environment for object");

        TestEnvironment tEnv = new TestEnvironment(oObj);
       
        // do not execute com::sun::star::sheets::XCellSeries::fillAuto()
        tEnv.addObjRelation("XCELLSERIES_FILLAUTO", new Boolean(false));

        // set the adress ranges of the cells (see values set above): for e.g. XSheetOutline test
        tEnv.addObjRelation("CellRangeAddress",
            new CellRangeAddress((short)0, 6, 6, 8, 8));
        tEnv.addObjRelation("CellRangeSubAddress",
            new CellRangeAddress((short)0, 6, 6, 7, 8));
        // pick a cell with a formula for XSheetAuditing, a dependent cell and a precedent cell
        tEnv.addObjRelation("XSheetAuditing.CellAddress", new CellAddress((short)0, 8, 6));
        tEnv.addObjRelation("XSheetAuditing.PrecedentCellAddress", new CellAddress((short)0, 7, 6));
        tEnv.addObjRelation("XSheetAuditing.DependentCellAddress", new CellAddress((short)0, 9, 6));
       
        // add an existing sheet for linking
        tEnv.addObjRelation("XSheetLinkable.LinkSheet", "ScSheetLinksObj.sdc");
       
        //adding Scenario and with that a ScenarioSheet-Relation for Scenario and XScenarioEnhanced
        XScenariosSupplier scene = (XScenariosSupplier) UnoRuntime.queryInterface(
                                           XScenariosSupplier.class,
                                           tEnv.getTestObject());
        scene.getScenarios()
             .addNewByName("Scenario",
                           new CellRangeAddress[] {
            new CellRangeAddress((short) 0, 0, 0, 10, 10)
        }, "Comment");

        XSpreadsheet sSheet = null;
       
        try {
            sSheet = (XSpreadsheet) UnoRuntime.queryInterface(
                             XSpreadsheet.class,
                             xSpreadsheets.getByName("Scenario"));
        } catch (com.sun.star.container.NoSuchElementException e) {
            log.println("Couldn't get Scenario");
        } catch (com.sun.star.lang.WrappedTargetException e) {
            log.println("Couldn't get Scenario");
        }

        tEnv.addObjRelation("ScenarioSheet", sSheet);

        log.println("adding ObjRelation 'noArray' to avoid the test" +
                    " 'XArrayFormulaRange'");
        tEnv.addObjRelation("noArray", "ScTableSheetObj");

        XPropertySet PropSet = (XPropertySet) UnoRuntime.queryInterface(
                                       XPropertySet.class, oObj);
        tEnv.addObjRelation("PropSet", PropSet);
        tEnv.addObjRelation("SHEET", oSheet);

        // add expected results for the XCellRangesQuery interface test
        String[] expectedResults = new String[7];
        expectedResults[_XCellRangesQuery.QUERYCOLUMNDIFFERENCES] = "Sheet1.B5;Sheet1.C1";
        expectedResults[_XCellRangesQuery.QUERYCONTENTCELLS] = "Sheet1.B5;Sheet1.C1;Sheet1.F6";
        expectedResults[_XCellRangesQuery.QUERYEMPTYCELLS] = "Sheet1.A1 ... Sheet1.B1 ... Sheet1.B6 ... Sheet1.C2 ... Sheet1.D1 ... Sheet1.F1 ... Sheet1.F7 ... Sheet1.G1";
        expectedResults[_XCellRangesQuery.QUERYFORMULACELLS] = "Sheet1.I7:J7;Sheet1.I9";
        expectedResults[_XCellRangesQuery.QUERYINTERSECTION] = "Sheet1.D4";
        expectedResults[_XCellRangesQuery.QUERYROWDIFFERENCES] = "Sheet1.A5;Sheet1.C1";
        expectedResults[_XCellRangesQuery.QUERYVISIBLECELLS] = "Sheet1.A2";
        tEnv.addObjRelation("XCellRangesQuery.EXPECTEDRESULTS",
                            expectedResults);

        // for XFormulaQuery interface test
        try {
            tEnv.addObjRelation("MAKEENTRYINCELL",
                                oSheet.getCellByPosition(15, 15));
            tEnv.addObjRelation("RANGEINDICES", new int[] { 0, 0 });
            tEnv.addObjRelation("EXPECTEDDEPENDENTVALUES",
                                new int[] { 0, 255, 0, 65535 });
            tEnv.addObjRelation("EXPECTEDPRECEDENTVALUES",
                                new int[] { 0, 255, 0, 65535 });
        } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
            log.println(
                    "Cannot add the necessary object relation for XFormulaQuery test.");
        }

        // XSearchable interface test
        try {
            tEnv.addObjRelation("XSearchable.MAKEENTRYINCELL",
                                new XCell[] {
                oSheet.getCellByPosition(15, 15),
                oSheet.getCellByPosition(15, 16)
            });
        } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
            e.printStackTrace((PrintWriter) log);
            log.println(
                    "Cannot make required object relation 'XSearchable.MAKEENTRYINCELL'.");
        }

        //Adding relation for util.XSortable
        final PrintWriter finalLog = log;
        final XCellRange oTable = oSheet;
        tEnv.addObjRelation("SORTCHECKER",
                            new ifc.util._XSortable.XSortChecker() {
            PrintWriter out = finalLog;

            public void setPrintWriter(PrintWriter log) {
                out = log;
View Full Code Here

            log.println("Exception occured while creating test Object.");
            e.printStackTrace(log);
            throw new StatusException("Couldn't create test object", e);
        }

        TestEnvironment tEnv = new TestEnvironment(oObj) ;

        tEnv.addObjRelation("ENUM", xTextFieldsSupp.getTextFields());

        return tEnv;
    }
View Full Code Here

        oObj = ea.createEnumeration();

        log.println("ImplementationName: "+util.utils.getImplName(oObj));
        // creating test environment
        TestEnvironment tEnv = new TestEnvironment( oObj );

        tEnv.addObjRelation("ENUM",ea);

        return tEnv;
    }
View Full Code Here

            UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet);
        XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns();
        oObj = oColumns;

        log.println("creating a new environment for object");
        TestEnvironment tEnv = new TestEnvironment(oObj);

        // adding relation for XTableColumns
        tEnv.addObjRelation("XTableColumns.XCellRange",
            UnoRuntime.queryInterface(XCellRange.class, xSpreadsheet));

        return tEnv;
    }
View Full Code Here

        oDP.insertNewByIndex(1);
        oDP.insertNewByIndex(2);
        oObj = oDP;

        log.println( "creating a new environment for drawpage object" );
        TestEnvironment tEnv = new TestEnvironment( oObj );

        return tEnv;
    } // finish method getTestEnvironment
View Full Code Here

        }
       
        log.println ("Creating object - " +
            ((oObj == null) ? "FAILED" : "OK"));
       
        TestEnvironment tEnv = new TestEnvironment (oObj);
       
        log.println ("Implementationname: " + util.utils.getImplName (oObj));
       
        // Other parameters required for interface tests
        return tEnv;
View Full Code Here

        oObj = ea.createEnumeration();

        log.println("ImplementationName: "+util.utils.getImplName(oObj));
        // creating test environment
        TestEnvironment tEnv = new TestEnvironment( oObj );

        tEnv.addObjRelation("ENUM",ea);
        return tEnv;
    }
View Full Code Here

            throw new StatusException("Couldn't create document settings", e);
        }

        log.println("Implementationname: " + util.utils.getImplName(oObj));

        TestEnvironment tEnv = new TestEnvironment((XInterface) oObj);

        return tEnv;
    }
View Full Code Here

        } catch(com.sun.star.lang.IllegalArgumentException e){
            e.printStackTrace(log);
            throw new StatusException("Couldn't get by name", e);
        }

        TestEnvironment tEnv = new TestEnvironment( oObj );

        // Other parameters required for interface tests
        tEnv.addObjRelation("DATAAREA", DataArea);

        return tEnv;
    }
View Full Code Here

TOP

Related Classes of lib.TestEnvironment

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.