summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/mod/_streams/uno
diff options
context:
space:
mode:
Diffstat (limited to 'qadevOOo/tests/java/mod/_streams/uno')
-rw-r--r--qadevOOo/tests/java/mod/_streams/uno/DataInputStream.java15
-rw-r--r--qadevOOo/tests/java/mod/_streams/uno/DataOutputStream.java16
-rw-r--r--qadevOOo/tests/java/mod/_streams/uno/MarkableInputStream.java12
-rw-r--r--qadevOOo/tests/java/mod/_streams/uno/MarkableOutputStream.java19
-rw-r--r--qadevOOo/tests/java/mod/_streams/uno/ObjectInputStream.java39
-rw-r--r--qadevOOo/tests/java/mod/_streams/uno/ObjectOutputStream.java45
-rw-r--r--qadevOOo/tests/java/mod/_streams/uno/Pipe.java3
-rw-r--r--qadevOOo/tests/java/mod/_streams/uno/Pump.java6
8 files changed, 55 insertions, 100 deletions
diff --git a/qadevOOo/tests/java/mod/_streams/uno/DataInputStream.java b/qadevOOo/tests/java/mod/_streams/uno/DataInputStream.java
index ec16d4046d2e..63eef1a645b1 100644
--- a/qadevOOo/tests/java/mod/_streams/uno/DataInputStream.java
+++ b/qadevOOo/tests/java/mod/_streams/uno/DataInputStream.java
@@ -93,8 +93,7 @@ public class DataInputStream extends TestCase {
// creating and connecting DataOutputStream to the
// DataInputStream created through the Pipe
- XActiveDataSink xDataSink = (XActiveDataSink)
- UnoRuntime.queryInterface(XActiveDataSink.class, oObj);
+ XActiveDataSink xDataSink = UnoRuntime.queryInterface(XActiveDataSink.class, oObj);
XInterface oPipe = null;
try {
@@ -105,10 +104,8 @@ public class DataInputStream extends TestCase {
throw new StatusException("Couldn't create instance", e);
}
- XInputStream xPipeInput = (XInputStream)
- UnoRuntime.queryInterface(XInputStream.class, oPipe);
- XOutputStream xPipeOutput = (XOutputStream)
- UnoRuntime.queryInterface(XOutputStream.class, oPipe);
+ XInputStream xPipeInput = UnoRuntime.queryInterface(XInputStream.class, oPipe);
+ XOutputStream xPipeOutput = UnoRuntime.queryInterface(XOutputStream.class, oPipe);
XInterface oDataOutput = null;
try {
@@ -119,10 +116,8 @@ public class DataInputStream extends TestCase {
throw new StatusException("Couldn't create instance", e);
}
- XDataOutputStream xDataOutput = (XDataOutputStream)
- UnoRuntime.queryInterface(XDataOutputStream.class, oDataOutput) ;
- XActiveDataSource xDataSource = (XActiveDataSource)
- UnoRuntime.queryInterface(XActiveDataSource.class, oDataOutput) ;
+ XDataOutputStream xDataOutput = UnoRuntime.queryInterface(XDataOutputStream.class, oDataOutput) ;
+ XActiveDataSource xDataSource = UnoRuntime.queryInterface(XActiveDataSource.class, oDataOutput) ;
xDataSource.setOutputStream(xPipeOutput) ;
xDataSink.setInputStream(xPipeInput) ;
diff --git a/qadevOOo/tests/java/mod/_streams/uno/DataOutputStream.java b/qadevOOo/tests/java/mod/_streams/uno/DataOutputStream.java
index 177ce4bd0001..85cc334414cc 100644
--- a/qadevOOo/tests/java/mod/_streams/uno/DataOutputStream.java
+++ b/qadevOOo/tests/java/mod/_streams/uno/DataOutputStream.java
@@ -93,11 +93,9 @@ public class DataOutputStream extends TestCase {
oObj = (XInterface) oInterface;
- final XOutputStream xPipeOutput = (XOutputStream)
- UnoRuntime.queryInterface(XOutputStream.class, oPipe);
+ final XOutputStream xPipeOutput = UnoRuntime.queryInterface(XOutputStream.class, oPipe);
- XActiveDataSource xDataSource = (XActiveDataSource)
- UnoRuntime.queryInterface(XActiveDataSource.class, oObj);
+ XActiveDataSource xDataSource = UnoRuntime.queryInterface(XActiveDataSource.class, oObj);
xDataSource.setOutputStream(xPipeOutput);
@@ -124,8 +122,7 @@ public class DataOutputStream extends TestCase {
//add relation for io.XOutputStream
final XMultiServiceFactory msf = xMSF;
- final XInputStream xPipeInput = (XInputStream)
- UnoRuntime.queryInterface(XInputStream.class, oPipe);
+ final XInputStream xPipeInput = UnoRuntime.queryInterface(XInputStream.class, oPipe);
tEnv.addObjRelation("XOutputStream.StreamChecker",
new ifc.io._XOutputStream.StreamChecker() {
XInputStream xInStream = null;
@@ -149,15 +146,14 @@ public class DataOutputStream extends TestCase {
try {
Object oInStream = msf.createInstance(
"com.sun.star.io.DataInputStream");
- xInStream = (XInputStream) UnoRuntime.queryInterface
+ xInStream = UnoRuntime.queryInterface
(XInputStream.class, oInStream);
} catch(com.sun.star.uno.Exception e) {
return null;
}
- XActiveDataSink xDataSink = (XActiveDataSink)
- UnoRuntime.queryInterface(
- XActiveDataSink.class, xInStream);
+ XActiveDataSink xDataSink = UnoRuntime.queryInterface(
+ XActiveDataSink.class, xInStream);
xDataSink.setInputStream(xPipeInput);
return xInStream;
diff --git a/qadevOOo/tests/java/mod/_streams/uno/MarkableInputStream.java b/qadevOOo/tests/java/mod/_streams/uno/MarkableInputStream.java
index 971cfb44941a..8fc218e8acb3 100644
--- a/qadevOOo/tests/java/mod/_streams/uno/MarkableInputStream.java
+++ b/qadevOOo/tests/java/mod/_streams/uno/MarkableInputStream.java
@@ -98,18 +98,14 @@ public class MarkableInputStream extends TestCase {
// Creating construction :
// MarkableOutputStream -> Pipe -> MarkableInputStream
- XActiveDataSource xdSmo = (XActiveDataSource)
- UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
+ XActiveDataSource xdSmo = UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
- XOutputStream PipeOut = (XOutputStream)
- UnoRuntime.queryInterface(XOutputStream.class, aPipe);
- XInputStream PipeIn = (XInputStream)
- UnoRuntime.queryInterface(XInputStream.class, aPipe);
+ XOutputStream PipeOut = UnoRuntime.queryInterface(XOutputStream.class, aPipe);
+ XInputStream PipeIn = UnoRuntime.queryInterface(XInputStream.class, aPipe);
xdSmo.setOutputStream(PipeOut);
- XActiveDataSink xmSi = (XActiveDataSink)
- UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
+ XActiveDataSink xmSi = UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
xmSi.setInputStream(PipeIn) ;
diff --git a/qadevOOo/tests/java/mod/_streams/uno/MarkableOutputStream.java b/qadevOOo/tests/java/mod/_streams/uno/MarkableOutputStream.java
index dd3666207da0..bfa0341a4c56 100644
--- a/qadevOOo/tests/java/mod/_streams/uno/MarkableOutputStream.java
+++ b/qadevOOo/tests/java/mod/_streams/uno/MarkableOutputStream.java
@@ -109,18 +109,14 @@ public class MarkableOutputStream extends TestCase {
// Creating construction :
// MarkableOutputStream -> Pipe -> MarkableInputStream
- XActiveDataSource xdSmo = (XActiveDataSource)
- UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
+ XActiveDataSource xdSmo = UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
- final XOutputStream PipeOut = (XOutputStream)
- UnoRuntime.queryInterface(XOutputStream.class,aPipe);
- final XInputStream PipeIn = (XInputStream)
- UnoRuntime.queryInterface(XInputStream.class,aPipe);
+ final XOutputStream PipeOut = UnoRuntime.queryInterface(XOutputStream.class,aPipe);
+ final XInputStream PipeIn = UnoRuntime.queryInterface(XInputStream.class,aPipe);
xdSmo.setOutputStream(PipeOut);
- XActiveDataSink xmSi = (XActiveDataSink)
- UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
+ XActiveDataSink xmSi = UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
xmSi.setInputStream(PipeIn) ;
@@ -173,15 +169,14 @@ public class MarkableOutputStream extends TestCase {
try {
Object oInStream = msf.createInstance(
"com.sun.star.io.MarkableInputStream");
- xInStream = (XInputStream) UnoRuntime.queryInterface
+ xInStream = UnoRuntime.queryInterface
(XInputStream.class, oInStream);
} catch(com.sun.star.uno.Exception e) {
return null;
}
- XActiveDataSink xDataSink = (XActiveDataSink)
- UnoRuntime.queryInterface(
- XActiveDataSink.class, xInStream);
+ XActiveDataSink xDataSink = UnoRuntime.queryInterface(
+ XActiveDataSink.class, xInStream);
xDataSink.setInputStream(PipeIn);
return xInStream;
diff --git a/qadevOOo/tests/java/mod/_streams/uno/ObjectInputStream.java b/qadevOOo/tests/java/mod/_streams/uno/ObjectInputStream.java
index 576076f87f2f..528a63031537 100644
--- a/qadevOOo/tests/java/mod/_streams/uno/ObjectInputStream.java
+++ b/qadevOOo/tests/java/mod/_streams/uno/ObjectInputStream.java
@@ -96,9 +96,8 @@ public class ObjectInputStream extends TestCase {
try {
Object o = xMSF.createInstance(
"com.sun.star.registry.ImplementationRegistration");
- xir = (XImplementationRegistration)
- UnoRuntime.queryInterface(
- XImplementationRegistration.class, o);
+ xir = UnoRuntime.queryInterface(
+ XImplementationRegistration.class, o);
}
catch (com.sun.star.uno.Exception e) {
@@ -189,7 +188,7 @@ public class ObjectInputStream extends TestCase {
("com.sun.star.io.MarkableInputStream");
mostream = xMSF.createInstance
("com.sun.star.io.MarkableOutputStream");
- xConnect = (XInterface)xMSF.createInstance
+ xConnect = xMSF.createInstance
("com.sun.star.io.DataInputStream") ;
} catch( com.sun.star.uno.Exception e ) {
@@ -199,35 +198,26 @@ public class ObjectInputStream extends TestCase {
// Creating construction :
// ObjectOutputStream -> MarkableOutputStream -> Pipe ->
// -> MarkableInputStream -> ObjectInputStream
- XActiveDataSource xdSo = (XActiveDataSource)
- UnoRuntime.queryInterface(XActiveDataSource.class, ostream);
+ XActiveDataSource xdSo = UnoRuntime.queryInterface(XActiveDataSource.class, ostream);
- XActiveDataSource xdSmo = (XActiveDataSource)
- UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
+ XActiveDataSource xdSmo = UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
- XOutputStream moStream = (XOutputStream)
- UnoRuntime.queryInterface(XOutputStream.class, mostream);
+ XOutputStream moStream = UnoRuntime.queryInterface(XOutputStream.class, mostream);
- XOutputStream PipeOut = (XOutputStream)
- UnoRuntime.queryInterface(XOutputStream.class, aPipe);
- XInputStream PipeIn = (XInputStream)
- UnoRuntime.queryInterface(XInputStream.class, aPipe);
+ XOutputStream PipeOut = UnoRuntime.queryInterface(XOutputStream.class, aPipe);
+ XInputStream PipeIn = UnoRuntime.queryInterface(XInputStream.class, aPipe);
xdSo.setOutputStream(moStream);
xdSmo.setOutputStream(PipeOut);
- XObjectInputStream iStream = (XObjectInputStream)
- UnoRuntime.queryInterface(XObjectInputStream.class, istream);
+ XObjectInputStream iStream = UnoRuntime.queryInterface(XObjectInputStream.class, istream);
XObjectOutputStream oStream = null;
- oStream = (XObjectOutputStream)
- UnoRuntime.queryInterface(XObjectOutputStream.class, ostream);
+ oStream = UnoRuntime.queryInterface(XObjectOutputStream.class, ostream);
- XActiveDataSink xmSi = (XActiveDataSink)
- UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
- XInputStream xmIstream = (XInputStream)
- UnoRuntime.queryInterface(XInputStream.class, mistream);
+ XActiveDataSink xmSi = UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
+ XInputStream xmIstream = UnoRuntime.queryInterface(XInputStream.class, mistream);
- XActiveDataSink xdSi = (XActiveDataSink) UnoRuntime.queryInterface
+ XActiveDataSink xdSi = UnoRuntime.queryInterface
(XActiveDataSink.class, istream);
xdSi.setInputStream(xmIstream);
xmSi.setInputStream(PipeIn);
@@ -237,8 +227,7 @@ public class ObjectInputStream extends TestCase {
try {
Object oPersObj = xMSF.createInstance
("com.sun.star.cmp.PersistObject");
- xPersObj = (XPersistObject)
- UnoRuntime.queryInterface(XPersistObject.class, oPersObj);
+ xPersObj = UnoRuntime.queryInterface(XPersistObject.class, oPersObj);
} catch (com.sun.star.uno.Exception e) {
e.printStackTrace(log);
throw new StatusException("Can't write persist object.", e);
diff --git a/qadevOOo/tests/java/mod/_streams/uno/ObjectOutputStream.java b/qadevOOo/tests/java/mod/_streams/uno/ObjectOutputStream.java
index f30870ec2d24..ff869a3973bd 100644
--- a/qadevOOo/tests/java/mod/_streams/uno/ObjectOutputStream.java
+++ b/qadevOOo/tests/java/mod/_streams/uno/ObjectOutputStream.java
@@ -93,9 +93,8 @@ public class ObjectOutputStream extends TestCase {
try {
Object o = xMSF.createInstance(
"com.sun.star.registry.ImplementationRegistration");
- xir = (XImplementationRegistration)
- UnoRuntime.queryInterface(
- XImplementationRegistration.class, o);
+ xir = UnoRuntime.queryInterface(
+ XImplementationRegistration.class, o);
}
catch (com.sun.star.uno.Exception e) {
System.err.println(
@@ -191,44 +190,33 @@ public class ObjectOutputStream extends TestCase {
}
// creating the pipe where object has to be written to
- XActiveDataSource xdSo = (XActiveDataSource)
- UnoRuntime.queryInterface(XActiveDataSource.class, ostream);
+ XActiveDataSource xdSo = UnoRuntime.queryInterface(XActiveDataSource.class, ostream);
- XActiveDataSource xdSmo = (XActiveDataSource)
- UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
+ XActiveDataSource xdSmo = UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
- XOutputStream moStream = (XOutputStream)
- UnoRuntime.queryInterface(XOutputStream.class, mostream);
+ XOutputStream moStream = UnoRuntime.queryInterface(XOutputStream.class, mostream);
- XActiveDataSink markIn = (XActiveDataSink)
- UnoRuntime.queryInterface(XActiveDataSink.class, minstream);
- XActiveDataSink inStream = (XActiveDataSink)
- UnoRuntime.queryInterface(XActiveDataSink.class, istream);
- XInputStream markInStream = (XInputStream)
- UnoRuntime.queryInterface(XInputStream.class, minstream);
+ XActiveDataSink markIn = UnoRuntime.queryInterface(XActiveDataSink.class, minstream);
+ XActiveDataSink inStream = UnoRuntime.queryInterface(XActiveDataSink.class, istream);
+ XInputStream markInStream = UnoRuntime.queryInterface(XInputStream.class, minstream);
- final XOutputStream PipeOut = (XOutputStream)
- UnoRuntime.queryInterface(XOutputStream.class,aPipe);
- final XInputStream PipeIn = (XInputStream)
- UnoRuntime.queryInterface(XInputStream.class,aPipe);
+ final XOutputStream PipeOut = UnoRuntime.queryInterface(XOutputStream.class,aPipe);
+ final XInputStream PipeIn = UnoRuntime.queryInterface(XInputStream.class,aPipe);
markIn.setInputStream(PipeIn);
inStream.setInputStream(markInStream);
- XObjectInputStream objInputStream = (XObjectInputStream)
- UnoRuntime.queryInterface(XObjectInputStream.class, istream);
+ XObjectInputStream objInputStream = UnoRuntime.queryInterface(XObjectInputStream.class, istream);
xdSo.setOutputStream(moStream);
xdSmo.setOutputStream(PipeOut);
- oStream = (XObjectOutputStream)
- UnoRuntime.queryInterface(XObjectOutputStream.class, ostream);
+ oStream = UnoRuntime.queryInterface(XObjectOutputStream.class, ostream);
// creating Persistent object which has to be written
XPersistObject xPersObj = null ;
try {
Object oPersObj = xMSF.createInstance
("com.sun.star.cmp.PersistObject");
- xPersObj = (XPersistObject)
- UnoRuntime.queryInterface(XPersistObject.class, oPersObj);
+ xPersObj = UnoRuntime.queryInterface(XPersistObject.class, oPersObj);
} catch (com.sun.star.uno.Exception e) {
e.printStackTrace(log);
throw new StatusException("Can't write persist object.", e) ;
@@ -286,15 +274,14 @@ public class ObjectOutputStream extends TestCase {
try {
Object oInStream = msf.createInstance(
"com.sun.star.io.ObjectInputStream");
- xInStream = (XInputStream) UnoRuntime.queryInterface
+ xInStream = UnoRuntime.queryInterface
(XInputStream.class, oInStream);
} catch(com.sun.star.uno.Exception e) {
return null;
}
- XActiveDataSink xDataSink = (XActiveDataSink)
- UnoRuntime.queryInterface(
- XActiveDataSink.class, xInStream);
+ XActiveDataSink xDataSink = UnoRuntime.queryInterface(
+ XActiveDataSink.class, xInStream);
xDataSink.setInputStream(PipeIn);
return xInStream;
diff --git a/qadevOOo/tests/java/mod/_streams/uno/Pipe.java b/qadevOOo/tests/java/mod/_streams/uno/Pipe.java
index a4d32449de14..c4260ae00b5b 100644
--- a/qadevOOo/tests/java/mod/_streams/uno/Pipe.java
+++ b/qadevOOo/tests/java/mod/_streams/uno/Pipe.java
@@ -79,8 +79,7 @@ public class Pipe extends TestCase {
TestEnvironment tEnv = new TestEnvironment( oObj );
//add relation for io.XOutputStream
- final XInputStream iStream = (XInputStream)
- UnoRuntime.queryInterface(XInputStream.class, oObj);
+ final XInputStream iStream = UnoRuntime.queryInterface(XInputStream.class, oObj);
tEnv.addObjRelation("ByteData", byteData);
tEnv.addObjRelation("StreamWriter", oObj);
diff --git a/qadevOOo/tests/java/mod/_streams/uno/Pump.java b/qadevOOo/tests/java/mod/_streams/uno/Pump.java
index f953e557901c..de5eb1152dc4 100644
--- a/qadevOOo/tests/java/mod/_streams/uno/Pump.java
+++ b/qadevOOo/tests/java/mod/_streams/uno/Pump.java
@@ -83,10 +83,8 @@ public class Pump extends TestCase {
XInterface oObj = (XInterface) oInterface;
// setting up input and output streams for pump
- XActiveDataSink xSink = (XActiveDataSink)
- UnoRuntime.queryInterface(XActiveDataSink.class, oObj);
- XActiveDataSource xSource = (XActiveDataSource)
- UnoRuntime.queryInterface(XActiveDataSource.class, oObj);
+ XActiveDataSink xSink = UnoRuntime.queryInterface(XActiveDataSink.class, oObj);
+ XActiveDataSource xSource = UnoRuntime.queryInterface(XActiveDataSource.class, oObj);
XInputStream xInput = new MyInput();
XOutputStream xOutput = new MyOutput();