summaryrefslogtreecommitdiff
path: root/framework/qa/complex/loadAllDocuments/helper
diff options
context:
space:
mode:
Diffstat (limited to 'framework/qa/complex/loadAllDocuments/helper')
-rw-r--r--framework/qa/complex/loadAllDocuments/helper/InteractionHandler.java155
-rw-r--r--framework/qa/complex/loadAllDocuments/helper/StatusIndicator.java237
-rw-r--r--framework/qa/complex/loadAllDocuments/helper/StreamSimulator.java474
-rw-r--r--framework/qa/complex/loadAllDocuments/helper/makefile.mk48
4 files changed, 914 insertions, 0 deletions
diff --git a/framework/qa/complex/loadAllDocuments/helper/InteractionHandler.java b/framework/qa/complex/loadAllDocuments/helper/InteractionHandler.java
new file mode 100644
index 000000000000..ff4bf87c4f23
--- /dev/null
+++ b/framework/qa/complex/loadAllDocuments/helper/InteractionHandler.java
@@ -0,0 +1,155 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package complex.loadAllDocuments.helper;
+
+import com.sun.star.beans.PropertyValue;
+
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.RuntimeException;
+
+import com.sun.star.task.XInteractionHandler;
+import com.sun.star.task.XInteractionAbort;
+import com.sun.star.task.XInteractionRetry;
+
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.AnyConverter;
+
+//import java.lang.*;
+
+
+/**
+ * Implemets a simple interaction handler,
+ * which can abort all incoming interactions only ... but make it possible to
+ * log it. So it can be used for debug and test purposes.
+ */
+public class InteractionHandler implements XInteractionHandler
+{
+ // ____________________
+
+ /**
+ * @const RETRY_COUNT it defines the max count of
+ * retrying of an interaction
+ */
+ private static final int RETRY_COUNT = 3;
+
+ // ____________________
+
+ /**
+ * @member m_aRequest the origianl interaction request
+ * safed for later analyzing
+ * @member m_bWasUsed true if the interaction handler was used
+ * @member m_nTry count using of RETRY continuations
+ */
+ private Object m_aRequest ;
+ private int m_nTry ;
+ private boolean m_bWasUsed ;
+
+
+ /**
+ * ctor
+ * It's initialize an object of this class with default values
+ * and set the protocol stack. So the outside code can check
+ * if this handler was used or not.
+ */
+ public InteractionHandler()
+ {
+ m_aRequest = null ;
+ //m_aProtocol = aProtocol;
+ m_nTry = 0 ;
+ m_bWasUsed = false;
+ }
+
+ /**
+ * Called to start the interaction, because the outside code whish to solve
+ * a detected problem or to inform the user about something.
+ * We safe the informations here and can handle two well known continuations
+ * only.
+ * [abort and retry].
+ *
+ * @param xRequest
+ * describe the interaction
+ */
+ public void handle(com.sun.star.task.XInteractionRequest xRequest)
+ {
+ m_bWasUsed = true;
+
+ // first sav thje original request
+ // Our user can use this information later for some debug analyzing
+ Object aRequest = xRequest.getRequest();
+ synchronized(this)
+ {
+ m_aRequest = aRequest;
+ }
+
+ // analyze the possible continuations.
+ // We can abort all incoming interactions only.
+ // But additional we can try to continue it several times too.
+ // Of course after e.g. three loops we have to stop and abort it.
+ com.sun.star.task.XInteractionContinuation[] lContinuations = xRequest.getContinuations();
+
+ com.sun.star.task.XInteractionAbort xAbort = null;
+ com.sun.star.task.XInteractionRetry xRetry = null;
+ com.sun.star.uno.Type xAbortType = new com.sun.star.uno.Type(com.sun.star.task.XInteractionAbort.class);
+ com.sun.star.uno.Type xRetryType = new com.sun.star.uno.Type(com.sun.star.task.XInteractionRetry.class);
+
+ for (int i=0; i<lContinuations.length; ++i)
+ {
+ try
+ {
+ if (xAbort == null)
+ xAbort = (com.sun.star.task.XInteractionAbort)AnyConverter.toObject(xAbortType, lContinuations[i]);
+ if (xRetry == null)
+ xRetry = (com.sun.star.task.XInteractionRetry)AnyConverter.toObject(xRetryType, lContinuations[i]);
+ }
+ catch(com.sun.star.lang.IllegalArgumentException exArg) {}
+ }
+
+ // try it again, but only if it wasn't tried to much before.
+ if (xRetry != null)
+ {
+ synchronized(this)
+ {
+ if (m_nTry < RETRY_COUNT)
+ {
+ ++m_nTry;
+ xRetry.select();
+ return;
+ }
+ }
+ }
+
+ // otherwhise we can abort this interaction only
+ if (xAbort != null)
+ {
+ xAbort.select();
+ }
+ }
+
+ public boolean wasUsed() {
+ return m_bWasUsed;
+ }
+}
diff --git a/framework/qa/complex/loadAllDocuments/helper/StatusIndicator.java b/framework/qa/complex/loadAllDocuments/helper/StatusIndicator.java
new file mode 100644
index 000000000000..61f6d9fc525c
--- /dev/null
+++ b/framework/qa/complex/loadAllDocuments/helper/StatusIndicator.java
@@ -0,0 +1,237 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package complex.loadAllDocuments.helper;
+
+// __________ Imports __________
+
+// structs, const, ...
+import com.sun.star.beans.PropertyValue;
+
+// exceptions
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.RuntimeException;
+
+// interfaces
+import com.sun.star.task.XStatusIndicator;
+
+// helper
+import com.sun.star.uno.UnoRuntime;
+
+// others
+//import java.lang.*;
+
+// __________ Implementation __________
+
+/**
+ * Implemets a simple status indicator, which
+ * provide informations about state of a load request.
+ * It can be used as an argument e.g. for loadComponentFromURL().
+ */
+public class StatusIndicator implements com.sun.star.task.XStatusIndicator
+{
+ // ____________________
+
+ /**
+ * @const SHOWSTATUS_NO don't show the status - but save information about using of this indicator object
+ * @const SHOWSTATUS_LOG the possible set protocol object will be used (it covers STDOUT, STDERR automaticly too)
+ * @const SHOWSTATUS_DIALOG the status will be shown inside a java dialog
+ * @const SHOWSTATUS_LINK the status will be notified to interested listener (one listener only!)
+ */
+ public static final int SHOWSTATUS_NO = 0;
+ public static final int SHOWSTATUS_LOG = 1;
+ public static final int SHOWSTATUS_DIALOG = 4;
+ public static final int SHOWSTATUS_LINK = 8;
+
+ // ____________________
+
+ /**
+ * @member m_sText text, which describe the current status
+ * @member m_nRange max value for any progress
+ * @member m_nValue the progress value
+ * @member m_nOut regulate, how the status will be shown
+ * @member m_aProtocol used for logging and transport information about used interface of this object
+ */
+ private String m_sText ;
+ private int m_nRange ;
+ private int m_nValue ;
+ private int m_nOut ;
+// private Protocol m_aProtocol ;
+ private boolean m_bWasUsed ;
+
+ // ____________________
+
+ /**
+ * ctor
+ * It's initialize an object of this class with default values.
+ */
+ public StatusIndicator( int nOut)
+ {
+ m_sText = new String() ;
+ m_nRange = 100 ;
+ m_nValue = 0 ;
+ m_nOut = nOut ;
+ //m_aProtocol = aProtocol ;
+ m_bWasUsed = false;
+// aProtocol.resetUsingState();
+ }
+
+ // ____________________
+
+ /**
+ * It starts the progress and set the initial text and range.
+ *
+ * @param sText
+ * the initial text for showing
+ *
+ * @param nRange
+ * the new range for following progress
+ */
+ public void start( /*IN*/String sText, /*IN*/int nRange )
+ {
+ synchronized(this)
+ {
+ //m_aProtocol.log("start("+sText+","+nRange+")\n");
+ m_bWasUsed = true;
+// m_aProtocol.itWasUsed();
+
+ m_sText = sText ;
+ m_nRange = nRange;
+ m_nValue = 0 ;
+ }
+ impl_show();
+ }
+
+ // ____________________
+
+ /**
+ * Finish the progress and reset internal members.
+ */
+ public void end()
+ {
+ synchronized(this)
+ {
+ //m_aProtocol.log("end()\n");
+ m_bWasUsed = true;
+// m_aProtocol.itWasUsed();
+
+ m_sText = new String();
+ m_nRange = 100;
+ m_nValue = 0;
+ }
+ impl_show();
+ }
+
+ // ____________________
+
+ /**
+ * Set the new description text.
+ *
+ * @param sText
+ * the new text for showing
+ */
+ public void setText( /*IN*/String sText )
+ {
+ synchronized(this)
+ {
+ //m_aProtocol.log("setText("+sText+")\n");
+ m_bWasUsed = true;
+// m_aProtocol.itWasUsed();
+
+ m_sText = sText;
+ }
+ impl_show();
+ }
+
+ // ____________________
+
+ /**
+ * Set the new progress value.
+ *
+ * @param nValue
+ * the new progress value
+ * Must fit the range!
+ */
+ public void setValue( /*IN*/int nValue )
+ {
+ synchronized(this)
+ {
+ //m_aProtocol.log("setValue("+nValue+")\n");
+ m_bWasUsed = true;
+// m_aProtocol.itWasUsed();
+
+ if (nValue<=m_nRange)
+ m_nValue = nValue;
+ }
+ impl_show();
+ }
+
+ // ____________________
+
+ /**
+ * Reset text and progress value to her defaults.
+ */
+ public void reset()
+ {
+ synchronized(this)
+ {
+ //m_aProtocol.log("reset()\n");
+ m_bWasUsed = true;
+// m_aProtocol.itWasUsed();
+
+ m_sText = new String();
+ m_nValue = 0;
+ }
+ impl_show();
+ }
+
+ // ____________________
+
+ /**
+ * Internal helper to show the status.
+ * Currently it's implement as normal text out on stdout.
+ * But of course other thimngs are possible here too.
+ * e.g. a dialog
+ */
+ private void impl_show()
+ {
+/* synchronized(this)
+ {
+ if ((m_nOut & SHOWSTATUS_LOG) == SHOWSTATUS_LOG)
+ //m_aProtocol.log("\t["+m_nValue+"/"+m_nRange+"] "+m_sText+"\n");
+
+ //if ((m_nOut & SHOWSTATUS_DIALOG) == SHOWSTATUS_DIALOG)
+ // not supported yet!
+
+ //if ((m_nOut & SHOWSTATUS_LINK) == SHOWSTATUS_LINK)
+ // not supported yet!
+ } */
+ }
+
+ public boolean wasUsed() {
+ return m_bWasUsed;
+ }
+}
diff --git a/framework/qa/complex/loadAllDocuments/helper/StreamSimulator.java b/framework/qa/complex/loadAllDocuments/helper/StreamSimulator.java
new file mode 100644
index 000000000000..2f09044960ad
--- /dev/null
+++ b/framework/qa/complex/loadAllDocuments/helper/StreamSimulator.java
@@ -0,0 +1,474 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package complex.loadAllDocuments.helper;
+
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.ucb.XSimpleFileAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+
+/**
+ * Simulates an input and output stream and
+ * implements the interfaces XInputStream, XOutputStream.
+ * So it can be used for testing loading/saving of documents
+ * using streams instead of URLs.
+ */
+public class StreamSimulator implements com.sun.star.io.XInputStream ,
+ com.sun.star.io.XOutputStream ,
+ com.sun.star.io.XSeekable
+{
+ //_________________________________
+ /**
+ * @member m_sFileName name of the corrsponding file on disk
+ * @member m_xInStream the internal input stream for reading
+ * @member m_xOutStream the internal input stream for writing
+ * @member m_xSeek points at runtime to m_xInStream or m_xOutStream and make it seekable
+ *
+ * @member m_bInWasUsed indicates, that the input stream interface was used
+ * @member m_bOutWasUsed indicates, that the output stream interface was used
+ */
+
+ private String m_sFileName ;
+ private com.sun.star.io.XInputStream m_xInStream ;
+ private com.sun.star.io.XOutputStream m_xOutStream ;
+ private com.sun.star.io.XSeekable m_xSeek ;
+
+ public boolean m_bInWasUsed ;
+ public boolean m_bOutWasUsed ;
+
+ /**
+ * construct a new instance of this class
+ * It set the name of the correspojnding file on disk, which
+ * should be source or target for the following operations on
+ * this object. And it regulate if it should function as
+ * input or output stream.
+ *
+ * @param sFileName
+ * name of the file on disk
+ * Will be used as source (if param bInput==true)
+ * or as target (if param bInput==false).
+ *
+ * @param bInput
+ * it specify, which interface should work at this object.
+ * <TRUE/> => we simulate an input stream
+ * <FALSE/> => we simulate an output stream
+ *
+ * @throw com.sun.star.io.NotConnectedException
+ * in case the internal streams to the file on disk couldn't
+ * be established.
+ * They are neccessary. Otherwhise this simulator can't
+ * really work.
+ */
+ public StreamSimulator(XMultiServiceFactory xMSF,
+ String sFileName, boolean bInput)
+ throws com.sun.star.io.NotConnectedException
+ {
+ m_sFileName = sFileName ;
+ m_bInWasUsed = false ;
+ m_bOutWasUsed = false ;
+
+ try
+ {
+ XSimpleFileAccess xHelper = (XSimpleFileAccess)
+ UnoRuntime.queryInterface(XSimpleFileAccess.class,
+ xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"));
+
+ if (xHelper == null)
+ throw new com.sun.star.io.NotConnectedException(
+ "ucb helper not available. Can't create streams.");
+
+ if (bInput)
+ {
+ m_xInStream = xHelper.openFileRead(m_sFileName);
+ m_xSeek = (com.sun.star.io.XSeekable)UnoRuntime.queryInterface(
+ com.sun.star.io.XSeekable.class,
+ m_xInStream);
+ }
+ else
+ {
+ m_xOutStream = xHelper.openFileWrite(m_sFileName);
+ m_xSeek = (com.sun.star.io.XSeekable)UnoRuntime.queryInterface(
+ com.sun.star.io.XSeekable.class,
+ m_xOutStream);
+ }
+ }
+ catch(com.sun.star.uno.Exception exUno)
+ {
+ throw new com.sun.star.io.NotConnectedException(
+ "Could not open the file.");
+ }
+ }
+
+ /**
+ * following methods simulates the XInputStream.
+ * The notice all actions inside the internal protocol
+ * and try to map all neccessary functions to the internal
+ * open in-stream.
+ */
+ public int readBytes(byte[][] lData, int nBytesToRead )
+ throws com.sun.star.io.NotConnectedException,
+ com.sun.star.io.BufferSizeExceededException,
+ com.sun.star.io.IOException
+ {
+ m_bInWasUsed = true;
+
+ if (m_xInStream == null)
+ {
+ throw new com.sun.star.io.NotConnectedException("stream not open");
+ }
+
+ int nRead = 0;
+ try
+ {
+ nRead = m_xInStream.readBytes(lData,nBytesToRead);
+ }
+ catch (com.sun.star.io.NotConnectedException exConnect) {
+ }
+ catch (com.sun.star.io.BufferSizeExceededException exBuffer ) {
+ }
+ catch (com.sun.star.io.IOException exIO ) {
+ }
+ catch (com.sun.star.uno.RuntimeException exRuntime) {
+ }
+ catch (com.sun.star.uno.Exception exUno ) {
+ }
+
+
+ return nRead;
+ }
+
+ public int readSomeBytes(byte[][] lData, int nMaxBytesToRead)
+ throws com.sun.star.io.NotConnectedException,
+ com.sun.star.io.BufferSizeExceededException ,
+ com.sun.star.io.IOException
+ {
+ m_bInWasUsed = true;
+
+ if (m_xInStream == null)
+ {
+ throw new com.sun.star.io.NotConnectedException("stream not open");
+ }
+
+ int nRead = 0;
+ try
+ {
+ nRead = m_xInStream.readSomeBytes(lData,nMaxBytesToRead);
+ }
+ catch (com.sun.star.io.NotConnectedException exConnect) {
+ }
+ catch (com.sun.star.io.BufferSizeExceededException exBuffer ) {
+ }
+ catch (com.sun.star.io.IOException exIO ) {
+ }
+ catch (com.sun.star.uno.RuntimeException exRuntime) {
+ }
+ catch (com.sun.star.uno.Exception exUno ) {
+ }
+
+ return nRead;
+ }
+
+ //_________________________________
+
+ public void skipBytes(int nBytesToSkip)
+ throws com.sun.star.io.NotConnectedException,
+ com.sun.star.io.BufferSizeExceededException ,
+ com.sun.star.io.IOException
+ {
+ m_bInWasUsed = true;
+
+ if (m_xInStream == null)
+ {
+ throw new com.sun.star.io.NotConnectedException("stream not open");
+ }
+
+ try
+ {
+ m_xInStream.skipBytes(nBytesToSkip);
+ }
+ catch (com.sun.star.io.NotConnectedException exConnect) {
+ }
+ catch (com.sun.star.io.BufferSizeExceededException exBuffer ) {
+ }
+ catch (com.sun.star.io.IOException exIO ) {
+ }
+ catch (com.sun.star.uno.RuntimeException exRuntime) {
+ }
+ catch (com.sun.star.uno.Exception exUno ) {
+ }
+
+ }
+
+ public int available() throws com.sun.star.io.NotConnectedException,
+ com.sun.star.io.IOException
+ {
+ m_bInWasUsed = true;
+
+ if (m_xInStream == null)
+ {
+ throw new com.sun.star.io.NotConnectedException("stream not open");
+ }
+
+ int nAvailable = 0;
+ try
+ {
+ nAvailable = m_xInStream.available();
+ }
+ catch (com.sun.star.io.NotConnectedException exConnect) {
+ }
+ catch (com.sun.star.io.IOException exIO ) {
+ }
+ catch (com.sun.star.uno.RuntimeException exRuntime) {
+ }
+ catch (com.sun.star.uno.Exception exUno ) {
+ }
+
+ return nAvailable;
+ }
+
+ //_________________________________
+
+ public void closeInput() throws com.sun.star.io.NotConnectedException,
+ com.sun.star.io.IOException
+ {
+ m_bInWasUsed = true;
+
+ if (m_xInStream == null)
+ {
+ throw new com.sun.star.io.NotConnectedException("stream not open");
+ }
+
+ try
+ {
+ m_xInStream.closeInput();
+ }
+ catch (com.sun.star.io.NotConnectedException exConnect) {
+ }
+ catch (com.sun.star.io.IOException exIO ) {
+ }
+ catch (com.sun.star.uno.RuntimeException exRuntime) {
+ }
+ catch (com.sun.star.uno.Exception exUno ) {
+ }
+
+ }
+
+ /**
+ * following methods simulates the XOutputStream.
+ * The notice all actions inside the internal protocol
+ * and try to map all neccessary functions to the internal
+ * open out-stream.
+ */
+ public void writeBytes(byte[] lData)
+ throws com.sun.star.io.NotConnectedException,
+ com.sun.star.io.BufferSizeExceededException ,
+ com.sun.star.io.IOException
+ {
+ m_bOutWasUsed = true;
+
+ if (m_xOutStream == null)
+ {
+ throw new com.sun.star.io.NotConnectedException("stream not open");
+ }
+
+ try
+ {
+ m_xOutStream.writeBytes(lData);
+ }
+ catch (com.sun.star.io.NotConnectedException exConnect) {
+ }
+ catch (com.sun.star.io.BufferSizeExceededException exBuffer ) {
+ }
+ catch (com.sun.star.io.IOException exIO ) {
+ }
+ catch (com.sun.star.uno.RuntimeException exRuntime) {
+ }
+ catch (com.sun.star.uno.Exception exUno ) {
+ }
+
+ }
+
+ //_________________________________
+
+ public void flush() throws com.sun.star.io.NotConnectedException ,
+ com.sun.star.io.BufferSizeExceededException ,
+ com.sun.star.io.IOException
+ {
+ m_bOutWasUsed = true;
+
+ if (m_xOutStream == null)
+ {
+ throw new com.sun.star.io.NotConnectedException("stream not open");
+ }
+
+ try
+ {
+ m_xOutStream.flush();
+ }
+ catch (com.sun.star.io.NotConnectedException exConnect) {
+ }
+ catch (com.sun.star.io.BufferSizeExceededException exBuffer ) {
+ }
+ catch (com.sun.star.io.IOException exIO ) {
+ }
+ catch (com.sun.star.uno.RuntimeException exRuntime) {
+ }
+ catch (com.sun.star.uno.Exception exUno ) {
+ }
+ }
+
+ //_________________________________
+
+ public void closeOutput() throws com.sun.star.io.NotConnectedException ,
+ com.sun.star.io.BufferSizeExceededException,
+ com.sun.star.io.IOException
+ {
+ m_bOutWasUsed = true;
+
+ if (m_xOutStream == null)
+ {
+ throw new com.sun.star.io.NotConnectedException("stream not open");
+ }
+
+ try
+ {
+ m_xOutStream.closeOutput();
+ }
+ catch (com.sun.star.io.NotConnectedException exConnect) {
+ }
+ catch (com.sun.star.io.BufferSizeExceededException exBuffer ) {
+ }
+ catch (com.sun.star.io.IOException exIO ) {
+ }
+ catch (com.sun.star.uno.RuntimeException exRuntime) {
+ }
+ catch (com.sun.star.uno.Exception exUno ) {
+ }
+
+ }
+
+ /**
+ * following methods simulates the XSeekable.
+ * The notice all actions inside the internal protocol
+ * and try to map all neccessary functions to the internal
+ * open stream.
+ */
+ public void seek(long nLocation )
+ throws com.sun.star.lang.IllegalArgumentException,
+ com.sun.star.io.IOException
+ {
+ if (m_xInStream != null)
+ m_bInWasUsed = true;
+ else
+ if (m_xOutStream != null)
+ m_bOutWasUsed = true;
+// else
+ //m_aProtocol.log("\tno stream open!\n");
+
+ if (m_xSeek == null)
+ {
+ throw new com.sun.star.io.IOException("stream not seekable");
+ }
+
+ try
+ {
+ m_xSeek.seek(nLocation);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException exArg ) {
+ }
+ catch (com.sun.star.io.IOException exIO ) {
+ }
+ catch (com.sun.star.uno.RuntimeException exRuntime) {
+ }
+ catch (com.sun.star.uno.Exception exUno ) {
+ }
+
+ }
+
+ public long getPosition() throws com.sun.star.io.IOException
+ {
+
+ if (m_xInStream != null)
+ m_bInWasUsed = true;
+ else
+ if (m_xOutStream != null)
+ m_bOutWasUsed = true;
+// else
+ //m_aProtocol.log("\tno stream open!\n");
+
+ if (m_xSeek == null)
+ {
+ throw new com.sun.star.io.IOException("stream not seekable");
+ }
+
+ long nPos = 0;
+ try
+ {
+ nPos = m_xSeek.getPosition();
+ }
+ catch (com.sun.star.io.IOException exIO ) {
+ }
+ catch (com.sun.star.uno.RuntimeException exRuntime) {
+ }
+ catch (com.sun.star.uno.Exception exUno ) {
+ }
+
+ return nPos;
+ }
+
+ //_________________________________
+
+ public long getLength() throws com.sun.star.io.IOException
+ {
+
+ if (m_xInStream != null)
+ m_bInWasUsed = true;
+ else
+ if (m_xOutStream != null)
+ m_bOutWasUsed = true;
+// else
+ //m_aProtocol.log("\tno stream open!\n");
+
+ if (m_xSeek == null)
+ {
+ throw new com.sun.star.io.IOException("stream not seekable");
+ }
+
+ long nLen = 0;
+ try
+ {
+ nLen = m_xSeek.getLength();
+ }
+ catch (com.sun.star.io.IOException exIO ) {
+ }
+ catch (com.sun.star.uno.RuntimeException exRuntime) {
+ }
+ catch (com.sun.star.uno.Exception exUno ) {
+ }
+
+ return nLen;
+ }
+}
diff --git a/framework/qa/complex/loadAllDocuments/helper/makefile.mk b/framework/qa/complex/loadAllDocuments/helper/makefile.mk
new file mode 100644
index 000000000000..98c414c2c1f7
--- /dev/null
+++ b/framework/qa/complex/loadAllDocuments/helper/makefile.mk
@@ -0,0 +1,48 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+PRJ = ..$/..$/..$/..
+TARGET = CheckXComponentLoader
+PRJNAME = framework
+PACKAGE = complex$/loadAllDocuments$/helper
+
+# --- Settings -----------------------------------------------------
+.INCLUDE: settings.mk
+
+
+#----- compile .java files -----------------------------------------
+
+JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar \
+ Generator.jar
+JAVAFILES = InteractionHandler.java StatusIndicator.java StreamSimulator.java
+JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+
+MAXLINELENGTH = 100000
+
+.INCLUDE : target.mk
+
+
+