1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: StorageUnitTest.java,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 package complex
.storages
;
32 import com
.sun
.star
.lang
.XMultiServiceFactory
;
33 import com
.sun
.star
.lang
.XMultiComponentFactory
;
34 import com
.sun
.star
.connection
.XConnector
;
35 import com
.sun
.star
.connection
.XConnection
;
37 import com
.sun
.star
.bridge
.XUnoUrlResolver
;
38 import com
.sun
.star
.uno
.UnoRuntime
;
39 import com
.sun
.star
.uno
.XInterface
;
40 import com
.sun
.star
.uno
.XNamingService
;
41 import com
.sun
.star
.uno
.XComponentContext
;
43 import com
.sun
.star
.container
.*;
44 import com
.sun
.star
.beans
.*;
45 import com
.sun
.star
.lang
.*;
47 import complexlib
.ComplexTestCase
;
49 import complex
.storages
.*;
55 /* This unit test for storage objects is designed to
56 * test most important statements from storage service
59 * Regression tests are added to extend the tested
62 public class StorageUnitTest
extends ComplexTestCase
64 private XMultiServiceFactory m_xMSF
= null;
65 private XSingleServiceFactory m_xStorageFactory
= null;
67 public String
[] getTestMethodNames()
87 "ExecuteRegressionTest_114358",
88 "ExecuteRegressionTest_i29169",
89 "ExecuteRegressionTest_i30400",
90 "ExecuteRegressionTest_i29321",
91 "ExecuteRegressionTest_i30677",
92 "ExecuteRegressionTest_i27773",
93 "ExecuteRegressionTest_i46848",
94 "ExecuteRegressionTest_i55821",
95 "ExecuteRegressionTest_i35095",
96 "ExecuteRegressionTest_i49755",
97 "ExecuteRegressionTest_i59886",
98 "ExecuteRegressionTest_i61909",
99 "ExecuteRegressionTest_i84234",
100 "ExecuteRegressionTest_125919"};
103 public String
getTestObjectName()
105 return "StorageUnitTest";
110 m_xMSF
= (XMultiServiceFactory
)param
.getMSF();
111 if ( m_xMSF
== null )
113 failed( "Can't create service factory!" );
118 Object oStorageFactory
= m_xMSF
.createInstance( "com.sun.star.embed.StorageFactory" );
119 m_xStorageFactory
= (XSingleServiceFactory
)UnoRuntime
.queryInterface( XSingleServiceFactory
.class,
124 failed( "Can't create storage factory!" );
128 if ( m_xStorageFactory
== null )
130 failed( "Can't create service factory!" );
135 public void ExecuteTest01()
137 StorageTest aTest
= new Test01( m_xMSF
, m_xStorageFactory
, log
);
138 assure( "Test01 failed!", aTest
.test() );
141 public void ExecuteTest02()
143 StorageTest aTest
= new Test02( m_xMSF
, m_xStorageFactory
, log
);
144 assure( "Test02 failed!", aTest
.test() );
147 public void ExecuteTest03()
149 StorageTest aTest
= new Test03( m_xMSF
, m_xStorageFactory
, log
);
150 assure( "Test03 failed!", aTest
.test() );
153 public void ExecuteTest04()
155 StorageTest aTest
= new Test04( m_xMSF
, m_xStorageFactory
, log
);
156 assure( "Test04 failed!", aTest
.test() );
159 public void ExecuteTest05()
161 StorageTest aTest
= new Test05( m_xMSF
, m_xStorageFactory
, log
);
162 assure( "Test05 failed!", aTest
.test() );
165 public void ExecuteTest06()
167 StorageTest aTest
= new Test06( m_xMSF
, m_xStorageFactory
, log
);
168 assure( "Test06 failed!", aTest
.test() );
171 public void ExecuteTest07()
173 StorageTest aTest
= new Test07( m_xMSF
, m_xStorageFactory
, log
);
174 assure( "Test07 failed!", aTest
.test() );
177 public void ExecuteTest08()
179 StorageTest aTest
= new Test08( m_xMSF
, m_xStorageFactory
, log
);
180 assure( "Test08 failed!", aTest
.test() );
183 public void ExecuteTest09()
185 StorageTest aTest
= new Test09( m_xMSF
, m_xStorageFactory
, log
);
186 assure( "Test09 failed!", aTest
.test() );
189 public void ExecuteTest10()
191 StorageTest aTest
= new Test10( m_xMSF
, m_xStorageFactory
, log
);
192 assure( "Test10 failed!", aTest
.test() );
195 public void ExecuteTest11()
197 StorageTest aTest
= new Test11( m_xMSF
, m_xStorageFactory
, log
);
198 assure( "Test11 failed!", aTest
.test() );
201 public void ExecuteTest12()
203 StorageTest aTest
= new Test12( m_xMSF
, m_xStorageFactory
, log
);
204 assure( "Test12 failed!", aTest
.test() );
207 public void ExecuteTest13()
209 StorageTest aTest
= new Test13( m_xMSF
, m_xStorageFactory
, log
);
210 assure( "Test13 failed!", aTest
.test() );
213 public void ExecuteTest14()
215 StorageTest aTest
= new Test14( m_xMSF
, m_xStorageFactory
, log
);
216 assure( "Test14 failed!", aTest
.test() );
219 public void ExecuteTest15()
221 StorageTest aTest
= new Test15( m_xMSF
, m_xStorageFactory
, log
);
222 assure( "Test15 failed!", aTest
.test() );
225 public void ExecuteTest16()
227 StorageTest aTest
= new Test16( m_xMSF
, m_xStorageFactory
, log
);
228 assure( "Test16 failed!", aTest
.test() );
231 public void ExecuteTest17()
233 StorageTest aTest
= new Test17( m_xMSF
, m_xStorageFactory
, log
);
234 assure( "Test17 failed!", aTest
.test() );
238 public void ExecuteRegressionTest_114358()
240 StorageTest aTest
= new RegressionTest_114358( m_xMSF
, m_xStorageFactory
, log
);
241 assure( "RegressionTest_114358 failed!", aTest
.test() );
244 public void ExecuteRegressionTest_i29169()
246 StorageTest aTest
= new RegressionTest_i29169( m_xMSF
, m_xStorageFactory
, log
);
247 assure( "RegressionTest_i29169 failed!", aTest
.test() );
250 public void ExecuteRegressionTest_i30400()
252 StorageTest aTest
= new RegressionTest_i30400( m_xMSF
, m_xStorageFactory
, log
);
253 assure( "RegressionTest_i30400 failed!", aTest
.test() );
256 public void ExecuteRegressionTest_i29321()
258 StorageTest aTest
= new RegressionTest_i29321( m_xMSF
, m_xStorageFactory
, log
);
259 assure( "RegressionTest_i29321 failed!", aTest
.test() );
262 public void ExecuteRegressionTest_i30677()
264 StorageTest aTest
= new RegressionTest_i30677( m_xMSF
, m_xStorageFactory
, log
);
265 assure( "RegressionTest_i30677 failed!", aTest
.test() );
268 public void ExecuteRegressionTest_i27773()
270 StorageTest aTest
= new RegressionTest_i27773( m_xMSF
, m_xStorageFactory
, log
);
271 assure( "RegressionTest_i27773 failed!", aTest
.test() );
274 public void ExecuteRegressionTest_i46848()
276 StorageTest aTest
= new RegressionTest_i46848( m_xMSF
, m_xStorageFactory
, log
);
277 assure( "RegressionTest_i46848 failed!", aTest
.test() );
280 public void ExecuteRegressionTest_i55821()
282 StorageTest aTest
= new RegressionTest_i55821( m_xMSF
, m_xStorageFactory
, log
);
283 assure( "RegressionTest_i55821 failed!", aTest
.test() );
286 public void ExecuteRegressionTest_i35095()
288 StorageTest aTest
= new RegressionTest_i35095( m_xMSF
, m_xStorageFactory
, log
);
289 assure( "RegressionTest_i35095 failed!", aTest
.test() );
292 public void ExecuteRegressionTest_i49755()
294 StorageTest aTest
= new RegressionTest_i49755( m_xMSF
, m_xStorageFactory
, log
);
295 assure( "RegressionTest_i49755 failed!", aTest
.test() );
298 public void ExecuteRegressionTest_i59886()
300 StorageTest aTest
= new RegressionTest_i59886( m_xMSF
, m_xStorageFactory
, log
);
301 assure( "RegressionTest_i59886 failed!", aTest
.test() );
304 public void ExecuteRegressionTest_i61909()
306 StorageTest aTest
= new RegressionTest_i61909( m_xMSF
, m_xStorageFactory
, log
);
307 assure( "RegressionTest_i61909 failed!", aTest
.test() );
310 public void ExecuteRegressionTest_i84234()
312 StorageTest aTest
= new RegressionTest_i84234( m_xMSF
, m_xStorageFactory
, log
);
313 assure( "RegressionTest_i84234 failed!", aTest
.test() );
316 public void ExecuteRegressionTest_125919()
318 StorageTest aTest
= new RegressionTest_125919( m_xMSF
, m_xStorageFactory
, log
);
319 assure( "RegressionTest_125919 failed!", aTest
.test() );