[Libreoffice-commits] .: 2 commits - qadevOOo/runner qadevOOo/tests
Fridrich Strba
fridrich at kemper.freedesktop.org
Wed Jun 20 01:26:58 PDT 2012
qadevOOo/runner/complexlib/Assurance.java | 6 +++---
qadevOOo/runner/complexlib/ComplexTestCase.java | 2 +-
qadevOOo/runner/complexlib/MethodThread.java | 9 +++++++++
qadevOOo/runner/graphical/GlobalLogWriter.java | 4 ----
qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess.java | 17 +++++++++++------
5 files changed, 24 insertions(+), 14 deletions(-)
New commits:
commit 197d1c2dfc562dbfb9ad746244ffa7276dd4c1f7
Author: Noel Grandin <noel at peralex.com>
Date: Mon Jun 18 18:45:19 2012 +0200
Convert date/calendar code to avoid deprecation warnings
Change-Id: Ib9a3e9620064aaea3d51f432b523861656363f7e
Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>
diff --git a/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess.java b/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess.java
index cb58dde..a5b3e76 100644
--- a/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess.java
+++ b/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess.java
@@ -37,6 +37,9 @@ import com.sun.star.ucb.XSimpleFileAccess;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.util.DateTime;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+
/**
* Testing <code>com.sun.star.ucb.XSimpleFileAccess</code>
* interface methods. <p>
@@ -347,28 +350,30 @@ public class _XSimpleFileAccess extends MultiMethodTest {
java.io.File the_file = new java.io.File(filename);
long lastModified = the_file.lastModified();
java.util.Date lastMod = new java.util.Date(lastModified);
+ GregorianCalendar lastModCal = new GregorianCalendar();
+ lastModCal.setTime(lastMod);
//compare the dates gained by java with those gained by this method
boolean res = true;
- boolean partResult = (fTime.Day == lastMod.getDay());
+ boolean partResult = (fTime.Day == lastModCal.get(Calendar.DAY_OF_WEEK));
if (!partResult) {
log.println("Wrong Day");
- log.println("Expected: "+lastMod.getDay());
+ log.println("Expected: "+lastModCal.get(Calendar.DAY_OF_WEEK));
log.println("Gained: "+fTime.Day);
log.println("------------------------------");
}
- partResult = (fTime.Month == lastMod.getMonth());
+ partResult = (fTime.Month == lastModCal.get(Calendar.MONTH));
if (!partResult) {
log.println("Wrong Month");
- log.println("Expected: "+lastMod.getMonth());
+ log.println("Expected: "+lastModCal.get(Calendar.MONTH));
log.println("Gained: "+fTime.Month);
log.println("------------------------------");
}
- partResult = (fTime.Year == lastMod.getYear());
+ partResult = (fTime.Year == (lastModCal.get(Calendar.MONTH) - 1900));
if (!partResult) {
log.println("Wrong Year");
- log.println("Expected: "+lastMod.getYear());
+ log.println("Expected: "+(lastModCal.get(Calendar.MONTH) - 1900));
log.println("Gained: "+fTime.Year);
log.println("------------------------------");
}
commit 2554f08f6544c54e45a5fc660d65d50ef3f29aed
Author: Noel Grandin <noel at peralex.com>
Date: Mon Jun 18 18:37:06 2012 +0200
Fix some deprecation warnings
Change-Id: I60a02dea64a5f6fd34c2de86e60bdfb9171b3ea0
Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>
diff --git a/qadevOOo/runner/complexlib/Assurance.java b/qadevOOo/runner/complexlib/Assurance.java
index 980ede9..b250c63 100644
--- a/qadevOOo/runner/complexlib/Assurance.java
+++ b/qadevOOo/runner/complexlib/Assurance.java
@@ -409,9 +409,9 @@ public class Assurance
assure(msg, false, cont);
}
- /**
- * @deprecated
- */
+// /**
+// * @deprecated
+// */
// protected void addResult(String message, boolean state) {
// String msg = message + " - " + state;
// this.state &= state;
diff --git a/qadevOOo/runner/complexlib/ComplexTestCase.java b/qadevOOo/runner/complexlib/ComplexTestCase.java
index b15224b..68d6755 100644
--- a/qadevOOo/runner/complexlib/ComplexTestCase.java
+++ b/qadevOOo/runner/complexlib/ComplexTestCase.java
@@ -190,7 +190,7 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest
if (th.isAlive())
{
log.println("Destroy " + mTestMethodName);
- th.destroy();
+ th.stopRunning();
subEntry.State = "Test did sleep for " + (m_nThreadTimeOut / 1000) + " seconds and has been killed!";
subEntry.hasErrorMsg = true;
subEntry.ErrorMsg = subEntry.State;
diff --git a/qadevOOo/runner/complexlib/MethodThread.java b/qadevOOo/runner/complexlib/MethodThread.java
index e068323..418be5c 100644
--- a/qadevOOo/runner/complexlib/MethodThread.java
+++ b/qadevOOo/runner/complexlib/MethodThread.java
@@ -95,9 +95,18 @@ public class MethodThread extends Thread
/**
* Stop the running method.
+ * @deprecated
*/
public void destroy()
{
+ stop();
+ }
+
+ /**
+ * Stop the running method.
+ */
+ public void stopRunning()
+ {
try
{
interrupt();
diff --git a/qadevOOo/runner/graphical/GlobalLogWriter.java b/qadevOOo/runner/graphical/GlobalLogWriter.java
index 478d332..65d731e 100644
--- a/qadevOOo/runner/graphical/GlobalLogWriter.java
+++ b/qadevOOo/runner/graphical/GlobalLogWriter.java
@@ -44,10 +44,6 @@ public class GlobalLogWriter
get().println(_sMsg);
}
- /**
- * @deprecated use GlobalLogWriter.println(...) direct
- * @return
- */
protected static synchronized LogWriter get()
{
if (m_aGlobalLogWriter == null)
More information about the Libreoffice-commits
mailing list