From 1f9abbd13e98b50a03813b643477d7aed96b5a3e Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 7 May 2010 11:03:36 +0200 Subject: sb123: #i111449# adapted sw/qa/complex to new framework --- sw/prj/build.lst | 4 + .../accessibility/AccessibleRelationSet.java | 172 +++---- sw/qa/complex/accessibility/makefile.mk | 43 +- sw/qa/complex/checkColor/CheckChangeColor.java | 117 +++-- sw/qa/complex/checkColor/makefile.mk | 61 +-- .../CheckIndeterminateState.java | 127 +++-- sw/qa/complex/indeterminateState/makefile.mk | 66 +-- sw/qa/complex/writer/CheckBookmarks.java | 125 ++--- sw/qa/complex/writer/CheckCrossReferences.java | 332 +++++-------- sw/qa/complex/writer/CheckFlies.java | 218 ++++---- .../complex/writer/CheckIndexedPropertyValues.java | 182 +++---- sw/qa/complex/writer/CheckNamedPropertyValues.java | 198 +++----- sw/qa/complex/writer/TestDocument.java | 41 ++ .../complex/writer/TextPortionEnumerationTest.java | 547 +++++++++------------ sw/qa/complex/writer/makefile.mk | 100 +--- 15 files changed, 929 insertions(+), 1404 deletions(-) create mode 100644 sw/qa/complex/writer/TestDocument.java (limited to 'sw') diff --git a/sw/prj/build.lst b/sw/prj/build.lst index 87d163d72648..8cb52efb9adb 100755 --- a/sw/prj/build.lst +++ b/sw/prj/build.lst @@ -74,4 +74,8 @@ sw sw\source\ui nmake - all sw_ui sw_app sw sw\source\core nmake - all sw_core sw_attr sw_bast sw_crsr sw_dcnd sw_doc sw_draw sw_edit sw_excpt sw_fld sw_frmed sw_grph sw_layo sw_ole sw_para sw_sw3io sw_swg sw_text sw_tox sw_txtnd sw_uco sw_undo sw_view sw_acc sw_objpos sw_NumberTree sw_tablecore NULL sw sw\source\filter nmake - all sw_flt sw_ascii sw_bsflt sw_html sw_rtf sw_wrtr sw_ww1 sw_ww8 sw_xml NULL sw sw\util nmake - all sw_util sw_core sw_flt sw_sdi sw_ui NULL +sw sw\qa\complex\accessibility nmake - all sw_qa_complex_accessibility NULL +sw sw\qa\complex\checkColor nmake - all sw_qa_complex_checkColor NULL +sw sw\qa\complex\indeterminateState nmake - all sw_qa_complex_indeterminateState NULL +sw sw\qa\complex\writer nmake - all sw_qa_complex_writer NULL sw sw\qa\unoapi nmake - all sw_qa_unoapi NULL diff --git a/sw/qa/complex/accessibility/AccessibleRelationSet.java b/sw/qa/complex/accessibility/AccessibleRelationSet.java index b7f45d25db2b..e71ff23e1684 100644 --- a/sw/qa/complex/accessibility/AccessibleRelationSet.java +++ b/sw/qa/complex/accessibility/AccessibleRelationSet.java @@ -27,7 +27,6 @@ package complex.accessibility; -import com.sun.star.accessibility.AccessibleRelation; import com.sun.star.accessibility.AccessibleRole; import com.sun.star.accessibility.XAccessible; import com.sun.star.accessibility.XAccessibleText; @@ -36,74 +35,66 @@ import com.sun.star.accessibility.XAccessibleRelationSet; import com.sun.star.awt.XWindow; import com.sun.star.frame.XModel; import com.sun.star.lang.IndexOutOfBoundsException; -import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.text.ControlCharacter; import com.sun.star.text.XText; import com.sun.star.text.XTextCursor; import com.sun.star.text.XTextDocument; import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; -import complexlib.ComplexTestCase; -import java.io.PrintWriter; -import lib.StatusException; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; import util.AccessibilityTools; import util.WriterTools; -import util.utils; +import static org.junit.Assert.*; -public class AccessibleRelationSet extends ComplexTestCase { - - private static XAccessible para1 = null; - private static XAccessible para2 = null; - private static XAccessible para3 = null; - private static XTextDocument xTextDoc = null; +public class AccessibleRelationSet { + private XAccessible para1 = null; + private XAccessible para2 = null; + private XAccessible para3 = null; + private XTextDocument xTextDoc = null; private final static String[] types = {"INVALID","CONTENT_FLOWS_FROM","CONTENT_FLOWS_TO","CONTROLLED_BY","CONTROLLER_FOR","LABEL_FOR","LABELED_BY","MEMBER_OF","SUB_WINDOW_OF"}; - public String[] getTestMethodNames() { - return new String[]{"contents_flows_to","contents_flows_from"}; - } - - public void contents_flows_to() { + @Test public void contents_flows_to() { XAccessibleRelationSet set = getAccessibleRelation(para1); - boolean res = true; short firstrelation=-1; XAccessibleText atarget=null; if (set != null) { - log.println("Count of relations "+set.getRelationCount()); - assure("didn't gain correct count of relations", - set.getRelationCount() == 1); + assertEquals( + "didn't gain correct count of relations", 1, + set.getRelationCount()); try { firstrelation = set.getRelation(0).RelationType; Object oTmp = set.getRelation(0).TargetSet[0]; atarget = (XAccessibleText) UnoRuntime.queryInterface(XAccessibleText.class, oTmp); } catch (IndexOutOfBoundsException e) { - log.println("Exception when getting relations "+e); - res = false; + fail("Exception when getting relations "+e); } } - log.println("Expected for paragraph 0 "+types[2]); - log.println("gained for paragraph 0 "+types[firstrelation]); - res = types[2].equals(types[firstrelation]); - assure("didn't gain correct relation type",res); + assertEquals( + "didn't gain correct relation type for paragraph 0", types[2], + types[firstrelation]); - log.println("Text of target paragraph "+atarget.getText()); XAccessibleText paraTxt2 = (XAccessibleText) UnoRuntime.queryInterface(XAccessibleText.class, para2); - assure("didn't gain correct target paragraph", - atarget.getText().equals(paraTxt2.getText()) ); + assertEquals( + "didn't gain correct target paragraph", atarget.getText(), + paraTxt2.getText()); } - public void contents_flows_from() { + @Test public void contents_flows_from() { XAccessibleRelationSet set = getAccessibleRelation(para2); - boolean res = true; short[] relationtypes = new short[2]; XAccessibleText[] atargets = new XAccessibleText[2]; if (set != null) { - log.println("Count of relations "+set.getRelationCount()); - assure("didn't gain correct count of relations", - set.getRelationCount() == 2); + assertEquals( + "didn't gain correct count of relations", 2, + set.getRelationCount()); try { short tmprelation = set.getRelation(0).RelationType; if ( tmprelation == 1 ) @@ -120,7 +111,7 @@ public class AccessibleRelationSet extends ComplexTestCase { } else { - assure("didn't gain correct relation type", false); + fail("didn't gain correct relation type"); } tmprelation = set.getRelation(1).RelationType; if ( tmprelation == 1 ) @@ -137,79 +128,47 @@ public class AccessibleRelationSet extends ComplexTestCase { } else { - assure("didn't gain correct relation type", false); + fail("didn't gain correct relation type"); } } catch (IndexOutOfBoundsException e) { - log.println("Exception when getting relations "+e); - res = false; + fail("Exception when getting relations "+e); } } - log.println("### Checking "+types[1]+" for paragraph 1"); - log.println("Expected for paragraph 1 "+types[1]); - log.println("gained for paragraph 1 "+types[relationtypes[0]]); - res = types[1].equals(types[relationtypes[0]]); - assure("didn't gain correct relation type",res); + assertEquals( + "didn't gain correct relation type for paragraph 1", types[1], + types[relationtypes[0]]); - log.println("Text of target paragraph "+atargets[0].getText()); XAccessibleText paraTxt1 = (XAccessibleText) UnoRuntime.queryInterface(XAccessibleText.class, para1); - assure("didn't gain correct target paragraph", - atargets[0].getText().equals(paraTxt1.getText()) ); + assertEquals( + "didn't gain correct target paragraph", atargets[0].getText(), + paraTxt1.getText()); - log.println("### Checking "+types[2]+" for paragraph 1"); - log.println("Expected for paragraph 1 "+types[2]); - log.println("gained for paragraph 1 "+types[relationtypes[1]]); - res = types[2].equals(types[relationtypes[1]]); - assure("didn't gain correct relation type",res); + assertEquals( + "didn't gain correct relation type for paragraph 3", types[2], + types[relationtypes[1]]); - log.println("Text of target paragraph "+atargets[1].getText()); XAccessibleText paraTxt3 = (XAccessibleText) UnoRuntime.queryInterface(XAccessibleText.class, para3); - assure("didn't gain correct target paragraph", - atargets[1].getText().equals(paraTxt3.getText()) ); - } - - private boolean getResult(XAccessible aPara, short index, int nr) { - XAccessibleRelationSet set = getAccessibleRelation(aPara); - - boolean res = true; - short firstrelation=-1; - if (set != null) { - log.println("Count of relations "+set.getRelationCount()); - try { - firstrelation = set.getRelation(0).RelationType; - } catch (IndexOutOfBoundsException e) { - log.println("Exception when getting relations "+e); - res = false; - } - } - - - log.println("Expected for paragraph "+nr+" "+types[index]); - log.println("gained for paragraph "+nr+" "+types[firstrelation]); - res = types[index].equals(types[firstrelation]); - return res; + assertEquals( + "didn't gain correct target paragraph", atargets[1].getText(), + paraTxt3.getText()); } - - public void before() { - log.println( "creating a text document" ); - xTextDoc = WriterTools.createTextDoc( (XMultiServiceFactory) param.getMSF()); + @Before public void before() + throws com.sun.star.lang.IllegalArgumentException, + IndexOutOfBoundsException + { + xTextDoc = WriterTools.createTextDoc(connection.getFactory()); XText oText = xTextDoc.getText(); XTextCursor oCursor = oText.createTextCursor(); - log.println( "inserting some lines" ); - try { - for (int i=0; i<5; i++){ - oText.insertString( oCursor,"Paragraph Number: " + i, false); - oText.insertControlCharacter( - oCursor, ControlCharacter.PARAGRAPH_BREAK, false ); - } - } catch ( com.sun.star.lang.IllegalArgumentException e ){ - e.printStackTrace((PrintWriter)log); - throw new StatusException( "Couldn't insert lines", e ); + for (int i=0; i<5; i++){ + oText.insertString( oCursor,"Paragraph Number: " + i, false); + oText.insertControlCharacter( + oCursor, ControlCharacter.PARAGRAPH_BREAK, false ); } XModel aModel = (XModel) @@ -217,26 +176,17 @@ public class AccessibleRelationSet extends ComplexTestCase { AccessibilityTools at = new AccessibilityTools(); - XWindow xWindow = at.getCurrentWindow( (XMultiServiceFactory) param.getMSF(), aModel); + XWindow xWindow = at.getCurrentWindow(connection.getFactory(), aModel); XAccessible xRoot = at.getAccessibleObject(xWindow); at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT); - try { - para1 = at.SearchedContext.getAccessibleChild(0); - para2 = at.SearchedContext.getAccessibleChild(1); - para3 = at.SearchedContext.getAccessibleChild(2); - } catch(IndexOutOfBoundsException e) { - e.printStackTrace((PrintWriter)log); - throw new StatusException( "Couldn't insert lines", e ); - } - - log.println("ImplementationName (para1)" + utils.getImplName(para1)); - log.println("ImplementationName (para2)" + utils.getImplName(para2)); + para1 = at.SearchedContext.getAccessibleChild(0); + para2 = at.SearchedContext.getAccessibleChild(1); + para3 = at.SearchedContext.getAccessibleChild(2); } - public void after() { - log.println("close text document"); + @After public void after() { util.DesktopTools.closeDoc(xTextDoc); } @@ -248,5 +198,15 @@ public class AccessibleRelationSet extends ComplexTestCase { return set; } + @BeforeClass public static void setUpConnection() throws Exception { + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + private static final OfficeConnection connection = new OfficeConnection(); } diff --git a/sw/qa/complex/accessibility/makefile.mk b/sw/qa/complex/accessibility/makefile.mk index e4096829bb22..06e7c6a70408 100644 --- a/sw/qa/complex/accessibility/makefile.mk +++ b/sw/qa/complex/accessibility/makefile.mk @@ -25,33 +25,26 @@ # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = AccessibleRelationSet -PRJNAME = sw -PACKAGE = complex$/accessibility - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar -JAVAFILES = AccessibleRelationSet.java -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -#----- make a jar from compiled files ------------------------------ - -MAXLINELENGTH = 100000 - -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE +PRJ = ../../.. +PRJNAME = sw +TARGET = qa_complex_accessibility -# --- Targets ------------------------------------------------------ +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/accessibility +JAVATESTFILES = AccessibleRelationSet.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END -.INCLUDE : target.mk +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk +ALLTAR : javatest -run: - +java -cp $(CLASSPATH) org.openoffice.Runner -TimeOut 0 -tb java_complex -o $(PACKAGE:s#$/#.#).$(JAVAFILES:b) +.END diff --git a/sw/qa/complex/checkColor/CheckChangeColor.java b/sw/qa/complex/checkColor/CheckChangeColor.java index 8a8c563c7eea..e77964dc2e21 100755 --- a/sw/qa/complex/checkColor/CheckChangeColor.java +++ b/sw/qa/complex/checkColor/CheckChangeColor.java @@ -1,90 +1,85 @@ package complex.checkColor; -import com.sun.star.awt.Rectangle; import com.sun.star.awt.Size; -import com.sun.star.awt.WindowDescriptor; -import com.sun.star.awt.XControlModel; -import com.sun.star.awt.XToolkit; -import com.sun.star.awt.XWindow; -import com.sun.star.awt.XWindowPeer; -import com.sun.star.beans.PropertyValue; import com.sun.star.beans.XPropertySet; import com.sun.star.container.XNameAccess; import com.sun.star.container.XNameContainer; -import com.sun.star.drawing.XControlShape; -import com.sun.star.drawing.XShape; -import com.sun.star.frame.XComponentLoader; -import com.sun.star.frame.XController; -import com.sun.star.lang.XComponent; -import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.style.XStyleFamiliesSupplier; import com.sun.star.text.XTextDocument; +import com.sun.star.uno.Any; +import com.sun.star.uno.Type; import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; -import com.sun.star.view.XControlAccess; -import complexlib.ComplexTestCase; -import java.io.PrintWriter; -import util.FormTools; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import util.DesktopTools; import util.SOfficeFactory; -import util.WriterTools; +import static org.junit.Assert.*; /** * Created because of complaint on dev@openoffice.org: check the changing of * BackColor and IsLandscape properties on the PageStyle service. */ -public class CheckChangeColor extends ComplexTestCase { - - private XToolkit xToolkit = null; - private XWindowPeer xWinPeer = null; - - /** - * Get all test method names. - * @return The test methods. - */ - public String[] getTestMethodNames() { - return new String[] {"checkChangeColor"}; - } - - +public class CheckChangeColor { /** * Check BackColor and IsLandscape properties, wait for an exception: test * is ok if no exception happened. */ - public void checkChangeColor() { - try { - XMultiServiceFactory m_xMSF_ = (XMultiServiceFactory)param.getMSF(); - XComponentLoader aLoader = (XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class,m_xMSF_.createInstance( "com.sun.star.frame.Desktop" )); - XComponent xDocument = (XComponent)UnoRuntime.queryInterface(XComponent.class, aLoader.loadComponentFromURL( "private:factory/swriter", "_blank", 0, new PropertyValue[ 0 ] ) ); - // xDocument.addEventListener( this ); + @Test public void checkChangeColor() throws Exception { + // create a supplier to get the Style family collection + XStyleFamiliesSupplier xSupplier = ( XStyleFamiliesSupplier ) UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, document); - XTextDocument oDoc = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, xDocument); - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, oDoc ); + // get the NameAccess interface from the Style family collection + XNameAccess xNameAccess = xSupplier.getStyleFamilies(); - // XInterface xInterface = (XInterface) oDocMSF.createInstance( "com.sun.star.style.PageStyle" ); + XNameContainer xPageStyleCollection = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, xNameAccess.getByName( "PageStyles" )); - // create a supplier to get the Style family collection - XStyleFamiliesSupplier xSupplier = ( XStyleFamiliesSupplier ) UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, oDoc ); + // create a PropertySet to set the properties for the new Pagestyle + XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xPageStyleCollection.getByName("Standard") ); - // get the NameAccess interface from the Style family collection - XNameAccess xNameAccess = xSupplier.getStyleFamilies(); + assertEquals( + "BackColor", new Any(Type.LONG, 0xFFFFFFFF), + Any.complete(xPropertySet.getPropertyValue("BackColor"))); + assertEquals( + "IsLandscape", new Any(Type.BOOLEAN, false), + Any.complete(xPropertySet.getPropertyValue("IsLandscape"))); + assertEquals( + "Size", new Type(Size.class), + Any.complete(xPropertySet.getPropertyValue("Size")).getType()); - XNameContainer xPageStyleCollection = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, xNameAccess.getByName( "PageStyles" )); + xPropertySet.setPropertyValue("BackColor", 0xFF000000); + xPropertySet.setPropertyValue("IsLandscape", true); + assertEquals( + "BackColor", new Any(Type.LONG, 0xFF000000), + Any.complete(xPropertySet.getPropertyValue("BackColor"))); + assertEquals( + "IsLandscape", new Any(Type.BOOLEAN, true), + Any.complete(xPropertySet.getPropertyValue("IsLandscape"))); + } + + @Before public void setUpDocument() throws com.sun.star.uno.Exception { + document = SOfficeFactory.getFactory(connection.getFactory()). + createTextDoc(null); + } - // create a PropertySet to set the properties for the new Pagestyle - XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xPageStyleCollection.getByName("Standard") ); + @After public void tearDownDocument() { + DesktopTools.closeDoc(document); + } - log.println("BackColor @ "+xPropertySet.getPropertyValue("BackColor").toString()); - log.println("IsLandscape @ "+xPropertySet.getPropertyValue("IsLandscape").toString()); - log.println("Size @ H:"+((Size)xPropertySet.getPropertyValue("Size")).Height+" W:"+((Size)xPropertySet.getPropertyValue("Size")).Width); + private XTextDocument document = null; - log.println("Set Landscape"); - xPropertySet.setPropertyValue("IsLandscape",new Boolean(true) ); - log.println("Set BackColor"); - xPropertySet.setPropertyValue("BackColor",new Integer((int)255000000) ); - } - catch(Exception e) { - e.printStackTrace(); - failed("Exception."); - } + @BeforeClass public static void setUpConnection() throws Exception { + connection.setUp(); } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); } diff --git a/sw/qa/complex/checkColor/makefile.mk b/sw/qa/complex/checkColor/makefile.mk index 3048fb8fff95..e5b368083ada 100755 --- a/sw/qa/complex/checkColor/makefile.mk +++ b/sw/qa/complex/checkColor/makefile.mk @@ -25,51 +25,26 @@ # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = CheckChangeColor -PRJNAME = $(TARGET) -PACKAGE = complex$/checkColor - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar mysql.jar -JAVAFILES = CheckChangeColor.java -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -#----- make a jar from compiled files ------------------------------ - -MAXLINELENGTH = 100000 - -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE - -# --- Parameters for the test -------------------------------------- - -# test base is java complex -CT_TESTBASE = -TestBase java_complex - -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) - -# start the runner application -CT_APP = org.openoffice.Runner +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -# --- Targets ------------------------------------------------------ +PRJ = ../../.. +PRJNAME = sw +TARGET = qa_complex_checkColor -.IF "$(depend)" == "" -ALL : ALLTAR -.ELSE -ALL: ALLDEP -.ENDIF +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/checkColor +JAVATESTFILES = CheckChangeColor.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END -.INCLUDE : target.mk +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk -RUN: run +ALLTAR : javatest -run: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_NOOFFICE) $(CT_TEST) +.END diff --git a/sw/qa/complex/indeterminateState/CheckIndeterminateState.java b/sw/qa/complex/indeterminateState/CheckIndeterminateState.java index 7c3bf14f2e01..cb756da46b60 100755 --- a/sw/qa/complex/indeterminateState/CheckIndeterminateState.java +++ b/sw/qa/complex/indeterminateState/CheckIndeterminateState.java @@ -27,110 +27,93 @@ package complex.indeterminateState; -import complexlib.ComplexTestCase; -import helper.OfficeProvider; -import util.SOfficeFactory; -import util.AccessibilityTools; +import com.sun.star.accessibility.AccessibleRole; +import com.sun.star.accessibility.AccessibleStateType; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.accessibility.XAccessibleStateSet; +import com.sun.star.awt.FontWeight; import com.sun.star.awt.XWindow; -import com.sun.star.awt.XExtendedToolkit; -import com.sun.star.frame.XDispatch; +import com.sun.star.beans.XPropertySet; import com.sun.star.frame.XController; -import com.sun.star.frame.XDesktop; import com.sun.star.frame.XModel; +import com.sun.star.text.XText; import com.sun.star.text.XTextDocument; -import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.text.XTextRange; +import com.sun.star.text.XTextViewCursorSupplier; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XInterface; -import com.sun.star.accessibility.AccessibleRole; -import com.sun.star.accessibility.XAccessible; -import com.sun.star.accessibility.XAccessibleValue; -import com.sun.star.accessibility.XAccessibleContext; -import com.sun.star.accessibility.XAccessibleStateSet; -import com.sun.star.accessibility.AccessibleStateType; -import com.sun.star.accessibility.XAccessibleAction; -import com.sun.star.awt.XTopWindow; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.frame.XDispatchProvider; -import com.sun.star.util.URL; -import com.sun.star.util.XURLTransformer; - -import java.io.PrintWriter; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import util.AccessibilityTools; +import util.DesktopTools; +import util.SOfficeFactory; +import static org.junit.Assert.*; /** */ -public class CheckIndeterminateState extends ComplexTestCase { - - /** - * Return all test methods. - * @return The test methods. - */ - public String[] getTestMethodNames() { - return new String[]{"checkToolBoxItem"}; - } - +public class CheckIndeterminateState { /* * Test the indeterminate state of AccessibleToolBarItem * The used tools are in project qadevOOo/runner */ - public void checkToolBoxItem() { - log.println( "creating a test environment" ); - XTextDocument xTextDoc = null; - // get a soffice factory object - SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory) param.getMSF()); - - try { - log.println( "creating a text document" ); - xTextDoc = SOF.createTextDoc(null); - } catch ( com.sun.star.uno.Exception e ) { - // Some exception occures.FAILED - e.printStackTrace( (java.io.PrintWriter)log ); - failed (e.getMessage()); - } - + @Test public void checkToolBoxItem() throws Exception { XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xTextDoc); + UnoRuntime.queryInterface(XModel.class, document); XController xController = aModel.getCurrentController(); - XInterface oObj = null; + XText text = document.getText(); + text.setString("normal"); + XTextRange end = text.getEnd(); + end.setString("bold"); + UnoRuntime.queryInterface(XPropertySet.class, end).setPropertyValue( + "CharWeight", FontWeight.BOLD); + UnoRuntime.queryInterface(XTextViewCursorSupplier.class, xController). + getViewCursor().gotoRange(text, false); - System.out.println("Press any key after making 'Bold' indeterminate."); - try{ - byte[]b = new byte[16]; - System.in.read(b); - } catch (Exception e) { - e.printStackTrace(); - } + XInterface oObj = null; AccessibilityTools at = new AccessibilityTools(); - XWindow xWindow = at.getCurrentContainerWindow((XMultiServiceFactory)param.getMSF(), aModel); + XWindow xWindow = at.getCurrentContainerWindow(connection.getFactory(), aModel); XAccessible xRoot = at.getAccessibleObject(xWindow); - // uncomment to print the whole accessible tree. -// at.printAccessibleTree((java.io.PrintWriter)log,xRoot); - - oObj = at.getAccessibleObjectForRole(xRoot, - AccessibleRole.PUSH_BUTTON, "Bold"); - System.out.println("Found a PUSH_BUTTON: " + (oObj != null)); - oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TOGGLE_BUTTON, "Bold"); - System.out.println("Found a TOGGLE_BUTTON: " + (oObj != null)); - - log.println("ImplementationName: "+ util.utils.getImplName(oObj)); + assertNotNull("Found a TOGGLE_BUTTON", oObj); XAccessibleContext oContext = (XAccessibleContext) UnoRuntime.queryInterface(XAccessibleContext.class, oObj); XAccessibleStateSet oSet = oContext.getAccessibleStateSet(); - short[]states = oSet.getStates(); - for(int i=0; i +* for a copy of the LGPLv3 License. +* +************************************************************************/ package complex.writer; -import complexlib.ComplexTestCase; import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.text.XTextDocument; import com.sun.star.uno.UnoRuntime; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; /** * * @author od138299 */ -public class CheckCrossReferences extends ComplexTestCase { +public class CheckCrossReferences { - private com.sun.star.text.XTextDocument xDoc; private com.sun.star.container.XEnumeration xParaEnum; private com.sun.star.container.XEnumeration xPortionEnum; private com.sun.star.util.XRefreshable xFldsRefresh; - public String[] getTestMethodNames() { - return new String[]{"checkCrossReferences"}; - } - - public com.sun.star.text.XTextField getNextField() { - - com.sun.star.text.XTextField xField = null; + public com.sun.star.text.XTextField getNextField() + throws com.sun.star.uno.Exception + { if ( xPortionEnum != null ) { - try { - while ( xPortionEnum.hasMoreElements() ) { - com.sun.star.beans.XPropertySet xPortionProps = - (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface( - com.sun.star.beans.XPropertySet.class , xPortionEnum.nextElement()); - final String sPortionType = - xPortionProps.getPropertyValue( "TextPortionType" ).toString(); - if ( sPortionType.equals( "TextField") ) { - xField = (com.sun.star.text.XTextField)UnoRuntime.queryInterface( - com.sun.star.text.XTextField.class, - xPortionProps.getPropertyValue( "TextField" ) ); - if ( xField == null ) { - System.out.println("Cannot retrieve next field."); - failed("Cannot retrieve next field."); - return null; - } - return xField; - } + while ( xPortionEnum.hasMoreElements() ) { + com.sun.star.beans.XPropertySet xPortionProps = + (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface( + com.sun.star.beans.XPropertySet.class , xPortionEnum.nextElement()); + final String sPortionType = + xPortionProps.getPropertyValue( "TextPortionType" ).toString(); + if ( sPortionType.equals( "TextField") ) { + com.sun.star.text.XTextField xField = (com.sun.star.text.XTextField)UnoRuntime.queryInterface( + com.sun.star.text.XTextField.class, + xPortionProps.getPropertyValue( "TextField" ) ); + assertNotNull("Cannot retrieve next field.", xField); + return xField; } - } catch (com.sun.star.container.NoSuchElementException e) { - System.out.println("Cannot retrieve next field."); - e.printStackTrace(); - failed(e.getMessage()); - return null; - } catch (com.sun.star.beans.UnknownPropertyException e) { - System.out.println("Cannot retrieve next field."); - e.printStackTrace(); - failed(e.getMessage()); - return null; - } catch (com.sun.star.lang.WrappedTargetException e) { - System.out.println("Cannot retrieve next field."); - e.printStackTrace(); - failed(e.getMessage()); - return null; } } while ( xParaEnum.hasMoreElements() ) { - try { - com.sun.star.container.XEnumerationAccess aPara = - (com.sun.star.container.XEnumerationAccess)UnoRuntime.queryInterface( - com.sun.star.container.XEnumerationAccess.class, xParaEnum.nextElement()); - xPortionEnum = aPara.createEnumeration(); - while ( xPortionEnum.hasMoreElements() ) { - com.sun.star.beans.XPropertySet xPortionProps = - (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface( - com.sun.star.beans.XPropertySet.class , xPortionEnum.nextElement()); - final String sPortionType = - xPortionProps.getPropertyValue( "TextPortionType" ).toString(); - if ( sPortionType.equals( "TextField") ) { - xField = (com.sun.star.text.XTextField)UnoRuntime.queryInterface( - com.sun.star.text.XTextField.class, - xPortionProps.getPropertyValue( "TextField" ) ); - if ( xField == null ) { - System.out.println("Cannot retrieve next field."); - failed("Cannot retrieve next field."); - return null; - } - return xField; - } + com.sun.star.container.XEnumerationAccess aPara = + (com.sun.star.container.XEnumerationAccess)UnoRuntime.queryInterface( + com.sun.star.container.XEnumerationAccess.class, xParaEnum.nextElement()); + xPortionEnum = aPara.createEnumeration(); + while ( xPortionEnum.hasMoreElements() ) { + com.sun.star.beans.XPropertySet xPortionProps = + (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface( + com.sun.star.beans.XPropertySet.class , xPortionEnum.nextElement()); + final String sPortionType = + xPortionProps.getPropertyValue( "TextPortionType" ).toString(); + if ( sPortionType.equals( "TextField") ) { + com.sun.star.text.XTextField xField = (com.sun.star.text.XTextField)UnoRuntime.queryInterface( + com.sun.star.text.XTextField.class, + xPortionProps.getPropertyValue( "TextField" ) ); + assertNotNull("Cannot retrieve next field.", xField); + return xField; } - } catch (com.sun.star.container.NoSuchElementException e) { - System.out.println("Cannot retrieve next field."); - e.printStackTrace(); - failed(e.getMessage()); - return null; - } catch (com.sun.star.beans.UnknownPropertyException e) { - System.out.println("Cannot retrieve next field."); - e.printStackTrace(); - failed(e.getMessage()); - return null; - } catch (com.sun.star.lang.WrappedTargetException e) { - System.out.println("Cannot retrieve next field."); - e.printStackTrace(); - failed(e.getMessage()); - return null; } } - if ( xField == null ) { - System.out.println("Cannot retrieve next field."); - failed("Cannot retrieve next field."); - return null; - } - - return xField; + fail("Cannot retrieve next field."); + return null; // unreachable } public com.sun.star.beans.XPropertySet getFieldProps( @@ -126,11 +99,7 @@ public class CheckCrossReferences extends ComplexTestCase { (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface( com.sun.star.beans.XPropertySet.class, xField ); - if ( xProps == null ) { - System.out.println("Cannot retrieve field properties."); - failed("Cannot retrieve field properties."); - return null; - } + assertNotNull("Cannot retrieve field properties.", xProps); return xProps; } @@ -138,56 +107,26 @@ public class CheckCrossReferences extends ComplexTestCase { public void checkField( com.sun.star.text.XTextField xField, com.sun.star.beans.XPropertySet xProps, short nFormat, - String aExpectedFldResult ) { + String aExpectedFldResult ) + throws com.sun.star.uno.Exception + { // set requested format - try { - xProps.setPropertyValue("ReferenceFieldPart", new Short(nFormat)); - } catch (com.sun.star.lang.IllegalArgumentException e) { - System.out.println("Cannot set ReferenceFieldPart property at field."); - e.printStackTrace(); - failed(e.getMessage()); - return; - } catch (com.sun.star.beans.PropertyVetoException e) { - System.out.println("Cannot set ReferenceFieldPart property at field."); - e.printStackTrace(); - failed(e.getMessage()); - return; - } catch (com.sun.star.lang.WrappedTargetException e) { - System.out.println("Cannot set ReferenceFieldPart property at field."); - e.printStackTrace(); - failed(e.getMessage()); - return; - } catch (com.sun.star.beans.UnknownPropertyException e) { - System.out.println("Cannot set ReferenceFieldPart property at field."); - e.printStackTrace(); - failed(e.getMessage()); - return; - } + xProps.setPropertyValue("ReferenceFieldPart", new Short(nFormat)); + // refresh fields in order to get new format applied xFldsRefresh.refresh(); String aFldResult = xField.getPresentation( false ); - assure( "set reference field format doesn't result in correct field result", - aFldResult.equals(aExpectedFldResult), true ); + assertEquals( "set reference field format doesn't result in correct field result", + aExpectedFldResult, aFldResult); } - public void checkCrossReferences() throws com.sun.star.uno.Exception { - // load test document - try { - XMultiServiceFactory xMSF = (XMultiServiceFactory)param.getMSF(); - xDoc = util.WriterTools.loadTextDoc( xMSF, util.utils.getFullTestURL("CheckCrossReferences.odt")); - } catch(com.sun.star.uno.RuntimeException e) { - System.out.println("Cannot load test document."); - e.printStackTrace(); - failed(e.getMessage()); - return; - } - + @Test public void checkCrossReferences() throws com.sun.star.uno.Exception { // setup paragraph enumeration { com.sun.star.container.XEnumerationAccess xParaEnumAccess = (com.sun.star.container.XEnumerationAccess)UnoRuntime.queryInterface( - com.sun.star.container.XEnumerationAccess.class, xDoc.getText()); + com.sun.star.container.XEnumerationAccess.class, document.getText()); xParaEnum = xParaEnumAccess.createEnumeration(); } @@ -195,7 +134,7 @@ public class CheckCrossReferences extends ComplexTestCase { { com.sun.star.text.XTextFieldsSupplier xFieldSupp = (com.sun.star.text.XTextFieldsSupplier)UnoRuntime.queryInterface( - com.sun.star.text.XTextFieldsSupplier.class, xDoc); + com.sun.star.text.XTextFieldsSupplier.class, document); xFldsRefresh = (com.sun.star.util.XRefreshable)UnoRuntime.queryInterface( com.sun.star.util.XRefreshable.class, xFieldSupp.getTextFields()); } @@ -214,7 +153,6 @@ public class CheckCrossReferences extends ComplexTestCase { com.sun.star.text.XTextField xField = null; com.sun.star.beans.XPropertySet xProps = null; - log.println( "Checking field reference formats NUMBER, NUMBER_NO_CONTEXT and NUMBER_FULL_CONTEXT for existing fields" ); xField = getNextField(); xProps = getFieldProps( xField ); checkField( xField, xProps, com.sun.star.text.ReferenceFieldPart.NUMBER, FldResult2 ); @@ -254,63 +192,36 @@ public class CheckCrossReferences extends ComplexTestCase { // insert a certain cross-reference bookmark and a reference field to this bookmark { - log.println("Checking insert of cross-reference bookmark and corresponding reference field"); // restart paragraph enumeration com.sun.star.container.XEnumerationAccess xParaEnumAccess = (com.sun.star.container.XEnumerationAccess)UnoRuntime.queryInterface( - com.sun.star.container.XEnumerationAccess.class, xDoc.getText()); + com.sun.star.container.XEnumerationAccess.class, document.getText()); xParaEnum = xParaEnumAccess.createEnumeration(); // iterate on the paragraphs to find certain paragraph to insert the bookmark com.sun.star.text.XTextRange xParaTextRange = null; while ( xParaEnum.hasMoreElements() ) { - try { - xParaTextRange = (com.sun.star.text.XTextRange)UnoRuntime.queryInterface( - com.sun.star.text.XTextRange.class, xParaEnum.nextElement()); - if ( xParaTextRange.getString().equals( "J" ) ) { - break; - } - else { - xParaTextRange = null; - } - } catch (com.sun.star.container.NoSuchElementException e) { - System.out.println("Cannot find paragraph to insert cross-reference bookmark."); - e.printStackTrace(); - failed(e.getMessage()); - return; - } catch (com.sun.star.lang.WrappedTargetException e) { - System.out.println("Cannot find paragraph to insert cross-reference bookmark."); - e.printStackTrace(); - failed(e.getMessage()); - return; + xParaTextRange = (com.sun.star.text.XTextRange)UnoRuntime.queryInterface( + com.sun.star.text.XTextRange.class, xParaEnum.nextElement()); + if ( xParaTextRange.getString().equals( "J" ) ) { + break; + } + else { + xParaTextRange = null; } } - if ( xParaTextRange == null ) { - System.out.println("Cannot find paragraph to insert cross-reference bookmark."); - failed("Cannot find paragraph to insert cross-reference bookmark."); - return; - } + assertNotNull( + "Cannot find paragraph to insert cross-reference bookmark.", + xParaTextRange); // insert bookmark XMultiServiceFactory xFac = (XMultiServiceFactory)UnoRuntime.queryInterface( - XMultiServiceFactory.class, xDoc); + XMultiServiceFactory.class, document); final String cBookmarkName = "__RefNumPara__47114711"; - com.sun.star.text.XTextContent xBookmark = null; - try { - xBookmark = (com.sun.star.text.XTextContent)UnoRuntime.queryInterface( - com.sun.star.text.XTextContent.class, - xFac.createInstance( "com.sun.star.text.Bookmark" ) ); - } catch (com.sun.star.lang.IllegalArgumentException e) { - System.out.println("Cannot create bookmark."); - e.printStackTrace(); - failed(e.getMessage()); - return; - } catch (com.sun.star.uno.Exception e) { - System.out.println("Cannot create bookmark."); - e.printStackTrace(); - failed(e.getMessage()); - return; - } + com.sun.star.text.XTextContent xBookmark = + (com.sun.star.text.XTextContent)UnoRuntime.queryInterface( + com.sun.star.text.XTextContent.class, + xFac.createInstance( "com.sun.star.text.Bookmark" ) ); if ( xBookmark != null ) { com.sun.star.container.XNamed xName = (com.sun.star.container.XNamed)UnoRuntime.queryInterface( @@ -320,22 +231,10 @@ public class CheckCrossReferences extends ComplexTestCase { } // insert reference field, which references the inserted bookmark - com.sun.star.text.XTextContent xNewField = null; - try { - xNewField = (com.sun.star.text.XTextContent)UnoRuntime.queryInterface( - com.sun.star.text.XTextContent.class, - xFac.createInstance( "com.sun.star.text.TextField.GetReference" ) ); - } catch (com.sun.star.lang.IllegalArgumentException e) { - System.out.println("Cannot create new field."); - e.printStackTrace(); - failed(e.getMessage()); - return; - } catch (com.sun.star.uno.Exception e) { - System.out.println("Cannot create new field."); - e.printStackTrace(); - failed(e.getMessage()); - return; - } + com.sun.star.text.XTextContent xNewField = + (com.sun.star.text.XTextContent)UnoRuntime.queryInterface( + com.sun.star.text.XTextContent.class, + xFac.createInstance( "com.sun.star.text.TextField.GetReference" ) ); if ( xNewField != null ) { com.sun.star.beans.XPropertySet xFieldProps = (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface( @@ -354,16 +253,37 @@ public class CheckCrossReferences extends ComplexTestCase { com.sun.star.text.XTextField xField = (com.sun.star.text.XTextField)UnoRuntime.queryInterface( com.sun.star.text.XTextField.class, xNewField ); - assure( "inserted reference field doesn't has correct field result", - xField.getPresentation( false ).equals("J"), true ); + assertEquals( "inserted reference field doesn't has correct field result", + "J", xField.getPresentation( false ) ); xParaTextRange.getStart().setString( "Hallo new bookmark: " ); xFldsRefresh.refresh(); - assure( "inserted reference field doesn't has correct field result. Instead it's: "+xField.getPresentation( false ), - xField.getPresentation( false ).equals("Hallo new bookmark: J"), true ); + assertEquals( "inserted reference field doesn't has correct field result", + "Hallo new bookmark: J", xField.getPresentation( false ) ); } + } + + @Before public void setUpDocument() throws com.sun.star.uno.Exception { + document = util.WriterTools.loadTextDoc( + connection.getFactory(), + TestDocument.getUrl("CheckCrossReferences.odt")); + } - // closing test document - util.DesktopTools.closeDoc( xDoc ); + @After public void tearDownDocument() { + util.DesktopTools.closeDoc(document); } + + private XTextDocument document = null; + + @BeforeClass public static void setUpConnection() throws Exception { + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); } diff --git a/sw/qa/complex/writer/CheckFlies.java b/sw/qa/complex/writer/CheckFlies.java index 50e94290c5b2..7b4cdd8098d3 100644 --- a/sw/qa/complex/writer/CheckFlies.java +++ b/sw/qa/complex/writer/CheckFlies.java @@ -31,50 +31,40 @@ import com.sun.star.beans.PropertyValue; import com.sun.star.container.XNamed; import com.sun.star.container.XNameAccess; import com.sun.star.container.XIndexAccess; -import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.text.XTextDocument; import com.sun.star.uno.UnoRuntime; import complexlib.ComplexTestCase; import java.math.BigInteger; import java.util.Collection; import java.util.ArrayList; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; -public class CheckFlies extends ComplexTestCase { - private XMultiServiceFactory m_xMsf = null; - private XTextDocument m_xDoc = null; - - public String[] getTestMethodNames() { - return new String[]{"checkFlies"}; - } - - public void checkFlies() - throws com.sun.star.uno.Exception, - com.sun.star.io.IOException +public class CheckFlies { + @Test public void checkFlies() + throws com.sun.star.uno.Exception { - try { - m_xMsf = (XMultiServiceFactory)param.getMSF(); - m_xDoc = util.WriterTools.loadTextDoc(m_xMsf, util.utils.getFullTestURL("CheckFlies.odt")); - com.sun.star.text.XTextFramesSupplier xTFS = (com.sun.star.text.XTextFramesSupplier)UnoRuntime.queryInterface( - com.sun.star.text.XTextFramesSupplier.class, - m_xDoc); - checkTextFrames(xTFS); - com.sun.star.text.XTextGraphicObjectsSupplier xTGOS = (com.sun.star.text.XTextGraphicObjectsSupplier)UnoRuntime.queryInterface( - com.sun.star.text.XTextGraphicObjectsSupplier.class, - m_xDoc); - checkGraphicFrames(xTGOS); - com.sun.star.text.XTextEmbeddedObjectsSupplier xTEOS = (com.sun.star.text.XTextEmbeddedObjectsSupplier)UnoRuntime.queryInterface( - com.sun.star.text.XTextEmbeddedObjectsSupplier.class, - m_xDoc); - checkEmbeddedFrames(xTEOS); - } finally { - // closing test document - if(m_xDoc != null) - util.DesktopTools.closeDoc(m_xDoc); - } + com.sun.star.text.XTextFramesSupplier xTFS = (com.sun.star.text.XTextFramesSupplier)UnoRuntime.queryInterface( + com.sun.star.text.XTextFramesSupplier.class, + document); + checkTextFrames(xTFS); + com.sun.star.text.XTextGraphicObjectsSupplier xTGOS = (com.sun.star.text.XTextGraphicObjectsSupplier)UnoRuntime.queryInterface( + com.sun.star.text.XTextGraphicObjectsSupplier.class, + document); + checkGraphicFrames(xTGOS); + com.sun.star.text.XTextEmbeddedObjectsSupplier xTEOS = (com.sun.star.text.XTextEmbeddedObjectsSupplier)UnoRuntime.queryInterface( + com.sun.star.text.XTextEmbeddedObjectsSupplier.class, + document); + checkEmbeddedFrames(xTEOS); } private void checkEmbeddedFrames(com.sun.star.text.XTextEmbeddedObjectsSupplier xTGOS) - throws com.sun.star.lang.WrappedTargetException + throws com.sun.star.uno.Exception { Collection vExpectedEmbeddedFrames = new ArrayList(); vExpectedEmbeddedFrames.add("Object1"); @@ -82,51 +72,42 @@ public class CheckFlies extends ComplexTestCase { com.sun.star.container.XNameAccess xEmbeddedFrames = xTGOS.getEmbeddedObjects(); for(String sFrameName : xEmbeddedFrames.getElementNames()) { - if(!vExpectedEmbeddedFrames.remove(sFrameName)) - failed("Unexpected frame name"); - try - { - xEmbeddedFrames.getByName(sFrameName); - } - catch(com.sun.star.container.NoSuchElementException e) - { - failed("Could not get embedded frame by name."); - } - if(!xEmbeddedFrames.hasByName(sFrameName)) - failed("Could not find embedded frame by name."); + assertTrue( + "Unexpected frame name", + vExpectedEmbeddedFrames.remove(sFrameName)); + xEmbeddedFrames.getByName(sFrameName); + assertTrue( + "Could not find embedded frame by name.", + xEmbeddedFrames.hasByName(sFrameName)); } - if(!vExpectedEmbeddedFrames.isEmpty()) - failed("Missing expected embedded frames."); + assertTrue( + "Missing expected embedded frames.", + vExpectedEmbeddedFrames.isEmpty()); try { xEmbeddedFrames.getByName("Nonexisting embedded frame"); - failed("Got nonexisting embedded frame"); + fail("Got nonexisting embedded frame"); } catch(com.sun.star.container.NoSuchElementException e) {} - if(xEmbeddedFrames.hasByName("Nonexisting embedded frame")) - failed("Has nonexisting embedded frame"); + assertFalse( + "Has nonexisting embedded frame", + xEmbeddedFrames.hasByName("Nonexisting embedded frame")); com.sun.star.container.XIndexAccess xEmbeddedFramesIdx = (com.sun.star.container.XIndexAccess)UnoRuntime.queryInterface( com.sun.star.container.XIndexAccess.class, xEmbeddedFrames); - if(xEmbeddedFramesIdx.getCount() != nEmbeddedFrames) - failed("Unexpected number of embedded frames reported."); + assertEquals( + "Unexpected number of embedded frames reported.", nEmbeddedFrames, + xEmbeddedFramesIdx.getCount()); for(int nCurrentFrameIdx = 0; nCurrentFrameIdx < xEmbeddedFramesIdx.getCount(); nCurrentFrameIdx++) { - try - { - xEmbeddedFramesIdx.getByIndex(nCurrentFrameIdx); - } - catch(com.sun.star.lang.IndexOutOfBoundsException e) - { - failed("Could not get embedded frame by index."); - } + xEmbeddedFramesIdx.getByIndex(nCurrentFrameIdx); } } private void checkGraphicFrames(com.sun.star.text.XTextGraphicObjectsSupplier xTGOS) - throws com.sun.star.lang.WrappedTargetException + throws com.sun.star.uno.Exception { Collection vExpectedGraphicFrames = new ArrayList(); vExpectedGraphicFrames.add("graphics1"); @@ -134,51 +115,42 @@ public class CheckFlies extends ComplexTestCase { com.sun.star.container.XNameAccess xGraphicFrames = xTGOS.getGraphicObjects(); for(String sFrameName : xGraphicFrames.getElementNames()) { - if(!vExpectedGraphicFrames.remove(sFrameName)) - failed("Unexpected frame name"); - try - { - xGraphicFrames.getByName(sFrameName); - } - catch(com.sun.star.container.NoSuchElementException e) - { - failed("Could not get graphics frame by name."); - } - if(!xGraphicFrames.hasByName(sFrameName)) - failed("Could not find graphics frame by name."); + assertTrue( + "Unexpected frame name", + vExpectedGraphicFrames.remove(sFrameName)); + xGraphicFrames.getByName(sFrameName); + assertTrue( + "Could not find graphics frame by name.", + xGraphicFrames.hasByName(sFrameName)); } - if(!vExpectedGraphicFrames.isEmpty()) - failed("Missing expected graphics frames."); + assertTrue( + "Missing expected graphics frames.", + vExpectedGraphicFrames.isEmpty()); try { xGraphicFrames.getByName("Nonexisting graphics frame"); - failed("Got nonexisting graphics frame"); + fail("Got nonexisting graphics frame"); } catch(com.sun.star.container.NoSuchElementException e) {} - if(xGraphicFrames.hasByName("Nonexisting graphics frame")) - failed("Has nonexisting graphics frame"); + assertFalse( + "Has nonexisting graphics frame", + xGraphicFrames.hasByName("Nonexisting graphics frame")); com.sun.star.container.XIndexAccess xGraphicFramesIdx = (com.sun.star.container.XIndexAccess)UnoRuntime.queryInterface( com.sun.star.container.XIndexAccess.class, xGraphicFrames); - if(xGraphicFramesIdx.getCount() != nGraphicFrames) - failed("Unexpected number of graphics frames reported."); + assertEquals( + "Unexpected number of graphics frames reported.", nGraphicFrames, + xGraphicFramesIdx.getCount()); for(int nCurrentFrameIdx = 0; nCurrentFrameIdx < xGraphicFramesIdx.getCount(); nCurrentFrameIdx++) { - try - { - xGraphicFramesIdx.getByIndex(nCurrentFrameIdx); - } - catch(com.sun.star.lang.IndexOutOfBoundsException e) - { - failed("Could not get graphics frame by index."); - } + xGraphicFramesIdx.getByIndex(nCurrentFrameIdx); } } private void checkTextFrames(com.sun.star.text.XTextFramesSupplier xTFS) - throws com.sun.star.lang.WrappedTargetException + throws com.sun.star.uno.Exception { Collection vExpectedTextFrames = new ArrayList(); vExpectedTextFrames.add("Frame1"); @@ -188,46 +160,60 @@ public class CheckFlies extends ComplexTestCase { com.sun.star.container.XNameAccess xTextFrames = xTFS.getTextFrames(); for(String sFrameName : xTextFrames.getElementNames()) { - if(!vExpectedTextFrames.remove(sFrameName)) - failed("Unexpected frame name"); - try - { - xTextFrames.getByName(sFrameName); - } - catch(com.sun.star.container.NoSuchElementException e) - { - failed("Could not get text frame by name."); - } - if(!xTextFrames.hasByName(sFrameName)) - failed("Could not find text frame by name."); + assertTrue( + "Unexpected frame name", + vExpectedTextFrames.remove(sFrameName)); + xTextFrames.getByName(sFrameName); + assertTrue( + "Could not find text frame by name.", + xTextFrames.hasByName(sFrameName)); } - if(!vExpectedTextFrames.isEmpty()) - failed("Missing expected text frames."); + assertTrue( + "Missing expected text frames.", vExpectedTextFrames.isEmpty()); try { xTextFrames.getByName("Nonexisting Textframe"); - failed("Got nonexisting text frame."); + fail("Got nonexisting text frame."); } catch(com.sun.star.container.NoSuchElementException e) {} - if(xTextFrames.hasByName("Nonexisting text frame")) - failed("Has nonexisting text frame."); + assertFalse( + "Has nonexisting text frame.", + xTextFrames.hasByName("Nonexisting text frame")); com.sun.star.container.XIndexAccess xTextFramesIdx = (com.sun.star.container.XIndexAccess)UnoRuntime.queryInterface( com.sun.star.container.XIndexAccess.class, xTextFrames); - if(xTextFramesIdx.getCount() != nTextFrames) - failed("Unexpected number of text frames reported."); + assertEquals( + "Unexpected number of text frames reported.", nTextFrames, + xTextFramesIdx.getCount()); for(int nCurrentFrameIdx = 0; nCurrentFrameIdx < xTextFramesIdx.getCount(); nCurrentFrameIdx++) { - try - { - xTextFramesIdx.getByIndex(nCurrentFrameIdx); - } - catch(com.sun.star.lang.IndexOutOfBoundsException e) - { - failed("Could not get text frame by index."); - } + xTextFramesIdx.getByIndex(nCurrentFrameIdx); } } + + @Before public void setUpDocument() throws com.sun.star.uno.Exception { + document = util.WriterTools.loadTextDoc( + connection.getFactory(), + TestDocument.getUrl("CheckFlies.odt")); + } + + @After public void tearDownDocument() { + util.DesktopTools.closeDoc(document); + } + + private XTextDocument document = null; + + @BeforeClass public static void setUpConnection() throws Exception { + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); } diff --git a/sw/qa/complex/writer/CheckIndexedPropertyValues.java b/sw/qa/complex/writer/CheckIndexedPropertyValues.java index aca4f68c7ec2..bd086afc3e65 100755 --- a/sw/qa/complex/writer/CheckIndexedPropertyValues.java +++ b/sw/qa/complex/writer/CheckIndexedPropertyValues.java @@ -27,53 +27,29 @@ package complex.writer; -import complexlib.ComplexTestCase; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.XInterface; import com.sun.star.beans.PropertyValue; import com.sun.star.container.XIndexContainer; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.Type; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; /** * Test the com.sun.star.document.IndexedPropertyValues service */ -public class CheckIndexedPropertyValues extends ComplexTestCase { +public class CheckIndexedPropertyValues { + @Test public void checkIndexedPropertyValues() + throws com.sun.star.uno.Exception + { + XIndexContainer xCont = UnoRuntime.queryInterface( + XIndexContainer.class, + connection.getFactory().createInstance( + "com.sun.star.document.IndexedPropertyValues")); - private final String testedServiceName = - "com.sun.star.document.IndexedPropertyValues"; - public String[] getTestMethodNames() { - return new String[]{"checkIndexedPropertyValues"}; - } - -/* public String getTestObjectName() { - return testedServiceName; - } -*/ - public void checkIndexedPropertyValues() { - Object oObj = null; - try { - // print information about the service - XMultiServiceFactory xMSF = (XMultiServiceFactory)param.getMSF(); - oObj = xMSF.createInstance(testedServiceName); - System.out.println("****************"); - System.out.println("Service Name:"); - util.dbg.getSuppServices(oObj); - System.out.println("****************"); - System.out.println("Interfaces:"); - util.dbg.printInterfaces((XInterface)oObj, true); - } - catch(com.sun.star.uno.Exception e) { - System.out.println("Cannot create object."); - e.printStackTrace(); - failed(e.getMessage()); - return; - } - XIndexContainer xCont = (XIndexContainer)UnoRuntime.queryInterface( - XIndexContainer.class, oObj); - - assure("XIndexContainer was queried but returned null.", - (xCont != null)); + assertNotNull("XIndexContainer was queried but returned null.", xCont); PropertyValue[] prop1 = new PropertyValue[1]; prop1[0] = new PropertyValue(); prop1[0].Name = "Jupp"; @@ -84,99 +60,55 @@ public class CheckIndexedPropertyValues extends ComplexTestCase { prop2[0].Name = "Horst"; prop2[0].Value = "BadGuy"; - try { - Type t = xCont.getElementType(); - log.println("Insertable Type: " + t.getTypeName()); - assure("Initial container is not empty: " + xCont.getCount(), xCont.getCount()==0); - log.println("Inserting a PropertyValue."); - xCont.insertByIndex(0, prop1); - PropertyValue[]ret = (PropertyValue[])xCont.getByIndex(0); - assure("Got the wrong PropertyValue: " + - ret[0].Name + " " +(String)ret[0].Value, - ret[0].Name.equals(prop1[0].Name) && - ret[0].Value.equals(prop1[0].Value)); - log.println("Replace the PropertyValue."); - xCont.replaceByIndex(0, prop2); - ret = (PropertyValue[])xCont.getByIndex(0); - assure("Got the wrong PropertyValue: " + - ret[0].Name + " " +(String)ret[0].Value, - ret[0].Name.equals(prop2[0].Name) && - ret[0].Value.equals(prop2[0].Value)); - log.println("Remove the PropertyValue."); - xCont.removeByIndex(0); - assure("Could not remove PropertyValue.", - !xCont.hasElements() && xCont.getCount()==0); - log.println("Insert again."); - xCont.insertByIndex(0, prop1); - xCont.insertByIndex(1, prop2); - assure("Did not insert PropertyValue.", - xCont.hasElements() && xCont.getCount()==2); - - try { - log.println("Insert with wrong index."); - xCont.insertByIndex(25, prop2); - failed("IllegalArgumentException was not thrown."); - } - catch(com.sun.star.lang.IllegalArgumentException e) { - log.println("Wrong exception thrown."); - failed(e.getMessage()); - e.printStackTrace(); - } - catch(com.sun.star.lang.IndexOutOfBoundsException e) { - log.println("Expected exception thrown: "+e); - } - catch(com.sun.star.lang.WrappedTargetException e) { - log.println("Wrong exception thrown."); - failed(e.getMessage()); - e.printStackTrace(); - } - - try { - log.println("Remove non-existing index."); - xCont.removeByIndex(25); - failed("IndexOutOfBoundsException was not thrown."); - } - catch(com.sun.star.lang.IndexOutOfBoundsException e) { - log.println("Expected exception thrown: "+e); - } - catch(com.sun.star.lang.WrappedTargetException e) { - log.println("Wrong exception thrown."); - failed(e.getMessage()); - e.printStackTrace(); - } - - try { - log.println("Insert wrong argument."); - xCont.insertByIndex(2, "Example String"); - failed("IllegalArgumentException was not thrown."); - } - catch(com.sun.star.lang.IllegalArgumentException e) { - log.println("Expected exception thrown: " + e); - } - catch(com.sun.star.lang.IndexOutOfBoundsException e) { - log.println("Wrong exception thrown."); - failed(e.getMessage()); - e.printStackTrace(); - } - catch(com.sun.star.lang.WrappedTargetException e) { - log.println("Wrong exception thrown."); - failed(e.getMessage()); - e.printStackTrace(); - } + Type t = xCont.getElementType(); + assertEquals("Initial container is not empty", 0, xCont.getCount()); + xCont.insertByIndex(0, prop1); + PropertyValue[]ret = (PropertyValue[])xCont.getByIndex(0); + assertEquals(prop1[0].Name, ret[0].Name); + assertEquals(prop1[0].Value, ret[0].Value); + xCont.replaceByIndex(0, prop2); + ret = (PropertyValue[])xCont.getByIndex(0); + assertEquals(prop2[0].Name, ret[0].Name); + assertEquals(prop2[0].Value, ret[0].Value); + xCont.removeByIndex(0); + assertTrue("Could not remove PropertyValue.", + !xCont.hasElements() && xCont.getCount()==0); + xCont.insertByIndex(0, prop1); + xCont.insertByIndex(1, prop2); + assertTrue("Did not insert PropertyValue.", + xCont.hasElements() && xCont.getCount()==2); + try { + xCont.insertByIndex(25, prop2); + fail("IllegalArgumentException was not thrown."); } - catch(com.sun.star.lang.IllegalArgumentException e) { - failed(e.getMessage()); - e.printStackTrace(); + catch(com.sun.star.lang.IndexOutOfBoundsException e) { + } + + try { + xCont.removeByIndex(25); + fail("IndexOutOfBoundsException was not thrown."); } catch(com.sun.star.lang.IndexOutOfBoundsException e) { - failed(e.getMessage()); - e.printStackTrace(); } - catch(com.sun.star.lang.WrappedTargetException e) { - failed(e.getMessage()); - e.printStackTrace(); + + try { + xCont.insertByIndex(2, "Example String"); + fail("IllegalArgumentException was not thrown."); + } + catch(com.sun.star.lang.IllegalArgumentException e) { } } + @BeforeClass public static void setUpConnection() throws Exception { + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); } diff --git a/sw/qa/complex/writer/CheckNamedPropertyValues.java b/sw/qa/complex/writer/CheckNamedPropertyValues.java index 851381cf3c24..bad8bbda3303 100755 --- a/sw/qa/complex/writer/CheckNamedPropertyValues.java +++ b/sw/qa/complex/writer/CheckNamedPropertyValues.java @@ -27,53 +27,29 @@ package complex.writer; - -import complexlib.ComplexTestCase; import com.sun.star.beans.PropertyValue; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.XInterface; import com.sun.star.container.XNameContainer; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.Type; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; /** * */ -public class CheckNamedPropertyValues extends ComplexTestCase { - - private final String testedServiceName = - "com.sun.star.document.NamedPropertyValues"; - - public String[] getTestMethodNames() { - return new String[]{"checkNamedPropertyValues"}; - } - -/* public String getTestObjectName() { - return "complex.writer.CheckNamedPropertyValues"; - } */ - - public void checkNamedPropertyValues() { - Object oObj = null; - try { - XMultiServiceFactory xMSF = (XMultiServiceFactory)param.getMSF(); - oObj = xMSF.createInstance(testedServiceName); - System.out.println("****************"); - System.out.println("Service Name:"); - util.dbg.getSuppServices(oObj); - System.out.println("****************"); - System.out.println("Interfaces:"); - util.dbg.printInterfaces((XInterface)oObj, true); - } - catch(com.sun.star.uno.Exception e) { - e.printStackTrace(); - failed(e.getMessage()); - return; - } - XNameContainer xCont = (XNameContainer)UnoRuntime.queryInterface( - XNameContainer.class, oObj); - - assure("XNameContainer was queried but returned null.", - (xCont != null)); +public class CheckNamedPropertyValues { + @Test public void checkNamedPropertyValues() + throws com.sun.star.uno.Exception + { + XNameContainer xCont = UnoRuntime.queryInterface( + XNameContainer.class, + connection.getFactory().createInstance( + "com.sun.star.document.NamedPropertyValues")); + + assertNotNull("XNameContainer was queried but returned null.", xCont); PropertyValue[] prop1 = new PropertyValue[1]; prop1[0] = new PropertyValue(); prop1[0].Name = "Jupp"; @@ -84,113 +60,61 @@ public class CheckNamedPropertyValues extends ComplexTestCase { prop2[0].Name = "Horst"; prop2[0].Value = "BadGuy"; - try { - Type t = xCont.getElementType(); - log.println("Insertable Type: " + t.getTypeName()); - assure("Initial container is not empty.", !xCont.hasElements()); - - log.println("Insert a PropertyValue."); - xCont.insertByName("prop1", prop1); - PropertyValue[]ret = (PropertyValue[])xCont.getByName("prop1"); - assure("Got the wrong PropertyValue: " + - ret[0].Name + " " +(String)ret[0].Value, - ret[0].Name.equals(prop1[0].Name) && - ret[0].Value.equals(prop1[0].Value)); - log.println("Replace the PropertyValue."); - xCont.replaceByName("prop1", prop2); - ret = (PropertyValue[])xCont.getByName("prop1"); - assure("Got the wrong PropertyValue: " + - ret[0].Name + " " +(String)ret[0].Value, - ret[0].Name.equals(prop2[0].Name) && - ret[0].Value.equals(prop2[0].Value)); - log.println("Remove the PropertyValue."); - xCont.removeByName("prop1"); - assure("Could not remove PropertyValue.", !xCont.hasElements()); - log.println("Insert again."); - xCont.insertByName("prop1", prop1); - xCont.insertByName("prop2", prop2); - assure("Did not insert PropertyValue.", xCont.hasElements()); - String[] names = xCont.getElementNames(); - int count = 0; - for (int i=0; i +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +package complex.writer; + +import java.io.File; + +final class TestDocument { + public static String getUrl(String name) { + return new File("testdocuments", name). + getAbsoluteFile().toURI().toString().replaceFirst( + "\\A[Ff][Ii][Ll][Ee]:/(?=[^/]|\\z)", "file:///"); + // file:/path -> file:///path + } + + private TestDocument() {} +} diff --git a/sw/qa/complex/writer/TextPortionEnumerationTest.java b/sw/qa/complex/writer/TextPortionEnumerationTest.java index 72e9664aaab4..8c84cae3ce16 100755 --- a/sw/qa/complex/writer/TextPortionEnumerationTest.java +++ b/sw/qa/complex/writer/TextPortionEnumerationTest.java @@ -27,7 +27,6 @@ package complex.writer; -import complexlib.ComplexTestCase; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.AnyConverter; import com.sun.star.uno.XComponentContext; @@ -60,6 +59,13 @@ import com.sun.star.text.TextContentAnchorType; import static com.sun.star.text.TextContentAnchorType.*; import static com.sun.star.text.ControlCharacter.*; import com.sun.star.rdf.XMetadatable; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; import java.util.Map; import java.util.HashMap; @@ -422,10 +428,8 @@ class FuzzyTester private Stack> m_StackActual; private List m_BufferExpected; private List m_BufferActual; - private share.LogWriter m_Log; - FuzzyTester(share.LogWriter log) { - m_Log = log; + FuzzyTester() { m_BufferExpected = new ArrayList(); m_BufferActual = new ArrayList(); m_StackExpected = new Stack>(); @@ -434,12 +438,10 @@ class FuzzyTester /** idea: traverse both trees, enumerate nodes, stopping at content nodes. then compare buffers. */ - boolean doTest(TreeNode expected, TreeNode actual) + void doTest(TreeNode expected, TreeNode actual) { - if (!expected.getType().equals("__ROOT__")) - throw new RuntimeException("doTest: expected: root"); - if (!actual.getType().equals("__ROOT__")) - throw new RuntimeException("doTest: actual: root"); + assertEquals("__ROOT__", expected.getType()); + assertEquals("__ROOT__", actual.getType()); m_StackExpected.push(new Pair(expected, expected.createEnumeration())); m_StackActual.push(new Pair(actual, actual.createEnumeration())); do { @@ -449,18 +451,19 @@ class FuzzyTester testBuffer(); } while (!m_StackExpected.empty() || !m_StackActual.empty()); if (m_DiffSequence != 0) { - m_Log.println("warning: " + m_DiffSequence + System.out.println("warning: " + m_DiffSequence + " differences in sequence"); } if (m_DiffSpuriousEmptyText != 0) { - m_Log.println("warning: " + m_DiffSpuriousEmptyText + System.out.println("warning: " + m_DiffSpuriousEmptyText + " spurious empty text nodes"); } if (m_DiffNesting != 0) { - m_Log.println("WARNING: " + m_DiffNesting + System.out.println("WARNING: " + m_DiffNesting + " differences in nesting"); } - return (m_DiffContent == 0) && (m_DiffMissing == 0); + assertEquals(0, m_DiffContent); + assertEquals(0, m_DiffMissing); } private void traverse(Stack> stack, @@ -553,7 +556,7 @@ class FuzzyTester } m_BufferActual.set(j, null); } else { -//m_Log.println("testBuffer:"); +//System.out.println("testBuffer:"); printMissing(node); m_DiffMissing++; } @@ -563,7 +566,7 @@ class FuzzyTester TreeNode node = m_BufferActual.get(j); if (node != null) { -//m_Log.println("testBuffer:"); +//System.out.println("testBuffer:"); printUnexpected(node); if ((node instanceof TextNode) && ((TextNode) node).getContent().length() == 0) { @@ -580,25 +583,25 @@ class FuzzyTester void printDiff(String prefix, String expected, String actual) { - m_Log.println(prefix + + System.out.println(prefix + ":\texpected: " + expected + "\tactual: " + actual); } void printNesting(TreeNode node, TreeNode nesting) { - m_Log.println("node: " + node.toString() + System.out.println("node: " + node.toString() + " possibly moved across nesting " + nesting.toString()); } void printMissing(TreeNode node) { - m_Log.println(" missing node: " + node.toString()); + System.out.println(" missing node: " + node.toString()); } void printUnexpected(TreeNode node) { - m_Log.println("unexpected node: " + node.toString()); + System.out.println("unexpected node: " + node.toString()); } } @@ -609,10 +612,9 @@ class FuzzyTester class EnumConverter { private Stack m_Stack; - TextPortionEnumerationTest m_T; - EnumConverter(TextPortionEnumerationTest err) { - m_Stack = new Stack(); m_T = err; + EnumConverter() { + m_Stack = new Stack(); } TreeNode convert(XEnumeration xEnum) throws Exception @@ -620,7 +622,7 @@ class EnumConverter TreeNode root = new TreeNode(); m_Stack.push(root); TreeNode ret = convertChildren(xEnum); - m_T.assure("EnumConverter.convert: stack", m_Stack.empty()); + assertTrue("EnumConverter.convert: stack", m_Stack.empty()); return ret; } @@ -660,7 +662,7 @@ class EnumConverter xMeta); XEnumeration xEnumChildren = xEA.createEnumeration(); TreeNode node2 = convertChildren(xEnumChildren); - m_T.assure("stack error: meta-field", node == node2); + assertSame("stack error: meta-field", node2, node); } else { XPropertySet xFieldPropSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xField); @@ -668,7 +670,7 @@ class EnumConverter xFieldPropSet.getPropertyValue("Content"); boolean isFixed = (Boolean) xFieldPropSet.getPropertyValue("IsFixed"); - m_T.assure("field not fixed?", isFixed); + assertTrue("field not fixed?", isFixed); node = new TextFieldNode(content); } } else if (type.equals("Footnote")) { @@ -771,10 +773,8 @@ class EnumConverter continue; } else { node = m_Stack.pop(); - m_T.assure("stack error: Ruby expected; is: " + - node.toString(), node instanceof RubyNode); -// m_T.assure("stack error: ruby", -// ruby.equals(((RubyNode)node).getRubyText())); + assertTrue("stack error: Ruby expected; is: " + + node.toString(), node instanceof RubyNode); } } else if (type.equals("InContentMetadata")) { Object xMeta = xPropSet.getPropertyValue("InContentMetadata"); @@ -787,9 +787,7 @@ class EnumConverter UnoRuntime.queryInterface(XEnumerationAccess.class, xMeta); XEnumeration xEnumChildren = xEA.createEnumeration(); TreeNode node2 = convertChildren(xEnumChildren); - m_T.assure("stack error: meta", node == node2); -// } else if (type.equals("MetadataField")) { -// Object xMeta = xPropSet.getPropertyValue("MetadataField"); + assertSame("stack error: meta", node2, node); } else { throw new RuntimeException("unexpected type: " + type); } @@ -1226,7 +1224,7 @@ class RangeInserter extends Inserter //---------------------------------------------------------------------- -public class TextPortionEnumerationTest extends ComplexTestCase +public class TextPortionEnumerationTest { private XMultiServiceFactory m_xMSF = null; private XComponentContext m_xContext = null; @@ -1235,113 +1233,26 @@ public class TextPortionEnumerationTest extends ComplexTestCase private int m_Count = 1; -// public String[] getTestMethodNames() { return new String[] { "testLoadStore" }; } - public String[] getTestMethodNames() { - return new String[] { - "testText", - "testTextField", -// "testControlChar", -// "testSoftPageBreak", - "testFootnote", - "testFrameAs", - "testFrameAt", - "testBookmarkPoint", - "testBookmark", - "testBookmarkPointXmlId", - "testBookmarkXmlId", - "testRefmarkPoint", - "testRefmark", - "testToxmarkPoint", - "testToxmark", - "testHyperlink", - "testHyperlinkEmpty", - "testRuby", - "testRubyEmpty", - "testMeta", - "testMetaEmpty", - "testMetaField", - "testMetaFieldEmpty", - "testBookmark1", - "testBookmark2", - "testRefMark2", - "testRefMark3", - "testToxMark2", - "testToxMark3", - "testMarks1", - "testMarks2", - "testMarks3", - "testFrameMark1", - "testFrameMark2", - "testFrameMark3", - "testFrameMark4", - "testFrames1", - "testFrames2", - "testFrames3", - "testFrames4", - "testFrames5", - "testRubyHyperlink1", - "testRubyHyperlink2", - "testEnd1", - "testEnd2", - "testEnd3", - "testEnd4", - "testEnd5", - "testEmpty1", - "testEmpty2", - "testEmpty3", - "test1", - "testRange1", - "testRangeHyperlinkHyperlink", - "testRangeHyperlinkRuby", - "testRangeRubyHyperlink", - "testRangeRubyRuby", - "testRangeHyperlinkMeta", - "testRangeRubyMeta", - "testRangeMetaHyperlink", - "testRangeMetaRuby", - "testRangeMetaMeta", - "testRange2", - "testRange3", - "testRange4", - "testRange5", - "testRange6", - "testRange7", - "testMetaXText", - "testMetaXTextCursor", - "testMetaXTextAttachToxMark", - "testMetaXTextAttachRefMark", - "testMetaXTextAttachTextField", - "testMetaXTextAttachFootnote", - "testMetaXTextAttachMeta", - "testMetaFieldXTextField", - "testMetaFieldXPropertySet", - "testLoadStore", - }; - } - - public void before() throws Exception - { - m_xMSF = (XMultiServiceFactory) param.getMSF(); + @Before public void before() throws Exception + { + m_xMSF = connection.getFactory(); XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, m_xMSF); Object defaultCtx = xPropertySet.getPropertyValue("DefaultContext"); m_xContext = (XComponentContext) UnoRuntime.queryInterface(XComponentContext.class, defaultCtx); - assure("could not get component context.", m_xContext != null); + assertNotNull("could not get component context.", m_xContext); m_xDoc = util.WriterTools.createTextDoc(m_xMSF); m_TmpDir = util.utils.getOfficeTemp/*Dir*/(m_xMSF); - log.println("tempdir: " + m_TmpDir); + System.out.println("tempdir: " + m_TmpDir); } - public void after() + @After public void after() { - if (m_xDoc != null) { - util.DesktopTools.closeDoc(m_xDoc); - m_xDoc = null; - } + util.DesktopTools.closeDoc(m_xDoc); } - public void testText() throws Exception + @Test public void testText() throws Exception { TreeNode root = new TreeNode(); TreeNode text = new TextNode("abc"); @@ -1349,7 +1260,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testTextField() throws Exception + @Test public void testTextField() throws Exception { String name = mkName("ruby"); TreeNode root = new TreeNode(); @@ -1358,7 +1269,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testControlChar() throws Exception + /*@Test*/ public void testControlChar() throws Exception { //FIXME this is converted to a text portion: ControlCharacter is obsolete TreeNode root = new TreeNode(); @@ -1367,7 +1278,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testSoftPageBreak() throws Exception + /*@Test*/ public void testSoftPageBreak() throws Exception { //FIXME: insert a soft page break: not done TreeNode root = new TreeNode(); @@ -1378,7 +1289,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testFootnote() throws Exception + @Test public void testFootnote() throws Exception { String name = mkName("ftn"); TreeNode root = new TreeNode(); @@ -1387,7 +1298,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testFrameAs() throws Exception + @Test public void testFrameAs() throws Exception { String name = mkName("frame"); TreeNode root = new TreeNode(); @@ -1396,7 +1307,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testFrameAt() throws Exception + @Test public void testFrameAt() throws Exception { String name = mkName("frame"); TreeNode root = new TreeNode(); @@ -1407,7 +1318,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testBookmarkPoint() throws Exception + @Test public void testBookmarkPoint() throws Exception { String name = mkName("mark"); TreeNode root = new TreeNode(); @@ -1418,7 +1329,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testBookmark() throws Exception + @Test public void testBookmark() throws Exception { String name = mkName("mark"); TreeNode root = new TreeNode(); @@ -1431,7 +1342,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testBookmarkPointXmlId() throws Exception + @Test public void testBookmarkPointXmlId() throws Exception { String name = mkName("mark"); StringPair id = mkId("id"); @@ -1443,7 +1354,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testBookmarkXmlId() throws Exception + @Test public void testBookmarkXmlId() throws Exception { String name = mkName("mark"); StringPair id = mkId("id"); @@ -1457,7 +1368,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testRefmarkPoint() throws Exception + @Test public void testRefmarkPoint() throws Exception { String name = mkName("refmark"); TreeNode root = new TreeNode(); @@ -1468,7 +1379,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testRefmark() throws Exception + @Test public void testRefmark() throws Exception { String name = mkName("refmark"); TreeNode root = new TreeNode(); @@ -1481,7 +1392,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testToxmarkPoint() throws Exception + @Test public void testToxmarkPoint() throws Exception { String name = mkName("toxmark"); TreeNode root = new TreeNode(); @@ -1492,7 +1403,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testToxmark() throws Exception + @Test public void testToxmark() throws Exception { String name = mkName("toxmark"); TreeNode root = new TreeNode(); @@ -1505,7 +1416,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testHyperlink() throws Exception + @Test public void testHyperlink() throws Exception { String name = mkName("url"); TreeNode root = new TreeNode(); @@ -1516,7 +1427,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testHyperlinkEmpty() throws Exception + @Test public void testHyperlinkEmpty() throws Exception { String name = mkName("url"); TreeNode root = new TreeNode(); @@ -1527,7 +1438,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testRuby() throws Exception + @Test public void testRuby() throws Exception { String name = mkName("ruby"); TreeNode root = new TreeNode(); @@ -1538,7 +1449,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testRubyEmpty() throws Exception + @Test public void testRubyEmpty() throws Exception { // BUG: #i91534# String name = mkName("ruby"); @@ -1548,7 +1459,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testMeta() throws Exception + @Test public void testMeta() throws Exception { StringPair id = new StringPair("content.xml", mkName("id")); TreeNode root = new TreeNode(); @@ -1560,7 +1471,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testMetaEmpty() throws Exception + @Test public void testMetaEmpty() throws Exception { StringPair id = new StringPair("content.xml", mkName("id")); TreeNode root = new TreeNode(); @@ -1571,7 +1482,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testMetaField() throws Exception + @Test public void testMetaField() throws Exception { StringPair id = new StringPair("content.xml", mkName("id")); TreeNode root = new TreeNode(); @@ -1583,7 +1494,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testMetaFieldEmpty() throws Exception + @Test public void testMetaFieldEmpty() throws Exception { StringPair id = new StringPair("content.xml", mkName("id")); TreeNode root = new TreeNode(); @@ -1594,7 +1505,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testBookmark1() throws Exception + @Test public void testBookmark1() throws Exception { String name1 = mkName("mark"); String name2 = mkName("mark"); @@ -1610,7 +1521,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testBookmark2() throws Exception + @Test public void testBookmark2() throws Exception { String name1 = mkName("mark"); String name2 = mkName("mark"); @@ -1626,7 +1537,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testRefMark2() throws Exception + @Test public void testRefMark2() throws Exception { String name1 = mkName("refmark"); TreeNode root = new TreeNode(); @@ -1638,7 +1549,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testRefMark3() throws Exception + @Test public void testRefMark3() throws Exception { String name1 = mkName("refmark"); String name2 = mkName("refmark"); @@ -1652,7 +1563,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testToxMark2() throws Exception + @Test public void testToxMark2() throws Exception { String name1 = mkName("toxmark"); TreeNode root = new TreeNode(); @@ -1663,7 +1574,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testToxMark3() throws Exception + @Test public void testToxMark3() throws Exception { String name1 = mkName("toxmark"); String name2 = mkName("toxmark"); @@ -1677,7 +1588,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testMarks1() throws Exception + @Test public void testMarks1() throws Exception { String name1 = mkName("bookmark"); String name2 = mkName("toxmark"); @@ -1696,7 +1607,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testMarks2() throws Exception + @Test public void testMarks2() throws Exception { String name1 = mkName("bookmark"); String name2 = mkName("refmark"); @@ -1719,7 +1630,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testMarks3() throws Exception + @Test public void testMarks3() throws Exception { String name1 = mkName("bookmark"); String name2 = mkName("refmark"); @@ -1741,7 +1652,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testFrameMark1() throws Exception + @Test public void testFrameMark1() throws Exception { String name1 = mkName("bookmark"); String name2 = mkName("frame"); @@ -1753,7 +1664,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testFrameMark2() throws Exception + @Test public void testFrameMark2() throws Exception { // BUG: #i98530# String name1 = mkName("bookmark"); @@ -1766,7 +1677,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testFrameMark3() throws Exception + @Test public void testFrameMark3() throws Exception { String name1 = mkName("frame"); String name2 = mkName("bookmark"); @@ -1778,7 +1689,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testFrameMark4() throws Exception + @Test public void testFrameMark4() throws Exception { String name1 = mkName("frame"); String name2 = mkName("bookmark"); @@ -1790,7 +1701,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testFrames1() throws Exception + @Test public void testFrames1() throws Exception { String name1 = mkName("frame"); String name2 = mkName("frame"); @@ -1802,7 +1713,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testFrames2() throws Exception + @Test public void testFrames2() throws Exception { String name1 = mkName("frame"); String name2 = mkName("frame"); @@ -1814,7 +1725,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testFrames3() throws Exception + @Test public void testFrames3() throws Exception { String name1 = mkName("frame"); String name2 = mkName("frame"); @@ -1826,7 +1737,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testFrames4() throws Exception + @Test public void testFrames4() throws Exception { String name1 = mkName("frame"); String name2 = mkName("frame"); @@ -1838,7 +1749,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testFrames5() throws Exception + @Test public void testFrames5() throws Exception { String name1 = mkName("frame"); String name2 = mkName("frame"); @@ -1850,7 +1761,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testRubyHyperlink1() throws Exception + @Test public void testRubyHyperlink1() throws Exception { String name1 = mkName("ruby"); String name2 = mkName("url"); @@ -1863,7 +1774,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testRubyHyperlink2() throws Exception + @Test public void testRubyHyperlink2() throws Exception { String name1 = mkName("url"); String name2 = mkName("ruby"); @@ -1876,7 +1787,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testEnd1() throws Exception + @Test public void testEnd1() throws Exception { String name1 = mkName("bookmark"); String name2 = mkName("toxmark"); @@ -1889,7 +1800,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testEnd2() throws Exception + @Test public void testEnd2() throws Exception { String name1 = mkName("bookmark"); String name2 = mkName("frame"); @@ -1906,7 +1817,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testEnd3() throws Exception + @Test public void testEnd3() throws Exception { String name1 = mkName("ftn"); String name2 = mkName("toxmark"); @@ -1917,7 +1828,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testEnd4() throws Exception + @Test public void testEnd4() throws Exception { String name1 = mkName("bookmark"); String name2 = mkName("frame"); @@ -1929,7 +1840,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testEnd5() throws Exception + @Test public void testEnd5() throws Exception { String name1 = mkName("refmark"); String name2 = mkName("ruby"); @@ -1943,7 +1854,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testEmpty1() throws Exception + @Test public void testEmpty1() throws Exception { String name1 = mkName("refmark"); String name2 = mkName("toxmark"); @@ -1965,7 +1876,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testEmpty2() throws Exception + @Test public void testEmpty2() throws Exception { String name3 = mkName("bookmark"); String name4 = mkName("frame"); @@ -1979,7 +1890,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void testEmpty3() throws Exception + @Test public void testEmpty3() throws Exception { String name1 = mkName("refmark"); String name2 = mkName("toxmark"); @@ -2010,7 +1921,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root); } - public void test1() throws Exception + @Test public void test1() throws Exception { String name1 = mkName("frame"); String name2 = mkName("bookmark"); @@ -2037,7 +1948,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase attributes; if these ever become entities, they should not be split! */ - public void testRange1() throws Exception + @Test public void testRange1() throws Exception { String name1 = mkName("url"); RangeInserter inserter = new RangeInserter(m_xDoc); @@ -2052,7 +1963,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root, false); } - public void testRangeHyperlinkHyperlink() throws Exception + @Test public void testRangeHyperlinkHyperlink() throws Exception { RangeInserter inserter = new RangeInserter(m_xDoc); TreeNode text = new TextNode("123456789"); @@ -2111,7 +2022,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root, false); } - public void testRangeHyperlinkRuby() throws Exception + @Test public void testRangeHyperlinkRuby() throws Exception { RangeInserter inserter = new RangeInserter(m_xDoc); TreeNode text = new TextNode("123456789"); @@ -2177,7 +2088,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root, false); } - public void testRangeRubyHyperlink() throws Exception + @Test public void testRangeRubyHyperlink() throws Exception { RangeInserter inserter = new RangeInserter(m_xDoc); TreeNode text = new TextNode("123456789"); @@ -2234,7 +2145,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root, false); } - public void testRangeRubyRuby() throws Exception + @Test public void testRangeRubyRuby() throws Exception { RangeInserter inserter = new RangeInserter(m_xDoc); TreeNode text = new TextNode("123456789"); @@ -2280,7 +2191,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root, false); } - public void testRangeHyperlinkMeta() throws Exception + @Test public void testRangeHyperlinkMeta() throws Exception { RangeInserter inserter = new RangeInserter(m_xDoc); TreeNode text = new TextNode("123456789"); @@ -2346,7 +2257,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root, false); } - public void testRangeRubyMeta() throws Exception + @Test public void testRangeRubyMeta() throws Exception { RangeInserter inserter = new RangeInserter(m_xDoc); TreeNode text = new TextNode("123456789"); @@ -2413,7 +2324,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root, false); } - public void testRangeMetaHyperlink() throws Exception + @Test public void testRangeMetaHyperlink() throws Exception { RangeInserter inserter = new RangeInserter(m_xDoc); TreeNode text = new TextNode("123456789"); @@ -2470,7 +2381,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root, false); } - public void testRangeMetaRuby() throws Exception + @Test public void testRangeMetaRuby() throws Exception { RangeInserter inserter = new RangeInserter(m_xDoc); TreeNode text = new TextNode("123456789"); @@ -2559,7 +2470,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root, false); } - public void testRangeMetaMeta() throws Exception + @Test public void testRangeMetaMeta() throws Exception { RangeInserter inserter = new RangeInserter(m_xDoc); TreeNode text = new TextNode("123456789"); @@ -2570,7 +2481,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase TreeNode met2 = new MetaNode( mkId("id") ); try { inserter.insertRange( new Range(0, 4, met2) ); - assure("testRangeMetaMeta: overlap left allowed", false); + fail("testRangeMetaMeta: overlap left allowed"); } catch (com.sun.star.lang.IllegalArgumentException e) { /* ignore */ } TreeNode root = new TreeNode() .appendChild( new TextNode("123") ) @@ -2581,7 +2492,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase TreeNode met3 = new MetaNode( mkId("id") ); try { inserter.insertRange( new Range(5/*-1*/, 8/*-1*/, met3) ); - assure("testRangeMetaMeta: overlap right allowed", false); + fail("testRangeMetaMeta: overlap right allowed"); } catch (com.sun.star.lang.IllegalArgumentException e) { /* ignore */ } root = new TreeNode() .appendChild( new TextNode("123") ) @@ -2611,7 +2522,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root, false); } - public void testRange2() throws Exception + @Test public void testRange2() throws Exception { RangeInserter inserter = new RangeInserter(m_xDoc); TreeNode text = new TextNode("123456789"); @@ -2681,7 +2592,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root, false); } - public void testRange3() throws Exception + @Test public void testRange3() throws Exception { RangeInserter inserter = new RangeInserter(m_xDoc); TreeNode text = new TextNode("123456789"); @@ -2715,7 +2626,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root, false); } - public void testRange4() throws Exception + @Test public void testRange4() throws Exception { RangeInserter inserter = new RangeInserter(m_xDoc); TreeNode text = new TextNode("123456789"); @@ -2769,7 +2680,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root, false); } - public void testRange5() throws Exception + @Test public void testRange5() throws Exception { RangeInserter inserter = new RangeInserter(m_xDoc); TreeNode text = new TextNode("123456789"); @@ -2818,7 +2729,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root, false); } - public void testRange6() throws Exception + @Test public void testRange6() throws Exception { RangeInserter inserter = new RangeInserter(m_xDoc); TreeNode text = new TextNode("123456789"); @@ -2858,7 +2769,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase doTest(root, false); } - public void testRange7() throws Exception + @Test public void testRange7() throws Exception { RangeInserter inserter = new RangeInserter(m_xDoc); TreeNode text = new TextNode("123456789"); @@ -2899,7 +2810,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase /* TODO: test partial selection, test UNDO/REDO */ /** test SwXMeta XText interface */ - public void testMetaXText() throws Exception + @Test public void testMetaXText() throws Exception { RangeInserter inserter = new RangeInserter(m_xDoc); TreeNode text = new TextNode("12AB6789"); @@ -2921,113 +2832,106 @@ public class TextPortionEnumerationTest extends ComplexTestCase XText xText = (XText) UnoRuntime.queryInterface(XText.class, xMeta); XText xParentText = xText.getText(); - assure("getText(): no parent", xParentText != null); + assertNotNull("getText(): no parent", xParentText); XTextRange xStart = xText.getStart(); - assure("getStart(): no start", xStart != null); + assertNotNull("getStart(): no start", xStart); XTextRange xEnd = xText.getEnd(); - assure("getEnd(): no end", xEnd != null); - - /* - String string = xText.getString(); - assure("getString(): invalid string returned", - string != null && "AB".equals(string) ); - */ + assertNotNull("getEnd(): no end", xEnd); xText.setString("45"); { String string = xText.getString(); - assure("getString(): invalid string returned: " + string, - string != null && "45".equals(string) ); + assertEquals("getString(): invalid string returned", + "45", string); } XTextCursor xTextCursor = xText.createTextCursor(); - assure("createTextCursor(): failed", xTextCursor != null); + assertNotNull("createTextCursor(): failed", xTextCursor); try { xText.createTextCursorByRange(null); - assure("createTextCursorByRange(): null allowed?", false); + fail("createTextCursorByRange(): null allowed?"); } catch (RuntimeException e) { /* expected */ } XTextCursor xTextCursorStart = xText.createTextCursorByRange(xStart); - assure("createTextCursorByRange(): failed for start", - xTextCursorStart != null); + assertNotNull("createTextCursorByRange(): failed for start", + xTextCursorStart); XTextCursor xTextCursorEnd = xText.createTextCursorByRange(xEnd); - assure("createTextCursorByRange(): failed for end", - xTextCursorEnd != null); + assertNotNull("createTextCursorByRange(): failed for end", + xTextCursorEnd); // move outside meta xDocTextCursor.gotoStart(false); try { xText.insertString(null, "foo", false); - assure("insertString(): null allowed?", false); + fail("insertString(): null allowed?"); } catch (RuntimeException e) { /* expected */ } try { xText.insertString(xDocTextCursor, "foo", false); - assure("insertString(): cursor outside allowed?", false); + fail("insertString(): cursor outside allowed?"); } catch (RuntimeException e) { /* expected */ } xStart = xText.getStart(); xText.insertString(xStart, "A", false); { String string = xText.getString(); - assure("getString(): invalid string returned: " + string, - string != null && "A45".equals(string) ); + assertEquals("getString(): invalid string returned", + "A45", string); } xText.insertString(xEnd, "B", false); { String string = xText.getString(); - assure("getString(): invalid string returned: " + string, - string != null && "A45B".equals(string) ); + assertEquals("getString(): invalid string returned", + "A45B", string); } try { xText.insertControlCharacter(null, HARD_HYPHEN, false); - assure("insertControlCharacter(): null allowed?", false); + fail("insertControlCharacter(): null allowed?"); } catch (com.sun.star.lang.IllegalArgumentException e) { /* ignore */ } xStart = xText.getStart(); try { xText.insertControlCharacter(xDocTextCursor, HARD_HYPHEN, false); - assure("insertControlCharacter(): cursor outside allowed?", false); + fail("insertControlCharacter(): cursor outside allowed?"); } catch (com.sun.star.lang.IllegalArgumentException e) { /* ignore */ } xText.insertControlCharacter(xStart, HARD_HYPHEN, false); { String string = xText.getString(); - assure("getString(): invalid string returned: " + string, - string != null && ('\u2011' + "A45B").equals(string) ); + assertEquals("getString(): invalid string returned", + '\u2011' + "A45B", string); } xText.insertControlCharacter(xEnd, HARD_HYPHEN, false); { String string = xText.getString(); - assure("getString(): invalid string returned: " + string, - string != null && - ('\u2011' + "A45B" + '\u2011').equals(string) ); + assertEquals("getString(): invalid string returned", + '\u2011' + "A45B" + '\u2011', string); } xText.setString("45"); try { xText.insertTextContent(null, xMeta, false); - assure("insertTextContent(): null range allowed?", false); + fail("insertTextContent(): null range allowed?"); } catch (com.sun.star.lang.IllegalArgumentException e) { /* ignore */ } try { xText.insertTextContent(xStart, null, false); - assure("insertTextContent(): null content allowed?", false); + fail("insertTextContent(): null content allowed?"); } catch (com.sun.star.lang.IllegalArgumentException e) { /* ignore */ } try { xText.insertTextContent(xDocTextCursor, xMeta, false); - assure("insertTextContent(): cursor outside allowed?", false); + fail("insertTextContent(): cursor outside allowed?"); } catch (com.sun.star.lang.IllegalArgumentException e) { /* ignore */ } TextFieldNode field1 = new TextFieldNode( "f1" ); @@ -3059,13 +2963,13 @@ public class TextPortionEnumerationTest extends ComplexTestCase try { xText.removeTextContent(null); - assure("removeTextContent(): null content allowed?", false); + fail("removeTextContent(): null content allowed?"); } catch (RuntimeException e) { /* expected */ } xText.removeTextContent(xField1); XTextRange xAnchor = xMeta.getAnchor(); - assure("getAnchor(): null", xAnchor != null); + assertNotNull("getAnchor(): null", xAnchor); // evil test case: insert ruby around meta RubyNode ruby = new RubyNode( mkName("ruby") ); @@ -3085,31 +2989,31 @@ public class TextPortionEnumerationTest extends ComplexTestCase XEnumerationAccess xEA = (XEnumerationAccess) UnoRuntime.queryInterface(XEnumerationAccess.class, xMeta); XEnumeration xEnum = xEA.createEnumeration(); - assure("createEnumeration(): returns null", xEnum != null); + assertNotNull("createEnumeration(): returns null", xEnum); { - assure("hasNext(): first missing", xEnum.hasMoreElements()); + assertTrue("hasNext(): first missing", xEnum.hasMoreElements()); Object xElement = xEnum.nextElement(); XTextRange xPortion = (XTextRange) UnoRuntime.queryInterface(XTextRange.class, xElement); XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xPortion); String type = (String) xPropSet.getPropertyValue("TextPortionType"); - assure("first: not text: " + type, type.equals("Text")); + assertEquals("first: not text", "Text", type); String txt = xPortion.getString(); - assure("first: text differs: " + txt, "45".equals(txt)); + assertEquals("first: text differs", "45", txt); } { - assure("hasNext(): second missing", xEnum.hasMoreElements()); + assertTrue("hasNext(): second missing", xEnum.hasMoreElements()); Object xElement = xEnum.nextElement(); XTextRange xPortion = (XTextRange) UnoRuntime.queryInterface(XTextRange.class, xElement); XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xPortion); String type = (String) xPropSet.getPropertyValue("TextPortionType"); - assure("second: not text", type.equals("TextField")); + assertEquals("second: not text", "TextField", type); } // no ruby end here!!! - assure("hasNext(): more elements?", !xEnum.hasMoreElements()); + assertFalse("hasNext(): more elements?", xEnum.hasMoreElements()); XComponent xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, xMeta); @@ -3117,14 +3021,14 @@ public class TextPortionEnumerationTest extends ComplexTestCase try { XTextCursor xCursor = xText.createTextCursor(); - assure("createTextCursor(): succeeds on disposed object?", - xCursor == null); + assertNull("createTextCursor(): succeeds on disposed object?", + xCursor); } catch (RuntimeException e) { /* expected */ } } /** check that cursor move methods move to positions in the meta, but do not move to positions outside the meta. */ - public void testMetaXTextCursor() throws Exception + @Test public void testMetaXTextCursor() throws Exception { RangeInserter inserter = new RangeInserter(m_xDoc); TreeNode text = new TextNode("Text. 12 More text here."); @@ -3145,30 +3049,30 @@ public class TextPortionEnumerationTest extends ComplexTestCase XText xText = (XText) UnoRuntime.queryInterface(XText.class, xMeta); XTextRange xStart = xText.getStart(); - assure("getStart(): no start", xStart != null); + assertNotNull("getStart(): no start", xStart); XTextRange xEnd = xText.getEnd(); - assure("getEnd(): no end", xEnd != null); + assertNotNull("getEnd(): no end", xEnd); XTextCursor xTextCursor = xText.createTextCursor(); - assure("createTextCursor(): no cursor", xTextCursor != null); + assertNotNull("createTextCursor(): no cursor", xTextCursor); // XTextCursor boolean bSuccess = false; xTextCursor.gotoStart(false); xTextCursor.gotoEnd(false); bSuccess = xTextCursor.goLeft((short)1, false); - assure("goLeft(): failed", bSuccess); + assertTrue("goLeft(): failed", bSuccess); bSuccess = xTextCursor.goLeft((short)1000, false); - assure("goLeft(): succeeded", !bSuccess); + assertFalse("goLeft(): succeeded", bSuccess); bSuccess = xTextCursor.goRight((short)1, false); - assure("goRight(): failed", bSuccess); + assertTrue("goRight(): failed", bSuccess); bSuccess = xTextCursor.goRight((short)1000, false); - assure("goRight(): succeeded", !bSuccess); + assertFalse("goRight(): succeeded", bSuccess); xTextCursor.gotoRange(xStart, false); xTextCursor.gotoRange(xEnd, false); try { xTextCursor.gotoRange(xDocTextCursor, false); - assure("gotoRange(): succeeded", false); + fail("gotoRange(): succeeded"); } catch (RuntimeException e) { /* expected */ } // XWordCursor @@ -3178,44 +3082,44 @@ public class TextPortionEnumerationTest extends ComplexTestCase UnoRuntime.queryInterface(XWordCursor.class, xTextCursor); bSuccess = xWordCursor.gotoNextWord(true); - assure("gotoNextWord(): failed", bSuccess); + assertTrue("gotoNextWord(): failed", bSuccess); { String string = xTextCursor.getString(); - assure("gotoNextWord(): wrong string: " + string, - "Two ".equals(string)); + assertEquals("gotoNextWord(): wrong string", + "Two ", string); } bSuccess = xWordCursor.gotoNextWord(false); - assure("gotoNextWord(): succeeded", !bSuccess); + assertFalse("gotoNextWord(): succeeded", bSuccess); xTextCursor.collapseToEnd(); bSuccess = xWordCursor.gotoPreviousWord(true); - assure("gotoPreviousWord(): failed", bSuccess); + assertTrue("gotoPreviousWord(): failed", bSuccess); { String string = xTextCursor.getString(); - assure("gotoPreviousWord(): wrong string: " + string, - "words".equals(string)); + assertEquals("gotoPreviousWord(): wrong string", + "words", string); } bSuccess = xWordCursor.gotoPreviousWord(false); - assure("gotoPreviousWord(): succeeded", !bSuccess); + assertFalse("gotoPreviousWord(): succeeded", bSuccess); bSuccess = xWordCursor.gotoEndOfWord(true); - assure("gotoEndOfWord(): failed", bSuccess); + assertTrue("gotoEndOfWord(): failed", bSuccess); { String string = xTextCursor.getString(); - assure("gotoEndOfWord(): wrong string: " + string, - "Two".equals(string)); + assertEquals("gotoEndOfWord(): wrong string", + "Two", string); } xTextCursor.gotoEnd(false); bSuccess = xWordCursor.gotoStartOfWord(true); - assure("gotoStartOfWord(): failed", bSuccess); + assertTrue("gotoStartOfWord(): failed", bSuccess); { String string = xTextCursor.getString(); - assure("gotoStartOfWord(): wrong string: " + string, - "words".equals(string)); + assertEquals("gotoStartOfWord(): wrong string", + "words", string); } xText.setString(""); bSuccess = xWordCursor.gotoEndOfWord(false); - assure("gotoEndOfWord(): succeeded", !bSuccess); + assertFalse("gotoEndOfWord(): succeeded", bSuccess); bSuccess = xWordCursor.gotoStartOfWord(false); - assure("gotoStartOfWord(): succeeded", !bSuccess); + assertFalse("gotoStartOfWord(): succeeded", bSuccess); // XSentenceCursor xText.setString("This is a sentence. Another sentence."); @@ -3224,60 +3128,60 @@ public class TextPortionEnumerationTest extends ComplexTestCase UnoRuntime.queryInterface(XSentenceCursor.class, xTextCursor); bSuccess = xSentenceCursor.gotoNextSentence(true); - assure("gotoNextSentence(): failed", bSuccess); + assertTrue("gotoNextSentence(): failed", bSuccess); { String string = xTextCursor.getString(); - assure("gotoNextSentence(): wrong string: " + string, - "This is a sentence. ".equals(string)); + assertEquals("gotoNextSentence(): wrong string", + "This is a sentence. ", string); } bSuccess = xSentenceCursor.gotoNextSentence(false); - assure("gotoNextSentence(): succeeded", !bSuccess); + assertFalse("gotoNextSentence(): succeeded", bSuccess); // FIXME: // the sentence cursor seems to work differently than the word cursor xText.setString("This is a sentence. Another sentence. Sentence 3."); xTextCursor.gotoEnd(false); bSuccess = xSentenceCursor.gotoPreviousSentence(true); - assure("gotoPreviousSentence(): failed", bSuccess); + assertTrue("gotoPreviousSentence(): failed", bSuccess); { String string = xTextCursor.getString(); - assure("gotoPreviousSentence(): wrong string: " + string, - "Another sentence. Sentence 3.".equals(string)); + assertEquals("gotoPreviousSentence(): wrong string", + "Another sentence. Sentence 3.", string); } bSuccess = xSentenceCursor.gotoPreviousSentence(false); - assure("gotoPreviousSentence(): succeeded", !bSuccess); + assertFalse("gotoPreviousSentence(): succeeded", bSuccess); bSuccess = xSentenceCursor.gotoEndOfSentence(true); - assure("gotoEndOfSentence(): failed", bSuccess); + assertTrue("gotoEndOfSentence(): failed", bSuccess); { String string = xTextCursor.getString(); - assure("gotoEndOfSentence(): wrong string: " + string, - "This is a sentence.".equals(string)); + assertEquals("gotoEndOfSentence(): wrong string", + "This is a sentence.", string); } xTextCursor.gotoEnd(false); bSuccess = xSentenceCursor.gotoStartOfSentence(true); - assure("gotoStartOfSentence(): failed", bSuccess); + assertTrue("gotoStartOfSentence(): failed", bSuccess); { String string = xTextCursor.getString(); - assure("gotoStartOfSentence(): wrong string: " + string, - "Sentence 3.".equals(string)); + assertEquals("gotoStartOfSentence(): wrong string", + "Sentence 3.", string); } xText.setString(""); bSuccess = xSentenceCursor.gotoEndOfSentence(false); - assure("gotoEndOfSentence(): succeeded", !bSuccess); + assertFalse("gotoEndOfSentence(): succeeded", bSuccess); bSuccess = xSentenceCursor.gotoStartOfSentence(false); - assure("gotoStartOfSentence(): succeeded", !bSuccess); + assertFalse("gotoStartOfSentence(): succeeded", bSuccess); XParagraphCursor xParagraphCursor = (XParagraphCursor) UnoRuntime.queryInterface(XParagraphCursor.class, xTextCursor); // XParagraphCursor (does not make sense) bSuccess = xParagraphCursor.gotoNextParagraph(false); - assure("gotoNextParagraph(): succeeded", !bSuccess); + assertFalse("gotoNextParagraph(): succeeded", bSuccess); bSuccess = xParagraphCursor.gotoPreviousParagraph(false); - assure("gotoPreviousParagraph(): succeeded", !bSuccess); + assertFalse("gotoPreviousParagraph(): succeeded", bSuccess); bSuccess = xParagraphCursor.gotoStartOfParagraph(false); - assure("gotoStartOfParagraph(): succeeded", !bSuccess); + assertFalse("gotoStartOfParagraph(): succeeded", bSuccess); bSuccess = xParagraphCursor.gotoEndOfParagraph(false); - assure("gotoEndOfParagraph(): succeeded", !bSuccess); + assertFalse("gotoEndOfParagraph(): succeeded", bSuccess); } @@ -3291,7 +3195,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase throws Exception { } } - public void testMetaXTextAttachToxMark() throws Exception + @Test public void testMetaXTextAttachToxMark() throws Exception { doMetaXTextAttach( new AttachHelper() { @@ -3307,7 +3211,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase }); } - public void testMetaXTextAttachRefMark() throws Exception + @Test public void testMetaXTextAttachRefMark() throws Exception { doMetaXTextAttach( new AttachHelper() { @@ -3323,7 +3227,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase }); } - public void testMetaXTextAttachTextField() throws Exception + @Test public void testMetaXTextAttachTextField() throws Exception { doMetaXTextAttach( new AttachHelper() { @@ -3339,7 +3243,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase }); } - public void testMetaXTextAttachFootnote() throws Exception + @Test public void testMetaXTextAttachFootnote() throws Exception { doMetaXTextAttach( new AttachHelper() { @@ -3355,7 +3259,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase }); } - public void testMetaXTextAttachMeta() throws Exception + @Test public void testMetaXTextAttachMeta() throws Exception { doMetaXTextAttach( new AttachHelper() { @@ -3605,7 +3509,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase } } - public void testMetaFieldXTextField() throws Exception + @Test public void testMetaFieldXTextField() throws Exception { com.sun.star.rdf.XRepositorySupplier xModel = (com.sun.star.rdf.XRepositorySupplier) UnoRuntime.queryInterface( @@ -3643,12 +3547,12 @@ public class TextPortionEnumerationTest extends ComplexTestCase xGraph.addStatement(xMetadatable, xOdfPrefix, xPrefix); xGraph.addStatement(xMetadatable, xOdfSuffix, xSuffix); - assure("getPresentation(): wrong", - "fooabcbar".equals(xMetaField.getPresentation(false))); + assertEquals("getPresentation(): wrong", + "fooabcbar", xMetaField.getPresentation(false)); inserter.insertRange( new Range(0, 0, text) ); } - public void testMetaFieldXPropertySet() throws Exception + @Test public void testMetaFieldXPropertySet() throws Exception { RangeInserter inserter = new RangeInserter(m_xDoc); TreeNode text = new TextNode("123"); @@ -3664,32 +3568,32 @@ public class TextPortionEnumerationTest extends ComplexTestCase XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xMetaField); - assure("PropertySet: not supported?", xPropertySet != null); + assertNotNull("PropertySet: not supported?", xPropertySet); XPropertySetInfo xPropertySetInfo = xPropertySet.getPropertySetInfo(); - assure("hasPropertyByName(\"NumberFormat\"):", - xPropertySetInfo.hasPropertyByName("NumberFormat")); - assure("hasPropertyByName(\"IsFixedLanguage\"):", - xPropertySetInfo.hasPropertyByName("IsFixedLanguage")); + assertTrue("hasPropertyByName(\"NumberFormat\"):", + xPropertySetInfo.hasPropertyByName("NumberFormat")); + assertTrue("hasPropertyByName(\"IsFixedLanguage\"):", + xPropertySetInfo.hasPropertyByName("IsFixedLanguage")); int def = (Integer) xPropertySet.getPropertyValue("NumberFormat"); - log.println("NumberFormat: default is " + def); + System.out.println("NumberFormat: default is " + def); short INT = com.sun.star.i18n.NumberFormatIndex.NUMBER_INT; xPropertySet.setPropertyValue("NumberFormat", INT); xPropertySet.setPropertyValue("IsFixedLanguage", true); int format = (Integer) xPropertySet.getPropertyValue("NumberFormat"); - assure("NumberFormat: failed", format == INT); + assertEquals("NumberFormat: failed", INT, format); boolean isFixed = (Boolean) xPropertySet.getPropertyValue("IsFixedLanguage"); - assure("IsFixedLanguage: failed", isFixed); + assertTrue("IsFixedLanguage: failed", isFixed); } - public void testLoadStore() throws Exception + @Test public void testLoadStore() throws Exception { XComponent xComp = null; String filename = "TESTMETA.odt"; String file; try { - file = util.utils.getFullTestURL(filename); + file = TestDocument.getUrl(filename); xComp = doLoad(file); if (xComp != null) { @@ -3705,21 +3609,21 @@ public class TextPortionEnumerationTest extends ComplexTestCase private void doStore(XComponent xComp, String file) throws Exception { - log.println("Storing test document..."); + System.out.println("Storing test document..."); XStorable xStor = (XStorable) UnoRuntime.queryInterface( XStorable.class, xComp); xStor.storeToURL(file, new PropertyValue[0]); - log.println("...done"); + System.out.println("...done"); } public XComponent doLoad(String file) throws Exception { XComponent xComp = null; - log.println("Loading test document..."); + System.out.println("Loading test document..."); PropertyValue[] loadProps = new PropertyValue[1]; loadProps[0] = new PropertyValue(); @@ -3735,9 +3639,9 @@ public class TextPortionEnumerationTest extends ComplexTestCase XText xText = xTextDoc.getText(); - log.println("...done"); + System.out.println("...done"); - log.println("Checking meta(-field)s in loaded test document..."); + System.out.println("Checking meta(-field)s in loaded test document..."); TreeNode root = new TreeNode() .appendChild( new RubyNode("ruby1") @@ -3782,7 +3686,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase .appendChild( new TextNode(" X X ") ); doTest(xTextDoc, root, false); - log.println("...done"); + System.out.println("...done"); return xComp; } @@ -3828,19 +3732,18 @@ public class TextPortionEnumerationTest extends ComplexTestCase XEnumerationAccess xEA = (XEnumerationAccess) UnoRuntime.queryInterface(XEnumerationAccess.class, xElement); XEnumeration xEnum = xEA.createEnumeration(); - TreeNode outtree = new EnumConverter(this).convert(xEnum); + TreeNode outtree = new EnumConverter().convert(xEnum); dumpTree(outtree, "O: "); - boolean success = new FuzzyTester(log).doTest(intree, outtree); - assure("test failed", success); + new FuzzyTester().doTest(intree, outtree); } private void dumpTree(TreeNode tree) { dumpTree(tree, "> "); } private void dumpTree(TreeNode tree, String prefix) { - log.println(prefix + tree.toString()); + System.out.println(prefix + tree.toString()); TreeNodeEnum children = tree.createEnumeration(); while (children.hasNext()) { TreeNode node = children.next(); @@ -3863,6 +3766,16 @@ public class TextPortionEnumerationTest extends ComplexTestCase return new StringPair("content.xml", id); } - public void assure(String str, boolean cond) { super.assure(str, cond); } + @BeforeClass public static void setUpConnection() throws Exception { + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); } diff --git a/sw/qa/complex/writer/makefile.mk b/sw/qa/complex/writer/makefile.mk index ae2a15f821dd..550e9d64fd82 100755 --- a/sw/qa/complex/writer/makefile.mk +++ b/sw/qa/complex/writer/makefile.mk @@ -25,84 +25,32 @@ # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = PropertyValues -PRJNAME = $(TARGET) -PACKAGE = complex$/writer - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar -JAVAFILES = CheckIndexedPropertyValues.java CheckNamedPropertyValues.java CheckCrossReferences.java CheckBookmarks.java CheckFlies.java TextPortionEnumerationTest.java -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -#----- make a jar from compiled files ------------------------------ - -MAXLINELENGTH = 100000 - -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE - -# --- Parameters for the test -------------------------------------- - -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: .ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF - -# test base is java complex -CT_TESTBASE = -TestBase java_complex - -# build package name with "." instead of $/ -CT_PACKAGE = -o $(PACKAGE:s\$/\.\) - -# start the runner application -CT_APP = org.openoffice.Runner -# --- Targets ------------------------------------------------------ +PRJ = ../../.. +PRJNAME = sw +TARGET = qa_complex_writer + +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/writer +JAVATESTFILES = \ + CheckBookmarks.java \ + CheckCrossReferences.java \ + CheckFlies.java \ + CheckIndexedPropertyValues.java \ + CheckNamedPropertyValues.java \ + TextPortionEnumerationTest.java +JAVAFILES = $(JAVATESTFILES) TestDocument.java +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END -.IF "$(depend)" == "" -ALL: ALLTAR -.ELSE -ALL: ALLDEP -.ENDIF - -.INCLUDE : target.mk - -run: \ - CheckBookmarks \ - CheckCrossReferences \ - CheckIndexedPropertyValues \ - CheckNamedPropertyValues \ - CheckFlies \ - TextPortionEnumerationTest \ - - -RUN: run - -CheckIndexedPropertyValues: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) $(CT_PACKAGE).CheckIndexedPropertyValues - - -CheckNamedPropertyValues: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) $(CT_PACKAGE).CheckNamedPropertyValues - -CheckCrossReferences: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) -tdoc $(PWD)$/testdocuments $(CT_PACKAGE).CheckCrossReferences - -CheckBookmarks: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) -tdoc $(PWD)$/testdocuments $(CT_PACKAGE).CheckBookmarks - -CheckFlies: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) -tdoc $(PWD)$/testdocuments $(CT_PACKAGE).CheckFlies +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk -TextPortionEnumerationTest: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) -tdoc $(PWD)$/testdocuments $(CT_PACKAGE).TextPortionEnumerationTest +ALLTAR : javatest +.END -- cgit From f9c107a9c4a7cea54e6bb133bb92da7e6b4a1d99 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 14 May 2010 13:50:22 +0200 Subject: sb123: #i111598# OfficeConnection getFactory -> getComponentContext --- sw/qa/complex/accessibility/AccessibleRelationSet.java | 9 +++++++-- sw/qa/complex/checkColor/CheckChangeColor.java | 6 +++++- .../complex/indeterminateState/CheckIndeterminateState.java | 12 +++++++++--- sw/qa/complex/writer/CheckBookmarks.java | 4 +++- sw/qa/complex/writer/CheckCrossReferences.java | 4 +++- sw/qa/complex/writer/CheckFlies.java | 5 ++++- sw/qa/complex/writer/CheckIndexedPropertyValues.java | 6 ++++-- sw/qa/complex/writer/CheckNamedPropertyValues.java | 6 ++++-- sw/qa/complex/writer/TextPortionEnumerationTest.java | 4 +++- 9 files changed, 42 insertions(+), 14 deletions(-) (limited to 'sw') diff --git a/sw/qa/complex/accessibility/AccessibleRelationSet.java b/sw/qa/complex/accessibility/AccessibleRelationSet.java index e71ff23e1684..a6da2f29115a 100644 --- a/sw/qa/complex/accessibility/AccessibleRelationSet.java +++ b/sw/qa/complex/accessibility/AccessibleRelationSet.java @@ -35,6 +35,7 @@ import com.sun.star.accessibility.XAccessibleRelationSet; import com.sun.star.awt.XWindow; import com.sun.star.frame.XModel; import com.sun.star.lang.IndexOutOfBoundsException; +import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.text.ControlCharacter; import com.sun.star.text.XText; import com.sun.star.text.XTextCursor; @@ -160,7 +161,11 @@ public class AccessibleRelationSet { throws com.sun.star.lang.IllegalArgumentException, IndexOutOfBoundsException { - xTextDoc = WriterTools.createTextDoc(connection.getFactory()); + XMultiServiceFactory factory = UnoRuntime.queryInterface( + XMultiServiceFactory.class, + connection.getComponentContext().getServiceManager()); + + xTextDoc = WriterTools.createTextDoc(factory); XText oText = xTextDoc.getText(); XTextCursor oCursor = oText.createTextCursor(); @@ -176,7 +181,7 @@ public class AccessibleRelationSet { AccessibilityTools at = new AccessibilityTools(); - XWindow xWindow = at.getCurrentWindow(connection.getFactory(), aModel); + XWindow xWindow = at.getCurrentWindow(factory, aModel); XAccessible xRoot = at.getAccessibleObject(xWindow); at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT); diff --git a/sw/qa/complex/checkColor/CheckChangeColor.java b/sw/qa/complex/checkColor/CheckChangeColor.java index e77964dc2e21..a072072e18c8 100755 --- a/sw/qa/complex/checkColor/CheckChangeColor.java +++ b/sw/qa/complex/checkColor/CheckChangeColor.java @@ -4,6 +4,7 @@ import com.sun.star.awt.Size; import com.sun.star.beans.XPropertySet; import com.sun.star.container.XNameAccess; import com.sun.star.container.XNameContainer; +import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.style.XStyleFamiliesSupplier; import com.sun.star.text.XTextDocument; import com.sun.star.uno.Any; @@ -61,7 +62,10 @@ public class CheckChangeColor { } @Before public void setUpDocument() throws com.sun.star.uno.Exception { - document = SOfficeFactory.getFactory(connection.getFactory()). + document = SOfficeFactory.getFactory( + UnoRuntime.queryInterface( + XMultiServiceFactory.class, + connection.getComponentContext().getServiceManager())). createTextDoc(null); } diff --git a/sw/qa/complex/indeterminateState/CheckIndeterminateState.java b/sw/qa/complex/indeterminateState/CheckIndeterminateState.java index cb756da46b60..23a6d89ccf51 100755 --- a/sw/qa/complex/indeterminateState/CheckIndeterminateState.java +++ b/sw/qa/complex/indeterminateState/CheckIndeterminateState.java @@ -37,6 +37,7 @@ import com.sun.star.awt.XWindow; import com.sun.star.beans.XPropertySet; import com.sun.star.frame.XController; import com.sun.star.frame.XModel; +import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.text.XText; import com.sun.star.text.XTextDocument; import com.sun.star.text.XTextRange; @@ -79,7 +80,7 @@ public class CheckIndeterminateState { XInterface oObj = null; AccessibilityTools at = new AccessibilityTools(); - XWindow xWindow = at.getCurrentContainerWindow(connection.getFactory(), aModel); + XWindow xWindow = at.getCurrentContainerWindow(getFactory(), aModel); XAccessible xRoot = at.getAccessibleObject(xWindow); oObj = at.getAccessibleObjectForRole(xRoot, @@ -95,8 +96,7 @@ public class CheckIndeterminateState { } @Before public void setUpDocument() throws com.sun.star.uno.Exception { - document = SOfficeFactory.getFactory(connection.getFactory()). - createTextDoc(null); + document = SOfficeFactory.getFactory(getFactory()).createTextDoc(null); } @After public void tearDownDocument() { @@ -116,4 +116,10 @@ public class CheckIndeterminateState { } private static final OfficeConnection connection = new OfficeConnection(); + + private static final XMultiServiceFactory getFactory() { + return UnoRuntime.queryInterface( + XMultiServiceFactory.class, + connection.getComponentContext().getServiceManager()); + } } diff --git a/sw/qa/complex/writer/CheckBookmarks.java b/sw/qa/complex/writer/CheckBookmarks.java index f1167b09a18e..84bfe15ba045 100644 --- a/sw/qa/complex/writer/CheckBookmarks.java +++ b/sw/qa/complex/writer/CheckBookmarks.java @@ -120,7 +120,9 @@ public class CheckBookmarks { } @Before public void setUpDocuments() throws Exception { - m_xMsf = connection.getFactory(); + m_xMsf = UnoRuntime.queryInterface( + XMultiServiceFactory.class, + connection.getComponentContext().getServiceManager()); m_xDoc = util.WriterTools.createTextDoc(m_xMsf); setupBookmarks(); actualHashes.m_nSetupHash = BookmarkHashes.getBookmarksHash(m_xDoc); diff --git a/sw/qa/complex/writer/CheckCrossReferences.java b/sw/qa/complex/writer/CheckCrossReferences.java index 720b3a4b7600..cc7fcb1c7e53 100644 --- a/sw/qa/complex/writer/CheckCrossReferences.java +++ b/sw/qa/complex/writer/CheckCrossReferences.java @@ -265,7 +265,9 @@ public class CheckCrossReferences { @Before public void setUpDocument() throws com.sun.star.uno.Exception { document = util.WriterTools.loadTextDoc( - connection.getFactory(), + UnoRuntime.queryInterface( + XMultiServiceFactory.class, + connection.getComponentContext().getServiceManager()), TestDocument.getUrl("CheckCrossReferences.odt")); } diff --git a/sw/qa/complex/writer/CheckFlies.java b/sw/qa/complex/writer/CheckFlies.java index 7b4cdd8098d3..a65c01ec147d 100644 --- a/sw/qa/complex/writer/CheckFlies.java +++ b/sw/qa/complex/writer/CheckFlies.java @@ -31,6 +31,7 @@ import com.sun.star.beans.PropertyValue; import com.sun.star.container.XNamed; import com.sun.star.container.XNameAccess; import com.sun.star.container.XIndexAccess; +import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.text.XTextDocument; import com.sun.star.uno.UnoRuntime; import complexlib.ComplexTestCase; @@ -195,7 +196,9 @@ public class CheckFlies { @Before public void setUpDocument() throws com.sun.star.uno.Exception { document = util.WriterTools.loadTextDoc( - connection.getFactory(), + UnoRuntime.queryInterface( + XMultiServiceFactory.class, + connection.getComponentContext().getServiceManager()), TestDocument.getUrl("CheckFlies.odt")); } diff --git a/sw/qa/complex/writer/CheckIndexedPropertyValues.java b/sw/qa/complex/writer/CheckIndexedPropertyValues.java index bd086afc3e65..c381cd5825c4 100755 --- a/sw/qa/complex/writer/CheckIndexedPropertyValues.java +++ b/sw/qa/complex/writer/CheckIndexedPropertyValues.java @@ -46,8 +46,10 @@ public class CheckIndexedPropertyValues { { XIndexContainer xCont = UnoRuntime.queryInterface( XIndexContainer.class, - connection.getFactory().createInstance( - "com.sun.star.document.IndexedPropertyValues")); + (connection.getComponentContext().getServiceManager(). + createInstanceWithContext( + "com.sun.star.document.IndexedPropertyValues", + connection.getComponentContext()))); assertNotNull("XIndexContainer was queried but returned null.", xCont); PropertyValue[] prop1 = new PropertyValue[1]; diff --git a/sw/qa/complex/writer/CheckNamedPropertyValues.java b/sw/qa/complex/writer/CheckNamedPropertyValues.java index bad8bbda3303..b2541954ce9f 100755 --- a/sw/qa/complex/writer/CheckNamedPropertyValues.java +++ b/sw/qa/complex/writer/CheckNamedPropertyValues.java @@ -46,8 +46,10 @@ public class CheckNamedPropertyValues { { XNameContainer xCont = UnoRuntime.queryInterface( XNameContainer.class, - connection.getFactory().createInstance( - "com.sun.star.document.NamedPropertyValues")); + (connection.getComponentContext().getServiceManager(). + createInstanceWithContext( + "com.sun.star.document.NamedPropertyValues", + connection.getComponentContext()))); assertNotNull("XNameContainer was queried but returned null.", xCont); PropertyValue[] prop1 = new PropertyValue[1]; diff --git a/sw/qa/complex/writer/TextPortionEnumerationTest.java b/sw/qa/complex/writer/TextPortionEnumerationTest.java index 8c84cae3ce16..04860820a86c 100755 --- a/sw/qa/complex/writer/TextPortionEnumerationTest.java +++ b/sw/qa/complex/writer/TextPortionEnumerationTest.java @@ -1235,7 +1235,9 @@ public class TextPortionEnumerationTest @Before public void before() throws Exception { - m_xMSF = connection.getFactory(); + m_xMSF = UnoRuntime.queryInterface( + XMultiServiceFactory.class, + connection.getComponentContext().getServiceManager()); XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, m_xMSF); Object defaultCtx = xPropertySet.getPropertyValue("DefaultContext"); -- cgit From 40850bb44e1f98e96815a64454efb2236706aec7 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 14 May 2010 16:22:06 +0200 Subject: sb123: #i111601# various additional test helper functionality --- sw/qa/complex/writer/TestDocument.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sw') diff --git a/sw/qa/complex/writer/TestDocument.java b/sw/qa/complex/writer/TestDocument.java index 8f120385bb79..25a11338ae5c 100644 --- a/sw/qa/complex/writer/TestDocument.java +++ b/sw/qa/complex/writer/TestDocument.java @@ -28,13 +28,11 @@ package complex.writer; import java.io.File; +import org.openoffice.test.OfficeFileUrl; final class TestDocument { public static String getUrl(String name) { - return new File("testdocuments", name). - getAbsoluteFile().toURI().toString().replaceFirst( - "\\A[Ff][Ii][Ll][Ee]:/(?=[^/]|\\z)", "file:///"); - // file:/path -> file:///path + return OfficeFileUrl.getAbsolute(new File("testdocuments", name)); } private TestDocument() {} -- cgit From b51501773668df37c6b674a04157b40269dd60e5 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 21 May 2010 13:04:32 +0200 Subject: sb123: fixed DEV300_m78 merge-in --- sw/qa/complex/writer/TextPortionEnumerationTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw') diff --git a/sw/qa/complex/writer/TextPortionEnumerationTest.java b/sw/qa/complex/writer/TextPortionEnumerationTest.java index 40652dc6da78..114359bc3581 100755 --- a/sw/qa/complex/writer/TextPortionEnumerationTest.java +++ b/sw/qa/complex/writer/TextPortionEnumerationTest.java @@ -3881,7 +3881,7 @@ public class TextPortionEnumerationTest String filename = "TESTXMLID.odt"; String file; try { - file = util.utils.getFullTestURL(filename); + file = TestDocument.getUrl(filename); xComp = doLoad(file); if (xComp != null) { -- cgit From b4f07e09edf4acb195f287dedf2c9aef56e6606d Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Thu, 10 Jun 2010 15:26:10 +0200 Subject: sb123:#i111449# cleanups in sw/prj/build.lst --- sw/prj/build.lst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'sw') diff --git a/sw/prj/build.lst b/sw/prj/build.lst index 8cb52efb9adb..e8195d20a2d4 100755 --- a/sw/prj/build.lst +++ b/sw/prj/build.lst @@ -74,8 +74,9 @@ sw sw\source\ui nmake - all sw_ui sw_app sw sw\source\core nmake - all sw_core sw_attr sw_bast sw_crsr sw_dcnd sw_doc sw_draw sw_edit sw_excpt sw_fld sw_frmed sw_grph sw_layo sw_ole sw_para sw_sw3io sw_swg sw_text sw_tox sw_txtnd sw_uco sw_undo sw_view sw_acc sw_objpos sw_NumberTree sw_tablecore NULL sw sw\source\filter nmake - all sw_flt sw_ascii sw_bsflt sw_html sw_rtf sw_wrtr sw_ww1 sw_ww8 sw_xml NULL sw sw\util nmake - all sw_util sw_core sw_flt sw_sdi sw_ui NULL -sw sw\qa\complex\accessibility nmake - all sw_qa_complex_accessibility NULL -sw sw\qa\complex\checkColor nmake - all sw_qa_complex_checkColor NULL -sw sw\qa\complex\indeterminateState nmake - all sw_qa_complex_indeterminateState NULL -sw sw\qa\complex\writer nmake - all sw_qa_complex_writer NULL -sw sw\qa\unoapi nmake - all sw_qa_unoapi NULL + +sw sw\qa\complex\accessibility nmake - all sw_qa_complex_accessibility sw_util NULL +sw sw\qa\complex\checkColor nmake - all sw_qa_complex_checkColor sw_util NULL +sw sw\qa\complex\indeterminateState nmake - all sw_qa_complex_indeterminateState sw_util NULL +sw sw\qa\complex\writer nmake - all sw_qa_complex_writer sw_util NULL +sw sw\qa\unoapi nmake - all sw_qa_unoapi sw_util NULL -- cgit From 9a78bbbb3dfab9ccf7ec8db4b7ca7f9c5019581f Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Fri, 23 Jul 2010 12:20:26 +0200 Subject: sb123:#i111449# fix all run through problems for qa/complex tests --- sw/prj/build.lst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sw') diff --git a/sw/prj/build.lst b/sw/prj/build.lst index e8195d20a2d4..8b6cecba92ba 100755 --- a/sw/prj/build.lst +++ b/sw/prj/build.lst @@ -77,6 +77,7 @@ sw sw\util nmake - all sw_util sw_c sw sw\qa\complex\accessibility nmake - all sw_qa_complex_accessibility sw_util NULL sw sw\qa\complex\checkColor nmake - all sw_qa_complex_checkColor sw_util NULL -sw sw\qa\complex\indeterminateState nmake - all sw_qa_complex_indeterminateState sw_util NULL -sw sw\qa\complex\writer nmake - all sw_qa_complex_writer sw_util NULL +# fails +# sw sw\qa\complex\indeterminateState nmake - all sw_qa_complex_indeterminateState sw_util NULL +# sw sw\qa\complex\writer nmake - all sw_qa_complex_writer sw_util NULL sw sw\qa\unoapi nmake - all sw_qa_unoapi sw_util NULL -- cgit From 75432aa630f06d616c71ff0ee15240904ed5017b Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 17 Sep 2010 11:20:23 +0200 Subject: sb123: #i113020# disabled some sw.SwXText*::com::sun::star::beans::XPropertySet for now --- sw/qa/unoapi/knownissues.xcl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sw') diff --git a/sw/qa/unoapi/knownissues.xcl b/sw/qa/unoapi/knownissues.xcl index 08e441211cf7..b9fead8766c3 100644 --- a/sw/qa/unoapi/knownissues.xcl +++ b/sw/qa/unoapi/knownissues.xcl @@ -173,3 +173,8 @@ sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier ### i111332 ### sw.XMLStylesExporter::com::sun::star::document::XFilter + +### i113020 ### +sw.SwXTextEmbeddedObject::com::sun::star::beans::XPropertySet +sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet +sw.SwXTextFrame::com::sun::star::beans::XPropertySet -- cgit From c637d5a4fd89179e51701b9d9e1f93acdb42aa13 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 17 Sep 2010 11:23:08 +0200 Subject: sb123: #i113136# disabled sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText for now --- sw/qa/unoapi/knownissues.xcl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sw') diff --git a/sw/qa/unoapi/knownissues.xcl b/sw/qa/unoapi/knownissues.xcl index b9fead8766c3..9d83269dd245 100644 --- a/sw/qa/unoapi/knownissues.xcl +++ b/sw/qa/unoapi/knownissues.xcl @@ -178,3 +178,6 @@ sw.XMLStylesExporter::com::sun::star::document::XFilter sw.SwXTextEmbeddedObject::com::sun::star::beans::XPropertySet sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet sw.SwXTextFrame::com::sun::star::beans::XPropertySet + +### i113136 ### +sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText -- cgit From be15f10cd9f5fa69c211b3cb307c6a7fac96e445 Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 14 Jul 2010 15:43:40 +0200 Subject: sb123: #i113142# disabled sw.SwAccessibleFooterView and sw.SwAccessibleHeaderView for now --- sw/qa/unoapi/sw.sce | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sw') diff --git a/sw/qa/unoapi/sw.sce b/sw/qa/unoapi/sw.sce index 0f1092af8a51..adf0b176393c 100644 --- a/sw/qa/unoapi/sw.sce +++ b/sw/qa/unoapi/sw.sce @@ -5,9 +5,9 @@ #i111197 -o sw.SwAccessibleDocumentPageView #i86751 -o sw.SwAccessibleDocumentView -o sw.SwAccessibleEndnoteView --o sw.SwAccessibleFooterView +#i113142 -o sw.SwAccessibleFooterView -o sw.SwAccessibleFootnoteView --o sw.SwAccessibleHeaderView +#i113142 -o sw.SwAccessibleHeaderView #i89022 -o sw.SwAccessiblePageView -o sw.SwAccessibleParagraphView -o sw.SwAccessibleTableCellView -- cgit From 77d05522dfd979b9de50ae98343d9c64e0c5db8e Mon Sep 17 00:00:00 2001 From: sb Date: Mon, 30 Aug 2010 15:56:17 +0200 Subject: sb123: #i114205# disabled sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText for now --- sw/qa/unoapi/knownissues.xcl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sw') diff --git a/sw/qa/unoapi/knownissues.xcl b/sw/qa/unoapi/knownissues.xcl index 9d83269dd245..1ef0217ef5a9 100644 --- a/sw/qa/unoapi/knownissues.xcl +++ b/sw/qa/unoapi/knownissues.xcl @@ -181,3 +181,6 @@ sw.SwXTextFrame::com::sun::star::beans::XPropertySet ### i113136 ### sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText + +### i114205 ### +sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText -- cgit From 98ef18c230c5a3f2fa67099dee326ba916901f32 Mon Sep 17 00:00:00 2001 From: sb Date: Tue, 21 Sep 2010 09:59:58 +0200 Subject: sb123: #i114637# disabled sw.SwAccessibleFootnoteView for now --- sw/qa/unoapi/sw.sce | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw') diff --git a/sw/qa/unoapi/sw.sce b/sw/qa/unoapi/sw.sce index adf0b176393c..f6ae766af2d7 100644 --- a/sw/qa/unoapi/sw.sce +++ b/sw/qa/unoapi/sw.sce @@ -6,7 +6,7 @@ #i86751 -o sw.SwAccessibleDocumentView -o sw.SwAccessibleEndnoteView #i113142 -o sw.SwAccessibleFooterView --o sw.SwAccessibleFootnoteView +#i114637 -o sw.SwAccessibleFootnoteView #i113142 -o sw.SwAccessibleHeaderView #i89022 -o sw.SwAccessiblePageView -o sw.SwAccessibleParagraphView -- cgit From bcee866667f48ae93c3dc4db144b61a23cd82a02 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 1 Oct 2010 17:41:28 +0200 Subject: sb123: #i114889# disabled sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor for now --- sw/qa/unoapi/knownissues.xcl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sw') diff --git a/sw/qa/unoapi/knownissues.xcl b/sw/qa/unoapi/knownissues.xcl index 1ef0217ef5a9..ea5bf843f3ec 100644 --- a/sw/qa/unoapi/knownissues.xcl +++ b/sw/qa/unoapi/knownissues.xcl @@ -184,3 +184,6 @@ sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditable ### i114205 ### sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText + +### i114889 ### +sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor -- cgit