SWS-667 - Improve SWS namespace
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright 2005-2010 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.ws.config;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition;
|
||||
import org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition;
|
||||
import org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author Arjen Poutsma
|
||||
*/
|
||||
public class WsdlBeanDefinitionParserTest {
|
||||
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
applicationContext = new ClassPathXmlApplicationContext("wsdlBeanDefinitionParserTest.xml", getClass());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void staticWsdl() throws Exception {
|
||||
Map<String, SimpleWsdl11Definition> result = applicationContext.getBeansOfType(SimpleWsdl11Definition.class);
|
||||
Assert.assertFalse("no WSDL definitions found", result.isEmpty());
|
||||
String beanName = result.keySet().iterator().next();
|
||||
Assert.assertEquals("invalid bean name", "simple", beanName);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void dynamicWsdl() throws Exception {
|
||||
Map<String, ?> result = applicationContext.getBeansOfType(DefaultWsdl11Definition.class);
|
||||
Assert.assertFalse("no WSDL definitions found", result.isEmpty());
|
||||
|
||||
result = applicationContext.getBeansOfType(CommonsXsdSchemaCollection.class);
|
||||
Assert.assertFalse("no XSD definitions found", result.isEmpty());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:sws="http://www.springframework.org/schema/web-services"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/web-services http://static.springframework.org/schema/web-services/web-services-2.0.xsd">
|
||||
|
||||
<sws:static-wsdl location="classpath:org/springframework/ws/client/support/destination/simple.wsdl"/>
|
||||
|
||||
<sws:dynamic-wsdl id="single" portTypeName="Order">
|
||||
<sws:xsd location="classpath:/org/springframework/ws/wsdl/wsdl11/single.xsd"/>
|
||||
</sws:dynamic-wsdl>
|
||||
|
||||
</beans>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user