Kaydet (Commit) 26f408cc authored tarafından Rüdiger Timm's avatar Rüdiger Timm

INTEGRATION: CWS qadev11 (1.2.14); FILE MERGED

2003/09/03 15:30:04 sw 1.2.14.1: #112049#
üst df213298
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: UnoControlRadioButtonModel.java,v $ * $RCSfile: UnoControlRadioButtonModel.java,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change:$Date: 2003-05-27 14:07:16 $ * last change:$Date: 2003-09-08 13:10:09 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -58,64 +58,38 @@ ...@@ -58,64 +58,38 @@
* *
* *
************************************************************************/ ************************************************************************/
package mod._toolkit; package mod._toolkit;
import com.sun.star.text.XTextDocument;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.XInterface;
import java.io.PrintWriter; import java.io.PrintWriter;
import lib.StatusException;
import lib.TestCase; import lib.TestCase;
import lib.TestEnvironment; import lib.TestEnvironment;
import lib.TestParameters; import lib.TestParameters;
import util.WriterTools;
import util.utils; import util.utils;
public class UnoControlRadioButtonModel extends TestCase { import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.XInterface;
XTextDocument xTextDoc;
/**
* Creates StarOffice Writer document.
*/
protected void initialize( TestParameters tParam, PrintWriter log ) {
log.println( "creating a textdocument" );
xTextDoc = WriterTools.createTextDoc((XMultiServiceFactory)tParam.getMSF());
}
/**
* Disposes StarOffice Writer document.
*/
protected void cleanup( TestParameters tParam, PrintWriter log ) {
log.println( " disposing xTextDoc " );
xTextDoc.dispose();
}
public synchronized TestEnvironment createTestEnvironment
(TestParameters Param, PrintWriter log) {
public class UnoControlRadioButtonModel extends TestCase {
public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
PrintWriter log) {
XInterface oObj = null; XInterface oObj = null;
try { try {
oObj = (XInterface) ((XMultiServiceFactory)Param.getMSF()).createInstance( oObj = (XInterface) ( (XMultiServiceFactory) Param.getMSF())
"com.sun.star.awt.UnoControlRadioButtonModel"); .createInstance("com.sun.star.awt.UnoControlRadioButtonModel");
} catch (Exception e) { } catch (Exception e) {
} }
log.println(
"creating a new environment for UnoControlRadioButtonModel object");
log.println( "creating a new environment for UnoControlRadioButtonModel object" ); TestEnvironment tEnv = new TestEnvironment(oObj);
TestEnvironment tEnv = new TestEnvironment( oObj );
tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.RadioButton"); tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.RadioButton");
System.out.println("ImplementationName: "+utils.getImplName(oObj)); System.out.println("ImplementationName: " + utils.getImplName(oObj));
return tEnv; return tEnv;
} // finish method getTestEnvironment } // finish method getTestEnvironment
} // finish class UnoControlRadioButtonModel
} // finish class UnoControlRadioButtonModel
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: UnoControlScrollBarModel.java,v $ * $RCSfile: UnoControlScrollBarModel.java,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change:$Date: 2003-05-27 14:07:26 $ * last change:$Date: 2003-09-08 13:10:24 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -58,18 +58,20 @@ ...@@ -58,18 +58,20 @@
* *
* *
************************************************************************/ ************************************************************************/
package mod._toolkit; package mod._toolkit;
import com.sun.star.uno.XInterface;
import com.sun.star.lang.XMultiServiceFactory;
import java.io.PrintWriter; import java.io.PrintWriter;
import lib.StatusException; import lib.StatusException;
import lib.TestCase; import lib.TestCase;
import lib.TestEnvironment; import lib.TestEnvironment;
import lib.TestParameters; import lib.TestParameters;
import util.utils; import util.utils;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.XInterface;
/** /**
* Test for object which is represented by service * Test for object which is represented by service
* <code>com.sun.star.awt.UnoControlScrollBarModel</code>. <p> * <code>com.sun.star.awt.UnoControlScrollBarModel</code>. <p>
...@@ -95,7 +97,6 @@ import util.utils; ...@@ -95,7 +97,6 @@ import util.utils;
* @see ifc.beans._XMultiPropertySet * @see ifc.beans._XMultiPropertySet
*/ */
public class UnoControlScrollBarModel extends TestCase { public class UnoControlScrollBarModel extends TestCase {
/** /**
* Creating a Testenvironment for the interfaces to be tested. * Creating a Testenvironment for the interfaces to be tested.
* Creates an instance of the service * Creates an instance of the service
...@@ -106,29 +107,24 @@ public class UnoControlScrollBarModel extends TestCase { ...@@ -106,29 +107,24 @@ public class UnoControlScrollBarModel extends TestCase {
* {@link ifc.io._XPersistObject} </li> * {@link ifc.io._XPersistObject} </li>
* </ul> * </ul>
*/ */
public synchronized TestEnvironment createTestEnvironment( TestParameters Param, public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
PrintWriter log ) PrintWriter log)
throws StatusException { throws StatusException {
XInterface oObj = null; XInterface oObj = null;
try { try {
oObj = (XInterface) ((XMultiServiceFactory)Param.getMSF()).createInstance( oObj = (XInterface) ( (XMultiServiceFactory) Param.getMSF())
"com.sun.star.awt.UnoControlScrollBarModel"); .createInstance("com.sun.star.awt.UnoControlScrollBarModel");
} catch (Exception e) { } catch (Exception e) {
} }
log.println("creating a new environment for object");
log.println( "creating a new environment for object" ); TestEnvironment tEnv = new TestEnvironment(oObj);
TestEnvironment tEnv = new TestEnvironment( oObj );
tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.ScrollBar"); tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.ScrollBar");
System.out.println("ImplementationName: "+utils.getImplName(oObj)); System.out.println("ImplementationName: " + utils.getImplName(oObj));
return tEnv; return tEnv;
} // finish method getTestEnvironment } // finish method getTestEnvironment
}
} \ No newline at end of file
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: UnoControlTimeField.java,v $ * $RCSfile: UnoControlTimeField.java,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change:$Date: 2003-05-27 14:07:34 $ * last change:$Date: 2003-09-08 13:10:35 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -58,11 +58,20 @@ ...@@ -58,11 +58,20 @@
* *
* *
************************************************************************/ ************************************************************************/
package mod._toolkit; package mod._toolkit;
import java.io.PrintWriter;
import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
import util.FormTools;
import util.SOfficeFactory;
import util.WriterTools;
import util.utils;
import com.sun.star.awt.XControl; import com.sun.star.awt.XControl;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.awt.XControlModel; import com.sun.star.awt.XControlModel;
import com.sun.star.awt.XDevice; import com.sun.star.awt.XDevice;
import com.sun.star.awt.XGraphics; import com.sun.star.awt.XGraphics;
...@@ -72,61 +81,67 @@ import com.sun.star.awt.XWindow; ...@@ -72,61 +81,67 @@ import com.sun.star.awt.XWindow;
import com.sun.star.awt.XWindowPeer; import com.sun.star.awt.XWindowPeer;
import com.sun.star.drawing.XControlShape; import com.sun.star.drawing.XControlShape;
import com.sun.star.drawing.XShape; import com.sun.star.drawing.XShape;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.text.XTextDocument; import com.sun.star.text.XTextDocument;
import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface; import com.sun.star.uno.XInterface;
import com.sun.star.util.XCloseable;
import com.sun.star.view.XControlAccess; import com.sun.star.view.XControlAccess;
import java.io.PrintWriter;
import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
import util.FormTools;
import util.SOfficeFactory;
import util.WriterTools;
import util.utils;
public class UnoControlTimeField extends TestCase {
public class UnoControlTimeField extends TestCase {
XTextDocument xTextDoc; XTextDocument xTextDoc;
protected void initialize ( TestParameters Param, PrintWriter log) { protected void initialize(TestParameters Param, PrintWriter log) {
SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF() ); SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) Param.getMSF());
try { try {
log.println( "creating a textdocument" ); log.println("creating a textdocument");
xTextDoc = SOF.createTextDoc( null ); xTextDoc = SOF.createTextDoc(null);
} catch ( com.sun.star.uno.Exception e ) { } catch (com.sun.star.uno.Exception e) {
// Some exception occures.FAILED // Some exception occures.FAILED
e.printStackTrace( log ); e.printStackTrace(log);
throw new StatusException( "Couldn't create document", e ); throw new StatusException("Couldn't create document", e);
} }
} }
protected void cleanup( TestParameters tParam, PrintWriter log ) { protected void cleanup(TestParameters tParam, PrintWriter log) {
log.println( " disposing xTextDoc " ); log.println(" disposing xTextDoc ");
xTextDoc.dispose();
try {
XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
XCloseable.class, xTextDoc);
closer.close(true);
} catch (com.sun.star.util.CloseVetoException e) {
log.println("couldn't close document");
} catch (com.sun.star.lang.DisposedException e) {
log.println("couldn't close document");
}
} }
public TestEnvironment createTestEnvironment( TestParameters Param, protected TestEnvironment createTestEnvironment(TestParameters Param,
PrintWriter log ) PrintWriter log) {
throws StatusException {
XInterface oObj = null; XInterface oObj = null;
XWindowPeer the_win = null; XWindowPeer the_win = null;
XToolkit the_kit = null; XToolkit the_kit = null;
XDevice aDevice = null; XDevice aDevice = null;
XGraphics aGraphic = null; XGraphics aGraphic = null;
XControl aControl = null; XControl aControl = null;
//Insert a ControlShape and get the ControlModel //Insert a ControlShape and get the ControlModel
XControlShape aShape = FormTools.createUnoControlShape( XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
xTextDoc,3000,4500,15000,10000,"TimeField","UnoControlTimeField"); 4500, 15000,
10000,
"TimeField",
"UnoControlTimeField");
WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
XControlModel the_Model = aShape.getControl(); XControlModel the_Model = aShape.getControl();
XControlShape aShape2 = FormTools.createControlShape( XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
xTextDoc,3000,4500,5000,10000,"TextField"); 4500, 5000, 10000,
"TextField");
WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2); WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
...@@ -134,7 +149,8 @@ public class UnoControlTimeField extends TestCase { ...@@ -134,7 +149,8 @@ public class UnoControlTimeField extends TestCase {
//Try to query XControlAccess //Try to query XControlAccess
XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
XControlAccess.class,xTextDoc.getCurrentController()); XControlAccess.class,
xTextDoc.getCurrentController());
//get the TimeFieldControl for the needed Object relations //get the TimeFieldControl for the needed Object relations
try { try {
...@@ -142,45 +158,46 @@ public class UnoControlTimeField extends TestCase { ...@@ -142,45 +158,46 @@ public class UnoControlTimeField extends TestCase {
aControl = the_access.getControl(the_Model2); aControl = the_access.getControl(the_Model2);
the_win = the_access.getControl(the_Model).getPeer(); the_win = the_access.getControl(the_Model).getPeer();
the_kit = the_win.getToolkit(); the_kit = the_win.getToolkit();
aDevice = the_kit.createScreenCompatibleDevice(200,200); aDevice = the_kit.createScreenCompatibleDevice(200, 200);
aGraphic = aDevice.createGraphics(); aGraphic = aDevice.createGraphics();
} catch (Exception e) { } catch (Exception e) {
log.println("Couldn't get TimeFieldControl"); log.println("Couldn't get TimeFieldControl");
e.printStackTrace(log); e.printStackTrace(log);
throw new StatusException("Couldn't get TimeFieldControl", e ); throw new StatusException("Couldn't get TimeFieldControl", e);
} }
log.println( "creating a new environment for UnoControlTimeField object" ); log.println(
TestEnvironment tEnv = new TestEnvironment( oObj ); "creating a new environment for UnoControlTimeField object");
TestEnvironment tEnv = new TestEnvironment(oObj);
//Adding ObjRelation for XView //Adding ObjRelation for XView
tEnv.addObjRelation("GRAPHICS",aGraphic); tEnv.addObjRelation("GRAPHICS", aGraphic);
//Adding ObjRelation for XControl //Adding ObjRelation for XControl
tEnv.addObjRelation("CONTEXT",xTextDoc); tEnv.addObjRelation("CONTEXT", xTextDoc);
tEnv.addObjRelation("WINPEER",the_win); tEnv.addObjRelation("WINPEER", the_win);
tEnv.addObjRelation("TOOLKIT",the_kit); tEnv.addObjRelation("TOOLKIT", the_kit);
tEnv.addObjRelation("MODEL",the_Model); tEnv.addObjRelation("MODEL", the_Model);
XWindow forObjRel = (XWindow) XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class,
UnoRuntime.queryInterface(XWindow.class,aControl); aControl);
tEnv.addObjRelation("XWindow.AnotherWindow",forObjRel); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel);
tEnv.addObjRelation("XWindow.ControlShape",aShape); tEnv.addObjRelation("XWindow.ControlShape", aShape);
// Adding relation for XTextListener // Adding relation for XTextListener
ifc.awt._XTextListener.TestTextListener listener = ifc.awt._XTextListener.TestTextListener listener =
new ifc.awt._XTextListener.TestTextListener() ; new ifc.awt._XTextListener.TestTextListener();
XTextComponent textComp = (XTextComponent) XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface(
UnoRuntime.queryInterface(XTextComponent.class, oObj); XTextComponent.class, oObj);
textComp.addTextListener(listener); textComp.addTextListener(listener);
tEnv.addObjRelation("TestTextListener", listener); tEnv.addObjRelation("TestTextListener", listener);
log.println("ImplementationName: "+utils.getImplName(oObj)); log.println("ImplementationName: " + utils.getImplName(oObj));
return tEnv; return tEnv;
} // finish method getTestEnvironment } // finish method getTestEnvironment
} // finish class UnoControlTimeField
} // finish class UnoControlTimeField
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment