summaryrefslogtreecommitdiff
path: root/dbaccess/qa/complex/dbaccess/UISettings.java
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/qa/complex/dbaccess/UISettings.java')
-rw-r--r--dbaccess/qa/complex/dbaccess/UISettings.java58
1 files changed, 33 insertions, 25 deletions
diff --git a/dbaccess/qa/complex/dbaccess/UISettings.java b/dbaccess/qa/complex/dbaccess/UISettings.java
index fc772b158f5f..8733f000f644 100644
--- a/dbaccess/qa/complex/dbaccess/UISettings.java
+++ b/dbaccess/qa/complex/dbaccess/UISettings.java
@@ -32,37 +32,45 @@ import com.sun.star.beans.XPropertySet;
import com.sun.star.container.XNameAccess;
import com.sun.star.form.runtime.XFormController;
import com.sun.star.frame.XController;
-import com.sun.star.frame.XModel;
import com.sun.star.sdb.application.DatabaseObject;
-import com.sun.star.sdb.application.XDatabaseDocumentUI;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.util.XCloseable;
import connectivity.tools.CRMDatabase;
+// ---------- junit imports -----------------
+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 UISettings extends TestCase
{
// --------------------------------------------------------------------------------------------------------
- public String[] getTestMethodNames()
- {
- return new String[] {
- "checkTableFormattingPersistence",
- "checkTransparentQueryColumnSettings"
- };
- }
-
- // --------------------------------------------------------------------------------------------------------
- public String getTestObjectName()
- {
- return "UISettings";
- }
+// public String[] getTestMethodNames()
+// {
+// return new String[] {
+// "checkTableFormattingPersistence",
+// "checkTransparentQueryColumnSettings"
+// };
+// }
+//
+// // --------------------------------------------------------------------------------------------------------
+// public String getTestObjectName()
+// {
+// return "UISettings";
+// }
// --------------------------------------------------------------------------------------------------------
/** verifies that aliases for inner queries work as expected
*/
- public void checkTableFormattingPersistence() throws java.lang.Exception
+ @Test public void checkTableFormattingPersistence() throws java.lang.Exception
{
// create, load, and connect a DB doc
- CRMDatabase database = new CRMDatabase( getORB(), true );
+ CRMDatabase database = new CRMDatabase( getMSF(), true );
// display a table
XFormController tableViewController = UnoRuntime.queryInterface( XFormController.class,
@@ -89,7 +97,7 @@ public class UISettings extends TestCase
// stay alive, and subsequent requests to load the doc will just reuse it, without really loading it.
docURL = copyToTempFile( docURL );
loadDocument( docURL );
- database = new CRMDatabase( getORB(), docURL );
+ database = new CRMDatabase( getMSF(), docURL );
// display the table, again
tableViewController = UnoRuntime.queryInterface( XFormController.class,
@@ -98,9 +106,9 @@ public class UISettings extends TestCase
tableViewController.getCurrentControl().getModel() );
// verify the properties
- assureEquals( "wrong font name", "Andale Sans UI", (String)tableControlModel.getPropertyValue( "FontName" ) );
- assureEquals( "wrong font height", (float)20, ((Float)tableControlModel.getPropertyValue( "FontHeight" )).floatValue() );
- assureEquals( "wrong font slant", FontSlant.ITALIC, (FontSlant)tableControlModel.getPropertyValue( "FontSlant" ) );
+ assertEquals( "wrong font name", "Andale Sans UI", (String)tableControlModel.getPropertyValue( "FontName" ) );
+ assertEquals( "wrong font height", (float)20, ((Float)tableControlModel.getPropertyValue( "FontHeight" )).floatValue() );
+ assertEquals( "wrong font slant", FontSlant.ITALIC, (FontSlant)tableControlModel.getPropertyValue( "FontSlant" ) );
// close the doc
database.saveAndClose();
@@ -111,10 +119,10 @@ public class UISettings extends TestCase
* settings
* @throws java.lang.Exception
*/
- public void checkTransparentQueryColumnSettings() throws java.lang.Exception
+ @Test public void checkTransparentQueryColumnSettings() throws java.lang.Exception
{
// create, load, and connect a DB doc
- CRMDatabase database = new CRMDatabase( getORB(), true );
+ CRMDatabase database = new CRMDatabase( getMSF(), true );
// display a table
XController tableView = database.loadSubComponent( DatabaseObject.TABLE, "customers" );
@@ -125,7 +133,7 @@ public class UISettings extends TestCase
// change the formatting of a table column
XPropertySet idColumn = UnoRuntime.queryInterface( XPropertySet.class, tableControlModel.getByName( "ID" ) );
- assure( "precondition not met: column already centered",
+ assertTrue( "precondition not met: column already centered",
((Short)idColumn.getPropertyValue( "Align" )).shortValue() != TextAlign.CENTER );
idColumn.setPropertyValue( "Align", TextAlign.CENTER );
@@ -143,7 +151,7 @@ public class UISettings extends TestCase
queryViewController.getCurrentControl().getModel() );
idColumn = UnoRuntime.queryInterface( XPropertySet.class, tableControlModel.getByName( "ID" ) );
- assure( "table column alignment was not propagated to the query column",
+ assertTrue( "table column alignment was not propagated to the query column",
((Short)idColumn.getPropertyValue( "Align" )).shortValue() == TextAlign.CENTER );
// save close the database document