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 
24 package ifc.script.framework.storage;
25 
26 import drafts.com.sun.star.script.framework.storage.XScriptStorageRefresh;
27 
28 import java.util.Collection;
29 import java.util.Iterator;
30 
31 import com.sun.star.uno.UnoRuntime;
32 import com.sun.star.lang.XMultiServiceFactory;
33 import com.sun.star.uno.XInterface;
34 import com.sun.star.ucb.XSimpleFileAccess;
35 import com.sun.star.uno.Exception;
36 import com.sun.star.beans.XPropertySet;
37 
38 import java.io.PrintWriter;
39 import lib.MultiMethodTest;
40 import lib.StatusException;
41 import lib.Parameters;
42 
43 public class _XScriptStorageRefresh extends MultiMethodTest {
44 
45     public XScriptStorageRefresh oObj = null;
46 
47     /**
48     * Retrieves object relation.
49     */
before()50     public void before() throws StatusException {
51     }
52 
_refresh()53     public void _refresh() {
54         boolean result = true;
55 
56         Collection c =
57             (Collection) tEnv.getObjRelation("_refresh");
58 
59         if (c == null) {
60             tRes.tested("refresh()", false);
61             return;
62         }
63 
64         Iterator tests = c.iterator();
65 
66         while (tests.hasNext()) {
67             Parameters testdata = (Parameters)tests.next();
68             String expected = testdata.get("expected");
69             String output = "";
70 
71             log.println(testdata.get("description"));
72 
73             try {
74                 oObj.refresh();
75                 output = "success";
76             }
77             catch (com.sun.star.uno.RuntimeException re) {
78                 log.println("Caught RuntimeException: " + re);
79                 output = "com.sun.star.uno.RuntimeException";
80             }
81             log.println("expected: " + expected + ", output: " + output);
82             result &= output.equals(expected);
83         }
84         tRes.tested("refresh()", result);
85     }
86 }
87