Clover Coverage Report - ksb-test 2.0.0-SNAPSHOT
Coverage timestamp: Wed Dec 31 1969 19:00:00 EST
27   77   5   9
0   47   0.19   3
3     1.67  
1    
 
  RemoteFailureTest       Line # 29 27 0% 5 30 0% 0.0
 
No Tests
 
1    /*
2    * Copyright 2007 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10    * Unless required by applicable law or agreed to in writing, software
11    * distributed under the License is distributed on an "AS IS" BASIS,
12    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13    * See the License for the specific language governing permissions and
14    * limitations under the License.
15    */
16    package org.kuali.rice.ksb.messaging;
17   
18    import org.junit.Test;
19    import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
20    import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
21    import org.kuali.rice.ksb.messaging.remotedservices.EchoService;
22    import org.kuali.rice.ksb.test.KSBTestCase;
23   
24    import javax.xml.namespace.QName;
25   
26    import static org.junit.Assert.*;
27   
28   
 
29    public class RemoteFailureTest extends KSBTestCase {
30   
 
31  0 toggle public boolean startClient1() {
32  0 return true;
33    }
34   
 
35  0 toggle @Test public void testEchoService() throws Exception {
36  0 EchoService echoService = (EchoService)GlobalResourceLoader.getService(new QName("TestCl1", "echoService"));
37  0 assertNotNull(echoService);
38  0 String echoValue = "echoValue";
39  0 String result = echoService.echo(echoValue);
40  0 assertEquals(echoValue, result);
41   
42    // now shut down the test client and try to access the echo service
43  0 getTestClient1().stop();
44  0 try {
45  0 result = echoService.echo(echoValue);
46  0 fail("Exception should have been thrown");
47    } catch (Exception e) {
48  0 e.printStackTrace();
49    }
50   
51    // start it back up and make sure we can use our service again
52  0 getTestClient1().start();
53  0 result = echoService.echo(echoValue);
54  0 assertEquals(echoValue, result);
55    }
56   
 
57  0 toggle @Test public void testSOAPEchoService() throws Exception {
58  0 EchoService echoService = (EchoService) GlobalResourceLoader.getService(new QName("TestCl1", "soap-echoService"));
59  0 assertNotNull(echoService);
60  0 String echoValue = "echoValue";
61  0 String result = echoService.echo(echoValue);
62  0 assertEquals(echoValue, result);
63    // now shut down the test client and try to access the echo service
64  0 getTestClient1().stop();
65  0 try {
66  0 result = echoService.echo(echoValue);
67  0 fail("Exception should have been thrown");
68    } catch (Exception e) {
69  0 e.printStackTrace();
70    }
71    // start it back up and make sure we can use our service again
72  0 getTestClient1().start();
73  0 result = echoService.echo(echoValue);
74  0 assertEquals(echoValue, result);
75    }
76   
77    }