1 16 17 package org.springframework.remoting.support; 18 19 import junit.framework.TestCase; 20 import org.springframework.core.JdkVersion; 21 22 27 public final class RemoteInvocationUtilsTests extends TestCase { 28 29 public void testFillInClientStackTraceIfPossibleSunnyDay() throws Exception { 30 if (!JdkVersion.isAtLeastJava14()) { 31 return; 32 } 33 try { 34 throw new IllegalStateException ("Mmm"); 35 } catch (Exception ex) { 36 int originalStackTraceLngth = ex.getStackTrace().length; 37 RemoteInvocationUtils.fillInClientStackTraceIfPossible(ex); 38 assertTrue("Stack trace not being filled in", 39 ex.getStackTrace().length > originalStackTraceLngth); 40 } 41 } 42 43 public void testFillInClientStackTraceIfPossibleWithNullThrowable() throws Exception { 44 if (!JdkVersion.isAtLeastJava14()) { 45 return; 46 } 47 RemoteInvocationUtils.fillInClientStackTraceIfPossible(null); 49 } 50 51 } 52 | Popular Tags |