[Libreoffice-commits] core.git: ridljar/test

Robert Antoni Buj i Gelonch robert.buj at gmail.com
Sun Sep 28 11:09:51 PDT 2014


 ridljar/test/com/sun/star/uno/Any_Test.java        |   10 +++++++---
 ridljar/test/com/sun/star/uno/UnoRuntime_Test.java |    6 +++---
 2 files changed, 10 insertions(+), 6 deletions(-)

New commits:
commit ffbdd805062b6587d17395e956f275e70a72a6c7
Author: Robert Antoni Buj i Gelonch <robert.buj at gmail.com>
Date:   Sun Sep 28 11:07:12 2014 +0200

    ridljar: Any_Test & UnoRuntime_Test (JUnit)
    
    Modify exception test in Any_Test.
    Replace assertTrue with AsserSame & AssertNotSame for equality operator
    in UnoRuntime_Test.
    
    $ make JunitTest_ridljar_uno
    
    Change-Id: I42a8380e7c4aed79af976165224c2af25c50fbce
    Reviewed-on: https://gerrit.libreoffice.org/11673
    Reviewed-by: David Ostrovsky <david at ostrovsky.org>
    Tested-by: David Ostrovsky <david at ostrovsky.org>

diff --git a/ridljar/test/com/sun/star/uno/Any_Test.java b/ridljar/test/com/sun/star/uno/Any_Test.java
index 9ecde9e..6dc3a15 100644
--- a/ridljar/test/com/sun/star/uno/Any_Test.java
+++ b/ridljar/test/com/sun/star/uno/Any_Test.java
@@ -18,18 +18,22 @@
 
 package com.sun.star.uno;
 
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import org.junit.Test;
 import static org.junit.Assert.*;
 
 public final class Any_Test {
+
+    private static final Logger logger = Logger.getLogger(Any_Test.class.getName());
+
     @Test public void testAnyAny() {
-        boolean caught = false;
         try {
             new Any(Type.ANY, null);
+            fail("IllegalArgumentException expected");
         } catch (IllegalArgumentException e) {
-            caught = true;
+            logger.log(Level.FINE, "IllegalArgumentException caught");
         }
-        assertTrue(caught);
     }
 
     @Test public void testComplete() {
diff --git a/ridljar/test/com/sun/star/uno/UnoRuntime_Test.java b/ridljar/test/com/sun/star/uno/UnoRuntime_Test.java
index e92422f..fb2afe8 100644
--- a/ridljar/test/com/sun/star/uno/UnoRuntime_Test.java
+++ b/ridljar/test/com/sun/star/uno/UnoRuntime_Test.java
@@ -111,9 +111,9 @@ public final class UnoRuntime_Test {
         Object v1 = t1.context.getValueByName("");
         Object v2 = t2.context.getValueByName("");
         assertFalse(t1.context == t2.context);
-        assertTrue(v1 == t1);
-        assertTrue(v2 == t2);
-        assertFalse(v1 == v2);
+        assertSame(v1, t1);
+        assertSame(v2, t2);
+        assertNotSame(v1, v2);
     }
 
     private interface Ifc extends XInterface {}


More information about the Libreoffice-commits mailing list