summaryrefslogtreecommitdiff
path: root/io/test
diff options
context:
space:
mode:
authorJörg Budischewski <jbu@openoffice.org>2001-01-25 13:06:36 +0000
committerJörg Budischewski <jbu@openoffice.org>2001-01-25 13:06:36 +0000
commit54fed04f01bf1375035fee788d3bcb99a959a28c (patch)
treeea5a81cce6789109b4806781152896446ea2ef3e /io/test
parentf24885eef48d9ba35b42fe70c839905ebad111d4 (diff)
added a simple pumptest
Diffstat (limited to 'io/test')
-rw-r--r--io/test/stm/pumptest.cxx36
1 files changed, 32 insertions, 4 deletions
diff --git a/io/test/stm/pumptest.cxx b/io/test/stm/pumptest.cxx
index 6abf4d1c1..88b23e7b6 100644
--- a/io/test/stm/pumptest.cxx
+++ b/io/test/stm/pumptest.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: pumptest.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:24:19 $
+ * last change: $Author: jbu $ $Date: 2001-01-25 14:06:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -120,15 +120,18 @@ public:
private:
void testSimple( const Reference < XInterface > & );
+ void testWrongUsage( const Reference < XInterface > & );
private:
Sequence<Any> m_seqExceptions;
Sequence<OUString> m_seqErrors;
Sequence<OUString> m_seqWarnings;
+ Reference< XMultiServiceFactory > m_rSmgr;
};
-OPumpTest::OPumpTest( const Reference< XMultiServiceFactory > &rFactory )
+OPumpTest::OPumpTest( const Reference< XMultiServiceFactory > &rFactory ) :
+ m_rSmgr( rFactory )
{
}
@@ -175,6 +178,10 @@ sal_Int32 OPumpTest::test(
if( 0 == hTestHandle ) {
testInvariant( TestName , TestObject );
}
+ else if ( 1 == hTestHandle )
+ {
+ testWrongUsage( TestObject);
+ }
}
catch( Exception & e )
{
@@ -188,7 +195,7 @@ sal_Int32 OPumpTest::test(
hTestHandle ++;
- if( 1 == hTestHandle )
+ if( 2 == hTestHandle )
{
// all tests finished.
hTestHandle = -1;
@@ -238,6 +245,27 @@ void OPumpTest::testSimple( const Reference < XInterface > &r )
}
+void OPumpTest::testWrongUsage( const Reference< XInterface > &r )
+{
+ Reference< XActiveDataSource > rSource ( r, UNO_QUERY );
+ Reference< XActiveDataSink > rSink( r , UNO_QUERY );
+ Reference< XActiveDataControl > rControl( r, UNO_QUERY );
+
+ Reference< XInputStream > rIn( m_rSmgr->createInstance(
+ OUString::createFromAscii( "com.sun.star.io.DataInputStream" )),UNO_QUERY);
+ Reference< XOutputStream > rOut( m_rSmgr->createInstance(
+ OUString::createFromAscii( "com.sun.star.io.DataOutputStream" )),UNO_QUERY);
+
+ rSink->setInputStream( rIn );
+ rSource->setOutputStream( rOut );
+
+ rControl->start();
+
+ //wait a second, so that the pumpthread can terminate
+ TimeValue w = {1,1};
+ osl_waitThread( &w );
+}
+
Reference< XInterface > SAL_CALL OPumpTest_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw( Exception )
{
return *new OPumpTest( rSMgr );