01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */package org.apache.cxf.binding.jbi;
19:
20: import org.apache.cxf.binding.Binding;
21: import org.apache.cxf.binding.jbi.interceptor.JBIFaultOutInterceptor;
22: import org.apache.cxf.binding.jbi.interceptor.JBIOperationInInterceptor;
23: import org.apache.cxf.binding.jbi.interceptor.JBIWrapperInInterceptor;
24: import org.apache.cxf.binding.jbi.interceptor.JBIWrapperOutInterceptor;
25: import org.apache.cxf.interceptor.StaxOutInterceptor;
26: import org.apache.cxf.service.model.ServiceInfo;
27: import org.junit.Assert;
28: import org.junit.Test;
29:
30: public class JBIBindingFactoryTest extends Assert {
31:
32: @Test
33: public void testCreateBinding() {
34:
35: JBIBindingInfo info = new JBIBindingInfo(new ServiceInfo(),
36: "id");
37: Binding binding = new JBIBindingFactory().createBinding(info);
38: assertEquals(3, binding.getInInterceptors().size());
39: //assertEquals(?, binding.getInFaultInterceptors().size());
40: assertEquals(2, binding.getOutInterceptors().size());
41: assertEquals(2, binding.getOutFaultInterceptors().size());
42: assertEquals(JBIOperationInInterceptor.class.getName(), binding
43: .getInInterceptors().get(1).getClass().getName());
44: assertEquals(JBIWrapperInInterceptor.class.getName(), binding
45: .getInInterceptors().get(2).getClass().getName());
46: assertEquals(StaxOutInterceptor.class.getName(), binding
47: .getOutInterceptors().get(0).getClass().getName());
48: assertEquals(JBIWrapperOutInterceptor.class.getName(), binding
49: .getOutInterceptors().get(1).getClass().getName());
50: assertEquals(StaxOutInterceptor.class.getName(), binding
51: .getOutFaultInterceptors().get(0).getClass().getName());
52: assertEquals(JBIFaultOutInterceptor.class.getName(), binding
53: .getOutFaultInterceptors().get(1).getClass().getName());
54: }
55: }
|