summaryrefslogtreecommitdiff
path: root/package/qa/storages/TestHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'package/qa/storages/TestHelper.java')
-rw-r--r--package/qa/storages/TestHelper.java60
1 files changed, 30 insertions, 30 deletions
diff --git a/package/qa/storages/TestHelper.java b/package/qa/storages/TestHelper.java
index dc28786513b1..0c1580fc7014 100644
--- a/package/qa/storages/TestHelper.java
+++ b/package/qa/storages/TestHelper.java
@@ -36,7 +36,7 @@ public class TestHelper {
Error( "Can't get XOutputStream implementation from substream '" + sStreamName + "'!" );
return false;
}
-
+
// get XTrucate implementation from output stream
XTruncate xTruncate = (XTruncate) UnoRuntime.queryInterface( XTruncate.class, xOutput );
if ( xTruncate == null )
@@ -44,7 +44,7 @@ public class TestHelper {
Error( "Can't get XTruncate implementation from substream '" + sStreamName + "'!" );
return false;
}
-
+
// write requested byte sequence
try
{
@@ -118,7 +118,7 @@ public class TestHelper {
Error( "Can't create substream '" + sStreamName + "', exception : " + e + "!" );
return false;
}
-
+
// get output stream of substream
XOutputStream xOutput = xSubStream.getOutputStream();
if ( xOutput == null )
@@ -126,7 +126,7 @@ public class TestHelper {
Error( "Can't get XOutputStream implementation from substream '" + sStreamName + "'!" );
return false;
}
-
+
// get XTrucate implementation from output stream
XTruncate xTruncate = (XTruncate) UnoRuntime.queryInterface( XTruncate.class, xOutput );
if ( xTruncate == null )
@@ -134,7 +134,7 @@ public class TestHelper {
Error( "Can't get XTruncate implementation from substream '" + sStreamName + "'!" );
return false;
}
-
+
// write requested byte sequence
try
{
@@ -213,7 +213,7 @@ public class TestHelper {
Error( "Can't create substream '" + sStreamName + "', exception : " + e + "!" );
return false;
}
-
+
if ( !WriteBytesToStream( xSubStream, sStreamName, sMediaType, bCompressed, pBytes ) )
return false;
@@ -345,7 +345,7 @@ public class TestHelper {
Error( "Can't create substream '" + sStreamPath + "', exception : " + e + "!" );
return false;
}
-
+
if ( !WriteBytesToStream( xSubStream, sStreamPath, sMediaType, bCompressed, pBytes ) )
return false;
@@ -410,7 +410,7 @@ public class TestHelper {
Error( "Can't create substream '" + sStreamPath + "', exception : " + e + "!" );
return false;
}
-
+
if ( !WriteBytesToStream( xSubStream, sStreamPath, sMediaType, bCompressed, pBytes ) )
return false;
@@ -555,7 +555,7 @@ public class TestHelper {
Message( "Optional interface XEncryptionProtectedSource is not implemented, feature can not be tested!" );
return -1;
}
-
+
try {
xStreamEncryption.setEncryptionPassword( sNewPass );
}
@@ -613,7 +613,7 @@ public class TestHelper {
Message( "Optional interface XEncryptionProtectedSource is not implemented, feature can not be tested!" );
return -1;
}
-
+
try {
xStreamEncryption.setEncryptionPassword( sNewPass );
}
@@ -672,7 +672,7 @@ public class TestHelper {
Error( "'IsRoot' property contains wrong value!" );
bOk = false;
}
-
+
if ( ( bIsRoot
&& ( nPropMode | ElementModes.READ ) != ( nMode | ElementModes.READ ) )
|| ( !bIsRoot && ( nPropMode & nMode ) != nMode ) )
@@ -716,13 +716,13 @@ public class TestHelper {
+ sMediaType + "', set '" + sPropMediaType + "' !" );
bOk = false;
}
-
+
if ( bPropIsRoot != bIsRoot )
{
Error( "'IsRoot' property contains wrong value!" );
bOk = false;
}
-
+
if ( ( bIsRoot
&& ( nPropMode | ElementModes.READ ) != ( nMode | ElementModes.READ ) )
|| ( !bIsRoot && ( nPropMode & nMode ) != nMode ) )
@@ -758,7 +758,7 @@ public class TestHelper {
Error( "Can't get XInputStream implementation from substream '" + sName + "'!" );
return false;
}
-
+
byte pContents[][] = new byte[1][]; // ???
// read contents
@@ -813,11 +813,11 @@ public class TestHelper {
bOk = true;
if ( !sPropMediaType.equals( sMediaType ) )
{
- Error( "'MediaType' property contains wrong value for stream '" + sName + "',\nexpected: '"
+ Error( "'MediaType' property contains wrong value for stream '" + sName + "',\nexpected: '"
+ sMediaType + "', set: '" + sPropMediaType + "'!" );
bOk = false;
}
-
+
if ( nPropSize != pBytes.length )
{
Error( "'Size' property contains wrong value for stream'" + sName + "'!" );
@@ -866,7 +866,7 @@ public class TestHelper {
Error( "Can't open substream '" + sName + "', exception : " + e + "!" );
return false;
}
-
+
boolean bResult = InternalCheckStream( xSubStream, sName, sMediaType, bCompressed, pBytes, true );
// free the stream resources, garbage collector may remove the object too late
@@ -883,7 +883,7 @@ public class TestHelper {
String sPass )
{
// Important: a common password for any of parent storage should not be set or
- // should be different from sPass
+ // should be different from sPass
try
{
@@ -898,7 +898,7 @@ public class TestHelper {
Error( "Unexpected exception in case of opening of encrypted stream '" + sName + "' without password: " + e + "!" );
return false;
}
-
+
String sWrongPass = "11";
sWrongPass += sPass;
try
@@ -914,7 +914,7 @@ public class TestHelper {
Error( "Unexpected exception in case of opening of encrypted stream '" + sName + "' with wrong password: " + e + "!" );
return false;
}
-
+
XStream xSubStream = null;
try
{
@@ -931,7 +931,7 @@ public class TestHelper {
Error( "Can't open encrypted substream '" + sName + "', exception : " + e + "!" );
return false;
}
-
+
// encrypted streams will be compressed always, so after the storing this property is always true,
// although before the storing it can be set to false ( it is not always clear whether a stream is encrypted
// before the storing )
@@ -975,7 +975,7 @@ public class TestHelper {
Error( "Can't open substream '" + sPath + "', exception : " + e + "!" );
return false;
}
-
+
boolean bResult = InternalCheckStream( xSubStream, sPath, sMediaType, bCompressed, pBytes, true );
// free the stream resources, garbage collector may remove the object too late
@@ -992,7 +992,7 @@ public class TestHelper {
String sPass )
{
// Important: a common password for any of parent storage should not be set or
- // should be different from sPass
+ // should be different from sPass
XHierarchicalStorageAccess xHStorage =
(XHierarchicalStorageAccess) UnoRuntime.queryInterface( XHierarchicalStorageAccess.class, xParentStorage );
if ( xHStorage == null )
@@ -1015,7 +1015,7 @@ public class TestHelper {
Error( "Unexpected exception in case of opening of encrypted stream '" + sPath + "' without password: " + e + "!" );
return false;
}
-
+
String sWrongPass = "11";
sWrongPass += sPass;
try
@@ -1032,7 +1032,7 @@ public class TestHelper {
Error( "Unexpected exception in case of opening of encrypted stream '" + sPath + "' with wrong password: " + e + "!" );
return false;
}
-
+
XStream xSubStream = null;
try
{
@@ -1049,7 +1049,7 @@ public class TestHelper {
Error( "Can't open encrypted substream '" + sPath + "', exception : " + e + "!" );
return false;
}
-
+
// encrypted streams will be compressed always, so after the storing this property is always true,
// although before the storing it can be set to false ( it is not always clear whether a stream is encrypted
// before the storing )
@@ -1100,7 +1100,7 @@ public class TestHelper {
return true;
}
-
+
public boolean disposeStream( XStream xStream, String sStreamName )
{
XComponent xComponent = (XComponent) UnoRuntime.queryInterface( XComponent.class, xStream );
@@ -1109,7 +1109,7 @@ public class TestHelper {
Error( "Can't get XComponent implementation from substream '" + sStreamName + "'!" );
return false;
}
-
+
try
{
xComponent.dispose();
@@ -1190,7 +1190,7 @@ public class TestHelper {
Error( "Can't close output part of a stream, exception :" + e );
return false;
}
-
+
return true;
}
@@ -1232,7 +1232,7 @@ public class TestHelper {
public String CreateTempFile( XMultiServiceFactory xMSF )
{
String sResult = null;
-
+
// try to get temporary file representation
XPropertySet xTempFileProps = null;
try