xref: /AOO41X/main/package/qa/storages/RegressionTest_i29169.java (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir package complex.storages;
2*cdf0e10cSrcweir 
3*cdf0e10cSrcweir import com.sun.star.uno.XInterface;
4*cdf0e10cSrcweir import com.sun.star.lang.XMultiServiceFactory;
5*cdf0e10cSrcweir import com.sun.star.lang.XSingleServiceFactory;
6*cdf0e10cSrcweir 
7*cdf0e10cSrcweir import com.sun.star.bridge.XUnoUrlResolver;
8*cdf0e10cSrcweir import com.sun.star.uno.UnoRuntime;
9*cdf0e10cSrcweir import com.sun.star.uno.XInterface;
10*cdf0e10cSrcweir import com.sun.star.io.XStream;
11*cdf0e10cSrcweir import com.sun.star.io.XInputStream;
12*cdf0e10cSrcweir 
13*cdf0e10cSrcweir import com.sun.star.embed.*;
14*cdf0e10cSrcweir 
15*cdf0e10cSrcweir import share.LogWriter;
16*cdf0e10cSrcweir import complex.storages.TestHelper;
17*cdf0e10cSrcweir import complex.storages.StorageTest;
18*cdf0e10cSrcweir 
19*cdf0e10cSrcweir public class RegressionTest_i29169 implements StorageTest {
20*cdf0e10cSrcweir 
21*cdf0e10cSrcweir 	XMultiServiceFactory m_xMSF;
22*cdf0e10cSrcweir 	XSingleServiceFactory m_xStorageFactory;
23*cdf0e10cSrcweir 	TestHelper m_aTestHelper;
24*cdf0e10cSrcweir 
25*cdf0e10cSrcweir 	public RegressionTest_i29169( XMultiServiceFactory xMSF, XSingleServiceFactory xStorageFactory, LogWriter aLogWriter )
26*cdf0e10cSrcweir 	{
27*cdf0e10cSrcweir 		m_xMSF = xMSF;
28*cdf0e10cSrcweir 		m_xStorageFactory = xStorageFactory;
29*cdf0e10cSrcweir 		m_aTestHelper = new TestHelper( aLogWriter, "RegressionTest_i29169: " );
30*cdf0e10cSrcweir 	}
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir     public boolean test()
33*cdf0e10cSrcweir 	{
34*cdf0e10cSrcweir 		try
35*cdf0e10cSrcweir 		{
36*cdf0e10cSrcweir 			XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF );
37*cdf0e10cSrcweir 			if ( xTempFileStream == null )
38*cdf0e10cSrcweir 				return false;
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir 			// create storage based on the temporary stream
41*cdf0e10cSrcweir 			Object pArgs[] = new Object[2];
42*cdf0e10cSrcweir 			pArgs[0] = (Object) xTempFileStream;
43*cdf0e10cSrcweir 			pArgs[1] = new Integer( ElementModes.WRITE );
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir 			Object oTempStorage = m_xStorageFactory.createInstanceWithArguments( pArgs );
46*cdf0e10cSrcweir 			XStorage xTempStorage = (XStorage) UnoRuntime.queryInterface( XStorage.class, oTempStorage );
47*cdf0e10cSrcweir 			if ( xTempStorage == null )
48*cdf0e10cSrcweir 			{
49*cdf0e10cSrcweir 				m_aTestHelper.Error( "Can't create temporary storage representation!" );
50*cdf0e10cSrcweir 				return false;
51*cdf0e10cSrcweir 			}
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir 			// open a new substorage
54*cdf0e10cSrcweir 			XStorage xTempSubStorage = m_aTestHelper.openSubStorage( xTempStorage,
55*cdf0e10cSrcweir 																	"SubStorage1",
56*cdf0e10cSrcweir 																	ElementModes.WRITE );
57*cdf0e10cSrcweir 			if ( xTempSubStorage == null )
58*cdf0e10cSrcweir 			{
59*cdf0e10cSrcweir 				m_aTestHelper.Error( "Can't create substorage!" );
60*cdf0e10cSrcweir 				return false;
61*cdf0e10cSrcweir 			}
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir 			byte pBytes1[] = { 1, 1, 1, 1, 1 };
64*cdf0e10cSrcweir 
65*cdf0e10cSrcweir 			// open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes
66*cdf0e10cSrcweir 			if ( !m_aTestHelper.WriteBytesToSubstream( xTempSubStorage, "SubStream1", "MediaType1", true, pBytes1 ) )
67*cdf0e10cSrcweir 				return false;
68*cdf0e10cSrcweir 
69*cdf0e10cSrcweir 			// open a new substorage in the existing substorage
70*cdf0e10cSrcweir 			XStorage xTempSubSubStorage = m_aTestHelper.openSubStorage( xTempSubStorage,
71*cdf0e10cSrcweir 																		"SubSubStorage1",
72*cdf0e10cSrcweir 																		ElementModes.WRITE );
73*cdf0e10cSrcweir 			if ( xTempSubStorage == null )
74*cdf0e10cSrcweir 			{
75*cdf0e10cSrcweir 				m_aTestHelper.Error( "Can't create substorage!" );
76*cdf0e10cSrcweir 				return false;
77*cdf0e10cSrcweir 			}
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir 			// open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes
80*cdf0e10cSrcweir 			if ( !m_aTestHelper.WriteBytesToSubstream( xTempSubSubStorage, "SubSubStream1", "MediaType2", true, pBytes1 ) )
81*cdf0e10cSrcweir 				return false;
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir 			// set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly
84*cdf0e10cSrcweir 			if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempSubSubStorage,
85*cdf0e10cSrcweir 															"MediaType3",
86*cdf0e10cSrcweir 															false,
87*cdf0e10cSrcweir 															ElementModes.WRITE ) )
88*cdf0e10cSrcweir 				return false;
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir 			// set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly
92*cdf0e10cSrcweir 			if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempSubStorage,
93*cdf0e10cSrcweir 															"MediaType4",
94*cdf0e10cSrcweir 															false,
95*cdf0e10cSrcweir 															ElementModes.WRITE ) )
96*cdf0e10cSrcweir 				return false;
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir 			// set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly
99*cdf0e10cSrcweir 			if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempStorage,
100*cdf0e10cSrcweir 															"MediaType5",
101*cdf0e10cSrcweir 															true,
102*cdf0e10cSrcweir 															ElementModes.WRITE ) )
103*cdf0e10cSrcweir 				return false;
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir 			// ================================================
106*cdf0e10cSrcweir 			// commit the storages, and check the renaming in all stages
107*cdf0e10cSrcweir 			// ================================================
108*cdf0e10cSrcweir 
109*cdf0e10cSrcweir 			// rename the storage before it is commited
110*cdf0e10cSrcweir 			if ( !m_aTestHelper.renameElement( xTempSubStorage, "SubSubStorage1", "SubSubStorage2" ) )
111*cdf0e10cSrcweir 				return false;
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir 			// rename the stream
114*cdf0e10cSrcweir 			if ( !m_aTestHelper.renameElement( xTempSubStorage, "SubStream1", "SubStream2" ) )
115*cdf0e10cSrcweir 				return false;
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir 			// commit lowlevel substorage first
118*cdf0e10cSrcweir 			if ( !m_aTestHelper.commitStorage( xTempSubSubStorage ) )
119*cdf0e10cSrcweir 				return false;
120*cdf0e10cSrcweir 
121*cdf0e10cSrcweir 			// rename the storage after it is commited
122*cdf0e10cSrcweir 			if ( !m_aTestHelper.renameElement( xTempSubStorage, "SubSubStorage2", "SubSubStorage3" ) )
123*cdf0e10cSrcweir 				return false;
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir 			// rename the stream one more time
126*cdf0e10cSrcweir 			if ( !m_aTestHelper.renameElement( xTempSubStorage, "SubStream2", "SubStream3" ) )
127*cdf0e10cSrcweir 				return false;
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir 			// commit substorage
130*cdf0e10cSrcweir 			if ( !m_aTestHelper.commitStorage( xTempSubStorage ) )
131*cdf0e10cSrcweir 				return false;
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir 			// rename the storage after it`s parent is commited
134*cdf0e10cSrcweir 			if ( !m_aTestHelper.renameElement( xTempSubStorage, "SubSubStorage3", "SubSubStorage4" ) )
135*cdf0e10cSrcweir 				return false;
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir 			// rename the stream after it`s parent is commited
138*cdf0e10cSrcweir 			if ( !m_aTestHelper.renameElement( xTempSubStorage, "SubStream3", "SubStream4" ) )
139*cdf0e10cSrcweir 				return false;
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir 			// commit substorage to let the renaming take place
142*cdf0e10cSrcweir 			if ( !m_aTestHelper.commitStorage( xTempSubStorage ) )
143*cdf0e10cSrcweir 				return false;
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir 			// commit the root storage so the contents must be stored now
146*cdf0e10cSrcweir 			if ( !m_aTestHelper.commitStorage( xTempStorage ) )
147*cdf0e10cSrcweir 				return false;
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir 			// rename the storage after the package is commited
150*cdf0e10cSrcweir 			if ( !m_aTestHelper.renameElement( xTempSubStorage, "SubSubStorage4", "SubSubStorage5" ) )
151*cdf0e10cSrcweir 				return false;
152*cdf0e10cSrcweir 
153*cdf0e10cSrcweir 			// rename the stream after it`s parent is commited
154*cdf0e10cSrcweir 			if ( !m_aTestHelper.renameElement( xTempSubStorage, "SubStream4", "SubStream5" ) )
155*cdf0e10cSrcweir 				return false;
156*cdf0e10cSrcweir 
157*cdf0e10cSrcweir 			// commit substorage to let the renaming take place
158*cdf0e10cSrcweir 			if ( !m_aTestHelper.commitStorage( xTempSubStorage ) )
159*cdf0e10cSrcweir 				return false;
160*cdf0e10cSrcweir 
161*cdf0e10cSrcweir 			// commit the root storage so the contents must be stored now
162*cdf0e10cSrcweir 			if ( !m_aTestHelper.commitStorage( xTempStorage ) )
163*cdf0e10cSrcweir 				return false;
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir 			// ================================================
166*cdf0e10cSrcweir 			// dispose the storages
167*cdf0e10cSrcweir 			// ================================================
168*cdf0e10cSrcweir 
169*cdf0e10cSrcweir 			// dispose lowerest substorage
170*cdf0e10cSrcweir 			if ( !m_aTestHelper.disposeStorage( xTempSubSubStorage ) )
171*cdf0e10cSrcweir 				return false;
172*cdf0e10cSrcweir 
173*cdf0e10cSrcweir 			// dispose substorage
174*cdf0e10cSrcweir 			if ( !m_aTestHelper.disposeStorage( xTempSubStorage ) )
175*cdf0e10cSrcweir 				return false;
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir 			// dispose the temporary storage
178*cdf0e10cSrcweir 			if ( !m_aTestHelper.disposeStorage( xTempStorage ) )
179*cdf0e10cSrcweir 				return false;
180*cdf0e10cSrcweir 
181*cdf0e10cSrcweir 			// ================================================
182*cdf0e10cSrcweir 			// create a new storage based on the stream and check the substreams and substorages
183*cdf0e10cSrcweir 			// ================================================
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir 			oTempStorage = m_xStorageFactory.createInstanceWithArguments( pArgs );
186*cdf0e10cSrcweir 			xTempStorage = (XStorage) UnoRuntime.queryInterface( XStorage.class, oTempStorage );
187*cdf0e10cSrcweir 			if ( xTempStorage == null )
188*cdf0e10cSrcweir 			{
189*cdf0e10cSrcweir 				m_aTestHelper.Error( "Can't create temporary storage representation!" );
190*cdf0e10cSrcweir 				return false;
191*cdf0e10cSrcweir 			}
192*cdf0e10cSrcweir 
193*cdf0e10cSrcweir 			// open the substorage
194*cdf0e10cSrcweir 			xTempSubStorage = m_aTestHelper.openSubStorage( xTempStorage,
195*cdf0e10cSrcweir 															"SubStorage1",
196*cdf0e10cSrcweir 															ElementModes.WRITE );
197*cdf0e10cSrcweir 			if ( xTempSubStorage == null )
198*cdf0e10cSrcweir 			{
199*cdf0e10cSrcweir 				m_aTestHelper.Error( "Can't create substorage!" );
200*cdf0e10cSrcweir 				return false;
201*cdf0e10cSrcweir 			}
202*cdf0e10cSrcweir 
203*cdf0e10cSrcweir 			// open the lowlevel substorage
204*cdf0e10cSrcweir 			xTempSubSubStorage = m_aTestHelper.openSubStorage( xTempSubStorage,
205*cdf0e10cSrcweir 																		"SubSubStorage5",
206*cdf0e10cSrcweir 																		ElementModes.WRITE );
207*cdf0e10cSrcweir 			if ( xTempSubStorage == null )
208*cdf0e10cSrcweir 			{
209*cdf0e10cSrcweir 				m_aTestHelper.Error( "Can't create substorage!" );
210*cdf0e10cSrcweir 				return false;
211*cdf0e10cSrcweir 			}
212*cdf0e10cSrcweir 
213*cdf0e10cSrcweir 			// check the storages and streams
214*cdf0e10cSrcweir 
215*cdf0e10cSrcweir 			if ( !m_aTestHelper.checkStorageProperties( xTempSubSubStorage, "MediaType3", false, ElementModes.WRITE ) )
216*cdf0e10cSrcweir 				return false;
217*cdf0e10cSrcweir 
218*cdf0e10cSrcweir 			if ( !m_aTestHelper.checkStorageProperties( xTempSubStorage, "MediaType4", false, ElementModes.WRITE ) )
219*cdf0e10cSrcweir 				return false;
220*cdf0e10cSrcweir 
221*cdf0e10cSrcweir 			if ( !m_aTestHelper.checkStorageProperties( xTempStorage, "MediaType5", true, ElementModes.WRITE ) )
222*cdf0e10cSrcweir 				return false;
223*cdf0e10cSrcweir 
224*cdf0e10cSrcweir 			if ( !m_aTestHelper.checkStream( xTempSubStorage, "SubStream5", "MediaType1", true, pBytes1 ) )
225*cdf0e10cSrcweir 				return false;
226*cdf0e10cSrcweir 
227*cdf0e10cSrcweir 			if ( !m_aTestHelper.checkStream( xTempSubSubStorage, "SubSubStream1", "MediaType2", true, pBytes1 ) )
228*cdf0e10cSrcweir 				return false;
229*cdf0e10cSrcweir 
230*cdf0e10cSrcweir 			// ================================================
231*cdf0e10cSrcweir 			// rename the reopened storages and streams
232*cdf0e10cSrcweir 			// ================================================
233*cdf0e10cSrcweir 
234*cdf0e10cSrcweir 			// rename the storage before it is commited
235*cdf0e10cSrcweir 			if ( !m_aTestHelper.renameElement( xTempSubStorage, "SubSubStorage5", "SubSubStorage6" ) )
236*cdf0e10cSrcweir 				return false;
237*cdf0e10cSrcweir 
238*cdf0e10cSrcweir 			// rename the stream
239*cdf0e10cSrcweir 			if ( !m_aTestHelper.renameElement( xTempSubStorage, "SubStream5", "SubStream6" ) )
240*cdf0e10cSrcweir 				return false;
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir 			// commit lowlevel substorage first
243*cdf0e10cSrcweir 			if ( !m_aTestHelper.commitStorage( xTempSubSubStorage ) )
244*cdf0e10cSrcweir 				return false;
245*cdf0e10cSrcweir 
246*cdf0e10cSrcweir 			// rename the storage after it is commited
247*cdf0e10cSrcweir 			if ( !m_aTestHelper.renameElement( xTempSubStorage, "SubSubStorage6", "SubSubStorage7" ) )
248*cdf0e10cSrcweir 				return false;
249*cdf0e10cSrcweir 
250*cdf0e10cSrcweir 			// rename the stream one more time
251*cdf0e10cSrcweir 			if ( !m_aTestHelper.renameElement( xTempSubStorage, "SubStream6", "SubStream7" ) )
252*cdf0e10cSrcweir 				return false;
253*cdf0e10cSrcweir 
254*cdf0e10cSrcweir 			// commit substorage
255*cdf0e10cSrcweir 			if ( !m_aTestHelper.commitStorage( xTempSubStorage ) )
256*cdf0e10cSrcweir 				return false;
257*cdf0e10cSrcweir 
258*cdf0e10cSrcweir 			// rename the storage after it`s parent is commited
259*cdf0e10cSrcweir 			if ( !m_aTestHelper.renameElement( xTempSubStorage, "SubSubStorage7", "SubSubStorage8" ) )
260*cdf0e10cSrcweir 				return false;
261*cdf0e10cSrcweir 
262*cdf0e10cSrcweir 			// rename the stream after it`s parent is commited
263*cdf0e10cSrcweir 			if ( !m_aTestHelper.renameElement( xTempSubStorage, "SubStream7", "SubStream8" ) )
264*cdf0e10cSrcweir 				return false;
265*cdf0e10cSrcweir 
266*cdf0e10cSrcweir 			// commit substorage to let the renaming take place
267*cdf0e10cSrcweir 			if ( !m_aTestHelper.commitStorage( xTempSubStorage ) )
268*cdf0e10cSrcweir 				return false;
269*cdf0e10cSrcweir 
270*cdf0e10cSrcweir 			// commit the root storage so the contents must be stored now
271*cdf0e10cSrcweir 			if ( !m_aTestHelper.commitStorage( xTempStorage ) )
272*cdf0e10cSrcweir 				return false;
273*cdf0e10cSrcweir 
274*cdf0e10cSrcweir 			// rename the storage after the package is commited
275*cdf0e10cSrcweir 			if ( !m_aTestHelper.renameElement( xTempSubStorage, "SubSubStorage8", "SubSubStorage9" ) )
276*cdf0e10cSrcweir 				return false;
277*cdf0e10cSrcweir 
278*cdf0e10cSrcweir 			// rename the stream after it`s parent is commited
279*cdf0e10cSrcweir 			if ( !m_aTestHelper.renameElement( xTempSubStorage, "SubStream8", "SubStream9" ) )
280*cdf0e10cSrcweir 				return false;
281*cdf0e10cSrcweir 
282*cdf0e10cSrcweir 			// commit substorage to let the renaming take place
283*cdf0e10cSrcweir 			if ( !m_aTestHelper.commitStorage( xTempSubStorage ) )
284*cdf0e10cSrcweir 				return false;
285*cdf0e10cSrcweir 
286*cdf0e10cSrcweir 			// commit the root storage so the contents must be stored now
287*cdf0e10cSrcweir 			if ( !m_aTestHelper.commitStorage( xTempStorage ) )
288*cdf0e10cSrcweir 				return false;
289*cdf0e10cSrcweir 
290*cdf0e10cSrcweir 			// ================================================
291*cdf0e10cSrcweir 			// dispose the storages
292*cdf0e10cSrcweir 			// ================================================
293*cdf0e10cSrcweir 
294*cdf0e10cSrcweir 			// dispose lowerest substorage
295*cdf0e10cSrcweir 			if ( !m_aTestHelper.disposeStorage( xTempSubSubStorage ) )
296*cdf0e10cSrcweir 				return false;
297*cdf0e10cSrcweir 
298*cdf0e10cSrcweir 			// dispose substorage
299*cdf0e10cSrcweir 			if ( !m_aTestHelper.disposeStorage( xTempSubStorage ) )
300*cdf0e10cSrcweir 				return false;
301*cdf0e10cSrcweir 
302*cdf0e10cSrcweir 			// dispose the temporary storage
303*cdf0e10cSrcweir 			if ( !m_aTestHelper.disposeStorage( xTempStorage ) )
304*cdf0e10cSrcweir 				return false;
305*cdf0e10cSrcweir 
306*cdf0e10cSrcweir 
307*cdf0e10cSrcweir 			// ================================================
308*cdf0e10cSrcweir 			// create a new readonly storage based on the stream and check the contents
309*cdf0e10cSrcweir 			// ================================================
310*cdf0e10cSrcweir 
311*cdf0e10cSrcweir 			pArgs[1] = new Integer( ElementModes.READ );
312*cdf0e10cSrcweir 			oTempStorage = m_xStorageFactory.createInstanceWithArguments( pArgs );
313*cdf0e10cSrcweir 			xTempStorage = (XStorage) UnoRuntime.queryInterface( XStorage.class, oTempStorage );
314*cdf0e10cSrcweir 			if ( xTempStorage == null )
315*cdf0e10cSrcweir 			{
316*cdf0e10cSrcweir 				m_aTestHelper.Error( "Can't create temporary storage representation!" );
317*cdf0e10cSrcweir 				return false;
318*cdf0e10cSrcweir 			}
319*cdf0e10cSrcweir 
320*cdf0e10cSrcweir 			// open the substorage
321*cdf0e10cSrcweir 			xTempSubStorage = m_aTestHelper.openSubStorage( xTempStorage,
322*cdf0e10cSrcweir 															"SubStorage1",
323*cdf0e10cSrcweir 															ElementModes.READ );
324*cdf0e10cSrcweir 			if ( xTempSubStorage == null )
325*cdf0e10cSrcweir 			{
326*cdf0e10cSrcweir 				m_aTestHelper.Error( "Can't create substorage!" );
327*cdf0e10cSrcweir 				return false;
328*cdf0e10cSrcweir 			}
329*cdf0e10cSrcweir 
330*cdf0e10cSrcweir 			// open the lowlevel substorage
331*cdf0e10cSrcweir 			xTempSubSubStorage = m_aTestHelper.openSubStorage( xTempSubStorage,
332*cdf0e10cSrcweir 																		"SubSubStorage9",
333*cdf0e10cSrcweir 																		ElementModes.READ );
334*cdf0e10cSrcweir 			if ( xTempSubStorage == null )
335*cdf0e10cSrcweir 			{
336*cdf0e10cSrcweir 				m_aTestHelper.Error( "Can't create substorage!" );
337*cdf0e10cSrcweir 				return false;
338*cdf0e10cSrcweir 			}
339*cdf0e10cSrcweir 
340*cdf0e10cSrcweir 			// check the storages and streams
341*cdf0e10cSrcweir 
342*cdf0e10cSrcweir 			if ( !m_aTestHelper.checkStorageProperties( xTempSubSubStorage, "MediaType3", false, ElementModes.READ ) )
343*cdf0e10cSrcweir 				return false;
344*cdf0e10cSrcweir 
345*cdf0e10cSrcweir 			if ( !m_aTestHelper.checkStorageProperties( xTempSubStorage, "MediaType4", false, ElementModes.READ ) )
346*cdf0e10cSrcweir 				return false;
347*cdf0e10cSrcweir 
348*cdf0e10cSrcweir 			if ( !m_aTestHelper.checkStorageProperties( xTempStorage, "MediaType5", true, ElementModes.READ ) )
349*cdf0e10cSrcweir 				return false;
350*cdf0e10cSrcweir 
351*cdf0e10cSrcweir 			if ( !m_aTestHelper.checkStream( xTempSubStorage, "SubStream9", "MediaType1", true, pBytes1 ) )
352*cdf0e10cSrcweir 				return false;
353*cdf0e10cSrcweir 
354*cdf0e10cSrcweir 			if ( !m_aTestHelper.checkStream( xTempSubSubStorage, "SubSubStream1", "MediaType2", true, pBytes1 ) )
355*cdf0e10cSrcweir 				return false;
356*cdf0e10cSrcweir 
357*cdf0e10cSrcweir 			// the storage is based on the temporary stream so it can be left undisposed, since it does not lock
358*cdf0e10cSrcweir 			// any resource, later the garbage collector will release the object and it must die by refcount
359*cdf0e10cSrcweir 
360*cdf0e10cSrcweir 			return true;
361*cdf0e10cSrcweir 		}
362*cdf0e10cSrcweir 		catch( Exception e )
363*cdf0e10cSrcweir 		{
364*cdf0e10cSrcweir 			m_aTestHelper.Error( "Exception: " + e );
365*cdf0e10cSrcweir 			return false;
366*cdf0e10cSrcweir 		}
367*cdf0e10cSrcweir     }
368*cdf0e10cSrcweir }
369*cdf0e10cSrcweir 
370