1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 package complex.storages; 24 25 import com.sun.star.lang.XMultiServiceFactory; 26 import com.sun.star.lang.XMultiComponentFactory; 27 import com.sun.star.connection.XConnector; 28 import com.sun.star.connection.XConnection; 29 30 import com.sun.star.bridge.XUnoUrlResolver; 31 import com.sun.star.uno.UnoRuntime; 32 import com.sun.star.uno.XInterface; 33 import com.sun.star.uno.XNamingService; 34 import com.sun.star.uno.XComponentContext; 35 36 import com.sun.star.container.*; 37 import com.sun.star.beans.*; 38 import com.sun.star.lang.*; 39 40 import complexlib.ComplexTestCase; 41 42 import complex.storages.*; 43 44 import util.utils; 45 import java.util.*; 46 import java.io.*; 47 48 /* This unit test for storage objects is designed to 49 * test most important statements from storage service 50 * specification. 51 * 52 * Regression tests are added to extend the tested 53 * functionalities. 54 */ 55 public class StorageUnitTest extends ComplexTestCase 56 { 57 private XMultiServiceFactory m_xMSF = null; 58 private XSingleServiceFactory m_xStorageFactory = null; 59 getTestMethodNames()60 public String[] getTestMethodNames() 61 { 62 return new String[] { 63 "ExecuteTest01", 64 "ExecuteTest02", 65 "ExecuteTest03", 66 "ExecuteTest04", 67 "ExecuteTest05", 68 "ExecuteTest06", 69 "ExecuteTest07", 70 "ExecuteTest08", 71 "ExecuteTest09", 72 "ExecuteTest10", 73 "ExecuteTest11", 74 "ExecuteTest12", 75 "ExecuteTest13", 76 "ExecuteTest14", 77 "ExecuteTest15", 78 "ExecuteTest16", 79 "ExecuteTest17", 80 "ExecuteTest18", 81 "ExecuteRegressionTest_114358", 82 "ExecuteRegressionTest_i29169", 83 "ExecuteRegressionTest_i30400", 84 "ExecuteRegressionTest_i29321", 85 "ExecuteRegressionTest_i30677", 86 "ExecuteRegressionTest_i27773", 87 "ExecuteRegressionTest_i46848", 88 "ExecuteRegressionTest_i55821", 89 "ExecuteRegressionTest_i35095", 90 "ExecuteRegressionTest_i49755", 91 "ExecuteRegressionTest_i59886", 92 "ExecuteRegressionTest_i61909", 93 "ExecuteRegressionTest_i84234", 94 "ExecuteRegressionTest_125919" 95 }; 96 } 97 getTestObjectName()98 public String getTestObjectName() 99 { 100 return "StorageUnitTest"; 101 } 102 before()103 public void before() 104 { 105 m_xMSF = (XMultiServiceFactory)param.getMSF(); 106 if ( m_xMSF == null ) 107 { 108 failed( "Can't create service factory!" ); 109 return; 110 } 111 112 try { 113 Object oStorageFactory = m_xMSF.createInstance( "com.sun.star.embed.StorageFactory" ); 114 m_xStorageFactory = (XSingleServiceFactory)UnoRuntime.queryInterface( XSingleServiceFactory.class, 115 oStorageFactory ); 116 } 117 catch( Exception e ) 118 { 119 failed( "Can't create storage factory!" ); 120 return; 121 } 122 123 if ( m_xStorageFactory == null ) 124 { 125 failed( "Can't create service factory!" ); 126 return; 127 } 128 } 129 ExecuteTest01()130 public void ExecuteTest01() 131 { 132 StorageTest aTest = new Test01( m_xMSF, m_xStorageFactory, log ); 133 assure( "Test01 failed!", aTest.test() ); 134 } 135 ExecuteTest02()136 public void ExecuteTest02() 137 { 138 StorageTest aTest = new Test02( m_xMSF, m_xStorageFactory, log ); 139 assure( "Test02 failed!", aTest.test() ); 140 } 141 ExecuteTest03()142 public void ExecuteTest03() 143 { 144 StorageTest aTest = new Test03( m_xMSF, m_xStorageFactory, log ); 145 assure( "Test03 failed!", aTest.test() ); 146 } 147 ExecuteTest04()148 public void ExecuteTest04() 149 { 150 StorageTest aTest = new Test04( m_xMSF, m_xStorageFactory, log ); 151 assure( "Test04 failed!", aTest.test() ); 152 } 153 ExecuteTest05()154 public void ExecuteTest05() 155 { 156 StorageTest aTest = new Test05( m_xMSF, m_xStorageFactory, log ); 157 assure( "Test05 failed!", aTest.test() ); 158 } 159 ExecuteTest06()160 public void ExecuteTest06() 161 { 162 StorageTest aTest = new Test06( m_xMSF, m_xStorageFactory, log ); 163 assure( "Test06 failed!", aTest.test() ); 164 } 165 ExecuteTest07()166 public void ExecuteTest07() 167 { 168 StorageTest aTest = new Test07( m_xMSF, m_xStorageFactory, log ); 169 assure( "Test07 failed!", aTest.test() ); 170 } 171 ExecuteTest08()172 public void ExecuteTest08() 173 { 174 StorageTest aTest = new Test08( m_xMSF, m_xStorageFactory, log ); 175 assure( "Test08 failed!", aTest.test() ); 176 } 177 ExecuteTest09()178 public void ExecuteTest09() 179 { 180 StorageTest aTest = new Test09( m_xMSF, m_xStorageFactory, log ); 181 assure( "Test09 failed!", aTest.test() ); 182 } 183 ExecuteTest10()184 public void ExecuteTest10() 185 { 186 StorageTest aTest = new Test10( m_xMSF, m_xStorageFactory, log ); 187 assure( "Test10 failed!", aTest.test() ); 188 } 189 ExecuteTest11()190 public void ExecuteTest11() 191 { 192 StorageTest aTest = new Test11( m_xMSF, m_xStorageFactory, log ); 193 assure( "Test11 failed!", aTest.test() ); 194 } 195 ExecuteTest12()196 public void ExecuteTest12() 197 { 198 StorageTest aTest = new Test12( m_xMSF, m_xStorageFactory, log ); 199 assure( "Test12 failed!", aTest.test() ); 200 } 201 ExecuteTest13()202 public void ExecuteTest13() 203 { 204 StorageTest aTest = new Test13( m_xMSF, m_xStorageFactory, log ); 205 assure( "Test13 failed!", aTest.test() ); 206 } 207 ExecuteTest14()208 public void ExecuteTest14() 209 { 210 StorageTest aTest = new Test14( m_xMSF, m_xStorageFactory, log ); 211 assure( "Test14 failed!", aTest.test() ); 212 } 213 ExecuteTest15()214 public void ExecuteTest15() 215 { 216 StorageTest aTest = new Test15( m_xMSF, m_xStorageFactory, log ); 217 assure( "Test15 failed!", aTest.test() ); 218 } 219 ExecuteTest16()220 public void ExecuteTest16() 221 { 222 StorageTest aTest = new Test16( m_xMSF, m_xStorageFactory, log ); 223 assure( "Test16 failed!", aTest.test() ); 224 } 225 ExecuteTest17()226 public void ExecuteTest17() 227 { 228 StorageTest aTest = new Test17( m_xMSF, m_xStorageFactory, log ); 229 assure( "Test17 failed!", aTest.test() ); 230 } 231 ExecuteTest18()232 public void ExecuteTest18() 233 { 234 StorageTest aTest = new Test18( m_xMSF, m_xStorageFactory, log ); 235 assure( "Test18 failed!", aTest.test() ); 236 } 237 ExecuteRegressionTest_114358()238 public void ExecuteRegressionTest_114358() 239 { 240 StorageTest aTest = new RegressionTest_114358( m_xMSF, m_xStorageFactory, log ); 241 assure( "RegressionTest_114358 failed!", aTest.test() ); 242 } 243 ExecuteRegressionTest_i29169()244 public void ExecuteRegressionTest_i29169() 245 { 246 StorageTest aTest = new RegressionTest_i29169( m_xMSF, m_xStorageFactory, log ); 247 assure( "RegressionTest_i29169 failed!", aTest.test() ); 248 } 249 ExecuteRegressionTest_i30400()250 public void ExecuteRegressionTest_i30400() 251 { 252 StorageTest aTest = new RegressionTest_i30400( m_xMSF, m_xStorageFactory, log ); 253 assure( "RegressionTest_i30400 failed!", aTest.test() ); 254 } 255 ExecuteRegressionTest_i29321()256 public void ExecuteRegressionTest_i29321() 257 { 258 StorageTest aTest = new RegressionTest_i29321( m_xMSF, m_xStorageFactory, log ); 259 assure( "RegressionTest_i29321 failed!", aTest.test() ); 260 } 261 ExecuteRegressionTest_i30677()262 public void ExecuteRegressionTest_i30677() 263 { 264 StorageTest aTest = new RegressionTest_i30677( m_xMSF, m_xStorageFactory, log ); 265 assure( "RegressionTest_i30677 failed!", aTest.test() ); 266 } 267 ExecuteRegressionTest_i27773()268 public void ExecuteRegressionTest_i27773() 269 { 270 StorageTest aTest = new RegressionTest_i27773( m_xMSF, m_xStorageFactory, log ); 271 assure( "RegressionTest_i27773 failed!", aTest.test() ); 272 } 273 ExecuteRegressionTest_i46848()274 public void ExecuteRegressionTest_i46848() 275 { 276 StorageTest aTest = new RegressionTest_i46848( m_xMSF, m_xStorageFactory, log ); 277 assure( "RegressionTest_i46848 failed!", aTest.test() ); 278 } 279 ExecuteRegressionTest_i55821()280 public void ExecuteRegressionTest_i55821() 281 { 282 StorageTest aTest = new RegressionTest_i55821( m_xMSF, m_xStorageFactory, log ); 283 assure( "RegressionTest_i55821 failed!", aTest.test() ); 284 } 285 ExecuteRegressionTest_i35095()286 public void ExecuteRegressionTest_i35095() 287 { 288 StorageTest aTest = new RegressionTest_i35095( m_xMSF, m_xStorageFactory, log ); 289 assure( "RegressionTest_i35095 failed!", aTest.test() ); 290 } 291 ExecuteRegressionTest_i49755()292 public void ExecuteRegressionTest_i49755() 293 { 294 StorageTest aTest = new RegressionTest_i49755( m_xMSF, m_xStorageFactory, log ); 295 assure( "RegressionTest_i49755 failed!", aTest.test() ); 296 } 297 ExecuteRegressionTest_i59886()298 public void ExecuteRegressionTest_i59886() 299 { 300 StorageTest aTest = new RegressionTest_i59886( m_xMSF, m_xStorageFactory, log ); 301 assure( "RegressionTest_i59886 failed!", aTest.test() ); 302 } 303 ExecuteRegressionTest_i61909()304 public void ExecuteRegressionTest_i61909() 305 { 306 StorageTest aTest = new RegressionTest_i61909( m_xMSF, m_xStorageFactory, log ); 307 assure( "RegressionTest_i61909 failed!", aTest.test() ); 308 } 309 ExecuteRegressionTest_i84234()310 public void ExecuteRegressionTest_i84234() 311 { 312 StorageTest aTest = new RegressionTest_i84234( m_xMSF, m_xStorageFactory, log ); 313 assure( "RegressionTest_i84234 failed!", aTest.test() ); 314 } 315 ExecuteRegressionTest_125919()316 public void ExecuteRegressionTest_125919() 317 { 318 StorageTest aTest = new RegressionTest_125919( m_xMSF, m_xStorageFactory, log ); 319 assure( "RegressionTest_125919 failed!", aTest.test() ); 320 } 321 } 322 323