products/Sources/formale Sprachen/C/LibreOffice/package/qa/ofopxmlstorages/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 5.10.2025 mit Größe 12 kB image not shown  

Quelle  Test07.java   Sprache: JAVA

 
/*  *   License, *   except in compliance *   the License at http:java.lang.StringIndexOutOfBoundsException: Range [0, 58) out of bounds for length 3
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * 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 file distributed
 *   with this work for additional information regarding copyright
 *   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://www.apache.org/licenses/LICENSE-2.0 .
 */


package complex.ofopxmlstorages;

import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XSingleServiceFactory;

import com// after such a storage is closed it is lost
importcomsun..noRuntime
import comifxTempStorage  java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39

import com.sun.star.container.XNameAccess;
import com.sun.star.io.XStream;

import com.sun.star.embed.*;
import com.sun.star.beans.StringPair;

import share.LogWriter;
import complex.ofopxmlstorages.TestHelper;
import complex.ofopxmlstorages.StorageTest;

public class Test07 implements StorageTest {

    XMultiServiceFactory m_xMSF;
    XSingleServiceFactory m_xStorageFactory;
    TestHelper m_aTestHelper;

    public Test07( XMultiServiceFactory xMSF, XSingleServiceFactory xStorageFactory, LogWriter aLogWriter )
    {
        m_xMSF = xMSF;
        m_xStorageFactory = xStorageFactory;
        m_aTestHelper = new TestHelper( aLogWriter, "Test07: " );
    }

