Kaydet (Commit) 55d4d0a7 authored tarafından Laurent Godard's avatar Laurent Godard Kaydeden (comit) Markus Mohrhard

avoid localization issue

use the sheet name to build the expected strings

Change-Id: I5f079975921338b9449186cc33a0acde180679d5
Reviewed-on: https://gerrit.libreoffice.org/6419Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 8e1bafcc
......@@ -47,6 +47,8 @@ import org.junit.Test;
import org.openoffice.test.OfficeConnection;
import static org.junit.Assert.*;
import com.sun.star.container.XNamed;
/**
* Check the XCellRangesQuery interface on the SheetCell service. test was
* created for bug i20044.
......@@ -55,6 +57,7 @@ public class CheckXCellRangesQuery /* extends ComplexTestCase */ {
XSpreadsheetDocument m_xSheetDoc = null;
XCellRangesQuery m_xCell = null;
XSpreadsheet m_xSpreadSheet = null;
String sSheetName = "";
/**
* Get all test methods.
......@@ -92,6 +95,10 @@ public class CheckXCellRangesQuery /* extends ComplexTestCase */ {
m_xSpreadSheet = (XSpreadsheet) AnyConverter.toObject(
new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
// get the first sheet name
XNamed m_xNamed = (XNamed) AnyConverter.toObject(new Type(XNamed.class),m_xSpreadSheet);
sSheetName = m_xNamed.getName();
// get the cell
System.out.println("Getting a cell from sheet") ;
oObj = m_xSpreadSheet.getCellByPosition(2, 3);
......@@ -167,9 +174,9 @@ public class CheckXCellRangesQuery /* extends ComplexTestCase */ {
@Test public void checkEmptyCell() {
System.out.println("Checking an empty cell...");
// compare an empty cell with a cell with a value
assertTrue("\tQuery column differences did not return the correct value.", _queryColumnDifferences("Sheet1.C4"));
assertTrue("\tQuery column differences did not return the correct value.", _queryColumnDifferences(sSheetName+".C4"));
// compare an empty cell with a cell with a value
assertTrue("\tQuery column differences did not return the correct value.", _queryRowDifferences("Sheet1.C4"));
assertTrue("\tQuery column differences did not return the correct value.", _queryRowDifferences(sSheetName+".C4"));
// try to get this cell
// assertTrue("\tQuery empty cells did not return the correct value.", _queryEmptyCells("Sheet1.C4"));
System.out.println("...done");
......@@ -195,9 +202,9 @@ public class CheckXCellRangesQuery /* extends ComplexTestCase */ {
}
// compare an cell with value 5 with a cell with value 15
assertTrue("\tQuery column differences did not return the correct value.", _queryColumnDifferences("Sheet1.C4"));
assertTrue("\tQuery column differences did not return the correct value.", _queryColumnDifferences(sSheetName + ".C4"));
// compare an cell with value 5 with a cell with value 15
assertTrue("\tQuery column differences did not return the correct value.", _queryRowDifferences("Sheet1.C4"));
assertTrue("\tQuery column differences did not return the correct value.", _queryRowDifferences(sSheetName+".C4"));
// try to get nothing
assertTrue("\tQuery empty cells did not return the correct value.", _queryEmptyCells(""));
System.out.println("...done");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment