summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-10-01 14:13:56 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-10-01 14:13:56 +0200
commite9c1cbce903d325b1e19602d72765511589f5bf2 (patch)
tree07177fb32f692b32029fe848274026cc08e1b3ce /sw
parent257c4203faffdb62d7aaf03819fd2c8c2301f572 (diff)
Revert "sw: new unit test for XAutoTextGroup"
This reverts commit 9356a2d98b13f45b3d17d181b1ad79d541d7d2f8. For one, it caused PythonTest_sw_python to crash like <https://ci.libreoffice.org//job/lo_tb_master_linux_dbg/22022/> with > include/vcl/vclptr.hxx:112: VclPtr<T>::~VclPtr() [with reference_type = vcl::Window]: Assertion `m_rInnerRef.get() == nullptr || vclmain::isAlive()' failed. firing (presumably because some more clean-up as in e7a3329fd0a68c95f00e6cdfdc3e40e6afa5411c "DeInitVCL in PythonTest" is needed). And for another, it left behind instdir/share/autotext/atg_name1.bau at least in my build, and a subsequent PythonTest_sw_python would then fail due to css.container.ElementExistException from some of those tests' xAutoTextContainer.insertNewByName("atg_name1"). That apparently all needs further inspection before re-introducing that test.
Diffstat (limited to 'sw')
-rw-r--r--sw/PythonTest_sw_python.mk1
-rw-r--r--sw/qa/python/check_xautotextgroup.py211
2 files changed, 0 insertions, 212 deletions
diff --git a/sw/PythonTest_sw_python.mk b/sw/PythonTest_sw_python.mk
index f7a868d79d1c..6c5a4c818fe8 100644
--- a/sw/PythonTest_sw_python.mk
+++ b/sw/PythonTest_sw_python.mk
@@ -22,7 +22,6 @@ $(eval $(call gb_PythonTest_add_modules,sw_python,$(SRCDIR)/sw/qa/python,\
check_cross_references \
check_named_property_values \
check_indexed_property_values \
- check_xautotextgroup \
check_styles \
check_xtexttable \
check_table \
diff --git a/sw/qa/python/check_xautotextgroup.py b/sw/qa/python/check_xautotextgroup.py
deleted file mode 100644
index 95d4a0bce67c..000000000000
--- a/sw/qa/python/check_xautotextgroup.py
+++ /dev/null
@@ -1,211 +0,0 @@
-#! /usr/bin/env python
-# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-import unittest
-from org.libreoffice.unotest import UnoInProcess
-from com.sun.star.container import ElementExistException
-
-
-class XAutoTextGroup(unittest.TestCase):
-
- @classmethod
- def setUpClass(cls):
- cls._uno = UnoInProcess()
- cls._uno.setUp()
-
- @classmethod
- def tearDownClass(cls):
- cls._uno.tearDown()
-
- def test_XAutoTextGroup(self):
- # initialization
- xDoc = self._uno.openEmptyWriterDoc()
- xAutoTextContainer = self.createAutoTextContainer()
- xAutoTextGroup = xAutoTextContainer.insertNewByName("atg_name1")
-
- xText = xDoc.getText()
- xCursor = xText.createTextCursor()
- xRange = xCursor.getStart()
-
- # perform unit test
- xName = 'Name'
- xTitle = 'Title'
-
- titlesBefore = xAutoTextGroup.getTitles()
-
- xAutoTextGroup.insertNewByName(xName, xTitle, xRange)
- self.assertNotEqual(titlesBefore, xAutoTextGroup.getTitles())
-
- xAutoTextGroup.removeByName(xName)
- self.assertEqual(titlesBefore, xAutoTextGroup.getTitles())
-
- # clean up
- xAutoTextContainer.removeByName("atg_name1")
- xDoc.close(True)
-
- def test_XAutoTextGroup_NoTitle(self):
- # initialization
- xDoc = self._uno.openEmptyWriterDoc()
- xAutoTextContainer = self.createAutoTextContainer()
- xAutoTextGroup = xAutoTextContainer.insertNewByName("atg_name1")
-
- xText = xDoc.getText()
- xCursor = xText.createTextCursor()
- xRange = xCursor.getStart()
-
- # perform unit test
- xName = 'Name'
-
- titlesBefore = xAutoTextGroup.getTitles()
-
- xAutoTextGroup.insertNewByName(xName, xName, xRange)
- self.assertNotEqual(titlesBefore, xAutoTextGroup.getTitles())
-
- xAutoTextGroup.removeByName(xName)
- self.assertEqual(titlesBefore, xAutoTextGroup.getTitles())
-
- # clean up
- xAutoTextContainer.removeByName("atg_name1")
- xDoc.close(True)
-
- def test_insertNewByName_Twice(self):
- # initialization
- xDoc = self._uno.openEmptyWriterDoc()
- xAutoTextContainer = self.createAutoTextContainer()
- xAutoTextGroup = xAutoTextContainer.insertNewByName("atg_name1")
-
- xText = xDoc.getText()
- xCursor = xText.createTextCursor()
- xRange = xCursor.getStart()
-
- # perform unit test
- xName = 'Name'
- xTitle = 'Title'
-
- xAutoTextGroup.insertNewByName(xName, xTitle, xRange)
-
- with self.assertRaises(ElementExistException):
- xAutoTextGroup.insertNewByName(xName, xTitle, xRange)
-
- xAutoTextGroup.removeByName(xName)
-
- # clean up
- xAutoTextContainer.removeByName("atg_name1")
- xDoc.close(True)
-
- def test_renameByName(self):
- # initialization
- xDoc = self._uno.openEmptyWriterDoc()
- xAutoTextContainer = self.createAutoTextContainer()
- xAutoTextGroup = xAutoTextContainer.insertNewByName("atg_name1")
-
- xText = xDoc.getText()
- xCursor = xText.createTextCursor()
- xRange = xCursor.getStart()
-
- # perform unit test
- xName = 'Name'
- xTitle = 'Title'
-
- xNewName = 'New Name'
- xNewTitle = 'New Title'
-
- xAutoTextGroup.insertNewByName(xName, xTitle, xRange)
- xAutoTextGroup.renameByName(xName, xNewName, xNewTitle)
-
- titlesBefore = xAutoTextGroup.getTitles()
- xAutoTextGroup.removeByName(xName)
- titlesAfter = xAutoTextGroup.getTitles()
- self.assertEqual(titlesBefore, titlesAfter)
-
- xAutoTextGroup.removeByName(xNewName)
- titlesAfter2 = xAutoTextGroup.getTitles()
- self.assertNotEqual(titlesBefore, titlesAfter2)
-
- # clean up
- xAutoTextContainer.removeByName("atg_name1")
- xDoc.close(True)
-
- def test_renameByName_Failed(self):
- # initialization
- xDoc = self._uno.openEmptyWriterDoc()
- xAutoTextContainer = self.createAutoTextContainer()
- xAutoTextGroup = xAutoTextContainer.insertNewByName("atg_name1")
-
- xText = xDoc.getText()
- xCursor = xText.createTextCursor()
- xRange = xCursor.getStart()
-
- # perform unit test
- xName = 'Name'
- xTitle = 'Title'
-
- xNewName = 'New Name'
- xNewTitle = 'New Title'
-
- xAutoTextGroup.insertNewByName(xName, xTitle, xRange)
- xAutoTextGroup.insertNewByName(xNewName, xNewTitle, xRange)
-
- with self.assertRaises(ElementExistException):
- xAutoTextGroup.renameByName(xName, xNewName, xNewTitle)
-
- xAutoTextGroup.removeByName(xName)
- xAutoTextGroup.removeByName(xNewName)
-
- # clean up
- xAutoTextContainer.removeByName("atg_name1")
- xDoc.close(True)
-
- def test_removeByName_Twice(self):
- # initialization
- xDoc = self._uno.openEmptyWriterDoc()
- xAutoTextContainer = self.createAutoTextContainer()
- xAutoTextGroup = xAutoTextContainer.insertNewByName("atg_name1")
-
- xText = xDoc.getText()
- xCursor = xText.createTextCursor()
- xRange = xCursor.getStart()
-
- # perform unit test
- xName = 'Name'
- xTitle = 'Title'
-
- xAutoTextGroup.insertNewByName(xName, xTitle, xRange)
- xAutoTextGroup.removeByName(xName)
-
- # no exception
- xAutoTextGroup.removeByName(xName)
-
- # clean up
- xAutoTextContainer.removeByName("atg_name1")
- xDoc.close(True)
-
- def test_removeByName_Empty(self):
- # initialization
- xDoc = self._uno.openEmptyWriterDoc()
- xAutoTextContainer = self.createAutoTextContainer()
- xAutoTextGroup = xAutoTextContainer.insertNewByName("atg_name1")
-
- # perform unit test
- xAutoTextGroup.removeByName('')
-
- # clean up
- xAutoTextContainer.removeByName("atg_name1")
- xDoc.close(True)
-
- def createAutoTextContainer(self):
- xServiceManager = self._uno.xContext.ServiceManager
- self.assertIsNotNone(xServiceManager)
- xAutoTextContainer = xServiceManager.createInstance("com.sun.star.text.AutoTextContainer")
- self.assertIsNotNone(xAutoTextContainer)
- return xAutoTextContainer
-
-
-if __name__ == '__main__':
- unittest.main()