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 .
19 package ifc
.configuration
.backend
;
21 import com
.sun
.star
.configuration
.backend
.XLayer
;
22 import lib
.MultiMethodTest
;
23 import util
.XLayerHandlerImpl
;
25 public class _XLayer
extends MultiMethodTest
{
29 public void _readData() {
32 log
.println("Checking for Exception in case of nul argument");
36 } catch (com
.sun
.star
.lang
.NullPointerException e
) {
37 log
.println("Expected Exception -- OK");
39 } catch (com
.sun
.star
.lang
.WrappedTargetException e
) {
40 log
.println("Unexpected Exception ("+e
+") -- FAILED");
41 } catch (com
.sun
.star
.configuration
.backend
.MalformedDataException e
) {
42 log
.println("Unexpected Exception ("+e
+") -- FAILED");
45 log
.println("checking read data with own XLayerHandler implementation");
47 XLayerHandlerImpl xLayerHandler
= new XLayerHandlerImpl();
48 oObj
.readData(xLayerHandler
);
49 String implCalled
= xLayerHandler
.getCalls();
50 log
.println(implCalled
);
51 int sl
= implCalled
.indexOf("startLayer");
53 log
.println("startLayer wasn't called -- FAILED");
56 log
.println("startLayer was called -- OK");
59 int el
= implCalled
.indexOf("endLayer");
61 log
.println("endLayer wasn't called -- FAILED");
64 log
.println("endLayer was called -- OK");
67 } catch (com
.sun
.star
.lang
.NullPointerException e
) {
68 log
.println("Unexpected Exception ("+e
+") -- FAILED");
70 } catch (com
.sun
.star
.lang
.WrappedTargetException e
) {
71 log
.println("Unexpected Exception ("+e
+") -- FAILED");
73 } catch (com
.sun
.star
.configuration
.backend
.MalformedDataException e
) {
74 log
.println("Unexpected Exception ("+e
+") -- FAILED");
78 tRes
.tested("readData()",res
);