cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject [2/4] git commit: updated refs/heads/master to 22c78ed
Date Tue, 01 Sep 2015 09:08:50 GMT
Changed the test case to test each of the log traces in the array list.

Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b49d6815
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b49d6815
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b49d6815

Branch: refs/heads/master
Commit: b49d681598a4a44e16109efbad90feef13fb435b
Parents: 89bac52
Author: weingartner <rafaelweingartner@gmail.com>
Authored: Mon Aug 31 07:51:01 2015 -0300
Committer: weingartner <rafaelweingartner@gmail.com>
Committed: Mon Aug 31 07:51:01 2015 -0300

----------------------------------------------------------------------
 .../cloud/utils/log/CglibThrowableRendererTest.java    | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b49d6815/utils/src/test/java/com/cloud/utils/log/CglibThrowableRendererTest.java
----------------------------------------------------------------------
diff --git a/utils/src/test/java/com/cloud/utils/log/CglibThrowableRendererTest.java b/utils/src/test/java/com/cloud/utils/log/CglibThrowableRendererTest.java
index def65c4..ae5d487 100644
--- a/utils/src/test/java/com/cloud/utils/log/CglibThrowableRendererTest.java
+++ b/utils/src/test/java/com/cloud/utils/log/CglibThrowableRendererTest.java
@@ -21,6 +21,7 @@ package com.cloud.utils.log;
 
 import java.lang.reflect.Method;
 
+import org.apache.commons.lang.StringUtils;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -39,18 +40,20 @@ public class CglibThrowableRendererTest {
             sampleClass.theFirstMethodThatCapturesAnException();
         } catch (Exception e) {
             String[] exceptions = cglibThrowableRenderer.doRender(e);
-            dumpExceptions(exceptions);
-            Assert.assertEquals(40, exceptions.length);
+            assertThatTheTraceListDoesNotContainsCgLibLogs(exceptions);
         }
     }
 
-    private void dumpExceptions(String[] exceptions) {
-        System.out.println("Dumping exception for debugging purposes");
+    private void assertThatTheTraceListDoesNotContainsCgLibLogs(String[] exceptions) {
         for (String s : exceptions) {
-            System.out.println(s);
+            Assert.assertEquals(false, isCgLibLogTrace(s));
         }
     }
 
+    private boolean isCgLibLogTrace(String s) {
+        return StringUtils.contains(s, "net.sf.cglib.proxy");
+    }
+
     static class SampleClass {
         public void theFirstMethodThatCapturesAnException() {
             try {


Mime
View raw message