01: /*
02: * Copyright 2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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:
17: package org.springframework.ws.wsdl.wsdl11;
18:
19: import junit.framework.TestCase;
20: import org.easymock.MockControl;
21:
22: public class DynamicWsdl11DefinitionTest extends TestCase {
23:
24: private DynamicWsdl11Definition definition;
25:
26: private MockControl builderControl;
27:
28: private Wsdl11DefinitionBuilder builderMock;
29:
30: protected void setUp() throws Exception {
31: definition = new DynamicWsdl11Definition();
32: builderControl = MockControl
33: .createControl(Wsdl11DefinitionBuilder.class);
34: builderMock = (Wsdl11DefinitionBuilder) builderControl
35: .getMock();
36: definition.setBuilder(builderMock);
37: }
38:
39: public void testComplete() throws Exception {
40: builderMock.buildDefinition();
41: builderMock.buildImports();
42: builderMock.buildTypes();
43: builderMock.buildMessages();
44: builderMock.buildPortTypes();
45: builderMock.buildBindings();
46: builderMock.buildServices();
47: builderControl.expectAndReturn(builderMock.getDefinition(),
48: null);
49: builderControl.replay();
50: definition.afterPropertiesSet();
51: builderControl.verify();
52: }
53:
54: public void testAbstract() throws Exception {
55: definition.setBuildConcretePart(false);
56: builderMock.buildDefinition();
57: builderMock.buildImports();
58: builderMock.buildTypes();
59: builderMock.buildMessages();
60: builderMock.buildPortTypes();
61: builderControl.expectAndReturn(builderMock.getDefinition(),
62: null);
63: builderControl.replay();
64: definition.afterPropertiesSet();
65: builderControl.verify();
66: }
67:
68: public void testConcrete() throws Exception {
69: definition.setBuildAbstractPart(false);
70: builderMock.buildDefinition();
71: builderMock.buildImports();
72: builderMock.buildBindings();
73: builderMock.buildServices();
74: builderControl.expectAndReturn(builderMock.getDefinition(),
75: null);
76: builderControl.replay();
77: definition.afterPropertiesSet();
78: builderControl.verify();
79: }
80: }
|