Kaydet (Commit) 0d8c89a3 authored tarafından Frank Schoenheit [fs]'s avatar Frank Schoenheit [fs]

dba34a: if there exists a data source registration from the previous test run, revoke it

üst 730b1475
......@@ -26,6 +26,7 @@
************************************************************************/
package complex.dbaccess;
import com.sun.star.container.XNameAccess;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.Exception;
import com.sun.star.uno.UnoRuntime;
......@@ -99,6 +100,9 @@ public class DataSource extends ComplexTestCase
dataSourceName = "someDataSource";
final XNamingService dataSourceRegistrations = (XNamingService) UnoRuntime.queryInterface(
XNamingService.class, getFactory().createInstance("com.sun.star.sdb.DatabaseContext"));
final XNameAccess existenceCheck = UnoRuntime.queryInterface( XNameAccess.class, dataSourceRegistrations );
if ( existenceCheck.hasByName( "someDataSource" ) )
dataSourceRegistrations.revokeObject( "someDataSource" );
dataSourceRegistrations.registerObject("someDataSource", m_dataSource.getXDataSource());
assureEquals("registration name of a newly registered data source is wrong", dataSourceName, m_dataSource.getName());
}
......
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