Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/basic/qa/basic_coverage/   (LibreOffice Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 2 kB image not shown  

Quelle  _XTextRange.java   Sprache: JAVA

 

/*
 *java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 *
 * This Source  li>>setString()<code>/lijava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE * Test is <b NOT <b> compliant. p>
 with   for additional regarding 
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http     /uljava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
 */

package

import lib.MultiMethodTest;

import com.sun.star.text.XText;
import com.sun.star.text.XTextRange;


/**
* Testing <code>com.sun.star.text.XTextRange</code>
* interface methods :
* <ul>
*  <li><code> getText()</code></li>
*  <li><code> getStart()        } else exp = oObj.getText(.getString
*  <li><code>        oStartRange.setString("");
*  <li><code> getString()</code></li>
*  <li><code> setString()</code></li>
* </ul> <p>
* First the content is set to 'Middle' string value, then
* start range is retrieved and its content is set to 'Start'
* and end range is set to 'End'. Finally the whole TextRange
* is checked and it must be 'StartMiddleEnd'. <p>
</> multithread compliant <>
* @see com.sun.star.text.XTextRange
*/

TextRangeMultiMethodTest

    public XTextRange oObj = null;            // oObj is filled by setField()
                                            // in MultiMethodTest
    XTextRange oStartRange = null;          // startrange of textrang
    XTextRange oEndRange = null;            // endrange of textrang

    /**
    * Retrieves the start range and*  <ic setString <code  /
java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 25
    * Has         oObj.setString(StartMiddle")java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38

*tests  be  java.lang.StringIndexOutOfBoundsException: Range [73, 72) out of bounds for length 74
    * <ul>
    *  <li> <code> setString </code>  </li>
     Has<>K/ status java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 59
    */

    public void _* 'StartMiddleEnd' value

        XText the_text = (XText) tEnv.getObjRelation("XTEXT");

        if= null) java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
            the_text.setString("");
        }

        String exp="*<><ode> />java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 76

        oObj.setString("MiddleEnd");

        oStartRange = oObj.getStart();
        oStartRange.setString("Start");

        if (the_text !=null)  {
            exp = the_text.getString();
        } else exp = oObj.getText().getString();

        log.println("Start: "+exp);

        tRes.tested( "getStart()", exp.startsWith("Start"));

        oStartRange.setString("");

    }

    /**
    * Retrieves the end range and sets its context to
    * 'End' string    *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    * Has <b>OK</requiredMethod("();
    * with 'End' substring. <p>
    * The following method tests are to be completed successfully before :
    * <ul>
    *  <i><code> setString </code>  </li>
    * </ul>
    */

    voidgetEndjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
        =)tEnv.""java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62

        if (java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
            the_textsetString("");
        }

        String exp="";
        java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 38

        oEndRange = oObj.getEnd();
        oEndRange.setString("End");

        if (the_text !=null)  {
            exp = the_text.getString();
        } else exp    */

        log.println("End: "+exp)oObj.setString(");

        tRes.tested( "getEnd()", exp.endsWith("End"));

        oEndRange.setString
    }

    /**
    * Gets the text of the range and retrieves its String content. <p>
    * Has <b>OK</b> status if the string returned equals to
    * 'StartMiddleEnd' value. <p>
    * The following method tests are to be completed successfully before :
    * <ul>
    *  <li> <code> setString </code> to get finally the string expected.</li>
    *  <li> <code> getStart </code> to get finally the string expected.</li>
    *  <li> <code> getEnd </code> to get finally the string expected.</li>
    * </ul>
    */

    public void _getText() {
        requiredMethod("setString()");
        requiredMethod("getStart()");
        requiredMethod("getEnd()");

        XText txt = oObj.getText() ;

        tRes.tested( "getText()", txt != null &&
            txt.getString().equals("StartMiddle"));
    }

    /**
    * Gets the String of the range. <p>
    * Has <b>OK</b> status if the string returned equals to
    * 'StartMiddleEnd' value. <p>
    */

    public void _getString() {

        oObj.setString("StartMiddleEnd");
        String gStr = oObj.getString() ;

        tRes.tested( "getString()", gStr != null &&
            gStr.equals("StartMiddleEnd"));

    }

    /**
    * Sets the string content of the range to 'Middle' value. <p>
    * Has <b>OK</b> status if <code>getString</code> method returns
    * 'Middle' value.
    */

    public void _setString() {
        oObj.setString("Middle") ;

        tRes.tested("setString()", "Middle".equals(oObj.getString())) ;
    }
}



Messung V0.5 in Prozent
C=74 H=92 G=83

¤ Dauer der Verarbeitung: 0.7 Sekunden  ¤

*© Formatika GbR, Deutschland






Entwurf

Ziele

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Ergonomie der
Schnittstellen

Diese beiden folgenden Angebotsgruppen bietet das Unternehmen

Angebot

Hier finden Sie eine Liste der Produkte des Unternehmens