From 907e5d81d8b9ffab74e5b8a138d101e8d17013a4 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Thu, 24 Feb 2005 16:29:43 +0000 Subject: INTEGRATION: CWS qadev21 (1.2.106); FILE MERGED 2005/02/08 08:03:33 cn 1.2.106.1: #i42069# enhance test with invalid object relations for XInitialization test --- qadevOOo/tests/java/ifc/lang/_XInitialization.java | 28 ++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'qadevOOo') diff --git a/qadevOOo/tests/java/ifc/lang/_XInitialization.java b/qadevOOo/tests/java/ifc/lang/_XInitialization.java index c16e3e9a55a7..ed94ed497433 100644 --- a/qadevOOo/tests/java/ifc/lang/_XInitialization.java +++ b/qadevOOo/tests/java/ifc/lang/_XInitialization.java @@ -2,9 +2,9 @@ * * $RCSfile: _XInitialization.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change:$Date: 2003-09-08 10:45:05 $ + * last change:$Date: 2005-02-24 17:29:43 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -91,11 +91,31 @@ public class _XInitialization extends MultiMethodTest { boolean result = true ; try { + XInitialization xInit = (XInitialization) tEnv.getObjRelation("XInitialization.xIni"); + if (xInit == null) xInit = oObj; + + log.println("calling method with valid arguments..."); Object[] args = (Object[]) tEnv.getObjRelation("XInitialization.args"); if (args==null) { - oObj.initialize(new Object[0]); + xInit.initialize(new Object[0]); } else { - oObj.initialize(args); + xInit.initialize(args); + } + + // try to call the method with invalid parameters + Object[] ExArgs = (Object[]) tEnv.getObjRelation("XInitialization.ExceptionArgs"); + if (ExArgs !=null) { + log.println("calling method with in-valid arguments..."); + try{ + result = false; + xInit.initialize(ExArgs); + } catch (com.sun.star.uno.Exception e) { + log.println("Expected Exception 'com.sun.star.uno.Exception' occured -> OK") ; + result = true ; + } catch (Exception e) { + log.println("Un-Expected Exception occured -> FALSE") ; + log.println(e.toString()); + } } } catch (com.sun.star.uno.Exception e) { -- cgit