[Libreoffice-commits] core.git: 4 commits - binaryurp/source connectivity/Jar_ConnectivityTools.mk connectivity/qa dbaccess/JunitTest_dbaccess_complex.mk dbaccess/qa
Stephan Bergmann
sbergman at redhat.com
Thu Jun 4 01:04:53 PDT 2015
binaryurp/source/reader.cxx | 4
connectivity/Jar_ConnectivityTools.mk | 4
connectivity/qa/connectivity/tools/AbstractDatabase.java | 16
dbaccess/JunitTest_dbaccess_complex.mk | 1
dbaccess/qa/complex/dbaccess/RowSet.java | 365 +++++----------
5 files changed, 156 insertions(+), 234 deletions(-)
New commits:
commit bf98e6acde066ce3d204c3cdcfbd06ec70f7f17d
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Jun 4 09:58:31 2015 +0200
Revert "disable JunitTest_dbaccess_complex part RowSet"
This reverts commit 217dbf61ece9318f4430780d10cef60920086de7, the test should
work now reliably after the preceeding "Finalizers must not access UNO objects"
commit.
diff --git a/dbaccess/JunitTest_dbaccess_complex.mk b/dbaccess/JunitTest_dbaccess_complex.mk
index e3f2c00..7a0b17b 100644
--- a/dbaccess/JunitTest_dbaccess_complex.mk
+++ b/dbaccess/JunitTest_dbaccess_complex.mk
@@ -27,6 +27,7 @@ $(eval $(call gb_JunitTest_set_defs,dbaccess_complex,\
$(eval $(call gb_JunitTest_add_classes,dbaccess_complex,\
complex.dbaccess.Beamer \
complex.dbaccess.PropertyBag \
+ complex.dbaccess.RowSet \
))
$(eval $(call gb_JunitTest_add_sourcefiles,dbaccess_complex,\
commit 3766f2a0d3bc50919366b0e43f5ee8c814019c8b
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Jun 4 09:49:54 2015 +0200
Finalizers must not access UNO objects
If the object being finalized (A) has the last reference to the UNO object (B),
and B is actually a proxy for a remote UNO object, then A and B become eligible
for finalization in parallel, and the finalizer of B may already have run when
the finalizer for A runs. That means that B may already have been removed from
the remote bridge, causing an "unknown OID" error from the remote end when the
finalizer of A now tries to make a call on B.
(We try to assert that close() has actually been called before finalize() calls
delete(), but the corresponding exception may be silently swallowed by the JVM
finalization machinery.)
This caused spurious "URP: queryInterface request message with unknown OID
received" failures during JunitTest_dbaccess_unoapi.
Change-Id: Ia47c3ef2c22a6adc75b1b8271eb4b3140accebe7
diff --git a/connectivity/Jar_ConnectivityTools.mk b/connectivity/Jar_ConnectivityTools.mk
index e398d73..fc8a861 100644
--- a/connectivity/Jar_ConnectivityTools.mk
+++ b/connectivity/Jar_ConnectivityTools.mk
@@ -19,6 +19,10 @@ $(eval $(call gb_Jar_use_jars,ConnectivityTools,\
OOoRunner \
))
+$(eval $(call gb_Jar_use_system_jars,ConnectivityTools, \
+ $(OOO_JUNIT_JAR) \
+))
+
$(eval $(call gb_Jar_set_packageroot,ConnectivityTools,connectivity))
$(eval $(call gb_Jar_add_sourcefiles,ConnectivityTools,\
diff --git a/connectivity/qa/connectivity/tools/AbstractDatabase.java b/connectivity/qa/connectivity/tools/AbstractDatabase.java
index 3207daf..f7295d9 100644
--- a/connectivity/qa/connectivity/tools/AbstractDatabase.java
+++ b/connectivity/qa/connectivity/tools/AbstractDatabase.java
@@ -31,6 +31,7 @@ import com.sun.star.uno.UnoRuntime;
import com.sun.star.util.CloseVetoException;
import connectivity.tools.sdb.Connection;
import java.io.File;
+import static org.junit.Assert.*;
public abstract class AbstractDatabase implements DatabaseAccess
{
@@ -120,7 +121,11 @@ public abstract class AbstractDatabase implements DatabaseAccess
public void closeAndDelete()
{
close();
+ delete();
+ }
+ private void delete()
+ {
if (m_databaseDocumentFile != null)
{
final File file = new File(m_databaseDocumentFile);
@@ -184,7 +189,16 @@ public abstract class AbstractDatabase implements DatabaseAccess
@Override
protected void finalize() throws Throwable
{
- closeAndDelete();
+ // Cannot call close() here, as it accesses UNO objects (that may
+ // already have been finalized):
+ assertNull(
+ "missing call to connectivity.tools.AbstractDatabase.close",
+ m_connection);
+ assertNull(
+ "missing call to connectivity.tools.AbstractDatabase.close",
+ m_databaseDocument);
+
+ delete();
super.finalize();
}
commit 1d7220d0346c336ca6d7fd6b79beccd1daa070cd
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Jun 4 09:21:50 2015 +0200
More informative exception message
Change-Id: If168a3be2630170636c333e177c5db0d40092cbe
diff --git a/binaryurp/source/reader.cxx b/binaryurp/source/reader.cxx
index 4c0ba37..d4b4074 100644
--- a/binaryurp/source/reader.cxx
+++ b/binaryurp/source/reader.cxx
@@ -309,8 +309,8 @@ void Reader::readMessage(Unmarshal & unmarshal) {
css::uno::XInterface > >::get())))))
{
throw css::uno::RuntimeException(
- "URP: queryInterface request message with unknown OID"
- " received");
+ "URP: queryInterface request message with unknown OID '"
+ + oid + "' received");
}
}
break;
commit 4dd0ac62855c5b9382cac004c7eebb9bed983a2b
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Jun 3 13:49:28 2015 +0200
Let JUnit take care of exceptions
Change-Id: Ic628e4eccab59dce5d6d5e77656cac1f0006a491
diff --git a/dbaccess/qa/complex/dbaccess/RowSet.java b/dbaccess/qa/complex/dbaccess/RowSet.java
index 156776a..6baee75 100644
--- a/dbaccess/qa/complex/dbaccess/RowSet.java
+++ b/dbaccess/qa/complex/dbaccess/RowSet.java
@@ -111,30 +111,16 @@ public class RowSet extends TestCase
}
}
- private void createTestCase(boolean _defaultRowSet)
+ private void createTestCase(boolean _defaultRowSet) throws Exception
{
if (m_database == null)
{
- try
- {
- final CRMDatabase database = new CRMDatabase( getMSF(), false );
- m_database = database.getDatabase();
- m_dataSource = m_database.getDataSource();
- }
- catch (Exception e)
- {
- fail("could not create the embedded HSQL database: " + e.getMessage());
- }
+ final CRMDatabase database = new CRMDatabase( getMSF(), false );
+ m_database = database.getDatabase();
+ m_dataSource = m_database.getDataSource();
}
- try
- {
- createStructure();
- }
- catch (SQLException e)
- {
- fail("could not connect to the database/table structure, error message:\n" + e.getMessage());
- }
+ createStructure();
if (_defaultRowSet)
{
@@ -151,7 +137,7 @@ public class RowSet extends TestCase
* @param execute
* determines whether the RowSet should be executed
*/
- private void createRowSet(String command, int commandType, boolean execute)
+ private void createRowSet(String command, int commandType, boolean execute) throws com.sun.star.uno.Exception
{
createRowSet(command, commandType, execute, false);
}
@@ -167,35 +153,28 @@ public class RowSet extends TestCase
* @param limitFetchSize
* determines whether the fetch size of the RowSet should be limited to MAX_FETCH_ROWS
*/
- private void createRowSet(String command, int commandType, boolean execute, boolean limitFetchSize)
+ private void createRowSet(String command, int commandType, boolean execute, boolean limitFetchSize) throws com.sun.star.uno.Exception
{
- try
+ m_rowSet = UnoRuntime.queryInterface( XRowSet.class, getMSF().createInstance( "com.sun.star.sdb.RowSet" ) );
+ final XPropertySet rowSetProperties = UnoRuntime.queryInterface( XPropertySet.class, m_rowSet );
+ rowSetProperties.setPropertyValue("Command", command);
+ rowSetProperties.setPropertyValue("CommandType", Integer.valueOf(commandType));
+ rowSetProperties.setPropertyValue("ActiveConnection", m_database.defaultConnection().getXConnection());
+ if (limitFetchSize)
{
- m_rowSet = UnoRuntime.queryInterface( XRowSet.class, getMSF().createInstance( "com.sun.star.sdb.RowSet" ) );
- final XPropertySet rowSetProperties = UnoRuntime.queryInterface( XPropertySet.class, m_rowSet );
- rowSetProperties.setPropertyValue("Command", command);
- rowSetProperties.setPropertyValue("CommandType", Integer.valueOf(commandType));
- rowSetProperties.setPropertyValue("ActiveConnection", m_database.defaultConnection().getXConnection());
- if (limitFetchSize)
- {
- rowSetProperties.setPropertyValue("FetchSize", Integer.valueOf(MAX_FETCH_ROWS));
- }
+ rowSetProperties.setPropertyValue("FetchSize", Integer.valueOf(MAX_FETCH_ROWS));
+ }
- m_resultSet = UnoRuntime.queryInterface( XResultSet.class, m_rowSet );
- m_resultSetUpdate = UnoRuntime.queryInterface( XResultSetUpdate.class, m_rowSet );
- m_row = UnoRuntime.queryInterface( XRow.class, m_rowSet );
- m_rowLocate = UnoRuntime.queryInterface( XRowLocate.class, m_resultSet );
- m_rowSetProperties = UnoRuntime.queryInterface( XPropertySet.class, m_rowSet );
- m_paramsSupplier = UnoRuntime.queryInterface( XParametersSupplier.class, m_rowSet );
+ m_resultSet = UnoRuntime.queryInterface( XResultSet.class, m_rowSet );
+ m_resultSetUpdate = UnoRuntime.queryInterface( XResultSetUpdate.class, m_rowSet );
+ m_row = UnoRuntime.queryInterface( XRow.class, m_rowSet );
+ m_rowLocate = UnoRuntime.queryInterface( XRowLocate.class, m_resultSet );
+ m_rowSetProperties = UnoRuntime.queryInterface( XPropertySet.class, m_rowSet );
+ m_paramsSupplier = UnoRuntime.queryInterface( XParametersSupplier.class, m_rowSet );
- if (execute)
- {
- m_rowSet.execute();
- }
- }
- catch (Exception e)
+ if (execute)
{
- fail("caught an exception while creating the RowSet. Type:\n" + e.getClass().toString() + "\nMessage:\n" + e.getMessage());
+ m_rowSet.execute();
}
}
@@ -262,140 +241,99 @@ public class RowSet extends TestCase
}
- void testSequentialPositining(XResultSet _resultSet, XRow _row)
+ void testSequentialPositining(XResultSet _resultSet, XRow _row) throws com.sun.star.uno.Exception
{
- try
+ // 1st test
+ int i = 1;
+ while (_resultSet.next())
{
- // 1st test
- int i = 1;
- while (_resultSet.next())
- {
- testPosition(_resultSet, _row, i, "testSequentialPositining");
- ++i;
- }
- }
- catch (Exception e)
- {
- fail("testSequentialPositining failed: " + e);
+ testPosition(_resultSet, _row, i, "testSequentialPositining");
+ ++i;
}
}
- void testAbsolutePositioning(XResultSet _resultSet, XRow _row)
+ void testAbsolutePositioning(XResultSet _resultSet, XRow _row) throws com.sun.star.uno.Exception
{
- try
- {
- for (int i = 1; i <= MAX_FETCH_ROWS; ++i)
- {
- final int calcPos = (MAX_TABLE_ROWS % i) + 1;
- assertTrue("testAbsolutePositioning failed", _resultSet.absolute(calcPos));
- testPosition(_resultSet, _row, calcPos, "testAbsolutePositioning");
- }
- }
- catch (Exception e)
+ for (int i = 1; i <= MAX_FETCH_ROWS; ++i)
{
- fail("testAbsolutePositioning failed: " + e);
+ final int calcPos = (MAX_TABLE_ROWS % i) + 1;
+ assertTrue("testAbsolutePositioning failed", _resultSet.absolute(calcPos));
+ testPosition(_resultSet, _row, calcPos, "testAbsolutePositioning");
}
}
- void testModifyPosition(XResultSet _resultSet, XRow _row)
+ void testModifyPosition(XResultSet _resultSet, XRow _row) throws com.sun.star.uno.Exception
{
- try
- {
- final int testPos = 3;
- assertTrue("testModifyPosition wants at least " + (testPos+1) + " rows", MAX_FETCH_ROWS >= testPos+1);
- assertTrue("testModifyPosition failed on moving to row " + testPos, _resultSet.absolute(testPos));
- UnoRuntime.queryInterface( XRowUpdate.class, _row ).updateString(2, TEST21);
- testPosition(_resultSet, _row, testPos, "testModifyPosition");
- UnoRuntime.queryInterface( XResultSetUpdate.class, _resultSet ).cancelRowUpdates();
- }
- catch (Exception e)
- {
- fail("testModifyPosition failed: " + e);
- }
+ final int testPos = 3;
+ assertTrue("testModifyPosition wants at least " + (testPos+1) + " rows", MAX_FETCH_ROWS >= testPos+1);
+ assertTrue("testModifyPosition failed on moving to row " + testPos, _resultSet.absolute(testPos));
+ UnoRuntime.queryInterface( XRowUpdate.class, _row ).updateString(2, TEST21);
+ testPosition(_resultSet, _row, testPos, "testModifyPosition");
+ UnoRuntime.queryInterface( XResultSetUpdate.class, _resultSet ).cancelRowUpdates();
}
- void test3(XResultSet clone, XResultSet _resultSet)
+ void test3(XResultSet clone, XResultSet _resultSet) throws com.sun.star.uno.Exception
{
- try
+ final XRow _row = UnoRuntime.queryInterface( XRow.class, _resultSet );
+ final XRow cloneRow = UnoRuntime.queryInterface( XRow.class, clone );
+ for (int i = 1; i <= MAX_FETCH_ROWS; ++i)
{
- final XRow _row = UnoRuntime.queryInterface( XRow.class, _resultSet );
- final XRow cloneRow = UnoRuntime.queryInterface( XRow.class, clone );
- for (int i = 1; i <= MAX_FETCH_ROWS; ++i)
+ final int calcPos = (MAX_TABLE_ROWS % i) + 1;
+ if (clone.absolute(calcPos))
{
- final int calcPos = (MAX_TABLE_ROWS % i) + 1;
- if (clone.absolute(calcPos))
- {
- testPosition(clone, cloneRow, calcPos, "test3");
- testAbsolutePositioning(_resultSet, _row);
- testAbsolutePositioning(clone, cloneRow);
- }
+ testPosition(clone, cloneRow, calcPos, "test3");
+ testAbsolutePositioning(_resultSet, _row);
+ testAbsolutePositioning(clone, cloneRow);
}
}
- catch (Exception e)
- {
- fail("test3 failed: " + e);
- }
}
- void test4(XResultSet _resultSet)
+ void test4(XResultSet _resultSet) throws com.sun.star.uno.Exception
{
- try
- {
- final XRow _row = UnoRuntime.queryInterface( XRow.class, _resultSet );
- _resultSet.beforeFirst();
+ final XRow _row = UnoRuntime.queryInterface( XRow.class, _resultSet );
+ _resultSet.beforeFirst();
- for (int i = 1; i <= MAX_TABLE_ROWS; ++i)
+ for (int i = 1; i <= MAX_TABLE_ROWS; ++i)
+ {
+ _resultSet.next();
+ final XResultSet clone = createClone();
+ final XRow cloneRow = UnoRuntime.queryInterface( XRow.class, clone );
+ final int calcPos = MAX_TABLE_ROWS - 1;
+ if (calcPos != 0 && clone.absolute(calcPos))
{
- _resultSet.next();
- final XResultSet clone = createClone();
- final XRow cloneRow = UnoRuntime.queryInterface( XRow.class, clone );
- final int calcPos = MAX_TABLE_ROWS - 1;
- if (calcPos != 0 && clone.absolute(calcPos))
- {
- testPosition(clone, cloneRow, calcPos, "test4: clone");
- testPosition(_resultSet, _row, i, "test4: rowset");
- }
+ testPosition(clone, cloneRow, calcPos, "test4: clone");
+ testPosition(_resultSet, _row, i, "test4: rowset");
}
}
- catch (Exception e)
- {
- fail("test4 failed: " + e);
- }
}
- void testConcurrentAccess(XResultSet _resultSet)
+ void testConcurrentAccess(XResultSet _resultSet) throws Exception
{
System.out.println("testing Thread");
- try
- {
- _resultSet.beforeFirst();
- final int numberOfThreads = 10;
+ _resultSet.beforeFirst();
- final Thread threads[] = new Thread[numberOfThreads];
- for (int i = 0; i < numberOfThreads; ++i)
- {
- threads[i] = new Thread(new ResultSetMovementStress(createClone(), i));
- System.out.println("starting thread " + (i + 1) + " of " + (numberOfThreads));
- threads[i].start();
- }
+ final int numberOfThreads = 10;
- for (int i = 0; i < numberOfThreads; ++i)
- {
- threads[i].join();
- }
- synchronized (failedResultSetMovementStressGuard) {
- assertEquals("", failedResultSetMovementStressMessages);
- }
+ final Thread threads[] = new Thread[numberOfThreads];
+ for (int i = 0; i < numberOfThreads; ++i)
+ {
+ threads[i] = new Thread(new ResultSetMovementStress(createClone(), i));
+ System.out.println("starting thread " + (i + 1) + " of " + (numberOfThreads));
+ threads[i].start();
}
- catch (Exception e)
+
+ for (int i = 0; i < numberOfThreads; ++i)
{
- fail("testConcurrentAccess failed: " + e);
+ threads[i].join();
+ }
+ synchronized (failedResultSetMovementStressGuard) {
+ assertEquals("", failedResultSetMovementStressMessages);
}
}
@@ -757,7 +695,7 @@ public class RowSet extends TestCase
* on a clone of the RowSet
*/
@Test
- public void testCloneMovesPlusDeletions() throws SQLException, UnknownPropertyException, WrappedTargetException
+ public void testCloneMovesPlusDeletions() throws Exception
{
createTestCase(true);
// ensure that all records are known
@@ -826,7 +764,7 @@ public class RowSet extends TestCase
* on a clone of the RowSet
*/
@Test
- public void testCloneMovesPlusInsertions() throws SQLException, UnknownPropertyException, WrappedTargetException, PropertyVetoException, com.sun.star.lang.IllegalArgumentException
+ public void testCloneMovesPlusInsertions() throws Exception
{
createTestCase(true);
// ensure that all records are known
@@ -866,37 +804,23 @@ public class RowSet extends TestCase
}
- private void testTableParameters()
+ private void testTableParameters() throws com.sun.star.uno.Exception
{
// for a row set simply based on a table, there should be not parameters at all
createRowSet("products", CommandType.TABLE, false);
- try
- {
- verifyParameters(new String[]
- {
- }, "testTableParameters");
- }
- catch (Exception e)
- {
- fail("testing the parameters of a table failed" + e.getMessage());
- }
+ verifyParameters(new String[]
+ {
+ }, "testTableParameters");
}
- private void testParametersAfterNormalExecute()
+ private void testParametersAfterNormalExecute() throws com.sun.star.uno.Exception
{
- try
- {
- createRowSet("SELECT * FROM \"customers\"", CommandType.COMMAND, true);
- m_rowSetProperties.setPropertyValue("Command", "SELECT * FROM \"customers\" WHERE \"City\" = :city");
- final XParameters rowsetParams = UnoRuntime.queryInterface( XParameters.class, m_rowSet );
- rowsetParams.setString(1, "London");
- m_rowSet.execute();
- }
- catch (Exception e)
- {
- fail("testing the parameters of a table failed" + e.getMessage());
- }
+ createRowSet("SELECT * FROM \"customers\"", CommandType.COMMAND, true);
+ m_rowSetProperties.setPropertyValue("Command", "SELECT * FROM \"customers\" WHERE \"City\" = :city");
+ final XParameters rowsetParams = UnoRuntime.queryInterface( XParameters.class, m_rowSet );
+ rowsetParams.setString(1, "London");
+ m_rowSet.execute();
}
@@ -926,93 +850,72 @@ public class RowSet extends TestCase
}
- private void testParametrizedQuery()
+ private void testParametrizedQuery() throws com.sun.star.uno.Exception
{
- try
- {
- // for a row set based on a parametrized query, those parameters should be properly
- // recognized
- m_dataSource.createQuery("products like", "SELECT * FROM \"products\" WHERE \"Name\" LIKE :product_name");
- createRowSet("products like", CommandType.QUERY, false);
- verifyParameters(new String[]
- {
- "product_name"
- }, "testParametrizedQuery");
- }
- catch (Exception e)
- {
- fail("testing the parameters of a parametrized query failed" + e.getMessage());
- }
+ // for a row set based on a parametrized query, those parameters should be properly
+ // recognized
+ m_dataSource.createQuery("products like", "SELECT * FROM \"products\" WHERE \"Name\" LIKE :product_name");
+ createRowSet("products like", CommandType.QUERY, false);
+ verifyParameters(new String[]
+ {
+ "product_name"
+ }, "testParametrizedQuery");
}
- private void testParametersInteraction()
+ private void testParametersInteraction() throws com.sun.star.uno.Exception
{
- try
- {
- createRowSet("products like", CommandType.QUERY, false);
+ createRowSet("products like", CommandType.QUERY, false);
- // let's fill in a parameter value via XParameters, and see whether it is respected by the parameters container
- final XParameters rowsetParams = UnoRuntime.queryInterface(XParameters.class, m_rowSet);
- rowsetParams.setString(1, "Apples");
+ // let's fill in a parameter value via XParameters, and see whether it is respected by the parameters container
+ final XParameters rowsetParams = UnoRuntime.queryInterface(XParameters.class, m_rowSet);
+ rowsetParams.setString(1, "Apples");
- XIndexAccess params = m_paramsSupplier.getParameters();
- XPropertySet firstParam = UnoRuntime.queryInterface( XPropertySet.class, params.getByIndex( 0 ) );
- Object firstParamValue = firstParam.getPropertyValue("Value");
+ XIndexAccess params = m_paramsSupplier.getParameters();
+ XPropertySet firstParam = UnoRuntime.queryInterface( XPropertySet.class, params.getByIndex( 0 ) );
+ Object firstParamValue = firstParam.getPropertyValue("Value");
- assertTrue("XParameters and the parameters container do not properly interact",
- "Apples".equals(firstParamValue));
+ assertTrue("XParameters and the parameters container do not properly interact",
+ "Apples".equals(firstParamValue));
- // let's see whether this also survices an execute of the row set
- rowsetParams.setString(1, "Oranges");
- m_rowSet.execute();
- {
- // TODO: the following would not be necessary if the parameters container would *survive*
- // the execution of the row set. It currently doesn't (though the values it represents do).
- // It would be nice, but not strictly necessary, if it would.
- params = m_paramsSupplier.getParameters();
- firstParam = UnoRuntime.queryInterface( XPropertySet.class, params.getByIndex( 0 ) );
- }
- firstParamValue = firstParam.getPropertyValue("Value");
- assertTrue("XParameters and the parameters container do not properly interact, after the row set has been executed",
- "Oranges".equals(firstParamValue));
- }
- catch (Exception e)
+ // let's see whether this also survices an execute of the row set
+ rowsetParams.setString(1, "Oranges");
+ m_rowSet.execute();
{
- fail("could not test the relationship between XParameters and XParametersSupplier: " + e.getMessage());
+ // TODO: the following would not be necessary if the parameters container would *survive*
+ // the execution of the row set. It currently doesn't (though the values it represents do).
+ // It would be nice, but not strictly necessary, if it would.
+ params = m_paramsSupplier.getParameters();
+ firstParam = UnoRuntime.queryInterface( XPropertySet.class, params.getByIndex( 0 ) );
}
+ firstParamValue = firstParam.getPropertyValue("Value");
+ assertTrue("XParameters and the parameters container do not properly interact, after the row set has been executed",
+ "Oranges".equals(firstParamValue));
}
- private void testParametersInFilter()
+ private void testParametersInFilter() throws com.sun.star.uno.Exception
{
- try
- {
- createRowSet("SELECT * FROM \"customers\"", CommandType.COMMAND, false);
- m_rowSetProperties.setPropertyValue("Filter", "\"City\" = :city");
-
- m_rowSetProperties.setPropertyValue("ApplyFilter", Boolean.TRUE);
- verifyParameters(new String[]
- {
- "city"
- }, "testParametersInFilter");
-
- m_rowSetProperties.setPropertyValue("ApplyFilter", Boolean.FALSE);
- verifyParameters(new String[]
- {
- }, "testParametersInFilter");
- }
- catch (Exception e)
- {
- fail("testing the parameters within a WHERE clause failed" + e.getMessage());
- }
+ createRowSet("SELECT * FROM \"customers\"", CommandType.COMMAND, false);
+ m_rowSetProperties.setPropertyValue("Filter", "\"City\" = :city");
+
+ m_rowSetProperties.setPropertyValue("ApplyFilter", Boolean.TRUE);
+ verifyParameters(new String[]
+ {
+ "city"
+ }, "testParametersInFilter");
+
+ m_rowSetProperties.setPropertyValue("ApplyFilter", Boolean.FALSE);
+ verifyParameters(new String[]
+ {
+ }, "testParametersInFilter");
}
/** checks the XParametersSupplier functionality of a RowSet
*/
@Test
- public void testParameters()
+ public void testParameters() throws Exception
{
createTestCase(false);
// use an own RowSet instance, not the one which is also used for the other cases
More information about the Libreoffice-commits
mailing list