diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-08-04 01:14:22 +0200 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2013-08-04 06:51:31 +0000 |
commit | 8ee69b0ba13f74d1515fac71df92947eb6328ab1 (patch) | |
tree | 5d5e95bb877e5e961cd02eee47011548af94bca1 /qadevOOo/tests/java/ifc | |
parent | aa5683e18de07c9e86325595ead4574efa685c3a (diff) |
fdo#67235 adapt form control code to time nanosecond API change, step 3
Change-Id: I4899c89ee5b2a54c9c05b531ab284365f1558e3d
Reviewed-on: https://gerrit.libreoffice.org/5270
Tested-by: Lionel Elie Mamane <lionel@mamane.lu>
Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
Diffstat (limited to 'qadevOOo/tests/java/ifc')
-rw-r--r-- | qadevOOo/tests/java/ifc/awt/_XDateField.java | 29 | ||||
-rw-r--r-- | qadevOOo/tests/java/ifc/awt/_XTimeField.java | 31 |
2 files changed, 31 insertions, 29 deletions
diff --git a/qadevOOo/tests/java/ifc/awt/_XDateField.java b/qadevOOo/tests/java/ifc/awt/_XDateField.java index 54c268b7d155..c57106bf3ad7 100644 --- a/qadevOOo/tests/java/ifc/awt/_XDateField.java +++ b/qadevOOo/tests/java/ifc/awt/_XDateField.java @@ -22,6 +22,7 @@ package ifc.awt; import lib.MultiMethodTest; import com.sun.star.awt.XDateField; +import com.sun.star.util.Date; /** * Testing <code>com.sun.star.awt.XDateField</code> @@ -66,12 +67,12 @@ public class _XDateField extends MultiMethodTest { requiredMethod("getDate()") ; boolean result = true ; - oObj.setDate(19000101) ; + oObj.setDate(new Date((short)1, (short)1, (short)1900)) ; - result = oObj.getDate() == 19000101 ; + result = oObj.getDate() == new Date((short)1, (short)1, (short)1900); ; if (! result ) { - System.out.println("getDate: "+oObj.getDate()+" , expected 19000101"); + System.out.println("getDate: " + oObj.getDate() + " , expected 1900-01-01"); } tRes.tested("setDate()", result) ; @@ -100,9 +101,9 @@ public class _XDateField extends MultiMethodTest { public void _setMin() { boolean result = true ; - oObj.setMin(4978) ; + oObj.setMin(new Date((short)5, (short)2, (short)1963)); - result = oObj.getMin() == 4978 ; + result = oObj.getMin() == new Date((short)5, (short)2, (short)1963); tRes.tested("setMin()", result) ; } @@ -130,9 +131,9 @@ public class _XDateField extends MultiMethodTest { public void _setMax() { boolean result = true ; - oObj.setMax(27856) ; + oObj.setMax(new Date((short)18, (short)9, (short)2117)) ; - result = oObj.getMax() == 27856 ; + result = oObj.getMax() == new Date((short)18, (short)9, (short)2117) ; tRes.tested("setMax()", result) ; } @@ -160,9 +161,9 @@ public class _XDateField extends MultiMethodTest { public void _setFirst() { boolean result = true ; - oObj.setFirst(5118) ; + oObj.setFirst(new Date((short)7, (short)12, (short)1972)) ; - result = oObj.getFirst() == 5118 ; + result = oObj.getFirst() == new Date((short)7, (short)12, (short)1972) ; if (!result) { log.println("Set to " + 5118 + " but returned " + oObj.getFirst()) ; @@ -178,7 +179,7 @@ public class _XDateField extends MultiMethodTest { public void _getFirst() { boolean result = true ; - int val = oObj.getFirst() ; + com.sun.star.util.Date val = oObj.getFirst() ; log.println("getFirst() = " + val) ; @@ -196,12 +197,12 @@ public class _XDateField extends MultiMethodTest { public void _setLast() { boolean result = true ; - oObj.setLast(23450) ; + oObj.setLast(new Date((short)23, (short)8, (short)2053)) ; - result = oObj.getLast() == 23450 ; + result = oObj.getLast() == new Date((short)23, (short)8, (short)2053) ; if (!result) { - log.println("Set to " + 23450 + " but returned " + oObj.getLast()) ; + log.println("Set to 2053-08-23 but returned " + oObj.getLast()) ; } tRes.tested("setLast()", result) ; @@ -214,7 +215,7 @@ public class _XDateField extends MultiMethodTest { public void _getLast() { boolean result = true ; - int val = oObj.getLast() ; + com.sun.star.util.Date val = oObj.getLast() ; log.println("getLast() = " + val) ; diff --git a/qadevOOo/tests/java/ifc/awt/_XTimeField.java b/qadevOOo/tests/java/ifc/awt/_XTimeField.java index 77cde0f316f4..955b56d7aea9 100644 --- a/qadevOOo/tests/java/ifc/awt/_XTimeField.java +++ b/qadevOOo/tests/java/ifc/awt/_XTimeField.java @@ -22,6 +22,7 @@ package ifc.awt; import lib.MultiMethodTest; import com.sun.star.awt.XTimeField; +import com.sun.star.util.Time; /** * Testing <code>com.sun.star.awt.XTimeField</code> @@ -62,12 +63,12 @@ public class _XTimeField extends MultiMethodTest { requiredMethod("getTime()") ; boolean result = true ; - oObj.setTime(11150000) ; + oObj.setTime(new Time(0, (short)0, (short)15, (short)11, false)); - result = oObj.getTime() == 11150000 ; + result = oObj.getTime() == new Time(0, (short)0, (short)15, (short)11, false) ; if (! result ) { - System.out.println("Getting "+oObj.getTime()+ " expected 11150000"); + System.out.println("Getting " + oObj.getTime() + " expected 11:15"); } tRes.tested("setTime()", result) ; @@ -96,9 +97,9 @@ public class _XTimeField extends MultiMethodTest { public void _setMin() { boolean result = true ; - oObj.setMin(4978) ; + oObj.setMin(new Time(0, (short)14, (short)18, (short)6, false)); - result = oObj.getMin() == 4978 ; + result = oObj.getMin() == new Time(0, (short)14, (short)18, (short)6, false) ; tRes.tested("setMin()", result) ; } @@ -126,9 +127,9 @@ public class _XTimeField extends MultiMethodTest { public void _setMax() { boolean result = true ; - oObj.setMax(27856) ; + oObj.setMax(new Time(855447, (short)31, (short)23, (short)22, false)) ; - result = oObj.getMax() == 27856 ; + result = oObj.getMax() == new Time(855447, (short)31, (short)23, (short)22, false) ; tRes.tested("setMax()", result) ; } @@ -156,12 +157,12 @@ public class _XTimeField extends MultiMethodTest { public void _setFirst() { boolean result = true ; - oObj.setFirst(5118) ; + oObj.setFirst(new Time(0, (short)0, (short)30, (short)7, false)) ; - result = oObj.getFirst() == 5118 ; + result = oObj.getFirst() == new Time(0, (short)0, (short)30, (short)7, false); if (!result) { - log.println("Set to " + 5118 + " but returned " + oObj.getFirst()) ; + log.println("Set to 07:30 but returned " + oObj.getFirst()) ; } tRes.tested("setFirst()", result) ; @@ -174,7 +175,7 @@ public class _XTimeField extends MultiMethodTest { public void _getFirst() { boolean result = true ; - long val = oObj.getFirst() ; + com.sun.star.util.Time val = oObj.getFirst() ; log.println("getFirst() = " + val) ; @@ -192,12 +193,12 @@ public class _XTimeField extends MultiMethodTest { public void _setLast() { boolean result = true ; - oObj.setLast(23450) ; + oObj.setLast(new Time(500000, (short)31, (short)30, (short)18, false)) ; - result = oObj.getLast() == 23450 ; + result = oObj.getLast() == new Time(500000, (short)31, (short)30, (short)18, false); if (!result) { - log.println("Set to " + 23450 + " but returned " + oObj.getLast()) ; + log.println("Set to 18:30:31.5 but returned " + oObj.getLast()) ; } tRes.tested("setLast()", result) ; @@ -210,7 +211,7 @@ public class _XTimeField extends MultiMethodTest { public void _getLast() { boolean result = true ; - long val = oObj.getLast() ; + com.sun.star.util.Time val = oObj.getLast() ; log.println("getLast() = " + val) ; |