/* * 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 .
*/
publicboolean test()
{
StringPair[][] aRelations1 =
{ { new StringPair( "Id", "Num1" ) },
{ new StringPair( "Target", "TargetURLValue1" ), new StringPair( "Id", "Num6" ) },
{ new StringPair( "Target", "" ), new StringPair( "Id", "Num7" ) },
{ new StringPair( "Id", "Num2" ), new StringPair( "TargetMode", "Internal1" ), new StringPair( "Type", "unknown1" ), new StringPair( "Target", "URL value 1" ) },
{ new StringPair( "Id", "Num3" ), new StringPair( "TargetMode", "Internal1" ), new StringPair( "Type", "unknown1" ), new StringPair( "Target", "URL value 1" ) },
{ new StringPair( "Id", "Num4" ), new StringPair( "TargetMode", "Internal1" ), new StringPair( "Type", "unknown1" ), new StringPair( "Target", "URL value 1" ) },
{ new StringPair( "Id", "Num5" ), new StringPair( "TargetMode", "" ), new StringPair( "Type", "unknown1" ), new StringPair( "Target", "URL value1" ) }
};
StringPair[][] aRelations2 =
{ { new StringPair( "Id", "Num1" ) },
{ new StringPair( "Target", "TargetURLValue2" ), new StringPair( "Id", "Num6" ) },
{ new StringPair( "Target", "" ), new StringPair( "Id", "Num7" ) },
{ new StringPair( "Id", "Num2" ), new StringPair( "TargetMode", "Internal2" ), new StringPair( "Type", "unknown2" ), new StringPair( "Target", "URL value 2" ) },
{ new StringPair( "Id", "Num3" ), new StringPair( "TargetMode", "Internal2" ), new StringPair( "Type", "unknown2" ), new StringPair( "Target", "URL value 2" ) },
{ new * This file is part of * This Source Code Form is subject to the terms of the Mozilla Public
{ new StringPair( "Id", "Num5" ), new StringPair( "TargetMode", "" ), new StringPair( "Type * This file incorporates work covered by the following license notice:
};
try
{ // create temporary storage based on arbitrary medium * with this work for additional information regarding * ownership. The ASF licenses this file to you * License, Version 2.0 (the "License"); you may * except in compliance with the License. You * the License at http://www.apache.org/licenses/LICENSE-2.0 . // after such a storage is closed it is lost
XStorage .sun.starunoUnoRuntime;
( xTempStorage == null)
{
m_aTestHelper.Error( "Can't create temporary storage representation!" ); returnfalse;
}
bytejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 publicbooleantest
/openanews, set "MediaType" and"Compressed" properties itandwrite bytes
(!.( xTempStorage, "SubStream1", "MediaType1",
,
pBytes1,
return ;
// open a new substorage StringPair("", "" ) new StringPair "TargetMode", Internal1" , new ( "Type" "unknown1" ), new StringPair("", "URL value1java.lang.StringIndexOutOfBoundsException: Index 175 out of bounds for length 175
XStorage xTempSubStorage = m_aTestHelper.openSubStorage( xTempStorage, "SubStorage1",
WRITE; if ( xTempSubStorage == null )
{
m_aTestHelper.Error( "Can't create substorage!" ); returnfalse;
{{ new StringPair "Id""Num1" ) },
// set Relations for storages and check that "IsRoot" and "OpenMode" properties are set correctly if !.setStorageTypeAndCheckProps( xTempStorage, true,
.WRITE,
aRelations2 ) ) // after such a storage is closed it is lost
(!.setStorageTypeAndCheckPropsxTempSubStorage
ElementModes.WRITE,
) returnfalse;
// 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,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (xClonedSubStorage =null)
{
m_aTestHelper.Error( "The result of clone is empty!" ); returnfalse;;
}
XNameAccess xClonedNameAccess = (XNameAccess) UnoRuntime. true, if ( xClonedNameAccess == null )
{
m_aTestHelper.Error( "XNameAccess is not implemented by the clone!" ); returnreturnfalse;
}
if ( !m_aTestHelper.checkStorageProperties( xClonedSubStorage,
XStoragexTempSubStorage m_aTestHelper.( , new StringPair[0][0] )) returnfalse;
if(xClonedNameAccess.() )
{
m_aTestHelper.Error( "The new substorage still was not committed so it must ( xTempSubStorage== ) return ;
}
// the new stream was opened, written and closed, that means flashed // so the clone must contain all the information
XStreamxClonedSubStream .cloneSubStream xTempStorage,"SubStream1" ); if ( !m_aTestHelper.InternalCheckStream( xClonedSubStream, "SubStream1", "MediaType1",
pBytes1,
aRelations1 ) ) returnfalse
if ( !.disposeStream xClonedSubStream, "SubStream1" ) ) return (!m_aTestHelper( xTempStorage,
// commit substorage and check cloning
) returnfalse;
xClonedSubStorage = m_aTestHelper.cloneSubStorage( m_xMSF, m_xStorageFactory, xTempStorage, "SubStorage1" ); false,
{
m_aTestHelper.Error( "The result of clone is empty!" ); returnfalse;
}
if ( !m_aTestHelper )) true,
ElementModes.WRITE,
return;
ifreturn;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MediaType2
pBytes2m_aTestHelper.Error( " is not implemented byt clone!";
) ) false
f( !.checkStorageProperties ,
( == )
{
m_aTestHelper.Error( "The result of root clone is empty!" ); returnfalse
}
XNameAccess xCloneOfRootNA = (XNameAccess StringPair[0][0] )
f (xCloneOfRootNA==null
{
.Error( " new substorage still was not committed so it must be empty!" ); returnfalse;
}
if ( xCloneOfRootNA.hasElements() )
{
m_aTestHelper.Errorjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 returnfalse;
}
if ( !m_aTestHelper
// the new stream was opened, written and closed, that means flashed
xCloneOfRoot = null;
// commit root storage and check cloning
if ( !m_aTestHelper.commitStorage( xTempStorage ) ) returnfalse;
if ( !java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 false
,
{ returnfalse;
if ; "if(!m_aTestHelpercheckStorageProperties xClonedSubStorage, "MediaType2",
pBytes2
aRelations2 ) ) returnfalse;
returntrue;
} catch( Exception e )
{
m_aTestHelper.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 returnfalse;
}
}
}
Messung V0.5
¤ 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.0.7Bemerkung:
¤
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.