Update ooo320-m1
[ooovba.git] / package / qa / ofopxmlstorages / StorageUnitTest.java
blobacb4de6bc146f1bb0f96ca0401d92a8bf85d127c
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: StorageUnitTest.java,v $
10 * $Revision: 1.3 $
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.ofopxmlstorages;
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.ofopxmlstorages.*;
51 import util.utils;
52 import java.util.*;
53 import java.io.*;
55 /* This unit test for storage objects is designed to
56 * test most important statements from storage service
57 * specification.
59 * Regression tests are added to extend the tested
60 * functionalities.
62 public class StorageUnitTest extends ComplexTestCase
64 private XMultiServiceFactory m_xMSF = null;
65 private XSingleServiceFactory m_xStorageFactory = null;
67 public String[] getTestMethodNames()
69 return new String[] {
70 "ExecuteTest01",
71 "ExecuteTest02",
72 "ExecuteTest03",
73 "ExecuteTest04",
74 "ExecuteTest05",
75 "ExecuteTest06",
76 "ExecuteTest07",
77 "ExecuteTest08"
81 public String getTestObjectName()
83 return "StorageUnitTest";
86 public void before()
88 m_xMSF = (XMultiServiceFactory)param.getMSF();
89 if ( m_xMSF == null )
91 failed( "Can't create service factory!" );
92 return;
95 try {
96 Object oStorageFactory = m_xMSF.createInstance( "com.sun.star.embed.StorageFactory" );
97 m_xStorageFactory = (XSingleServiceFactory)UnoRuntime.queryInterface( XSingleServiceFactory.class,
98 oStorageFactory );
100 catch( Exception e )
102 failed( "Can't create storage factory!" );
103 return;
106 if ( m_xStorageFactory == null )
108 failed( "Can't create service factory!" );
109 return;
113 public void ExecuteTest01()
115 StorageTest aTest = new Test01( m_xMSF, m_xStorageFactory, log );
116 assure( "Test01 failed!", aTest.test() );
119 public void ExecuteTest02()
121 StorageTest aTest = new Test02( m_xMSF, m_xStorageFactory, log );
122 assure( "Test02 failed!", aTest.test() );
125 public void ExecuteTest03()
127 StorageTest aTest = new Test03( m_xMSF, m_xStorageFactory, log );
128 assure( "Test03 failed!", aTest.test() );
131 public void ExecuteTest04()
133 StorageTest aTest = new Test04( m_xMSF, m_xStorageFactory, log );
134 assure( "Test04 failed!", aTest.test() );
137 public void ExecuteTest05()
139 StorageTest aTest = new Test05( m_xMSF, m_xStorageFactory, log );
140 assure( "Test05 failed!", aTest.test() );
143 public void ExecuteTest06()
145 StorageTest aTest = new Test06( m_xMSF, m_xStorageFactory, log );
146 assure( "Test06 failed!", aTest.test() );
149 public void ExecuteTest07()
151 StorageTest aTest = new Test07( m_xMSF, m_xStorageFactory, log );
152 assure( "Test07 failed!", aTest.test() );
155 public void ExecuteTest08()
157 StorageTest aTest = new Test08( m_xMSF, m_xStorageFactory, log );
158 assure( "Test08 failed!", aTest.test() );