[Libreoffice-commits] core.git: 5 commits - framework/qa qadevOOo/Jar_OOoRunner.mk qadevOOo/runner qadevOOo/tests
Noel Grandin
noel at peralex.com
Fri Oct 16 01:39:00 PDT 2015
framework/qa/unoapi/framework.sce | 1
qadevOOo/Jar_OOoRunner.mk | 2
qadevOOo/runner/lib/ExceptionStatus.java | 2
qadevOOo/runner/lib/RunState.java | 43 +++++++++
qadevOOo/runner/lib/SimpleStatus.java | 61 ++----------
qadevOOo/runner/lib/Status.java | 24 ++---
qadevOOo/runner/util/DBTools.java | 5 -
qadevOOo/tests/java/mod/_fwk/ObjectMenuController.java | 81 -----------------
qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java | 12 --
9 files changed, 71 insertions(+), 160 deletions(-)
New commits:
commit 1bb1fc060d7849c9ef418ef510de8085daaee13a
Author: Noel Grandin <noel at peralex.com>
Date: Fri Oct 16 09:18:05 2015 +0200
rename state to bSuccessful
Change-Id: Idc757217b84812fa55efbcfc004abd02d0a78dc3
diff --git a/qadevOOo/runner/lib/ExceptionStatus.java b/qadevOOo/runner/lib/ExceptionStatus.java
index 8fee550..d085573 100644
--- a/qadevOOo/runner/lib/ExceptionStatus.java
+++ b/qadevOOo/runner/lib/ExceptionStatus.java
@@ -29,7 +29,7 @@ class ExceptionStatus extends Status {
* @param t the exception an activity terminated with.
*/
ExceptionStatus( Throwable t ) {
- super(RunState.EXCEPTION, FAILED);
+ super(RunState.EXCEPTION, false/*bSuccessful*/);
String message = t.getMessage();
if (message != null)
runStateString = message;
diff --git a/qadevOOo/runner/lib/SimpleStatus.java b/qadevOOo/runner/lib/SimpleStatus.java
index 11e3b7e..e65666d 100644
--- a/qadevOOo/runner/lib/SimpleStatus.java
+++ b/qadevOOo/runner/lib/SimpleStatus.java
@@ -25,19 +25,10 @@ package lib;
*/
class SimpleStatus {
- /* Test states */
-
- /**
- * The constant represents FAILED state.
- */
- public static final boolean FAILED = false;
-
-
-
/**
* The field is holding state of the status.
*/
- private final boolean state;
+ private final boolean bSuccessful;
/**
* The field is holding reason of the status.
@@ -53,8 +44,8 @@ class SimpleStatus {
/**
* The constructor initialize state and reason field.
*/
- protected SimpleStatus( RunState runState, boolean state ) {
- this.state = state;
+ protected SimpleStatus( RunState runState, boolean bSuccessful ) {
+ this.bSuccessful = bSuccessful;
this.runState = runState;
if ( runState == RunState.PASSED ) {
runStateString = "PASSED";
@@ -70,17 +61,14 @@ class SimpleStatus {
/**
* The constructor initialize state and reason field.
*/
- protected SimpleStatus(String runStateString, boolean state) {
- this.state = state;
+ protected SimpleStatus(String runStateString, boolean bSuccessful) {
+ this.bSuccessful = bSuccessful;
this.runState = RunState.USER_DEFINED;
this.runStateString = runStateString;
}
- /**
- * getState implementation. Just returns the state field value.
- */
- public boolean getState() {
- return state;
+ public boolean isSuccessful() {
+ return bSuccessful;
}
/**
@@ -101,7 +89,7 @@ class SimpleStatus {
* Get the result: passed or failed.
*/
public String getStateString() {
- if (state)
+ if (bSuccessful)
return "OK";
return "FAILED";
diff --git a/qadevOOo/runner/lib/Status.java b/qadevOOo/runner/lib/Status.java
index dcab93c..ba28a4c 100644
--- a/qadevOOo/runner/lib/Status.java
+++ b/qadevOOo/runner/lib/Status.java
@@ -39,16 +39,16 @@ public class Status extends SimpleStatus {
/**
* Construct a status: use runState and state
* @param runState either PASSED, SKIPPED, etc.
- * @param state OK or FAILED.
+ * @param bSuccessful OK or FAILED.
*/
- public Status(RunState runState, boolean state ) {
- super(runState, state);
+ public Status(RunState runState, boolean bSuccessful ) {
+ super(runState, bSuccessful);
}
/**
* Construct a status: use own message and state.
* @param message An own message for the status.
- * @param state OK or FAILED.
+ * @param bSuccessful OK or FAILED.
*/
public Status(String message, boolean state) {
super( message, state );
@@ -58,11 +58,11 @@ public class Status extends SimpleStatus {
* This is a factory method for creating a Status representing normal
* activity termination.
*
- * @param state describes a test state (OK if state == true, FAILED
+ * @param bSuccessful describes a test state (OK if state == true, FAILED
* otherwise).
*/
- public static Status passed( boolean state ) {
- return new Status(RunState.PASSED, state );
+ public static Status passed( boolean bSuccessful ) {
+ return new Status(RunState.PASSED, bSuccessful );
}
/**
@@ -82,8 +82,8 @@ public class Status extends SimpleStatus {
* @param state describes a test state (OK if state == true, FAILED
* otherwise).
*/
- public static Status skipped( boolean state ) {
- return new Status( RunState.SKIPPED, state );
+ public static Status skipped( boolean bSuccessful ) {
+ return new Status( RunState.SKIPPED, bSuccessful );
}
@@ -95,7 +95,7 @@ public class Status extends SimpleStatus {
* @param reason describes why the activity failed
*/
public static Status failed(final String reason) {
- return new Status(reason, FAILED);
+ return new Status(reason, false/*bSuccessful*/);
}
/**
@@ -122,7 +122,7 @@ public class Status extends SimpleStatus {
* Checks whether the status state is failed.
*/
public boolean isFailed() {
- return !getState();
+ return !isSuccessful();
}
}
commit 4e1a015d54b030818fdd491a81f47db2191034b0
Author: Noel Grandin <noel at peralex.com>
Date: Fri Oct 16 09:15:58 2015 +0200
convert runState to a proper enum
Change-Id: I6f74e597fe9834b18023e73ee8b8bf50d10c82e2
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk
index 4912f93..1e7483d 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -83,6 +83,7 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
qadevOOo/runner/lib/ExceptionStatus \
qadevOOo/runner/lib/MultiMethodTest \
qadevOOo/runner/lib/MultiPropertyTest \
+ qadevOOo/runner/lib/RunState \
qadevOOo/runner/lib/SimpleStatus \
qadevOOo/runner/lib/Status \
qadevOOo/runner/lib/StatusException \
diff --git a/qadevOOo/runner/lib/ExceptionStatus.java b/qadevOOo/runner/lib/ExceptionStatus.java
index 31bca4b..8fee550 100644
--- a/qadevOOo/runner/lib/ExceptionStatus.java
+++ b/qadevOOo/runner/lib/ExceptionStatus.java
@@ -29,7 +29,7 @@ class ExceptionStatus extends Status {
* @param t the exception an activity terminated with.
*/
ExceptionStatus( Throwable t ) {
- super(EXCEPTION, FAILED);
+ super(RunState.EXCEPTION, FAILED);
String message = t.getMessage();
if (message != null)
runStateString = message;
diff --git a/qadevOOo/runner/lib/RunState.java b/qadevOOo/runner/lib/RunState.java
new file mode 100644
index 0000000..eeee2d8
--- /dev/null
+++ b/qadevOOo/runner/lib/RunState.java
@@ -0,0 +1,43 @@
+/*
+ * 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+package lib;
+
+public enum RunState {
+
+ /**
+ * The constant represents PASSED runtime state.
+ */
+ PASSED,
+
+ /**
+ * The constant represents EXCEPTION runtime state.
+ */
+ EXCEPTION,
+
+ /**
+ * The constant represents SKIPPED runtime state.
+ */
+ SKIPPED,
+
+ /**
+ * This is a private indicator for a user defined runtime state
+ */
+ USER_DEFINED
+
+}
diff --git a/qadevOOo/runner/lib/SimpleStatus.java b/qadevOOo/runner/lib/SimpleStatus.java
index 320ae20..11e3b7e 100644
--- a/qadevOOo/runner/lib/SimpleStatus.java
+++ b/qadevOOo/runner/lib/SimpleStatus.java
@@ -24,27 +24,6 @@ package lib;
* the SimpleSTatus instance.
*/
class SimpleStatus {
- /* Run states. */
-
- /**
- * The constatnt represents PASSED runtime state.
- */
- public static final int PASSED = 0;
-
- /**
- * The constant represents EXCEPTION runtime state.
- */
- public static final int EXCEPTION = 3;
-
- /**
- * The constant represents SKIPPED runtime state.
- */
- public static final int SKIPPED = 1;
-
- /**
- * This is a private indicator for a user defined runtime state
- */
- private static final int USER_DEFINED = 4;
/* Test states */
@@ -63,7 +42,7 @@ class SimpleStatus {
/**
* The field is holding reason of the status.
*/
- private final int runState;
+ private final RunState runState;
/**
* This is the run state: either SKIPPED, PASSED, etc.
@@ -74,14 +53,14 @@ class SimpleStatus {
/**
* The constructor initialize state and reason field.
*/
- protected SimpleStatus( int runState, boolean state ) {
+ protected SimpleStatus( RunState runState, boolean state ) {
this.state = state;
this.runState = runState;
- if ( runState == PASSED ) {
+ if ( runState == RunState.PASSED ) {
runStateString = "PASSED";
- } else if ( runState == SKIPPED ) {
+ } else if ( runState == RunState.SKIPPED ) {
runStateString = "SKIPPED";
- } else if ( runState == EXCEPTION ) {
+ } else if ( runState == RunState.EXCEPTION ) {
runStateString = "EXCEPTION";
} else {
runStateString = "UNKNOWN";
@@ -93,7 +72,7 @@ class SimpleStatus {
*/
protected SimpleStatus(String runStateString, boolean state) {
this.state = state;
- this.runState = USER_DEFINED;
+ this.runState = RunState.USER_DEFINED;
this.runStateString = runStateString;
}
@@ -107,7 +86,7 @@ class SimpleStatus {
/**
* getRunState() implementation. Just returns th runState field value.
*/
- public int getRunState() {
+ public RunState getRunState() {
return runState;
}
diff --git a/qadevOOo/runner/lib/Status.java b/qadevOOo/runner/lib/Status.java
index 593fc6e..dcab93c 100644
--- a/qadevOOo/runner/lib/Status.java
+++ b/qadevOOo/runner/lib/Status.java
@@ -41,7 +41,7 @@ public class Status extends SimpleStatus {
* @param runState either PASSED, SKIPPED, etc.
* @param state OK or FAILED.
*/
- public Status(int runState, boolean state ) {
+ public Status(RunState runState, boolean state ) {
super(runState, state);
}
@@ -62,7 +62,7 @@ public class Status extends SimpleStatus {
* otherwise).
*/
public static Status passed( boolean state ) {
- return new Status(PASSED, state );
+ return new Status(RunState.PASSED, state );
}
/**
@@ -83,7 +83,7 @@ public class Status extends SimpleStatus {
* otherwise).
*/
public static Status skipped( boolean state ) {
- return new Status( SKIPPED, state );
+ return new Status( RunState.SKIPPED, state );
}
@@ -115,7 +115,7 @@ public class Status extends SimpleStatus {
* Checks whether the status runstate is passed.
*/
public boolean isPassed() {
- return getRunState() == PASSED;
+ return getRunState() == RunState.PASSED;
}
/**
commit cb2c4d775664121c3034abda5a8b5cdd5044f148
Author: Noel Grandin <noel at peralex.com>
Date: Fri Oct 16 09:01:24 2015 +0200
cid#1327197 UwF: Unwritten field
Change-Id: I06d167e1f6aebeb6629cbbc7fb90ffed8cec837d
diff --git a/qadevOOo/runner/util/DBTools.java b/qadevOOo/runner/util/DBTools.java
index 46af25a..589f714b 100644
--- a/qadevOOo/runner/util/DBTools.java
+++ b/qadevOOo/runner/util/DBTools.java
@@ -125,10 +125,6 @@ public class DBTools {
* Representation of <code>'TableFilter'</code> property.
*/
private String[] TableFilter = null ;
- /**
- * Representation of <code>'TableTypeFilter'</code> property.
- */
- private String[] TableTypeFilter = null ;
/**
* Creates an empty instance.
@@ -159,7 +155,6 @@ public class DBTools {
if (SuppressVersionColumns != null) props.setPropertyValue("SuppressVersionColumns", SuppressVersionColumns) ;
if (IsReadOnly != null) props.setPropertyValue("IsReadOnly", IsReadOnly) ;
if (TableFilter != null) props.setPropertyValue("TableFilter", TableFilter) ;
- if (TableTypeFilter != null) props.setPropertyValue("TableTypeFilter", TableTypeFilter) ;
return src ;
}
commit afc9d56bdd15bf50565945c67b791f65f0977e64
Author: Noel Grandin <noel at peralex.com>
Date: Fri Oct 16 08:16:17 2015 +0200
1327208 UwF: Unwritten field
this class is doing nothing useful at all, just remove it
Change-Id: I77f295f96758f8bf5e29fbdaca5eecc08cd5cf83
diff --git a/framework/qa/unoapi/framework.sce b/framework/qa/unoapi/framework.sce
index 9816450..ed1497d 100644
--- a/framework/qa/unoapi/framework.sce
+++ b/framework/qa/unoapi/framework.sce
@@ -24,7 +24,6 @@
-o fwk.DispatchRecorder
-o fwk.DispatchRecorderSupplier
-o fwk.FooterMenuController
--o fwk.ObjectMenuController
-o fwk.StatusBarControllerFactory
-o fwk.ToolBarsMenuController
-o fwk.UICategoryDescription
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk
index d64d1e6..4912f93 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -959,7 +959,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
qadevOOo/tests/java/mod/_fwk/ModuleManager \
qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager \
qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManagerSupplier \
- qadevOOo/tests/java/mod/_fwk/ObjectMenuController \
qadevOOo/tests/java/mod/_fwk/PopupMenuControllerFactory \
qadevOOo/tests/java/mod/_fwk/ServiceHandler \
qadevOOo/tests/java/mod/_fwk/SoundHandler \
diff --git a/qadevOOo/tests/java/mod/_fwk/ObjectMenuController.java b/qadevOOo/tests/java/mod/_fwk/ObjectMenuController.java
deleted file mode 100644
index 82072e8..0000000
--- a/qadevOOo/tests/java/mod/_fwk/ObjectMenuController.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-package mod._fwk;
-
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-import java.io.PrintWriter;
-import com.sun.star.text.XTextDocument;
-import com.sun.star.util.XCloseable;
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.utils;
-
-/**
- */
-public class ObjectMenuController extends TestCase {
- XInterface oObj = null;
- XTextDocument xTextDoc;
-
- /**
- * Cleanup: close the created document
- * @param tParam The test parameters.
- * @param log The log writer.
- */
- @Override
- protected void cleanup(TestParameters tParam, PrintWriter log) {
- log.println(" disposing xTextDoc ");
-
- try {
- XCloseable closer = UnoRuntime.queryInterface(
- XCloseable.class, xTextDoc);
- closer.close(true);
- } catch (com.sun.star.util.CloseVetoException e) {
- log.println("couldn't close document");
- } catch (com.sun.star.lang.DisposedException e) {
- log.println("couldn't close document");
- }
- }
-
- /**
- * Create test environment:
- * <ul>
- * <li>create a text doc</li>
- * <li>get the model from the text doc</li>
- * <li>query model for XUIConfigurationManagerSupplier interface</li>
- * <li>get the manager from the supplier</li>
- * </ul>
- * @param tParam The test parameters.
- * @param log The log writer.
- * @return The test environment.
- */
- @Override
- protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) throws Exception {
- XMultiServiceFactory xMSF = tParam.getMSF();
-
- oObj = (XInterface)xMSF.createInstance("com.sun.star.comp.framework.ObjectMenuController");
- log.println("TestObject: " + utils.getImplName(oObj));
- TestEnvironment tEnv = new TestEnvironment(oObj);
- return tEnv;
- }
-}
-
-
commit 20c733cace84bef6fedb04c69e77613e2234c06f
Author: Noel Grandin <noel at peralex.com>
Date: Thu Oct 15 15:33:05 2015 +0200
cid#1327209 UwF: Unwritten field
Change-Id: Ieacb049d8de5211d50ceb8cd69954909cf3fd57f
diff --git a/qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java b/qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java
index 1f13e42..cd41f19 100644
--- a/qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java
+++ b/qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java
@@ -20,7 +20,6 @@ package mod._toolkit;
import com.sun.star.awt.tree.XMutableTreeDataModel;
import com.sun.star.awt.tree.XMutableTreeNode;
import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.text.XTextDocument;
import com.sun.star.ucb.CommandAbortedException;
import com.sun.star.ucb.XSimpleFileAccess;
import com.sun.star.uno.UnoRuntime;
@@ -37,7 +36,6 @@ import util.utils;
public class MutableTreeNode extends TestCase {
- private static XTextDocument xTextDoc;
private static XInterface oObj = null;
private static XMutableTreeDataModel mXTreeDataModel;
private static XMultiServiceFactory mxMSF;
@@ -50,16 +48,6 @@ public class MutableTreeNode extends TestCase {
mxMSF = tParam.getMSF();
}
- /**
- * Disposes StarOffice Writer document.
- */
- @Override
- protected void cleanup(TestParameters tParam, PrintWriter log) {
- log.println(" disposing xTextDoc ");
-
- util.DesktopTools.closeDoc(xTextDoc);
- }
-
@Override
protected TestEnvironment createTestEnvironment(TestParameters Param,
PrintWriter log) throws Exception {
More information about the Libreoffice-commits
mailing list