Java TransmissionException Example

说明

java transmissionexception示例是从最受好评的开源项目中提取的实现代码,你可以参考下面示例的使用方式。

编程语言: Java

类/类型: TransmissionException

示例#1
文件: TransmissionExceptionTest.java项目: KenCloud2013/soap-ws

 @Test
 public void messageFormatFullFormatTest() {
   TransmissionException ex =
       new TransmissionException(
           "SOAP communication failed", 500, new RuntimeException("Internal server error"));
   assertEquals("SOAP communication failed; HTTP code = [500];", ex.getMessage());
 }

示例#2
文件: TransmissionExceptionTest.java项目: KenCloud2013/soap-ws

 @Test
 public void messageFormatCauseTest() {
   TransmissionException ex = new TransmissionException("", 0, new RuntimeException("Cause"));
   assertEquals("", ex.getMessage());
 }

示例#3
文件: TransmissionExceptionTest.java项目: KenCloud2013/soap-ws

 @Test
 public void messageFormatCodeTest() {
   TransmissionException ex = new TransmissionException("", 404, new RuntimeException());
   assertEquals("HTTP code = [404];", ex.getMessage());
 }

展开阅读全文