merge the formfield patch from ooo-build
[ooovba.git] / qadevOOo / tests / java / ifc / sdb / _XCompletedExecution.java
blobabbaf4c36d3ea71ab2a411755bfba58147ba3256
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: _XCompletedExecution.java,v $
10 * $Revision: 1.5 $
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 ifc.sdb;
32 import com.sun.star.sdb.XCompletedExecution;
33 import com.sun.star.task.XInteractionHandler;
34 import java.io.PrintWriter;
35 import lib.MultiMethodTest;
36 import lib.StatusException;
38 /**
41 public class _XCompletedExecution extends MultiMethodTest {
43 // oObj filled by MultiMethodTest
44 public XCompletedExecution oObj = null ;
46 private CheckInteractionHandler checkHandler = null;
47 /**
48 * Interface to implement so the call of the listener can be checked.
50 public static interface CheckInteractionHandler extends XInteractionHandler {
51 /**
52 * Set a log of the listener, so messages of the listener get printed
53 * into the file of the interface
55 public void setLog(PrintWriter log);
56 /**
57 * Return True, when the listener was called correctly.
59 public boolean checkInteractionHandler();
62 protected void before() {
63 checkHandler = (CheckInteractionHandler)
64 tEnv.getObjRelation("InteractionHandlerChecker");
65 if (checkHandler == null)
66 throw new StatusException("Missing object relation 'InteractionHandlerChecker'", new Exception());
67 checkHandler.setLog((PrintWriter)log);
71 public void _executeWithCompletion() {
72 try {
73 oObj.executeWithCompletion(checkHandler);
75 catch(com.sun.star.sdbc.SQLException e) {
76 e.printStackTrace((PrintWriter)log);
77 tRes.tested("executeWithCompletion()", false);
78 return;
81 tRes.tested("executeWithCompletion()", checkHandler.checkInteractionHandler());
84 protected void after() {
85 disposeEnvironment();