/** returns the URL of a temporary file which can be used during the test. * *Thefilewillbedeletedwhentheprocessexits *@returntheURLofatemporaryfile
*/ protectedfinal String createTempFileURL() throws IOException
{ final File documentFile = java.io.File.createTempFile( "dbaccess_test", ".odb" ).getAbsoluteFile(); if ( documentFile.exists() )
{
documentFile.delete();
} return FileHelper.getOOoCompatibleFileURL( documentFile.toURI().toURL().toString() );
}
/** *copiesthefilegivenbyURLtoatemporaryfile *@return *theURLofthenewfile
*/ protectedfinal String copyToTempFile( String _sourceURL ) throws IOException
{ final String targetURL = createTempFileURL(); try
{
FileTools.copyFile( new File( new URI( _sourceURL ) ), new File( new URI( targetURL ) ) );
} catch ( URISyntaxException e ) { }
/** invokes a given method on a given object, and assures a certain exception is caught *@param_message *isthemessagetoprintwhenthecheckfails *@param_object *istheobjecttoinvokethemethodon *@param_methodName *isthenameofthemethodtoinvoke *@param_methodArgs *aretheargumentstopasstothemethod. *@param_argClasses *aretheclassestoassumefortheargumentsofthemethods *@param_expectedExceptionClass *istheclassoftheexceptiontobecaught.Ifthisisnull, *itmeansthat<em>no</em>exceptionmustbethrowbyinvokingthemethod.
*/ privatevoid assureException( final String _message, final Object _object, final String _methodName, finalClass[] _argClasses, final Object[] _methodArgs, finalClass _expectedExceptionClass )
{ Class<?> objectClass = _object.getClass();
/** invokes a given method on a given object, and assures a certain exception is caught *@param_messageisthemessagetoprintwhenthecheckfails *@param_objectistheobjecttoinvokethemethodon *@param_methodNameisthenameofthemethodtoinvoke *@param_methodArgsaretheargumentstopasstothemethod.Thoseimplicitlydefine *theclassesoftheargumentsofthemethodwhichiscalled. *@param_expectedExceptionClassistheclassoftheexceptiontobecaught.Ifthisisnull, *itmeansthat<em>no</em>exceptionmustbethrowbyinvokingthemethod.
*/ privatevoid assureException( final String _message, final Object _object, final String _methodName, final Object[] _methodArgs, finalClass _expectedExceptionClass )
{ Class[] argClasses = newClass[ _methodArgs.length ]; for ( int i=0; i<_methodArgs.length; ++i )
argClasses[i] = _methodArgs[i].getClass();
assureException( _message, _object, _methodName, argClasses, _methodArgs, _expectedExceptionClass );
}
/** invokes a given method on a given object, and assures a certain exception is caught *@param_objectistheobjecttoinvokethemethodon *@param_methodNameisthenameofthemethodtoinvoke *@param_methodArgsaretheargumentstopasstothemethod.Thoseimplicitlydefine *theclassesoftheargumentsofthemethodwhichiscalled. *@param_expectedExceptionClassistheclassoftheexceptiontobecaught.Ifthisisnull, *itmeansthat<em>no</em>exceptionmustbethrowbyinvokingthemethod.
*/ privatevoid assureException( final Object _object, final String _methodName, final Object[] _methodArgs, finalClass _expectedExceptionClass )
{
assureException( "did not catch the expected exception (" +
( ( _expectedExceptionClass == null ) ? "none" : _expectedExceptionClass.getName() ) + ") while calling " + _object.getClass().getName() + "." + _methodName,
_object, _methodName, _methodArgs, _expectedExceptionClass );
}
/** invokes a given method on a given object, and assures a certain exception is caught *@param_objectistheobjecttoinvokethemethodon *@param_methodNameisthenameofthemethodtoinvoke *@param_methodArgsaretheargumentstopasstothemethod *@param_argClassesaretheclassestoassumefortheargumentsofthemethods *@param_expectedExceptionClassistheclassoftheexceptiontobecaught.Ifthisisnull, *itmeansthat<em>no</em>exceptionmustbethrowbyinvokingthemethod.
*/ protectedvoid assureException( final Object _object, final String _methodName, finalClass[] _argClasses, final Object[] _methodArgs, finalClass _expectedExceptionClass )
{
assureException( "did not catch the expected exception (" +
( ( _expectedExceptionClass == null ) ? "none" : _expectedExceptionClass.getName() ) + ") while calling " + _object.getClass().getName() + "." + _methodName,
_object, _methodName, _argClasses, _methodArgs, _expectedExceptionClass );
}
privatestaticfinal OfficeConnection connection = new OfficeConnection();
}
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.17Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-09-28)
¤
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.