tdf#154285 Check upper bound of arguments in SbRtl_Minute function
[LibreOffice.git] / package / qa / ofopxmlstorages / StorageUnitTest.java
blobe8ee7696a62f072343a644d438177b0fea00ba03
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 package complex.ofopxmlstorages;
20 import com.sun.star.lang.XMultiServiceFactory;
21 import com.sun.star.lang.XMultiComponentFactory;
22 import com.sun.star.connection.XConnector;
23 import com.sun.star.connection.XConnection;
25 import com.sun.star.bridge.XUnoUrlResolver;
26 import com.sun.star.uno.UnoRuntime;
27 import com.sun.star.uno.XInterface;
28 import com.sun.star.uno.XNamingService;
29 import com.sun.star.uno.XComponentContext;
31 import com.sun.star.container.*;
32 import com.sun.star.beans.*;
33 import com.sun.star.lang.*;
35 import complexlib.ComplexTestCase;
37 import complex.ofopxmlstorages.*;
39 import util.utils;
40 import java.util.*;
41 import java.io.*;
43 /* This unit test for storage objects is designed to
44 * test most important statements from storage service
45 * specification.
47 * Regression tests are added to extend the tested
48 * functionalities.
50 public class StorageUnitTest extends ComplexTestCase
52 private XMultiServiceFactory m_xMSF = null;
53 private XSingleServiceFactory m_xStorageFactory = null;
55 public String[] getTestMethodNames()
57 return new String[] {
58 "ExecuteTest01",
59 "ExecuteTest02",
60 "ExecuteTest03",
61 "ExecuteTest04",
62 "ExecuteTest05",
63 "ExecuteTest06",
64 "ExecuteTest07",
65 "ExecuteTest08"
69 public String getTestObjectName()
71 return "StorageUnitTest";
74 public void before()
76 m_xMSF = (XMultiServiceFactory)param.getMSF();
77 if ( m_xMSF == null )
79 failed( "Can't create service factory!" );
80 return;
83 try {
84 Object oStorageFactory = m_xMSF.createInstance( "com.sun.star.embed.StorageFactory" );
85 m_xStorageFactory = (XSingleServiceFactory)UnoRuntime.queryInterface( XSingleServiceFactory.class,
86 oStorageFactory );
88 catch( Exception e )
90 failed( "Can't create storage factory!" );
91 return;
94 if ( m_xStorageFactory == null )
96 failed( "Can't create service factory!" );
97 return;
101 public void ExecuteTest01()
103 StorageTest aTest = new Test01( m_xMSF, m_xStorageFactory, log );
104 assure( "Test01 failed!", aTest.test() );
107 public void ExecuteTest02()
109 StorageTest aTest = new Test02( m_xMSF, m_xStorageFactory, log );
110 assure( "Test02 failed!", aTest.test() );
113 public void ExecuteTest03()
115 StorageTest aTest = new Test03( m_xMSF, m_xStorageFactory, log );
116 assure( "Test03 failed!", aTest.test() );
119 public void ExecuteTest04()
121 StorageTest aTest = new Test04( m_xMSF, m_xStorageFactory, log );
122 assure( "Test04 failed!", aTest.test() );
125 public void ExecuteTest05()
127 StorageTest aTest = new Test05( m_xMSF, m_xStorageFactory, log );
128 assure( "Test05 failed!", aTest.test() );
131 public void ExecuteTest06()
133 StorageTest aTest = new Test06( m_xMSF, m_xStorageFactory, log );
134 assure( "Test06 failed!", aTest.test() );
137 public void ExecuteTest07()
139 StorageTest aTest = new Test07( m_xMSF, m_xStorageFactory, log );
140 assure( "Test07 failed!", aTest.test() );
143 public void ExecuteTest08()
145 StorageTest aTest = new Test08( m_xMSF, m_xStorageFactory, log );
146 assure( "Test08 failed!", aTest.test() );