Update ooo320-m1
[ooovba.git] / qadevOOo / tests / java / ifc / container / _XContentEnumerationAccess.java
blobba36432220579f34b0f6cb790c520eeade031ca9
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: _XContentEnumerationAccess.java,v $
10 * $Revision: 1.4 $
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 ************************************************************************/
31 package ifc.container;
33 import lib.MultiMethodTest;
35 import com.sun.star.container.XContentEnumerationAccess;
36 import com.sun.star.container.XEnumeration;
38 /**
39 * Testing <code>com.sun.star.container.XContentEnumerationAccess</code>
40 * interface methods :
41 * <ul>
42 * <li><code> createContentEnumeration()</code></li>
43 * <li><code> getAvailableServiceNames()</code></li>
44 * </ul> <p>
45 * @see com.sun.star.container.XContentEnumerationAccess
47 public class _XContentEnumerationAccess extends MultiMethodTest{
48 public XContentEnumerationAccess oObj = null;
49 String[] serviceNames = null;
51 /**
52 * Retrieves service names and stores them. <p>
53 * Has <b> OK </b> status if not <code>null</code>
54 * value returned.
56 public void _getAvailableServiceNames(){
57 boolean bResult = true;
58 try {
59 serviceNames = oObj.getAvailableServiceNames();
60 bResult = serviceNames != null ;
61 } catch (Exception e) {
62 log.println("Exception occured. " + e);
63 bResult = false;
65 tRes.tested("getAvailableServiceNames()", bResult);
68 /**
69 * If at least one service available then an enumeration for
70 * it created. <p>
71 * Has <b> OK </b> status if no services available or enumeration
72 * created for available service is not <code>null</code>.
73 * The following method tests are to be completed successfully before :
74 * <ul>
75 * <li> <code>getAvailableServiceNames()</code> :
76 * to have at least one service name for enumeration to create for.</li>
77 * </ul>
79 public void _createContentEnumeration(){
80 requiredMethod("getAvailableServiceNames()");
82 if (serviceNames.length == 0) {
83 log.println("No service name available") ;
84 tRes.tested("createContentEnumeration()", true) ;
85 return ;
88 boolean bResult = true;
90 log.println( "creating Enumeration" );
91 XEnumeration oEnum = oObj.createContentEnumeration(serviceNames[0]);
92 bResult &= oEnum != null;
94 tRes.tested( "createContentEnumeration()", bResult);