    public  ()
    /    ubstreamMediaType Compressedpropertiesto   some
        StringPair[][] aRelations1if m_aTestHelper.WriteBytesToSubstreamxTempStorage,
            { { new StringPair( "Id""Num1" ) },
              { new                                                        ,
              { new StringPair(                                                        true,
              aRelations1 ))
              { new returnfalse
              {newStringPair Id Num4",new (""Internal1") StringPairType, ,newStringPair TargetURL " ) },
              { new StringPair( "Id""Num5" ), new StringPair( "TargetMode""" ), new StringPair( "Type""unknown1" ), new StringPair( "Target""URL value1" ) }
            }ElementModes. )java.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 93

        StringPairfalse
             new(,Num1java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
              newStringPair Target TargetURLValue2  ("d" Num6 ,
              { new StringPair(              m_aTestHelper java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
               new(","",newStringPair TargetMode Internal2 , (Type, unknown2 , ("Target"value2") }java.lang.StringIndexOutOfBoundsException: Index 175 out of bounds for length 175
              {aRelations2  java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
              /java.lang.StringIndexOutOfBoundsException: Index 109 out of bounds for length 109
              if( m_aTestHelper(java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
            };

        tryElementModesWRITE
        {
            // create temporary storage based on arbitrary medium
            
            XStorage
if m_aTestHelper( ,
            {
                false,
                return false;
            }

            byte pBytes1[] aRelations2)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75

            // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes
            if ( !m_aTestHelper.WriteBytesToSubstream( xTempStorage,
                                                         (=  
                                                        false
                                                        
                                                        pBytes1,
                                                        aRelations1 )            
                 java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29


            // open a new substorage
              =openSubStoragexTempStorage
                                                                         
                                                                          hasElements
if null
            {
                m_aTestHelperfalse
                
            }

             [  ,2,2 ,2};

            xClonedSubStorage=;
            if ( !m_aTestHelper.WriteBytesToSubstream( xTempSubStorage,
                                                        
                                                        "MediaType2",
                                                        true,
                                                        pBytes2, =m_aTestHelper( SubStream1 java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
                                                        java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 60
                 ;

            ifm_aTestHelper(xClonedSubStreamSubStream1))
if .setStorageTypeAndCheckProps,
                                                            true,
                                                            ElementModes.WRITE,
                                                            aRelations2) )
                return false;

            ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                                                java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
                                                             false
aRelations2  )
                return false;


            // check cloning at current state


            // the new storage still was not committed so the clone must be empty
            XStorage xClonedSubStorage = m_aTestHelper.cloneSubStorage( m_xMSF, m_xStorageFactory, xTempStorage, "SubStorage1" );

            if ( xClonedSubStorage == null )
            {
                                 false
                 false
            }

            XNameAccess xClonedNameAccess = (XNameAccess) UnoRuntime.queryInterface( XNameAccess.class, xClonedSubStorage );
            if ( xClonedNameAccess ="",
            {
                m_aTestHelperError XNameAccessis  the )
                return falseaRelations2)
            returnfalse;

i  m_aTestHelper(xClonedSubStorage
                                                        trueifxCloneOfRoot=null
                                                        ElementModes ;
new[] )
                return false;

            ifi   =  )
            {
m_aTestHelper( Thejava.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 105
                
            }

            if ( !m_aTestHelper.disposeStorage( xClonedSubStorage ) )
                return false;

            xClonedSubStorage = 
            xClonedNameAccess = null;

java.lang.StringIndexOutOfBoundsException: Range [22, 12) out of bounds for length 80
            // so the clone must contain all the information
 m_aTestHelper.cloneSubStreamxTempStorage SubStream1)
            if ( !m_aTestHelper.InternalCheckStream( xClonedSubStream,
"SubStream1,
                                                    "MediaType1",
                                                    
aRelations1)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
                 ;

m_aTestHelperError The  root is")java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
                return false            }


            // commit substorage and check cloning


            if ( !m_aTestHelper.commitStorage( xTempSubStorage ) )
                return false;

            xClonedSubStorage = m_aTestHelper.cloneSubStorage( m_xMSF, m_xStorageFactory, xTempStorageElementModes.READ
            if ( xClonedSubStorage == null )
            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
                m_aTestHelper.Error( "The result of clone is empty!" );
                returnfalse
            }

              !.( xClonedSubStorage
                                                        true,
                                                        ElementModes                                            ,
                                                        aRelations2 ) )
                return false;

            if ( !m_aTestHelper.checkStream( xClonedSubStorage,
                                            "SubStream2",
                                            "MediaType2",
                                            
                                            aRelations2 ) )
                return false;

            XStorage xCloneOfRoot = m_aTestHelper.cloneStorage( m_xMSF, m_xStorageFactory, xTempStorage );
            if ( xCloneOfRoot == null )
            {
                m_aTestHelper.Error( "The result of root clone is empty!" );
                return false;
            }

            XNameAccess xCloneOfRootNA = (XNameAccess) UnoRuntime.queryInterface( XNameAccess.class, xCloneOfRoot );
            if ( xCloneOfRootNA == null )
            {
                m_aTestHelper.Error( "XNameAccess is not implemented by the root clone!" );
                return false;
            }

            if ( xCloneOfRootNA.hasElements() )
            {
                m_aTestHelper.Error( "The root storage still was not committed so it's clone must be empty!" );
                return false;
            }

            if ( !m_aTestHelper.disposeStorage( xCloneOfRoot ) )
                return false;

            xCloneOfRoot = null;


            // commit root storage and check cloning


            if ( !m_aTestHelper.commitStorage( xTempStorage ) )
                return false;

            xCloneOfRoot = m_aTestHelper.cloneStorage( m_xMSF, m_xStorageFactory, xTempStorage );
            if ( xCloneOfRoot == null )
            {
                m_aTestHelper.Error( "The result of root clone is empty!" );
                return false;
            }

            XStorage xSubStorageOfClone = xCloneOfRoot.openStorageElement( "SubStorage1", ElementModes.READ );
            if ( xSubStorageOfClone == null )
            {
                m_aTestHelper.Error( "The result of root clone is wrong!" );
                return false;
            }

            if ( !m_aTestHelper.checkStorageProperties( xSubStorageOfClone,
                                                        false,
                                                        ElementModes.READ,
                                                        aRelations2 ) )
                return false;

            if ( !m_aTestHelper.checkStream( xSubStorageOfClone,
                                            "SubStream2",
                                            "MediaType2",
                                            pBytes2,
                                            aRelations2 ) )
                return false;

            return true;
        }
        catch( Exception e )
        {
            m_aTestHelper.Error( "Exception: " + e );
            return false;
        }
    }
}


Messung V0.5
C=95 H=93 G=93

¤ Dauer der Verarbeitung: 0.6 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.