/
SimpleRegistryServiceCXFClientTest.java
47 lines (40 loc) · 1.61 KB
/
SimpleRegistryServiceCXFClientTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**
*
*/
package org.easysoa.registry.integration;
import junit.framework.Assert;
import org.easysoa.registry.rest.integration.ServiceInformation;
import org.easysoa.registry.rest.integration.SimpleRegistryService;
import org.easysoa.registry.rest.integration.ServiceInformations;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.support.FileSystemXmlApplicationContext;
/**
* CXF Client (Spring) for Simple registry Service
*
* @author jguillemotte
*
*/
public class SimpleRegistryServiceCXFClientTest {
private static FileSystemXmlApplicationContext context;
@BeforeClass
public static void setUp() throws Exception {
// Load the CXF Config file
System.out.println("Launching SimpleRegistryServiceCXFClientTest");
context = new FileSystemXmlApplicationContext("src/test/resources/cxf-test.xml");
}
/**
* Test the CXF client with the Simple Registry Service
* @throws Exception If a problem occurs
*/
@Test
public void cxfClientTest() throws Exception {
SimpleRegistryService client = (SimpleRegistryService) context.getBean("simpleRegistryServiceCXFTestClient");
ServiceInformations result = client.queryWSDLInterfaces(null, null, "strict");
Assert.assertNotNull(result);
Assert.assertEquals(3, result.getServiceInformationList().size());
ServiceInformation information = result.getServiceInformationList().get(0);
Assert.assertEquals("TdrService",information.getName());
Assert.assertEquals("InformationService", information.getObjectType());
}
}